novinzodevelopers
API referenceCore for pluginsProduct deliveries

Set Variant Stock

PUT/api/product-deliveries/variants/{variantId}/stock

Sets the stock core sells a variant against, taking ownership of it for the calling plugin when no other delivering plugin owns it. The count is the plugin's absolute count; core subtracts the units still held by open checkouts and by paid orders the plugin has not delivered. A report naming deliveredOrderId releases that order's hold on this variant only; an order of several variants needs one report per variant.

Path Parameters

variantId*string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

stockOnHand*|null
revision*integer
Range1 <= value <= 2147483647
deliveredOrderId?string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/api/product-deliveries/variants/string/stock" \  -H "Content-Type: application/json" \  -d '{    "stockOnHand": 0,    "revision": 1  }'
Empty