API reference

Inventory API

The Carriyo Inventory API manages stock levels across your fulfillment locations and tracks inventory changes over time. Submit inventory events to update per-location quantities, and query current positions by inventory key or product.

Idempotency

Write endpoints accept an optional Idempotency-Key request header for safe request replay when your integration retries after uncertain network outcomes. Replayed responses include Idempotent-Replayed: true. See Idempotency for the full contract.

Serverhttps://api.carriyo.comAuthOAuth 2.0 + API KeySpecinventory.yaml

Inventory

Stock addressed by an inventory key, held as one inventory position per location. Products that carry the same key share the same stock; a product without a key is not stock-managed. Positions are created and updated by inventory events rather than written directly.

Related: How inventory keys, positions and reservations work

7 operations · 0 objects

get/inventory/inventory-key/{inventory-key}

Get inventory by inventory key

Retrieves the current stock levels of an inventory key across all locations, keyed by location ID.

Errors

  • 404 — the inventory key has no inventory position at any location.

Related: How products carry the inventory key

Path parameters

NameTypeRequiredDescription
inventory-keystringYesThe inventory key.

Headers

NameValueRequiredDescription
AuthorizationBearer YOUR-ACCESS-TOKENYesOAuth 2.0 bearer token obtained from `POST /oauth/token`.
x-api-keyYOUR-API-KEYYesYour tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.
tenant-idYOUR-TENANT-IDYesYour Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.

Responses

200Successfully retrieved inventory for the inventory key.Schema: inventory-response
  • tenantstring
    The tenant identifier.
  • inventory_keystring
    The inventory key.
  • stock_by_locationobject
    Stock levels keyed by location ID.
  • creation_datestringformat: date-time
    When the inventory key's oldest position was created (ISO 8601 format).
  • update_datestringformat: date-time
    When the inventory key's stock was last updated, across all locations (ISO 8601 format).
  • creation_sourcerequest-source
    Describes which system or actor triggered an inventory change.
  • update_sourcerequest-source
    Describes which system or actor triggered an inventory change.
404No inventory found for the specified inventory key.Schema: error-response
  • errorsstring[]
    Error messages describing what went wrong, one entry per line of the underlying message.
  • error_detailserror-detail[]
    Structured detail for each error, when available.
  • statusstring
    HTTP status code of the response, as a string.
  • timestampstringformat: date-time
    When Carriyo built the error response.

Need the full machine-readable spec? Download the OpenAPI document →

get/inventory/product-id/{product-id}

Get inventory by product ID

Retrieves the current stock levels of the product's inventory key across all locations, keyed by location ID.

Errors

  • 404 — the product has no inventory_key.
  • 404 — the inventory key has no inventory position at any location.

Path parameters

NameTypeRequiredDescription
product-idstringYesThe unique identifier of the product.

Headers

NameValueRequiredDescription
AuthorizationBearer YOUR-ACCESS-TOKENYesOAuth 2.0 bearer token obtained from `POST /oauth/token`.
x-api-keyYOUR-API-KEYYesYour tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.
tenant-idYOUR-TENANT-IDYesYour Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.

Responses

200Successfully retrieved inventory for the product's inventory key.Schema: inventory-response
  • tenantstring
    The tenant identifier.
  • inventory_keystring
    The inventory key.
  • stock_by_locationobject
    Stock levels keyed by location ID.
  • creation_datestringformat: date-time
    When the inventory key's oldest position was created (ISO 8601 format).
  • update_datestringformat: date-time
    When the inventory key's stock was last updated, across all locations (ISO 8601 format).
  • creation_sourcerequest-source
    Describes which system or actor triggered an inventory change.
  • update_sourcerequest-source
    Describes which system or actor triggered an inventory change.
404The product does not exist, has no inventory key, or its key has no inventory.Schema: error-response
  • errorsstring[]
    Error messages describing what went wrong, one entry per line of the underlying message.
  • error_detailserror-detail[]
    Structured detail for each error, when available.
  • statusstring
    HTTP status code of the response, as a string.
  • timestampstringformat: date-time
    When Carriyo built the error response.

