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).
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
- 422
OK
Response Headers
Content-Type
Unprocessable Entity
Response Headers
Content-Type