Pos: custombatch

Batches multiple POS-related calls in a single request. Try it now.

Request

HTTP request

POST https://www.googleapis.com/content/v2.1/pos/batch

Authorization

This request requires authorization with the following scope:

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,
      "method": string,
      "targetMerchantId": unsigned long,
      "storeCode": string,
      "store": pos Resource,
      "inventory": {
        "kind": "content#posInventory",
        "storeCode": string,
        "itemId": string,
        "targetCountry": string,
        "contentLanguage": string,
        "gtin": string,
        "price": {
          "value": string,
          "currency": string
        },
        "quantity": long,
        "timestamp": string
      },
      "sale": {
        "kind": "content#posSale",
        "storeCode": string,
        "itemId": string,
        "targetCountry": string,
        "contentLanguage": string,
        "gtin": string,
        "price": {
          "value": string,
          "currency": string
        },
        "quantity": long,
        "timestamp": string,
        "saleId": 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 POS data provider.
entries[].method string

Acceptable values are:
  • "delete"
  • "get"
  • "insert"
  • "inventory"
  • "sale"
entries[].targetMerchantId unsigned long The ID of the account for which to get/submit data.
entries[].storeCode string The store code. Set this only if the method is delete or get.
entries[].store nested object The store information to submit. Set this only if the method is insert.
entries[].inventory nested object The inventory to submit. Set this only if the method is inventory.
entries[].inventory.kind string Identifies what kind of resource this is. Value: the fixed string "content#posInventory".
entries[].inventory.storeCode string The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business.
entries[].inventory.itemId string A unique identifier for the item.
entries[].inventory.targetCountry string The CLDR territory code for the item.
entries[].inventory.contentLanguage string The two-letter ISO 639-1 language code for the item.
entries[].inventory.gtin string Global Trade Item Number.
entries[].inventory.price nested object The current price of the item.
entries[].inventory.price.value string The price represented as a number. writable
entries[].inventory.price.currency string The currency of the price. writable
entries[].inventory.quantity long The available quantity of the item.
entries[].inventory.timestamp string The inventory timestamp, in ISO 8601 format.
entries[].sale nested object The sale information to submit. Set this only if the method is sale.
entries[].sale.kind string Identifies what kind of resource this is. Value: the fixed string "content#posSale".
entries[].sale.storeCode string The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business.
entries[].sale.itemId string A unique identifier for the item.
entries[].sale.targetCountry string The CLDR territory code for the item.
entries[].sale.contentLanguage string The two-letter ISO 639-1 language code for the item.
entries[].sale.gtin string Global Trade Item Number.
entries[].sale.price nested object The price of the item.
entries[].sale.price.value string The price represented as a number. writable
entries[].sale.price.currency string The currency of the price. writable
entries[].sale.quantity long The relative change of the available quantity. Negative for items returned.
entries[].sale.timestamp string The inventory timestamp, in ISO 8601 format.
entries[].sale.saleId string A unique ID to group items from the same sale event.

Response

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

{
  "kind": "content#posCustomBatchResponse",
  "entries": [
    {
      "kind": "content#posCustomBatchResponseEntry",
      "batchId": unsigned integer,
      "store": pos Resource,
      "inventory": {
        "kind": "content#posInventory",
        "storeCode": string,
        "itemId": string,
        "targetCountry": string,
        "contentLanguage": string,
        "gtin": string,
        "price": {
          "value": string,
          "currency": string
        },
        "quantity": long,
        "timestamp": string
      },
      "sale": {
        "kind": "content#posSale",
        "storeCode": string,
        "itemId": string,
        "targetCountry": string,
        "contentLanguage": string,
        "gtin": string,
        "price": {
          "value": string,
          "currency": string
        },
        "quantity": long,
        "timestamp": string,
        "saleId": 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#posCustomBatchResponse".
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#posCustomBatchResponseEntry".
entries[].batchId unsigned integer The ID of the request entry to which this entry responds.
entries[].store nested object The retrieved or updated store information.
entries[].inventory nested object The updated inventory information.
entries[].inventory.kind string Identifies what kind of resource this is. Value: the fixed string "content#posInventory".
entries[].inventory.storeCode string The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business.
entries[].inventory.itemId string A unique identifier for the item.
entries[].inventory.targetCountry string The CLDR territory code for the item.
entries[].inventory.contentLanguage string The two-letter ISO 639-1 language code for the item.
entries[].inventory.gtin string Global Trade Item Number.
entries[].inventory.price nested object The current price of the item.
entries[].inventory.price.value string The price represented as a number. writable
entries[].inventory.price.currency string The currency of the price. writable
entries[].inventory.quantity long The available quantity of the item.
entries[].inventory.timestamp string The inventory timestamp, in ISO 8601 format.
entries[].sale nested object The updated sale information.
entries[].sale.kind string Identifies what kind of resource this is. Value: the fixed string "content#posSale".
entries[].sale.storeCode string The identifier of the merchant's store. Either a storeCode inserted via the API or the code of the store in Google My Business.
entries[].sale.itemId string A unique identifier for the item.
entries[].sale.targetCountry string The CLDR territory code for the item.
entries[].sale.contentLanguage string The two-letter ISO 639-1 language code for the item.
entries[].sale.gtin string Global Trade Item Number.
entries[].sale.price nested object The price of the item.
entries[].sale.price.value string The price represented as a number. writable
entries[].sale.price.currency string The currency of the price. writable
entries[].sale.quantity long The relative change of the available quantity. Negative for items returned.
entries[].sale.timestamp string The inventory timestamp, in ISO 8601 format.
entries[].sale.saleId string A unique ID to group items from the same sale event.
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 live data and see the response.