Tillwire Read the guide
API reference

Stock. 18 operations.

18 of them work. Each needs a bearer token with its scope. All operations.

Operations

POST/api/v1/stock/damagestock.damagestock.write

Parameters

Idempotency-KeyheaderstringSee common parameters

Request body

DamageRequest

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/damage

GET/api/v1/stock/levels/{sku}stock.levelsstock.read

Parameters

skupathstring
skupathstring

Errors: 401, 403, 404, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/levels/{sku}

GET/api/v1/stock/locations/{key}/levelsstock.location-levelsstock.read

Parameters

keypathstring
keypathstring
afterquerystringThe SKU to go on after: the page's next; none for the first page.
limitqueryintegerHow many levels, at most 1000; 500 when left out.

Errors: 401, 403, 404, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/locations/{key}/levels

GET/api/v1/stock/locationsstock.locationsstock.read

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/locations

GET/api/v1/stock/lowstock.lowstock.read

Parameters

limitqueryintegerThe most variants in the page: 1 to 200.
afterquerystringThe cursor of the page: the next of the page before; the first page when left out. The variants follow it.

Answer

StockLow

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/low

GET/api/v1/stock/movementsstock.movementsstock.read

Parameters

skuquerystringOnly the movements of this variant.
locationquerystringOnly the movements at this stock location.
reasonquerystringOnly the movements of this reason.
limitqueryintegerThe most movements in the page: 1 to 200; 50 when left out.
beforequeryintegerThe id of a movement: the page holds the movements before it.
fromquerystringOnly the movements from this date or time (a date in the store time zone, or a time with its offset).
toquerystringOnly the movements up to this date or time (a date in the store time zone, or a time with its offset).

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/movements

POST/api/v1/stock/receiptsstock.receivestock.write

Parameters

Idempotency-KeyheaderstringSee common parameters

Request body

ReceiptRequest

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/receipts

GET/api/v1/stock/reportstock.reportstock.read

Parameters

skuquerystringOnly this variant.
locationquerystringOnly this stock location.
fromquerystringThe start of the period (a date in the store time zone, or a time with its offset).
toquerystringThe end of the period (a date in the store time zone, or a time with its offset).
limitqueryintegerThe most rows in the page: 1 to 200.
afterquerystringThe cursor of the page: the next of the page before; the first page when left out. The rows follow it.

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/report

POST/api/v1/stock/locationsstock.save-locationstock.write

Parameters

Idempotency-KeyheaderstringSee common parameters

Request body

LocationRequest

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/locations

POST/api/v1/stock/salesstock.sellstock.write

Parameters

Idempotency-KeyheaderstringSee common parameters

Request body

SellRequest

Answer

StockSale

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/sales

POST/api/v1/stock/levels/{sku}/reorderstock.set-reorderstock.write

Parameters

skupathstring
skupathstring
Idempotency-KeyheaderstringSee common parameters

Request body

ReorderRequest

Errors: 401, 403, 404, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/levels/{sku}/reorder

GET/api/v1/stock/takes/{id}stock.takestock.read

Parameters

idpathstring
idpathstring

Answer

StockTake

Errors: 401, 403, 404, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/takes/{id}

POST/api/v1/stock/takes/{id}/abandonstock.take-abandonstock.write

Parameters

idpathstring
idpathstring
Idempotency-KeyheaderstringSee common parameters

Answer

StockTake

Errors: 401, 403, 404, 405, 409, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/takes/{id}/abandon

POST/api/v1/stock/takes/{id}/applystock.take-applystock.write

Parameters

idpathstring
idpathstring
Idempotency-KeyheaderstringSee common parameters

Answer

StockTake

Errors: 401, 403, 404, 405, 409, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/takes/{id}/apply

POST/api/v1/stock/takes/{id}/countstock.take-countstock.write

Parameters

idpathstring
idpathstring
Idempotency-KeyheaderstringSee common parameters

Request body

TakeCountRequest

Answer

StockTake

Errors: 401, 403, 404, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/takes/{id}/count

POST/api/v1/stock/takesstock.take-openstock.write

Parameters

Idempotency-KeyheaderstringSee common parameters

Request body

TakeOpenRequest

Answer

StockTake

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/takes

GET/api/v1/stock/takesstock.takesstock.read

Parameters

