Orders: custombatch

Requires authorization

Retrieves or modifies multiple orders in a single request. Try it now.

Note that we don't guarantee sequential placing of the actions within the batch. We highly recommend not issuing interdependent calls in a single batch request (like creating and updating the same shipment), as the result of this is undefined.

Request

HTTP request

POST https://www.googleapis.com/content/v2/orders/batch

Parameters

Parameter name Value Description

Authorization

This request requires authorization with the following scope (read more about authentication and authorization).

Scope
https://www.googleapis.com/auth/content

Request body

In the request body, supply data with the following structure:

{
  "entries": [
    {
      "batchId": unsigned integer,
      "merchantId": unsigned long,
      "orderId": string,
      "method": string,
      "operationId": string,
      "shipLineItems": {
        "lineItems": [
          {
            "lineItemId": string,
            "quantity": unsigned integer
          }
        ],
        "shipmentId": string,
        "carrier": string,
        "trackingId": string
      },
      "updateShipment": {
        "shipmentId": string,
        "status": string,
        "carrier": string,
        "trackingId": string
      },
      "cancel": {
        "reason": string,
        "reasonText": string
      },
      "cancelLineItem": {
        "lineItemId": string,
        "quantity": unsigned integer,
        "reason": string,
        "reasonText": string,
        "amount": {
          "value": string,
          "currency": string
        }
      },
      "refund": {
        "amount": {
          "value": string,
          "currency": string
        },
        "reason": string,
        "reasonText": string
      },
      "returnLineItem": {
        "lineItemId": string,
        "quantity": unsigned integer,
        "reason": string,
        "reasonText": string
      },
      "merchantOrderId": string
    }
  ]
}
Property name Value Description Notes
entries[] list The request entries to be processed in the batch.
entries[].batchId unsigned integer An entry ID, unique within the batch request.
entries[].merchantId unsigned long The ID of the managing account.
entries[].orderId string The ID of the order. Required for all methods beside getByMerchantOrderId.
entries[].method string The method to apply.

Acceptable values are:
  • "acknowledge"
  • "cancel"
  • "cancelLineItem"
  • "get"
  • "getByMerchantOrderId"
  • "refund"
  • "returnLineItem"
  • "shipLineItems"
  • "updateMerchantOrderId"
  • "updateShipment"
entries[].operationId string The ID of the operation. Unique across all operations for a given order. Required for all methods beside get and getByMerchantOrderId.
entries[].shipLineItems nested object Required for shipLineItems method.
entries[].shipLineItems.shipmentId string The ID of the shipment.
entries[].shipLineItems.lineItems[] list Line items to ship.
entries[].shipLineItems.lineItems[].lineItemId string The id of the line item that is shipped.
entries[].shipLineItems.lineItems[].quantity unsigned integer The quantity that is shipped.
entries[].shipLineItems.carrier string The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values.
entries[].shipLineItems.trackingId string The tracking id for the shipment.
entries[].updateShipment nested object Required for updateShipment method.
entries[].updateShipment.shipmentId string The ID of the shipment.
entries[].updateShipment.status string New status for the shipment. Not updated if missing.

Acceptable values are:
  • "delivered"
entries[].updateShipment.carrier string The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable values.
entries[].updateShipment.trackingId string The tracking id for the shipment. Not updated if missing.
entries[].cancel nested object Required for cancel method.
entries[].cancel.reason string The reason for the cancellation.

Acceptable values are:
  • "customerInitiatedCancel"
  • "malformedShippingAddress"
  • "noInventory"
  • "other"
  • "priceError"
  • "shippingPriceError"
  • "taxError"
  • "undeliverableShippingAddress"
  • "unsupportedPoBoxAddress"
entries[].cancel.reasonText string The explanation of the reason.
entries[].cancelLineItem nested object Required for cancelLineItem method.
entries[].cancelLineItem.lineItemId string The ID of the line item to cancel.
entries[].cancelLineItem.quantity unsigned integer The quantity to cancel.
entries[].cancelLineItem.reason string The reason for the cancellation.

