<- Orders API

Orders API

All versions ->

Pay orderBeta

POST

 /v2/orders/{order_id}/pay

Pay for an order using one or more approved payments or settle an order with a total of 0.

The total of the payment_ids listed in the request must be equal to the order total. Orders with a total amount of 0 can be marked as paid by specifying an empty array of payment_ids in the request.

To be used with PayOrder, a payment must:

  • Reference the order by specifying the order_id when creating the payment. Any approved payments that reference the same order_id not specified in the payment_ids is canceled.
  • Be approved with delayed capture. Using a delayed capture payment with PayOrder completes the approved payment.
Permissions:ORDERS_WRITE, PAYMENTS_WRITE
Try in API Explorer
Link to section

Path parameters

Example code

Link to section

order_id

string

Required

The ID of the order being paid.

Link to section

Request body

Link to section

idempotency_key

string

Required

A value you specify that uniquely identifies this request among requests you have sent. If you are unsure whether a particular payment request was completed successfully, you can reattempt it with the same idempotency key without worrying about duplicate payments.

For more information, see Idempotency.

Link to section

order_version

integer(32-bit)

The version of the order being paid. If not supplied, the latest version will be paid.

Link to section

payment_ids

string [ ]

The IDs of the payments to collect. The payment total must match the order total.

Link to section

Response fields

Link to section

errors

Any errors that occurred during the request.

Link to section

order