Skip to main content

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.

Required scope: orders:write

Grant 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 data is 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

OK

Response Headers
    Content-Type