Need the full machine-readable spec? Download the OpenAPI document →

get/inventory/product-ref/{product-ref}

Get inventory by product reference

Retrieves the current stock levels of the inventory key of the product you reference, across all locations, keyed by location ID.

Behavior

Product references are unique per merchant, so merchant is required.

Errors

  • 400merchant missing.
  • 404 — the product has no inventory_key.
  • 404 — the inventory key has no inventory position at any location.

Path parameters

NameTypeRequiredDescription
product-refstringYesYour reference for the product.

Query parameters

NameTypeRequiredDescription
merchantstringYesThe merchant the product reference belongs to.

Headers

NameValueRequiredDescription
AuthorizationBearer YOUR-ACCESS-TOKENYesOAuth 2.0 bearer token obtained from `POST /oauth/token`.
x-api-keyYOUR-API-KEYYesYour tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.
tenant-idYOUR-TENANT-IDYesYour Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.

Responses

200Successfully retrieved inventory for the product's inventory key.Schema: inventory-response
  • tenantstring
    The tenant identifier.
  • inventory_keystring
    The inventory key.
  • stock_by_locationobject
    Stock levels keyed by location ID.
  • creation_datestringformat: date-time
    When the inventory key's oldest position was created (ISO 8601 format).
  • update_datestringformat: date-time
    When the inventory key's stock was last updated, across all locations (ISO 8601 format).
  • creation_sourcerequest-source
    Describes which system or actor triggered an inventory change.
  • update_sourcerequest-source
    Describes which system or actor triggered an inventory change.
400The merchant query parameter is missing.Schema: error-response
  • errorsstring[]
    Error messages describing what went wrong, one entry per line of the underlying message.
  • error_detailserror-detail[]
    Structured detail for each error, when available.
  • statusstring
    HTTP status code of the response, as a string.
  • timestampstringformat: date-time
    When Carriyo built the error response.
404The product does not exist, has no inventory key, or its key has no inventory.Schema: error-response
  • errorsstring[]
    Error messages describing what went wrong, one entry per line of the underlying message.
  • error_detailserror-detail[]
    Structured detail for each error, when available.
  • statusstring
    HTTP status code of the response, as a string.
  • timestampstringformat: date-time
    When Carriyo built the error response.

Need the full machine-readable spec? Download the OpenAPI document →

get/inventory/inventory-key/{inventory-key}/reservations

Get reservations by inventory key

Retrieves the open reservations held against an inventory key.

Behavior

Reservations are held per location and order, and back each position's reserved counter. A reservation is open while it holds a non-zero quantity: fulfillment and cancellation reduce it and then delete the row, and there is no status field. Rows are oldest first, paged with page_num and rows_per_page (10 per page by default); only the oldest 500 are reachable. location_id narrows the read to one location.

Path parameters

NameTypeRequiredDescription
inventory-keystringYesThe inventory key.

Query parameters

NameTypeRequiredDescription
location_idstringNoNarrow the results to one location.
page_numintegerNoThe page to return, starting at 1.
rows_per_pageintegerNoHow many rows per page.

Headers

NameValueRequiredDescription
AuthorizationBearer YOUR-ACCESS-TOKENYesOAuth 2.0 bearer token obtained from `POST /oauth/token`.
x-api-keyYOUR-API-KEYYesYour tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.
tenant-idYOUR-TENANT-IDYesYour Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.

Responses

200Successfully retrieved reservations for the inventory key.Schema: reservation-page
  • totalinteger
    How many rows the query fetched (up to a window of 500), not a global count.
  • page_numinteger
    The page returned.
  • rows_per_pageinteger
    The page size used.
  • itemsreservation[]
    The requested page of reservations.

Need the full machine-readable spec? Download the OpenAPI document →

get/inventory/product-id/{product-id}/reservations

Get reservations by product ID

Retrieves the open reservations held against the product's inventory key.

Behavior

Reservations are held per location and order, and back each position's reserved counter. A reservation is open while it holds a non-zero quantity: fulfillment and cancellation reduce it and then delete the row, and there is no status field. Rows are oldest first, paged with page_num and rows_per_page (10 per page by default); only the oldest 500 are reachable. location_id narrows the read to one location.

