Unallocate Sales Credit from Order
DELETE/api/customers/:customer/sales-credits/:salesCredit/allocations/:allocation
Reverse a single sales credit allocation. Deletes the allocation row, reverses the corresponding Credit-type Payment recorded against the sales order, and recalculates the credit's payment_status (paid → partially_paid or open).
customers:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
If the allocation was previously synced to QuickBooks Online, a background job is dispatched after the local DB transaction commits to delete the paired QBO Payment.
Scoping behavior:
- Returns 404 if the credit does not belong to the customer in the URL
- Returns 404 if the allocation does not belong to the credit in the URL
Validation:
- Returns 422 if the sales credit is archived (unarchive before reversing allocations)
- Returns 422 if the allocation has already been synced to Xero (Xero CreditNote Allocations are functionally immutable once accepted — unallocate in Xero first, then refresh)
Authentication: Requires Bearer token.
Request
Responses
- 200
- 401
- 403
- 404
- 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.
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.