Update Sales Order Payment
PUT/api/sales-orders/:salesOrderId/payments/:payment
Updates a payment on a sales order and recalculates the order's payment status (unpaid / partially paid / paid) afterward.
orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
Request body fields (all optional on update):
- payment_type_id (integer): Must exist in payment types. Ignored when the payment is a system-created store-credit (
Credit) payment — its type cannot be changed. - amount (number, < 100,000,000): A positive amount must not exceed the order's remaining balance (the payment's current amount is credited back before this check, so re-sending the same amount always passes). A negative amount is a refund and must not exceed the total already paid on the order.
- payment_date (date): Payment date.
- external_reference (string, max 255): External reference such as a cheque or transaction number.
- currency_id (integer): Must exist in currencies.
Behavior:
- The payment must belong to the sales order in the path; otherwise a 422 is returned.
- The response
datais the stored payment record (including its payment type), which is a fuller shape than the entries returned by the list endpoint.
Path parameters:
- salesOrderId (required): Sales Order ID.
- payment (required): Payment ID.
Requires permission: sales_orders.manage_payments
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.