Path parameters

NameTypeRequiredDescription
product-idstringYesThe unique identifier of the product.

Query parameters

NameTypeRequiredDescription
location_idstringNoNarrow the results to one location.
page_numintegerNoThe page to return, starting at 1.
rows_per_pageintegerNoHow many rows per page.

Headers

NameValueRequiredDescription
AuthorizationBearer YOUR-ACCESS-TOKENYesOAuth 2.0 bearer token obtained from `POST /oauth/token`.
x-api-keyYOUR-API-KEYYesYour tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.
tenant-idYOUR-TENANT-IDYesYour Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.

Responses

200Successfully retrieved reservations for the product's inventory key.Schema: reservation-page
  • totalinteger
    How many rows the query fetched (up to a window of 500), not a global count.
  • page_numinteger
    The page returned.
  • rows_per_pageinteger
    The page size used.
  • itemsreservation[]
    The requested page of reservations.
404The product does not exist or has no inventory key.Schema: error-response
  • errorsstring[]
    Error messages describing what went wrong, one entry per line of the underlying message.
  • error_detailserror-detail[]
    Structured detail for each error, when available.
  • statusstring
    HTTP status code of the response, as a string.
  • timestampstringformat: date-time
    When Carriyo built the error response.

Need the full machine-readable spec? Download the OpenAPI document →

get/inventory/product-ref/{product-ref}/reservations

Get reservations by product reference

Retrieves the open reservations held against the inventory key of the product you reference.

Behavior

Product references are unique per merchant, so merchant is required.

Reservations are held per location and order, and back each position's reserved counter. A reservation is open while it holds a non-zero quantity: fulfillment and cancellation reduce it and then delete the row, and there is no status field. Rows are oldest first, paged with page_num and rows_per_page (10 per page by default); only the oldest 500 are reachable. location_id narrows the read to one location.

Path parameters

NameTypeRequiredDescription
product-refstringYesYour reference for the product.

Query parameters

NameTypeRequiredDescription
merchantstringYesThe merchant the product reference belongs to.
location_idstringNoNarrow the results to one location.
page_numintegerNoThe page to return, starting at 1.
rows_per_pageintegerNoHow many rows per page.

Headers

NameValueRequiredDescription
AuthorizationBearer YOUR-ACCESS-TOKENYesOAuth 2.0 bearer token obtained from `POST /oauth/token`.
x-api-keyYOUR-API-KEYYesYour tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.
tenant-idYOUR-TENANT-IDYesYour Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.

Responses

200Successfully retrieved reservations for the product's inventory key.Schema: reservation-page
  • totalinteger
    How many rows the query fetched (up to a window of 500), not a global count.
  • page_numinteger
    The page returned.
  • rows_per_pageinteger
    The page size used.
  • itemsreservation[]
    The requested page of reservations.
400The merchant query parameter is missing.Schema: error-response
  • errorsstring[]
    Error messages describing what went wrong, one entry per line of the underlying message.
  • error_detailserror-detail[]
    Structured detail for each error, when available.
  • statusstring
    HTTP status code of the response, as a string.
  • timestampstringformat: date-time
    When Carriyo built the error response.
404The product does not exist or has no inventory key.Schema: error-response
  • errorsstring[]
    Error messages describing what went wrong, one entry per line of the underlying message.
  • error_detailserror-detail[]
    Structured detail for each error, when available.
  • statusstring
    HTTP status code of the response, as a string.
  • timestampstringformat: date-time
    When Carriyo built the error response.

Need the full machine-readable spec? Download the OpenAPI document →

delete/inventory/inventory-key/{inventory-key}/location-id/{location-id}

Delete inventory

Permanently deletes the inventory position of an inventory key at one location, along with its reservations.

Behavior

Position. The position is gone: reading it returns 404 until the next inventory event for that inventory key and location recreates it. The event history is not deleted, so the history for the inventory key still returns the events that preceded the deletion.

Reservations. Every reservation held at that location is deleted with the position. The orders holding them are not updated.

Webhook. An inventory webhook with operation: DELETE fires when the tenant has an active inventory webhook.

