Storeware Docs
REST

Inventory

Stock at each location, and the locations themselves.

List stock

GET /api/v1/stores/{storeId}/inventory

One row per variant of every product not archived, with what is on hand, held and left to sell, added up across locations or read for one. low is five or fewer left; a variant that is not tracked is never low or out. meta.counts says how many of each there are under the same search.

Needs products:read.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
filterquerystringall when not given. One of all, low, out.
searchquerystringWords in a product’s name, a variant’s name or a SKU.
locationIdquerystring (uuid)One location. Every location added up when not given.
limitqueryintegerHow many to return, up to 250. Fifty when not given. From 1 to 250.
offsetqueryintegerHow many to skip, for the next page. At least 0.

Answers 200

FieldTypeDescription
dataarray of object
data[].variantIdstring (uuid)
data[].productIdstring (uuid)
data[].productTitlestring
data[].variantTitlestring
data[].skustring or null
data[].trackedbooleanFalse for a variant that carries on selling when it runs out, or is a download.
data[].onHandinteger
data[].reservedintegerHeld for orders placed and not yet sent.
data[].availableintegerOn hand less reserved.
metaobject
meta.totalintegerHow many match the filter and search, across every page.
meta.countsobjectHow many of each filter there are under the same search.
meta.counts.allinteger
meta.counts.lowinteger
meta.counts.outinteger
curl "https://api.storeware.ai/api/v1/stores/$STORE_ID/inventory" \
  -H "Authorization: Bearer $TOKEN"

List stock on its way

GET /api/v1/stores/{storeId}/inventory/incoming

For each variant named, what is on order from vendors and what is in transit between the shop’s locations. None of it is stock that can be sold. Every variant asked about is answered, with zeros when nothing is coming.

Needs products:read.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
variantIdsquerystringRequired. Comma separated variant ids, up to 500.
locationIdquerystring (uuid)Only what is coming to this location.

Answers 200

FieldTypeDescription
dataarray of object
data[].variantIdstring (uuid)
data[].onOrderintegerAsked of a vendor and not yet delivered.
data[].inTransitintegerSent from another of the shop’s locations and not yet arrived.
data[].incomingintegerThe two together.
curl "https://api.storeware.ai/api/v1/stores/$STORE_ID/inventory/incoming" \
  -H "Authorization: Bearer $TOKEN"

Get a variant’s stock levels

GET /api/v1/stores/{storeId}/inventory/{variantId}

The variant’s level at each location that has one. A location that has never held it has no row: see getVariantStock for every location.

Needs products:read.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
variantIdpathstringThe variant.

Answers 200

FieldTypeDescription
dataarray of InventoryLevel
curl "https://api.storeware.ai/api/v1/stores/$STORE_ID/inventory/$VARIANT_ID" \
  -H "Authorization: Bearer $TOKEN"

Change stock at a location

POST /api/v1/stores/{storeId}/inventory/{variantId}

Send delta to add or take away, or onHand to set the shelf to a count, never both. Stock cannot fall below zero, nor below what is held for orders. A location kept by a supplier cannot be changed. A delta sent twice is applied twice, so send an Idempotency-Key header to make a retry safe.

Needs products:write.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
variantIdpathstringThe variant.

Body

FieldTypeRequiredDescription
locationIdstring (uuid)YesThe location whose shelf changes.
deltaintegerNoHow many to add, or take away when negative.
onHandintegerNoWhat was counted on the shelf. From 0 to 10,000,000.
reasonstringNoWhy, for the stock history. Up to 200 characters.

Answers 200

FieldTypeDescription
dataInventoryLevel
curl -X POST "https://api.storeware.ai/api/v1/stores/$STORE_ID/inventory/$VARIANT_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json

List a variant’s stock history

GET /api/v1/stores/{storeId}/inventory/{variantId}/movements

Every change to the variant’s stock, newest first: what changed, by how much, what it left, and why where somebody said. Pass meta.next back as before for the next page.

Needs products:read.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
variantIdpathstringThe variant.
limitqueryintegerHow many to return, up to 200. Fifty when not given. From 1 to 200.
beforequerystringThe meta.next of the page before.

Answers 200

FieldTypeDescription
dataarray of object
data[].idstringA 64 bit number, sent as a string.
data[].storeIdstring (uuid)
data[].variantIdstring (uuid)
data[].locationIdstring (uuid)
data[].kindstringopening, adjustment, count, reserved, released, shipped, received, returned, transfer_out or transfer_in.
data[].onHandDeltanumber
data[].reservedDeltanumber
data[].onHandAfternumber
data[].reservedAfternumber
data[].reasonstring or null
data[].referenceTypestring or nullWhat it was for, such as an order or a transfer.
data[].referenceIdstring or null
data[].actorTypestring or nullstaff, customer, plugin, agent or system, where known.
data[].actorIdstring or null
data[].createdAtstring (date-time)
data[].locationNamestring or null
metaobject
meta.nextstring or nullPass back as before. Null on the last page.
curl "https://api.storeware.ai/api/v1/stores/$STORE_ID/inventory/$VARIANT_ID/movements" \
  -H "Authorization: Bearer $TOKEN"

Get a variant’s stock at every location

GET /api/v1/stores/{storeId}/inventory/{variantId}/stock

The variant, and a row for each of the shop’s locations, including those that hold none of it, default first.

Needs products:read.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
variantIdpathstringThe variant.

Answers 200

FieldTypeDescription
dataobject
data.variantobject
data.variant.idstring (uuid)
data.variant.productIdstring (uuid)
data.variant.productTitlestring
data.variant.variantTitlestring
data.variant.skustring or null
data.variant.trackedbooleanFalse for a variant that carries on selling when it runs out, or is a download.
data.levelsarray of object
data.levels[].locationIdstring (uuid)
data.levels[].locationNamestring
data.levels[].kindstringsupplier stock is refreshed from the supplier and cannot be changed here. One of own, supplier.
data.levels[].onHandinteger
data.levels[].reservedinteger
data.levels[].availableinteger
curl "https://api.storeware.ai/api/v1/stores/$STORE_ID/inventory/$VARIANT_ID/stock" \
  -H "Authorization: Bearer $TOKEN"

List locations

GET /api/v1/stores/{storeId}/locations

Every place the shop keeps stock.

Needs products:read.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.

Answers 200

FieldTypeDescription
dataarray of Location
curl "https://api.storeware.ai/api/v1/stores/$STORE_ID/locations" \
  -H "Authorization: Bearer $TOKEN"

Create a location

POST /api/v1/stores/{storeId}/locations

With isDefault, the new location becomes the one orders take their stock from, in place of the old default.

Needs products:write.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.

Body

FieldTypeRequiredDescription
namestringYes
isDefaultbooleanNo

Answers 201

FieldTypeDescription
dataLocation
curl -X POST "https://api.storeware.ai/api/v1/stores/$STORE_ID/locations" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json

Update a location

PATCH /api/v1/stores/{storeId}/locations/{locationId}

Renames it, or makes it the default, which moves where every later order takes its stock from. The default cannot be turned off, only moved.

Needs products:write.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.
locationIdpathstringThe stock location.

Body

FieldTypeRequiredDescription
namestringNo1 to 200 characters.
isDefaulttrueNo

Answers 200

FieldTypeDescription
dataLocation
curl -X PATCH "https://api.storeware.ai/api/v1/stores/$STORE_ID/locations/$LOCATION_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json

On this page