Bulk Reconcile Items

Beta
POST/v1/catalog/items/actions/bulk-reconcile

Idempotent with Idempotency-Key header. Learn more

Reconciles inventory for multiple items by SKU in one call, the bulk equivalent of counting stock and correcting the books.

reconcile_type controls whether each quantity is added to the item's current quantity (addition) or replaces it (force). The figure a force measures against is what is on hand net of demand nothing has covered, the same basis the single-item endpoint uses. Each quantity is converted from its row's unit into the item's base unit, and previous_quantity and new_quantity are reported in that base unit. A SKU listed twice applies each row in turn.

The response reports each row as reconciled, skipped (unknown SKU), or errored (unknown unit, or a unit outside the item's unit group), so a problem with one row does not fail the rest. Rows are written in batches of 50, each in its own transaction; a batch that cannot be written is rolled back whole and every row in it is reported in errors, while the batches before and after it still apply. Resubmit only the errored rows — in addition mode, resubmitting the whole request would apply the reconciled rows twice.

At most 1,000 rows per request, and a request body of at most 8 MB. Each correction is written to the item's inventory audit trail as a user correction, attributed to the caller.

Permission requiredValues:items:create
The role behind your API key or agent must grant this permission.
dataarray of object

Items to reconcile, at most 1,000 rows per request. Split a larger count across requests.

skustring

SKU of the item to reconcile.

Items whose SKU does not match an existing item are reported in the response's skipped_items rather than failing the request.

unitstring

Abbreviation of the unit quantity is counted in (e.g. kg), matched without regard to case.

It must be the item's base unit or another unit in its category's unit group; the quantity is converted from it into the base unit before it is applied, so 2 dz against an item stocked in eaches reconciles 24. A row whose abbreviation matches no unit, or a unit outside the item's unit group, is reported in the response's errors and writes nothing.

quantitystring (decimal)

Quantity to apply, interpreted according to the request's reconcile_type.

A decimal string rather than a number: a quantity that has been through a binary float is not the quantity you sent.

reconcile_typestringenumValues:additionforce

How each item's quantity is applied to its current quantity.

  • addition: adds the quantity to the item's current quantity.
  • force: sets the item's current quantity to exactly the given quantity.
objectstringenumValues:bulk_reconcile_items_response

Resource type identifier.

reconciled_itemslistnullable

Items whose inventory was successfully reconciled.

objectstringenumValues:list

Resource type identifier.

page_infoobject

Pagination metadata.

next_page_urlstringnullable

Relative URL that fetches the next page of results.

previous_page_urlstringnullable

Relative URL that fetches the previous page of results.

has_next_pageboolean

Whether more results exist after this page.

has_prev_pageboolean

Whether results exist before this page.

dataarray of reconciled_item_result

Resources in this page.

objectstringenumValues:reconciled_item_result

Resource type identifier.

itementitynullable

The item that was reconciled, named by id and SKU.

idstring

Unique identifier for the entity.

objectstringenumValues:entity

Resource type identifier.

typestringenumValues:accountactorentity

The resource kind that this entity references, as an object-type value (e.g. user, account).

Unlike object — which is always entity — this names the underlying resource the id points to.

namestringnullable

Human-readable display name for the entity (e.g. a user's full name, a sales order number).

handlestringnullable

Secondary human-readable identifier (e.g. email address, username, redacted API key value).

previous_quantitycomputed_quantitynullable

Quantity before the reconciliation.

objectstringenumValues:computed_quantity

Resource type identifier.

valuestring (decimal)

Raw decimal value, as a string to preserve precision.

This is the unformatted machine value; see display_value for the human-readable rendering.

display_valuestring

Formatted value with unit abbreviation (e.g. "1,200 pr").

unitunitnullable

Unit of measure for this value.

Resolved in full rather than expandable: a computed quantity is not a stored row a caller could fetch on its own, so the unit it is counted in travels with it. Null only where the figure was derived without a unit record behind it.

idstring

Unit ID.

objectstringenumValues:unit

Resource type identifier.

namestring

Display name of the unit (e.g. "Gram", "Kilogram").

abbreviationstring

Short abbreviation for the unit (e.g. "g", "kg").

typestringenumValues:currencyquantitytime

The dimension this unit measures, such as mass, volume, or currency.

A unit can only be converted to another unit of the same dimension. The quantity dimension is for discrete countable items rather than a physical measure.

ratio_numeratorstring (decimal)

Numerator of the ratio that converts a quantity in this unit into the dimension's base unit.

A quantity is converted with value × (ratio_numerator / ratio_denominator) + (offset_numerator / offset_denominator), so a kilogram in a gram-based dimension has a numerator of 1000 and a denominator of 1.

ratio_denominatorstring (decimal)

Denominator of the ratio that converts a quantity in this unit into the dimension's base unit.

Cannot be zero.

offset_numeratorstring (decimal)

Numerator of the conversion offset, applied after the ratio for scales that do not share a zero point, such as temperature.

Zero for units that convert by ratio alone.

offset_denominatorstring (decimal)

Denominator of the conversion offset applied after the ratio.

Never zero; a unit with no offset carries a numerator of 0 over a denominator of 1.

is_base_unitboolean

Whether this is the base unit for its dimension.

Every other unit's conversion ratio is expressed relative to the base unit. Base units are platform-defined; units created through the API are never base units.

ownerownernullable

Owner of this resource.

objectstringenumValues:owner

Resource type identifier.

typestringenumValues:systemaccount

Where this resource came from.

  • system: a platform-provided default shared across all accounts; not editable.
  • account: created and owned by a specific account; the account field identifies which.
accountaccountnullable

The account that owns this resource.

Present only when type is account; system-owned resources have no owning account.

created_atstring (date-time)

When this unit was created.

updated_atstring (date-time)

When this unit was last updated.

new_quantitycomputed_quantitynullable

Quantity after the reconciliation.

objectstringenumValues:computed_quantity

Resource type identifier.

valuestring (decimal)

Raw decimal value, as a string to preserve precision.

This is the unformatted machine value; see display_value for the human-readable rendering.

display_valuestring

Formatted value with unit abbreviation (e.g. "1,200 pr").

unitunitnullable

Unit of measure for this value.

Resolved in full rather than expandable: a computed quantity is not a stored row a caller could fetch on its own, so the unit it is counted in travels with it. Null only where the figure was derived without a unit record behind it.

idstring

Unit ID.

objectstringenumValues:unit

Resource type identifier.

namestring

Display name of the unit (e.g. "Gram", "Kilogram").

abbreviationstring

Short abbreviation for the unit (e.g. "g", "kg").

typestringenumValues:currencyquantitytime

The dimension this unit measures, such as mass, volume, or currency.

A unit can only be converted to another unit of the same dimension. The quantity dimension is for discrete countable items rather than a physical measure.

ratio_numeratorstring (decimal)

Numerator of the ratio that converts a quantity in this unit into the dimension's base unit.

A quantity is converted with value × (ratio_numerator / ratio_denominator) + (offset_numerator / offset_denominator), so a kilogram in a gram-based dimension has a numerator of 1000 and a denominator of 1.

ratio_denominatorstring (decimal)

Denominator of the ratio that converts a quantity in this unit into the dimension's base unit.

Cannot be zero.

offset_numeratorstring (decimal)

Numerator of the conversion offset, applied after the ratio for scales that do not share a zero point, such as temperature.

Zero for units that convert by ratio alone.

offset_denominatorstring (decimal)

Denominator of the conversion offset applied after the ratio.

Never zero; a unit with no offset carries a numerator of 0 over a denominator of 1.

is_base_unitboolean

Whether this is the base unit for its dimension.

Every other unit's conversion ratio is expressed relative to the base unit. Base units are platform-defined; units created through the API are never base units.

ownerownernullable

Owner of this resource.

objectstringenumValues:owner

Resource type identifier.

typestringenumValues:systemaccount

Where this resource came from.

  • system: a platform-provided default shared across all accounts; not editable.
  • account: created and owned by a specific account; the account field identifies which.
accountaccountnullable

The account that owns this resource.

Present only when type is account; system-owned resources have no owning account.

created_atstring (date-time)

When this unit was created.

updated_atstring (date-time)

When this unit was last updated.

skipped_itemslistnullable

Items that were skipped, e.g. because no item with the given SKU exists.

objectstringenumValues:list

Resource type identifier.

page_infoobject

Pagination metadata.

next_page_urlstringnullable

Relative URL that fetches the next page of results.

previous_page_urlstringnullable

Relative URL that fetches the previous page of results.

has_next_pageboolean

Whether more results exist after this page.

has_prev_pageboolean

Whether results exist before this page.

dataarray of skipped_item_result

Resources in this page.

objectstringenumValues:skipped_item_result

Resource type identifier.

skustring

Item SKU, as submitted.

reasonstring

Human-readable reason the item was skipped.

errorslistnullable

Items that failed to reconcile, e.g. because the given unit does not exist or the inventory write failed.

objectstringenumValues:list

Resource type identifier.

page_infoobject

Pagination metadata.

next_page_urlstringnullable

Relative URL that fetches the next page of results.

previous_page_urlstringnullable

Relative URL that fetches the previous page of results.

has_next_pageboolean

Whether more results exist after this page.

has_prev_pageboolean

Whether results exist before this page.

dataarray of reconcile_error_result

Resources in this page.

objectstringenumValues:reconcile_error_result

Resource type identifier.

itementitynullable

The item the row named, named by id and SKU.

Always set: a row whose SKU matched no item is reported under skipped_items rather than here.

idstring

Unique identifier for the entity.

objectstringenumValues:entity

Resource type identifier.

typestringenumValues:accountactorentity

The resource kind that this entity references, as an object-type value (e.g. user, account).

Unlike object — which is always entity — this names the underlying resource the id points to.

namestringnullable

Human-readable display name for the entity (e.g. a user's full name, a sales order number).

handlestringnullable

Secondary human-readable identifier (e.g. email address, username, redacted API key value).

errorstring

Error message.

Responses

200

Successful response for Bulk Reconcile Items