Related: How inventory keys, positions and reservations work

Path parameters

NameTypeRequiredDescription
inventory-keystringYesThe inventory key.
location-idstringYesThe unique identifier of the location.

Headers

NameValueRequiredDescription
AuthorizationBearer YOUR-ACCESS-TOKENYesOAuth 2.0 bearer token obtained from `POST /oauth/token`.
x-api-keyYOUR-API-KEYYesYour tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.
tenant-idYOUR-TENANT-IDYesYour Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.

Responses

204Successfully deleted the inventory position.
404Inventory not found for the specified inventory key and location.Schema: error-response
  • errorsstring[]
    Error messages describing what went wrong, one entry per line of the underlying message.
  • error_detailserror-detail[]
    Structured detail for each error, when available.
  • statusstring
    HTTP status code of the response, as a string.
  • timestampstringformat: date-time
    When Carriyo built the error response.

Need the full machine-readable spec? Download the OpenAPI document →

Inventory Events

The event history behind every stock level: each event either sets an absolute quantity or applies a signed delta to one inventory key at one location.

Related: How an event changes stock, and when a batch is safe to resend

4 operations · 0 objects

get/inventory-events/request-id/{request-id}

Get inventory events by request ID

Returns the events submitted under one bulk import request, in sequence order.

Behavior

status reports the batch as a whole:

  • processing while any row is still queued.
  • completed once every row is accounted for.

Rows are in sequence order within the batch. APPLIED, REJECTED and UNCHANGED rows are all included; rows left out of the event history by skip_unchanged=true are not. A REJECTED row carries its reason in error_message.

Rows the import call rejected on validation never reach the event history; they are reported only in the import response. Once the status is completed, an accepted row with no event was unchanged and imported with skip_unchanged=true.

Path parameters

NameTypeRequiredDescription
request-idstringYesThe request ID returned from the bulk import operation.

Headers

NameValueRequiredDescription
AuthorizationBearer YOUR-ACCESS-TOKENYesOAuth 2.0 bearer token obtained from `POST /oauth/token`.
x-api-keyYOUR-API-KEYYesYour tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.
tenant-idYOUR-TENANT-IDYesYour Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.

Responses

200Successfully retrieved inventory events for the request.Schema: get-inventory-events-response
  • statusstring
    Overall status of the batch: - completed - All events in the batch have been processed - processing - Some events are still being processed
    Values:completedprocessing
  • inventory_eventsinventory-event[]
    List of inventory events for this request, sorted by sequence number.
404No events found for the specified request ID.Schema: error-response
  • errorsstring[]
    Error messages describing what went wrong, one entry per line of the underlying message.
  • error_detailserror-detail[]
    Structured detail for each error, when available.
  • statusstring
    HTTP status code of the response, as a string.
  • timestampstringformat: date-time
    When Carriyo built the error response.

Need the full machine-readable spec? Download the OpenAPI document →

get/inventory-events/inventory-key/{inventory-key}

Get inventory events by inventory key

Retrieves the event history of an inventory key, newest first.

Behavior

Rows are newest first, paged with page_num and rows_per_page (10 per page by default); only the newest 500 events are reachable. APPLIED, REJECTED and UNCHANGED rows are all included; rows left out of the event history by skip_unchanged=true are not. location_id narrows the read to one location.

Errors

  • 404 — the inventory key has no events.

Path parameters

NameTypeRequiredDescription
inventory-keystringYesThe inventory key.

Query parameters

NameTypeRequiredDescription
location_idstringNoNarrow the results to one location.
page_numintegerNoThe page to return, starting at 1.
rows_per_pageintegerNoHow many rows per page.

Headers

NameValueRequiredDescription
AuthorizationBearer YOUR-ACCESS-TOKENYesOAuth 2.0 bearer token obtained from `POST /oauth/token`.
x-api-keyYOUR-API-KEYYesYour tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.
tenant-idYOUR-TENANT-IDYesYour Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.

Responses

