# Method: pos.custombatch

- [HTTP request](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#body.request_body)
- [Response body](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#body.response_body)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#body.PosCustomBatchResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#body.aspect)
- [PosCustomBatchRequest](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosCustomBatchRequest)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosCustomBatchRequest.SCHEMA_REPRESENTATION)
- [PosCustomBatchRequestEntry](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosCustomBatchRequestEntry)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosCustomBatchRequestEntry.SCHEMA_REPRESENTATION)
- [PosInventory](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosInventory)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosInventory.SCHEMA_REPRESENTATION)
- [PosSale](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosSale)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosSale.SCHEMA_REPRESENTATION)
- [PosCustomBatchResponseEntry](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosCustomBatchResponseEntry)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosCustomBatchResponseEntry.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#try-it)

Batches multiple POS-related calls in a single request.

### HTTP request

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

### Request body

The request body contains an instance of `https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosCustomBatchRequest`.

### Response body

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "entries": [ { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosCustomBatchResponseEntry`) } ], "kind": string } ``` |

| Fields ||
|---|---|
| `entries[]` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosCustomBatchResponseEntry`)`` The result of the execution of the batch requests. |
| `kind` | `string` Identifies what kind of resource this is. Value: the fixed string "`content#posCustomBatchResponse`". |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/content`

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).

## PosCustomBatchRequest

| JSON representation |
|---|
| ``` { "entries": [ { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosCustomBatchRequestEntry`) } ] } ``` |

| Fields ||
|---|---|
| `entries[]` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosCustomBatchRequestEntry`)`` The request entries to be processed in the batch. |

## PosCustomBatchRequestEntry

| JSON representation |
|---|
| ``` { "batchId": integer, "merchantId": string, "method": string, "targetMerchantId": string, "storeCode": string, "store": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos#PosStore`) }, "inventory": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosInventory`) }, "sale": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosSale`) } } ``` |

| Fields ||
|---|---|
| `batchId` | `integer (https://developers.google.com/discovery/v1/type-format format)` An entry ID, unique within the batch request. |
| `merchantId` | `string` The ID of the POS data provider. |
| `method` | `string` The method of the batch entry. Acceptable values are: - "`delete`" - "`get`" - "`insert`" - "`inventory`" - "`sale`" <br /> |
| `targetMerchantId` | `string` The ID of the account for which to get/submit data. |
| `storeCode` | `string` The store code. This should be set only if the method is `delete` or `get`. |
| `store` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos#PosStore`)`` The store information to submit. This should be set only if the method is `insert`. |
| `inventory` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosInventory`)`` The inventory to submit. This should be set only if the method is `inventory`. |
| `sale` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosSale`)`` The sale information to submit. This should be set only if the method is `sale`. |

## PosInventory

The absolute quantity of an item available at the given store.

| JSON representation |
|---|
| ``` { "kind": string, "storeCode": string, "itemId": string, "targetCountry": string, "contentLanguage": string, "gtin": string, "price": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/Price`) }, "quantity": string, "timestamp": string, "pickupMethod": string, "pickupSla": string } ``` |

| Fields ||
|---|---|
| `kind` | `string` Identifies what kind of resource this is. Value: the fixed string "`content#posInventory`" |
| `storeCode` | `string` Required. The identifier of the merchant's store. Either a `storeCode` inserted through the API or the code of the store in a Business Profile. |
| `itemId` | `string` Required. A unique identifier for the item. |
| `targetCountry` | `string` Required. The [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) for the item. |
| `contentLanguage` | `string` Required. The two-letter ISO 639-1 language code for the item. |
| `gtin` | `string` Global Trade Item Number. |
| `price` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/Price`)`` Required. The current price of the item. |
| `quantity` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. The available quantity of the item. |
| `timestamp` | `string` Required. The inventory timestamp, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. |
| `pickupMethod` | `string` Optional. Supported pickup method for this offer. Unless the value is "not supported", this field must be submitted together with `pickupSla`. For accepted attribute values, see the [local product inventory feed specification](https://support.google.com/merchants/answer/3061342). |
| `pickupSla` | `string` Optional. Expected date that an order will be ready for pickup relative to the order date. Must be submitted together with `pickupMethod`. For accepted attribute values, see the [local product inventory feed specification](https://support.google.com/merchants/answer/3061342). |

## PosSale

The change of the available quantity of an item at the given store.

| JSON representation |
|---|
| ``` { "kind": string, "storeCode": string, "itemId": string, "targetCountry": string, "contentLanguage": string, "gtin": string, "price": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/Price`) }, "quantity": string, "timestamp": string, "saleId": string } ``` |

| Fields ||
|---|---|
| `kind` | `string` Identifies what kind of resource this is. Value: the fixed string "`content#posSale`" |
| `storeCode` | `string` Required. The identifier of the merchant's store. Either a `storeCode` inserted through the API or the code of the store in a Business Profile. |
| `itemId` | `string` Required. A unique identifier for the item. |
| `targetCountry` | `string` Required. The [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml) for the item. |
| `contentLanguage` | `string` Required. The two-letter ISO 639-1 language code for the item. |
| `gtin` | `string` Global Trade Item Number. |
| `price` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/Price`)`` Required. The price of the item. |
| `quantity` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. The relative change of the available quantity. Negative for items returned. |
| `timestamp` | `string` Required. The inventory timestamp, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. |
| `saleId` | `string` A unique ID to group items from the same sale event. |

## PosCustomBatchResponseEntry

| JSON representation |
|---|
| ``` { "batchId": integer, "store": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos#PosStore`) }, "errors": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/Errors`) }, "inventory": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosInventory`) }, "sale": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosSale`) }, "kind": string } ``` |

| Fields ||
|---|---|
| `batchId` | `integer (https://developers.google.com/discovery/v1/type-format format)` The ID of the request entry to which this entry responds. |
| `store` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos#PosStore`)`` The retrieved or updated store information. |
| `errors` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/Errors`)`` A list of errors defined if, and only if, the request failed. |
| `inventory` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosInventory`)`` The updated inventory information. |
| `sale` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/pos/custombatch#PosSale`)`` The updated sale information. |
| `kind` | `string` Identifies what kind of resource this is. Value: the fixed string "`content#posCustomBatchResponseEntry`" |