Applies to: Orders API
Learn about paying for orders using the Orders API or Payments API.
You can pay for your orders in two ways: with the Payments API (CreatePayment
Applies to: Orders API
Learn about paying for orders using the Orders API or Payments API.
You can pay for your orders in two ways: with the Payments API (CreatePayment
If you're creating a CASH
payment for an order, you need to call CreatePayment
to create the cash payment and then call PayOrder
to actually pay for the order.
Sometimes customers want to apply multiple payments to an order (for example, to pay a portion of an order using a gift card and then apply a credit card for the remaining amount).
To apply multiple payments to an order, applications must use the Orders API (PayOrder
CreatePayment
three times. In each request, specify the order ID and set the autocomplete
field to false
(to obtain only authorization).PayOrder
by specifying the authorized payment IDs. The endpoint captures the previously authorized payments.You cannot set the fulfillment.state
of any order fulfillment to COMPLETED
until after you call PayOrder
.
The endpoint also sets the order state to COMPLETED
, provided that:
total_money
).If the order does include a fulfillment, you need to call UpdateOrderPayOrder
. In your UpdateOrder
request, set the state of any fulfillments to COMPLETED
and the state of the order itself to COMPLETED
.
The following PayOrder
example pays for an order by specifying the payment IDs of previously authorized payments:
Pay order
Use the PayOrder
endpoint to apply a $0 payment. The request doesn't include any payment IDs.
Pay order
When you want an application to pay for an order using a single payment, use the Payments API ((CreatePayment
CreatePayment
request must include an order ID.total_money
in the Order
object).The following CreatePayment
example charges the specified payment source $2 to pay for the specified order:
Create payment
Suppose you create an order for $20 and apply a $20 discount. You then need to make a $0 payment before you can set the order state
to COMPLETED
. Applications can use either the Payments API or Orders API.
Use the CreatePayment
endpoint to record a $0 CASH
or EXTERNAL
payment for an order.
Create payment
After you record a cash payment, the order isn't paid until you call the PayOrder
endpoint with the ID of your cash payment.
For more information about how to use payments, see Take Payments
If you need more assistance, contact Developer and App Marketplace Support