200Successfully retrieved inventory events for the inventory key.Schema: inventory-event-page
  • totalinteger
    How many rows the query fetched (up to a window of 500), not a global count.
  • page_numinteger
    The page returned.
  • rows_per_pageinteger
    The page size used.
  • itemsinventory-event[]
    The requested page of events, newest first.
404No events found for the specified inventory key.Schema: error-response
  • errorsstring[]
    Error messages describing what went wrong, one entry per line of the underlying message.
  • error_detailserror-detail[]
    Structured detail for each error, when available.
  • statusstring
    HTTP status code of the response, as a string.
  • timestampstringformat: date-time
    When Carriyo built the error response.

Need the full machine-readable spec? Download the OpenAPI document →

get/inventory-events/product-id/{product-id}

Get inventory events by product ID

Retrieves the event history of the product's inventory key, newest first.

Behavior

Rows are newest first, paged with page_num and rows_per_page (10 per page by default); only the newest 500 events are reachable. APPLIED, REJECTED and UNCHANGED rows are all included; rows left out of the event history by skip_unchanged=true are not. location_id narrows the read to one location.

Errors

  • 404 — the product has no inventory_key.
  • 404 — the inventory key has no events.

Path parameters

NameTypeRequiredDescription
product-idstringYesThe unique identifier of the product.

Query parameters

NameTypeRequiredDescription
location_idstringNoNarrow the results to one location.
page_numintegerNoThe page to return, starting at 1.
rows_per_pageintegerNoHow many rows per page.

Headers

NameValueRequiredDescription
AuthorizationBearer YOUR-ACCESS-TOKENYesOAuth 2.0 bearer token obtained from `POST /oauth/token`.
x-api-keyYOUR-API-KEYYesYour tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.
tenant-idYOUR-TENANT-IDYesYour Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.

Responses

200Successfully retrieved inventory events for the product's inventory key.Schema: inventory-event-page
  • totalinteger
    How many rows the query fetched (up to a window of 500), not a global count.
  • page_numinteger
    The page returned.
  • rows_per_pageinteger
    The page size used.
  • itemsinventory-event[]
    The requested page of events, newest first.
404The product does not exist, has no inventory key, or its key has no events.Schema: error-response
  • errorsstring[]
    Error messages describing what went wrong, one entry per line of the underlying message.
  • error_detailserror-detail[]
    Structured detail for each error, when available.
  • statusstring
    HTTP status code of the response, as a string.
  • timestampstringformat: date-time
    When Carriyo built the error response.

Need the full machine-readable spec? Download the OpenAPI document →

post/inventory-events/bulk/import

Bulk import inventory events

Submits a batch of inventory events that set or adjust stock at your locations.

Behavior

What to send

Every batch needs a request-id header that has not been used before. Send an Idempotency-Key as well: a retry that repeats both headers returns the stored response instead of a refusal. Each event addresses one inventory position: one inventory key at one location.

  • inventory_key names the key. Product keys are refused here; they stay on the read endpoints.
  • location_id or location_code names the location, and at least one is required. A code must match exactly one location, and when both keys are sent they must name the same location.
  • The location must be inventory-enabled.

Resolution never guesses: an ambiguous or conflicting key rejects the event rather than applying it to a position you did not name.

Event types

Only the snapshot, adjustment and movement types may be sent.

Snapshot. Sets absolute values:

  • SNAPSHOT sets both counts; requires on_hand and unavailable.
  • SNAPSHOT_ONHAND sets on_hand only; requires on_hand.
  • SNAPSHOT_UNAVAILABLE sets unavailable only; requires unavailable.

Adjustment. Applies a signed delta:

  • INVENTORY_ADJUSTMENT_ONHAND adjusts on_hand; requires on_hand.
  • INVENTORY_ADJUSTMENT_UNAVAILABLE adjusts unavailable; requires unavailable.

Movement. Applies a signed delta for a stock movement:

  • RETURN adjusts unavailable for returned items; requires unavailable.
  • TRANSFER_IN, TRANSFER_OUT, SALE and PO_RECEIPT adjust on_hand, unavailable or both; each requires at least one of them.

The movement types apply the value exactly as sent, so a SALE or TRANSFER_OUT that reduces stock must carry a negative number.

