- HTTP request
- Request body
- Response body
- Authorization Scopes
- OrdersCustomBatchRequest
- OrdersCustomBatchRequestEntry
- OrdersCustomBatchRequestEntryShipLineItems
- OrdersCustomBatchRequestEntryUpdateShipment
- OrdersCustomBatchRequestEntryCancel
- OrdersCustomBatchRequestEntryCancelLineItem
- OrdersCustomBatchRequestEntryRefund
- OrdersCustomBatchRequestEntryReturnLineItem
- OrdersCustomBatchRequestEntrySetLineItemMetadata
- OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails
- OrdersCustomBatchRequestEntryReturnRefundLineItem
- OrdersCustomBatchRequestEntryInStoreRefundLineItem
- OrdersCustomBatchRequestEntryRejectReturnLineItem
- OrdersCustomBatchResponseEntry
- Try it!
Retrieves or modifies multiple orders in a single request.
HTTP request
POST https://shoppingcontent.googleapis.com/content/v2/orders/batch
Request body
The request body contains an instance of OrdersCustomBatchRequest
.
Response body
If successful, the response body contains data with the following structure:
JSON representation | |
---|---|
{
"entries": [
{
object ( |
Fields | |
---|---|
entries[] |
The result of the execution of the batch requests. |
kind |
Identifies what kind of resource this is. Value: the fixed string
. |
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/content
For more information, see the OAuth 2.0 Overview.
OrdersCustomBatchRequest
JSON representation | |
---|---|
{
"entries": [
{
object ( |
Fields | |
---|---|
entries[] |
The request entries to be processed in the batch. |
OrdersCustomBatchRequestEntry
JSON representation | |
---|---|
{ "batchId": integer, "merchantId": string, "orderId": string, "method": string, "operationId": string, "shipLineItems": { object ( |
Fields | |
---|---|
batchId |
An entry ID, unique within the batch request. |
merchantId |
The ID of the managing account. |
orderId |
The ID of the order. Required for all methods beside |
method |
The method of the batch entry.
|
operationId |
The ID of the operation. Unique across all operations for a given order. Required for all methods beside |
shipLineItems |
Required for |
updateShipment |
Required for |
cancel |
Required for |
cancelLineItem |
Required for |
refund |
Required for |
returnLineItem |
Required for |
merchantOrderId |
The merchant order ID. Required for |
setLineItemMetadata |
Required for |
updateLineItemShippingDetails |
Required for |
returnRefundLineItem |
Required for |
inStoreRefundLineItem |
Required for |
rejectReturnLineItem |
Required for |
OrdersCustomBatchRequestEntryShipLineItems
JSON representation | |
---|---|
{ "shipmentId": string, "lineItems": [ { object ( |
Fields | |
---|---|
shipmentId |
Deprecated. Please use shipmentInfo instead. The ID of the shipment. |
lineItems[] |
Line items to ship. |
carrier |
Deprecated. Please use shipmentInfo instead. The carrier handling the shipment. See |
trackingId |
Deprecated. Please use shipmentInfo instead. The tracking ID for the shipment. |
shipmentInfos[] |
Shipment information. This field is repeated because a single line item can be shipped in several packages (and have several tracking IDs). |
shipmentGroupId |
ID of the shipment group. Required for orders that use the orderinvoices service. |
OrdersCustomBatchRequestEntryUpdateShipment
JSON representation | |
---|---|
{ "shipmentId": string, "status": string, "carrier": string, "trackingId": string, "deliveryDate": string } |
Fields | |
---|---|
shipmentId |
The ID of the shipment. |
status |
New status for the shipment. Not updated if missing.
|
carrier |
The carrier handling the shipment. Not updated if missing. See |
trackingId |
The tracking ID for the shipment. Not updated if missing. |
deliveryDate |
Date on which the shipment has been delivered, in ISO 8601 format. Optional and can be provided only if |
OrdersCustomBatchRequestEntryCancel
JSON representation | |
---|---|
{ "reason": string, "reasonText": string } |
Fields | |
---|---|
reason |
The reason for the cancellation.
|
reasonText |
The explanation of the reason. |
OrdersCustomBatchRequestEntryCancelLineItem
JSON representation | |
---|---|
{ "lineItemId": string, "quantity": integer, "reason": string, "reasonText": string, "amount": { object ( |
Fields | |
---|---|
lineItemId |
The ID of the line item to cancel. Either lineItemId or productId is required. |
quantity |
The quantity to cancel. |
reason |
The reason for the cancellation.
|
reasonText |
The explanation of the reason. |
amount |
Deprecated. Please use amountPretax and amountTax instead. |
productId |
The ID of the product to cancel. This is the REST ID used in the products service. Either lineItemId or productId is required. |
amountPretax |
Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The amount must not be larger than the net amount left on the order. |
amountTax |
Tax amount that corresponds to cancellation amount in amountPretax. Optional, but if filled, then amountPretax must be set. Calculated automatically if not provided. |
OrdersCustomBatchRequestEntryRefund
JSON representation | |
---|---|
{ "amount": { object ( |
Fields | |
---|---|
amount |
Deprecated. Please use amountPretax and amountTax instead. |
reason |
The reason for the refund.
|
reasonText |
The explanation of the reason. |
amountPretax |
The amount that is refunded. Either amount or amountPretax should be filled. |
amountTax |
Tax amount that corresponds to refund amount in amountPretax. Optional, but if filled, amountPretax must be set. Calculated automatically if not provided. |
OrdersCustomBatchRequestEntryReturnLineItem
JSON representation | |
---|---|
{ "lineItemId": string, "quantity": integer, "reason": string, "reasonText": string, "productId": string } |
Fields | |
---|---|
lineItemId |
The ID of the line item to return. Either lineItemId or productId is required. |
quantity |
The quantity to return. |
reason |
The reason for the return.
|
reasonText |
The explanation of the reason. |
productId |
The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required. |
OrdersCustomBatchRequestEntrySetLineItemMetadata
JSON representation | |
---|---|
{
"lineItemId": string,
"productId": string,
"annotations": [
{
object ( |
Fields | |
---|---|
lineItemId |
The ID of the line item to set metadata. Either lineItemId or productId is required. |
productId |
The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required. |
annotations[] |
|
OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails
JSON representation | |
---|---|
{ "lineItemId": string, "productId": string, "shipByDate": string, "deliverByDate": string } |
Fields | |
---|---|
lineItemId |
The ID of the line item to set metadata. Either lineItemId or productId is required. |
productId |
The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required. |
shipByDate |
Updated ship by date, in ISO 8601 format. If not specified only deliver by date is updated. |
deliverByDate |
Updated delivery by date, in ISO 8601 format. If not specified only ship by date is updated. |
OrdersCustomBatchRequestEntryReturnRefundLineItem
JSON representation | |
---|---|
{ "lineItemId": string, "productId": string, "quantity": integer, "reason": string, "reasonText": string, "amountPretax": { object ( |
Fields | |
---|---|
lineItemId |
The ID of the line item to return. Either lineItemId or productId is required. |
productId |
The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required. |
quantity |
The quantity to return and refund. |
reason |
The reason for the return.
|
reasonText |
The explanation of the reason. |
amountPretax |
The amount that is refunded. If omitted, refundless return is assumed (same as calling returnLineItem method). |
amountTax |
Tax amount that corresponds to refund amount in amountPretax. Optional, but if filled, then amountPretax must be set. Calculated automatically if not provided. |
OrdersCustomBatchRequestEntryInStoreRefundLineItem
JSON representation | |
---|---|
{ "lineItemId": string, "productId": string, "quantity": integer, "reason": string, "reasonText": string, "amountPretax": { object ( |
Fields | |
---|---|
lineItemId |
The ID of the line item to return. Either lineItemId or productId is required. |
productId |
The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required. |
quantity |
The quantity to return and refund. |
reason |
The reason for the return.
|
reasonText |
The explanation of the reason. |
amountPretax |
The amount that is refunded. Required. |
amountTax |
Tax amount that correspond to refund amount in amountPretax. Required. |
OrdersCustomBatchRequestEntryRejectReturnLineItem
JSON representation | |
---|---|
{ "lineItemId": string, "productId": string, "quantity": integer, "reason": string, "reasonText": string } |
Fields | |
---|---|
lineItemId |
The ID of the line item to return. Either lineItemId or productId is required. |
productId |
The ID of the product to return. This is the REST ID used in the products service. Either lineItemId or productId is required. |
quantity |
The quantity to return and refund. |
reason |
The reason for the return.
|
reasonText |
The explanation of the reason. |
OrdersCustomBatchResponseEntry
JSON representation | |
---|---|
{ "batchId": integer, "order": { object ( |
Fields | |
---|---|
batchId |
The ID of the request entry this entry responds to. |
order |
The retrieved order. Only defined if the method is |
executionStatus |
The status of the execution. Only defined if
Acceptable values are:
|
errors |
A list of errors defined if and only if the request failed. |
kind |
Identifies what kind of resource this is. Value: the fixed string " |