Commerce

Record stock movement

Move stock in or out.

Taking stock out by hand needs a note. An untracked product is 409 stock_untracked.

Path Parameters

product*string

A product id. Anything that is not one is 404 resource_missing.

Formatuuid

Header Parameters

X-Request-Id?string

Your id for this request; it becomes the request_id of any error. Without it the server makes one.

Request Body

application/json
  1. body
direction*StockDirection
Value in"IN""OUT"
quantity*|

Greater than 0, up to 100000000, at most two decimal places.

variant_id?string
Formatuuid
note?string

Required to take stock out by hand.

Lengthlength <= 500
curl -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}