The order, shipment and return-request types (ORDER_RESERVATION, ORDER_UPDATE, ORDER_CANCELLATION, ORDER_FULFILLMENT, ORDER_UNFULFILLED, ORDER_RETURN, SHIPMENT_SHIPPED, RETURN_REQUEST_REVERSE_SHIPMENT_DELIVERED, RETURN_REQUEST_MARKED_AS_RECEIVED) are written by Carriyo as orders move. A row sending one is rejected; the rest of the batch continues.

Validation

A row that fails validation is rejected on its own and the batch continues; a problem with the request itself refuses the whole batch, as listed under Errors.

  • A quantity outside -1,000,000 to 1,000,000, or neither quantity supplied, rejects the row.
  • event_timestamp missing, older than 14 days, or more than two minutes ahead of the Carriyo server clock rejects the row.
  • A missing inventory_key, or any product_id, product_ref or merchant present, rejects the row.
  • A missing or unsupported event_type, or a field combination wrong for the type, rejects the row.
  • An unknown location, a disagreeing location_id and location_code, an ambiguous code, or a location that is not inventory-enabled rejects the row.

Processing

Rows are queued and applied asynchronously, in event_timestamp order. Each comes back processing (accepted and queued) or rejected with a reason, and the batch's progress is readable by request id. If queuing fails, accepted rows flip to rejected and the request-id is released for reuse.

  • Snapshot rows for the same position and type are collapsed to the one with the newest event_timestamp; the others are rejected as older snapshots.
  • Snapshot rows naming the same position with different snapshot types are all rejected.
  • Movement rows are never collapsed: each one applies.

An inventory key and location with no position yet gets one from its first event, with every counter at 0, so a movement on a new position applies its delta from 0. Across batches, a snapshot older than a count already applied to the position is rejected; a snapshot older than movements applied after it is re-based on those movements and applied; a movement older than a count already applied is rejected as already included.

Each row that changes a counter fires one inventory webhook, with operation CREATE when the row created the position and UPDATE otherwise, when the tenant has an active inventory webhook.

Resubmitting a snapshot batch converges on the same counts. Resubmitting adjustment or movement rows applies them again, so read a failed batch by its request id before resending it.

Unchanged rows

A row leaves the position unchanged when it is a snapshot equal to the stored counts or a zero movement. Such a row is recorded with status UNCHANGED and never fires a webhook. With skip_unchanged=true it is left out of the event history as well; the row is still counted and the request still completes.

Errors

  • 400 — the request-id header is missing.
  • 400 — the request-id has been used before; the whole request is lost, valid rows included.
  • 400 — the body is empty.
  • 400 — the body is malformed JSON.
  • 400 — the batch exceeds 500 rows; the message is bulk import cannot exceed 500 rows.

Related: How an event changes stock, and when a batch is safe to resend

Query parameters

NameTypeRequiredDescription
skip_unchangedbooleanNoWhen `true`, rows that leave the position's counters unchanged are not recorded as events. They are still counted towards batch completion but appear neither in the event history nor in webhooks. An unchanged row is not written at all, so it does not refresh the position's ordering timestamps the way a recorded `UNCHANGED` event does. When `false` (the default), such rows are recorded with status `UNCHANGED`.

Headers

NameValueRequiredDescription
AuthorizationBearer YOUR-ACCESS-TOKENYesOAuth 2.0 bearer token obtained from `POST /oauth/token`.
x-api-keyYOUR-API-KEYYesYour tenant's API key, issued in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.
tenant-idYOUR-TENANT-IDYesYour Carriyo tenant ID, shown in the Carriyo Dashboard. Required on every request except `POST /oauth/token`.
Content-Typeapplication/jsonYesMedia type of the request body.

Header parameters

NameTypeRequiredDescription
Idempotency-KeystringNoOptional client-generated key that identifies one logical operation. Reuse the same key when retrying with the same payload. Replays the stored response. See [Idempotency](/api/idempotency/).
request-idstringYesA unique request ID for this batch (required). - Must be unique across all previous requests - Use this to track processing status via the Get Events by Request ID endpoint - Cannot be reused once accepted - if you need to retry, use a new request ID

