Commerce
Record stock movement
Move stock in or out.
Taking stock out by hand needs a note. An untracked product is 409 stock_untracked.
product*stringA product id. Anything that is not one is 404 resource_missing.
Format
uuidX-Request-Id?stringYour id for this request; it becomes the request_id of any error. Without it the server makes one.
application/json- body
direction*StockDirectionValue in
"IN""OUT"quantity*|Greater than 0, up to 100000000, at most two decimal places.
variant_id?stringFormat
uuidnote?stringRequired to take stock out by hand.
Length
length <= 500curl -X POST 'https://v3.ghala.io/v1/commerce/shop/products/497f6eca-6276-4993-bfeb-53cbbbba6f08/stock-movements' \ -H 'Content-Type: application/json' \ -d '{ "direction": "IN", "quantity": 0}'{ "movement": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "direction": "IN", "quantity": 0, "variant_id": "8a2d415d-59aa-4132-bef3-011f97c4a0f6", "order_id": "93101167-9065-4b9c-b98b-5d789a3ed9fe", "recorded_by_user_id": "string", "recorded_by_name": "string", "note": "string", "created_at": "2019-08-24T14:15:22Z" }, "stock": 0}