limitqueryintegerThe most stock-takes in the answer: 1 to 200.

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/takes

POST/api/v1/stock/transfersstock.transferstock.write

Parameters

Idempotency-KeyheaderstringSee common parameters

Request body

TransferRequest

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/stock/transfers

Schemas 28

DamageRequest

DamageRequest writes Quantity of the variant SKU off its level at the stock location Location, main when none is named, as damaged, with a note of at most 200 characters. The level is never made negative.

locationstring
notestring
quantityrequiredinteger
skurequiredstring
LocationRequest

LocationRequest adds the location Key, or sets the name, position and flags of the one that has it. main cannot be made offline or inactive.

activerequiredboolean
closes_onstring
keyrequiredstring
namerequiredstring
opens_onstring
positionrequiredinteger
sells_onlinerequiredboolean
LowStockItem

LowStockItem is a variant that is low at a location: its level there, OnHand (owed stock is below 0), is at or below its reorder level.

locationrequiredstring
on_handrequiredinteger
option_valuesrequiredarray of string
productrequiredstring
reorder_levelrequiredinteger
skurequiredstring
PlaceLevel

PlaceLevel is a variant's level at a stock place: below 0 is owed stock, as a sale at the till may take.

on_handrequiredinteger
skurequiredstring
PlaceLevels

PlaceLevels are one stock place's levels: its key and name, the level of each live variant that tracks its stock, SKU order, and Next, the SKU to go on after ("" on the last page).

levelsrequiredarray of PlaceLevel
locationrequiredstring
namerequiredstring
nextrequiredstring
ReceiptRequest

ReceiptRequest adds the goods of the lines at the stock location Location, main when none is named, with a reference of at most 100 characters, such as a supplier's name or an invoice number, kept for search.

linesrequiredarray of StockLine
locationstring
referencestring
ReorderRequest

ReorderRequest keeps Level as the reorder level of a variant at the stock location Location, main when none is named: a whole number from 0 to 1000000, 0 switching the check off there; null clears it, which takes the store's default again. The body must carry level, a null included.

levelrequiredinteger
locationstring
SellRequest

SellRequest takes the lines of a sale made outside the shop, such as at a counter or a market stall, off the stock location Location, main when none is named, with an outside reference of one line and at most 100 characters, such as a till's receipt number. It makes no order, no invoice and no hold. The quantity of a line is a whole number of 1 or more: a refund of such a sale is a return, not a negative sale.

linesrequiredarray of StockLine
locationstring
referencestring
StockLevel

StockLevel is a variant's stock at one location.

locationrequiredstring
lowrequiredboolean
namerequiredstring
on_handrequiredinteger
reorder_keptrequiredboolean
reorder_levelrequiredinteger
sells_onlinerequiredboolean
StockLine

StockLine is a quantity of a variant: a line of a transfer or of a receipt. The quantity is a whole number of 1 or more.

quantityrequiredinteger
skurequiredstring
StockLocation

StockLocation is a place that holds stock. Key is a slug the owner chooses and cannot change; Position orders the locations; a location that sells online feeds the online pool; an inactive one takes no sale. From contract version 6.

activerequiredboolean
closes_onrequiredstring
keyrequiredstring
namerequiredstring
opens_onrequiredstring
positionrequiredinteger
sells_at_tillrequiredboolean
sells_onlinerequiredboolean
StockLocations

StockLocations are the store's stock locations in the order of their position. Enabled is false while the store keeps one location, main (store.yaml's stock.locations is off); a screen then shows no location.

blind_countsrequiredboolean
enabledrequiredboolean
locationsrequiredarray of StockLocation
StockLow

StockLow is a page of the variants that are low, in the order the variants were made and then the locations were, and Total how many there are in all, which the Home's restock item shows.

itemsrequiredarray of LowStockItem
nextrequiredstring
totalrequiredinteger
StockMovement

StockMovement is one row of the stock ledger: Delta is signed, After the level at that location after it, Reason one of opening, sale, refund, return, count, transfer, received, damaged and manual, Actor who made it (user:<id>, integration:<id>, system or pos:<id>), and RefKind and RefID the thing it came from (an order, a transfer, a stock-take).