Acceptable values are:
  • "customerInitiatedCancel"
  • "malformedShippingAddress"
  • "noInventory"
  • "other"
  • "priceError"
  • "shippingPriceError"
  • "taxError"
  • "undeliverableShippingAddress"
  • "unsupportedPoBoxAddress"
entries[].cancelLineItem.reasonText string The explanation of the reason.
entries[].refund nested object Required for refund method.
entries[].refund.amount nested object The amount that is refunded.
entries[].refund.amount.value string The price represented as a number. writable
entries[].refund.amount.currency string The currency of the price. writable
entries[].refund.reason string The reason for the refund.

Acceptable values are:
  • "adjustment"
  • "courtesyAdjustment"
  • "customerCanceled"
  • "customerDiscretionaryReturn"
  • "deliveredLateByCarrier"
  • "feeAdjustment"
  • "lateShipmentCredit"
  • "noInventory"
  • "other"
  • "priceError"
  • "productArrivedDamaged"
  • "productNotAsDescribed"
  • "shippingCostAdjustment"
  • "taxAdjustment"
  • "undeliverableShippingAddress"
  • "wrongProductShipped"
entries[].refund.reasonText string The explanation of the reason.
entries[].returnLineItem nested object Required for returnLineItem method.
entries[].returnLineItem.lineItemId string The ID of the line item to return.
entries[].returnLineItem.quantity unsigned integer The quantity to return.
entries[].returnLineItem.reason string The reason for the return.

Acceptable values are:
  • "customerDiscretionaryReturn"
  • "customerInitiatedMerchantCancel"
  • "invalidCoupon"
  • "malformedShippingAddress"
  • "other"
  • "productArrivedDamaged"
  • "undeliverableShippingAddress"
  • "unsupportedPoBoxAddress"
  • "wrongProductShipped"
entries[].returnLineItem.reasonText string The explanation of the reason.
entries[].merchantOrderId string The merchant order id. Required for updateMerchantOrderId and getByMerchantOrderId methods.
entries[].cancelLineItem.amount nested object 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.
entries[].cancelLineItem.amount.value string The price represented as a number. writable
entries[].cancelLineItem.amount.currency string The currency of the price. writable

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "content#ordersCustomBatchResponse",
  "entries": [
    {
      "kind": "content#ordersCustomBatchResponseEntry",
      "batchId": unsigned integer,
      "order": orders Resource,
      "executionStatus": string,
      "errors": {
        "errors": [
          {
            "domain": string,
            "reason": string,
            "message": string
          }
        ],
        "code": unsigned integer,
        "message": string
      }
    }
  ]
}
Property name Value Description Notes
kind string Identifies what kind of resource this is. Value: the fixed string "content#ordersCustomBatchResponse".
entries[] list The result of the execution of the batch requests.
entries[].kind string Identifies what kind of resource this is. Value: the fixed string "content#ordersCustomBatchResponseEntry".
entries[].batchId unsigned integer The ID of the request entry this entry responds to.
entries[].order nested object The retrieved order. Only defined if the method is get and if the request was successful.
entries[].executionStatus string The status of the execution. Only defined if the method is not get or getByMerchantOrderId and if the request was successful.

Acceptable values are:
  • "duplicate"
  • "executed"
entries[].errors nested object A list of errors defined if and only if the request failed.
entries[].errors.errors[] list A list of errors.
entries[].errors.errors[].domain string The domain of the error.
entries[].errors.errors[].reason string The error code.
entries[].errors.errors[].message string A description of the error.
entries[].errors.code unsigned integer The HTTP status of the first error in errors.
entries[].errors.message string The message of the first error in errors.

Try it!

Use the APIs Explorer below to call this method on the Sandbox environment and see the response.
Alternatively, test this on live data.

Send feedback about...

Content API for Shopping