POST
/
catalog
/
products
/
{id}
/
inventory
curl --request POST \
  --url https://services.commercengine.dev/api/v1/x2yh61zw4k/admin/catalog/products/{id}/inventory \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '[
  {
    "variant_id": "<string>",
    "update_other_variants": true,
    "track_quantity": true,
    "allow_backorder": true,
    "stock": [
      {
        "warehouse_id": "<string>",
        "stock_quantity": 123
      }
    ]
  }
]'
{
  "message": "<string>",
  "success": true,
  "content": {
    "inventory": [
      {
        "variant_id": "<string>",
        "track_quantity": true,
        "allow_backorder": true,
        "stock": [
          {
            "sku": "<string>",
            "warehouse_id": "<string>",
            "warehouse_name": "<string>",
            "received_quantity": 123,
            "reserved_quantity": 123,
            "sold_quantity": 123,
            "adjusted_quantity": 123,
            "stock_quantity": 123,
            "created_at": "2023-11-07T05:31:56Z",
            "modified_at": "2023-11-07T05:31:56Z"
          }
        ]
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

product id

Body

application/json · object[]
track_quantity
boolean
required
allow_backorder
boolean
required
variant_id
string
update_other_variants
boolean

if true, same inventry details will be updated to other variants which are not mentioned in request body.

stock
object[]

Response

200 - application/json
OK
message
string
success
boolean
content
object