List stock changes
GET
/api/v1/commerce/inventory/history
const url = 'https://digize.com/api/v1/commerce/inventory/history';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://digize.com/api/v1/commerce/inventory/history \ --header 'x-api-key: <x-api-key>'Every change to stock on hand, the newest first, a page at a time: the variant, location, change, reason and who made it, with the order, transfer or purchase order behind it.
Needs the commerce:read permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”variantId
string
locationId
string
reasons
Array<string>
cursor
The nextCursor of the page before. Leave it out for the first page.
string
The nextCursor of the page before. Leave it out for the first page.
limit
Rows on the page: 50 unless it says, 100 at most.
integer
Rows on the page: 50 unless it says, 100 at most.
Responses
Section titled “Responses”Done
Media typeapplication/json
object
rows
required
Array<object>
object
id
required
string
variantId
required
string
productId
required
string
product
required
string
variant
required
string
sku
required
string
locationId
required
string
location
required
string
delta
required
Added to on hand, or taken off when negative.
number
reason
required
string
onHandAfter
required
number
orderId
required
string | null
orderNumber
required
number | null
transferId
required
string | null
purchaseOrderId
required
string | null
note
required
string | null
actorName
required
string
at
required
string format: date-time
nextCursor
required
Pass it as cursor for the next page; null on the last.
string | null
total
required
number
Example
{ "rows": [ { "reason": "received" } ]}What was sent isn’t valid (invalid).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}