# Push Inventory

> Per-location stock levels (the first accepted batch sets inventory.location_source = feed).

Source: https://shopassist.coec.dk/docs/api/reference/catalog/push-inventory · Updated 2026-11-03

`POST /v1/stores/{store_id}/catalog/inventory:batch`

- Scope: `catalog:write`
- Rate limit: 600 requests/min per API key (test keys: 60/min); catalog batches 120/min per store

Per-location stock levels (the first accepted batch sets `inventory.location_source = feed`).

## Parameters [#parameters]

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `store_id` | path | `string` | yes |  |
| `Idempotency-Key` | header | `string` | yes | Replays return the original |

## Request body (InventoryBatch) [#request-body]

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `as_of` | `string` | no | format date-time |
| `levels` | `CatalogInventoryLevelInput[]` | yes | CatalogInventoryLevelInput items (validated individually; invalid items are reported in rejected[]) · ≥ 1 items · ≤ 500 items |
| `levels[].available` | `integer \| null` | yes |  |
| `levels[].location_external_id` | `string` | yes | 1–128 characters |
| `levels[].sku` | `string` | no | 1–255 characters |
| `levels[].status` | `"in_stock" \| "low_stock" \| "out_of_stock" \| "backorder" \| "unknown"` | no |  |
| `levels[].variant_external_id` | `string` | no | 1–128 characters |

## Example request [#example-request]

```bash
curl -X POST "https://api.shopassist.coec.dk/v1/stores/sto_01j8000000e008000000000000/catalog/inventory:batch" \
  -H "Authorization: Bearer $SHOPASSIST_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"as_of":"2026-09-28T10:15:30.123Z","levels":[{"available":1,"location_external_id":"string","sku":"string","status":"in_stock","variant_external_id":"string"}]}'
```

## Response 202 (BatchAccepted) [#response]

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accepted` | `integer` | yes | ≥ 0 |
| `rejected` | `ItemRejection[]` | yes |  |
| `rejected[].error` | `ItemError` | yes | `{ code; message }` of a rejected item. |
| `rejected[].error.code` | `"validation_error" \| "currency_mismatch" \| "duplicate_external_id" \| "too_many_variants" \| "url_not_allowed"` | yes |  |
| `rejected[].error.message` | `string` | yes |  |
| `rejected[].index` | `integer` | yes | ≥ 0 |
| `sync_run_id` | `string` | yes | pattern `^sync_[0-9a-hjkmnp-tv-z]{26}$` |

```json
{
  "accepted": 0,
  "rejected": [
    {
      "error": {
        "code": "validation_error",
        "message": "string"
      },
      "index": 0
    }
  ],
  "sync_run_id": "sync_01j8000000e008000000000000"
}
```

## Errors [#errors]

| Status | Meaning |
| --- | --- |
| 400 | Bad Request ([error codes](/docs/api/errors)) |
| 401 | Unauthorized ([error codes](/docs/api/errors)) |
| 403 | Forbidden ([error codes](/docs/api/errors)) |
| 404 | Not Found ([error codes](/docs/api/errors)) |
| 409 | Conflict ([error codes](/docs/api/errors)) |
| 413 | Content Too Large ([error codes](/docs/api/errors)) |
| 422 | Unprocessable Content ([error codes](/docs/api/errors)) |
| 429 | Too Many Requests ([error codes](/docs/api/errors)) |
