Fields
Needs write access. The row must already exist.
| Field | Type | Rule |
|---|---|---|
| deltarequired | integer | A whole number from -100,000 to 100,000, not 0. |
| reasonoptional | string or null | Up to 255 characters, kept with the adjustment. |
| Idempotency-Keyheader | string | Optional but strongly recommended. 1 to 255 printable characters, unique per adjustment. See Idempotency. |
- Stock never goes below 0. A delta that would take it lower stops at 0, and the response says so with
clampedandapplied_delta. - On a row priced 0.00, an adjustment that would leave stock above 0 is refused with
422onprice: set a price with PUT or PATCH first. An adjustment that takes its stock to 0 is allowed.
The adjustment in the response
The answer is the row as it now is, in data, and the adjustment beside it, in adjustment: {"data": {…}, "adjustment": {…}}.
| Field | Meaning |
|---|---|
| delta | What you asked for. |
| applied_delta | What changed. Differs from delta only when the stock stopped at 0. |
| previous_stock | Stock before. |
| stock | Stock after. |
| clamped | true when the stock stopped at 0. |
| reason | Your reason, or null. |
| idempotency_key | Your key, or null. |
| created_at | When it happened. |
Returns
- 200Applied, or replayed (header
Idempotent-Replayed: true). - 404item_not_found: the row must exist first.
- 409idempotency_key_reused: the key was used for a different adjustment.
- 422A field broke a rule, or the row is priced 0.00.
This endpoint can also answer 401 invalid_api_key, 403 license_not_active, 403 product_not_included and 429 rate_limited.