Request body

Content type: application/jsonrequired

An array of inventory-event-request. Each item has the following fields:

  • inventory_keystringrequired
    The inventory key — typically the barcode or GTIN your systems track stock by.
  • location_idstring
    The unique identifier of the location. Must be an inventory-enabled location. Send location_id or location_code — at least one is required. If you send both, they must name the same location; a mismatch rejects the event.
  • location_codestring
    The code of the location, as an alternative to location_id. Carriyo resolves it to the matching inventory-enabled location in your tenant. The code must match exactly one location. If two or more locations share the code, the event is rejected as ambiguous — send location_id instead.
  • on_handintegerformat: int64
    The on-hand quantity value. Required for some event types: - Required: SNAPSHOT, SNAPSHOT_ONHAND, INVENTORY_ADJUSTMENT_ONHAND - Not allowed: INVENTORY_ADJUSTMENT_UNAVAILABLE, RETURN, SNAPSHOT_UNAVAILABLE
  • unavailableintegerformat: int64
    The unavailable quantity value. Required for some event types: - Required: SNAPSHOT, SNAPSHOT_UNAVAILABLE, INVENTORY_ADJUSTMENT_UNAVAILABLE, RETURN - Not allowed: SNAPSHOT_ONHAND, INVENTORY_ADJUSTMENT_ONHAND
  • event_typestringrequired
    The type of inventory event: - SNAPSHOT - Set absolute values for both on_hand and unavailable - SNAPSHOT_ONHAND - Set absolute value for on_hand only - SNAPSHOT_UNAVAILABLE - Set absolute value for unavailable only - INVENTORY_ADJUSTMENT_ONHAND - Adjust on_hand by delta (+/-) - INVENTORY_ADJUSTMENT_UNAVAILABLE - Adjust unavailable by delta (+/-) - RETURN - Record returned items as a signed delta to unavailable (unavailable only) - TRANSFER_IN - Stock transfer into location, as a signed delta to on_hand and/or unavailable - TRANSFER_OUT - Stock transfer out of location, as a signed delta to on_hand and/or unavailable - SALE - Record sales as a signed delta to on_hand and/or unavailable - PO_RECEIPT - Purchase order receipt as a signed delta to on_hand and/or unavailable Deltas are applied exactly as sent, so a SALE or TRANSFER_OUT that reduces stock must carry a negative value. Carriyo writes these types itself as orders, shipments and returns move; a row sending one is rejected with event_type <value> is not supported in bulk import: - ORDER_RESERVATION - ORDER_UPDATE - ORDER_CANCELLATION - ORDER_FULFILLMENT - ORDER_UNFULFILLED - ORDER_RETURN - SHIPMENT_SHIPPED - RETURN_REQUEST_REVERSE_SHIPMENT_DELIVERED - RETURN_REQUEST_MARKED_AS_RECEIVED
    Values:SNAPSHOTSNAPSHOT_ONHANDSNAPSHOT_UNAVAILABLEINVENTORY_ADJUSTMENT_ONHANDINVENTORY_ADJUSTMENT_UNAVAILABLERETURNTRANSFER_INTRANSFER_OUTSALEPO_RECEIPT
  • reasonstring
    Optional reason or note for the inventory change.
  • event_timestampstringrequiredformat: date-time
    The timestamp when the event occurred, in ISO 8601 format. Required. Must be no older than 14 days and no more than two minutes ahead of the Carriyo server clock.

Responses

200Successfully processed inventory events.Schema: inventory-event-bulk-response
  • request_idstring
    The unique identifier for this bulk import request. Use this to track event status.
  • resultsinventory-event-bulk-response-item[]
    Processing results for each event in the request.
400Invalid request payload.Schema: error-response
  • errorsstring[]
    Error messages describing what went wrong, one entry per line of the underlying message.
  • error_detailserror-detail[]
    Structured detail for each error, when available.
  • statusstring
    HTTP status code of the response, as a string.
  • timestampstringformat: date-time
    When Carriyo built the error response.

Need the full machine-readable spec? Download the OpenAPI document →