actorrequiredstring
afterrequiredinteger
atrequiredstring (date-time)
deltarequiredinteger
idrequiredinteger
locationrequiredstring
noterequiredstring
reasonrequiredstring
ref_idrequiredinteger
ref_kindrequiredstring
skurequiredstring
StockMovements

StockMovements are the ledger's rows that match a filter, newest first. Next is the cursor of the next page (the id to pass as before), 0 when this is the last.

movementsrequiredarray of StockMovement
nextrequiredinteger
StockReceipt

StockReceipt is goods received: its number, which the movements name (ref_kind receipt), and what came in.

actorrequiredstring
atrequiredstring (date-time)
idrequiredinteger
linesrequiredarray of StockLine
locationrequiredstring
referencerequiredstring
StockReport

StockReport is a page of the stock report, and Total how many rows it has in all; Next is the cursor of the next page, to pass as after, "" for the last. Sale and refund movements of the online locations agree with the orders (a movement of an order has ref_kind order); a stock.sell is a sale movement too, of ref_kind pos.

nextrequiredstring
rowsrequiredarray of StockReportRow
totalrequiredinteger
StockReportRow

StockReportRow is the stock of one variant at one location over a period: the level it opened the period with, the quantity that came in and went out by reason (a movement that adds is in, one that takes is out, so a reason that does both, such as a count, is in both; a reason with none is left out), the level it closed with (Opening + In - Out), how many sale movements it had, and the level now. It gives numbers, not money.

closingrequiredinteger
inrequiredmap of integer
locationrequiredstring
on_handrequiredinteger
openingrequiredinteger
outrequiredmap of integer
salesrequiredinteger
skurequiredstring
trackedrequiredboolean
StockSale

StockSale is a sale outside the shop, made: Actor is the caller (user:<id> or integration:<id>).

actorrequiredstring
atrequiredstring (date-time)
linesrequiredarray of StockSaleLine
locationrequiredstring
referencerequiredstring
StockSaleLine

StockSaleLine is a line of a sale made: the quantity taken, and the level left at the location.

levelrequiredinteger
quantityrequiredinteger
skurequiredstring
StockTake

StockTake is a counting session at one location. Status is open, applied or abandoned; ClosedAt is null while it is open. Lines are in the order the variants were first entered, and empty in a list, where LineCount says how many there are.

closed_atrequiredstring (date-time)
idrequiredinteger
line_countrequiredinteger
linesrequiredarray of StockTakeLine
locationrequiredstring
opened_atrequiredstring (date-time)
opened_byrequiredstring
statusrequiredstring
StockTakeLine

StockTakeLine is a variant the owner counted: Expected is the physical stock when it was entered (the level, or 0 when the level is below 0, because owed stock is not on the shelf), Counted what the owner counted, and Clamped says that applying could not write the whole difference, so that a level was not made negative and owed stock was not removed.

clampedrequiredboolean
countedrequiredinteger
expectedrequiredinteger
skurequiredstring
StockTakes

StockTakes are the stock-takes, newest first.

takesrequiredarray of StockTake
StockTransfer

StockTransfer is a transfer made: its number, which the movements name (ref_kind transfer), and what it moved.

actorrequiredstring
atrequiredstring (date-time)
fromrequiredstring
idrequiredinteger
linesrequiredarray of StockLine
noterequiredstring
torequiredstring
TakeCountRequest

TakeCountRequest enters the count of the variant SKU in a stock-take: a whole number of 0 or more. The body must carry both fields: a count left out would read as 0.

countedrequiredinteger
skurequiredstring
TakeOpenRequest

TakeOpenRequest opens a stock-take at the location Location, main when none is named.

locationstring
TransferRequest

TransferRequest moves the lines from the stock location From to the stock location To in one step, with a note of at most 200 characters. Every field but Note is required; a request with more than 200 lines, or with a variant on two lines, is invalid.

fromrequiredstring
linesrequiredarray of StockLine
notestring
torequiredstring
VariantLevels

VariantLevels are the levels of one tracked variant: at each location that holds or held it, the online pool (the sum of the online levels, which is what the buyer's level reads) and the stock available to sell now.

availablerequiredinteger
levelsrequiredarray of StockLevel
poolrequiredinteger
skurequiredstring

Made from engine/internal/openapi/openapi.json at commit 6c4cbd921. The contract-only operations come from the engine’s stub file, engine/internal/ops.