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 sameorder_id
not specified in thepayment_ids
is canceled. - Be approved with delayed capture.
Using a delayed capture payment with
PayOrder
completes the approved payment.
Servers
- https://connect.squareup.com
Path parameters
Name | Type | Required | Description |
---|---|---|---|
order_id |
String | Yes |
The ID of the order being paid. |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
payment_ids[] |
Array | No |
The IDs of the payments to collect. The payment total must match the order total. |
order_version |
Integer | No |
The version of the order being paid. If not supplied, the latest version will be paid. |
idempotency_key |
String | Yes |
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. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.