Cancel Line Quantity
POST/api/sales-order-lines/:salesOrderLine/cancel-quantity
Cancel part (or all) of a sales order line's remaining quantity without changing the ordered quantity — the line keeps its original quantity as a permanent record and canceled_quantity rises, so the net quantity to fulfill drops. Cancelling everything nets the line to zero: allocations are released, backorder demand clears, and any open (not yet submitted) fulfillment orders shrink to match.
Units already shipped, externally fulfilled, committed to a live fulfillment (submitted / picked / packed, a staged pickup, or an order already handed to a shipping provider), or already cancelled cannot be cancelled — cancel or void that fulfillment first. Exceeding the cancellable quantity returns 409.
Body fields:
quantity(required, integer, min 1) — units to cancel.reason(optional, string, max 1000) — recorded on the order's notes for the audit trail.
Returns the refreshed sales order.
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Conflict
Response Headers
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.