Pay for order
POST https://api.duffel.com/air/payments
To pay for the order, use the create a payment endpoint and pass in the order_id and the latest order price.
You'll also need to include the currency of the payment ($ORDERTOTALCURRENCY) in ISO 4217 format — it should match the pending order's totalcurrency — and the total amount ($ORDERTOTALAMOUNT) of the order, which should match the pending order's totalamount.
The order is now paid for and the passenger is ready to fly. To verify that the order is paid for, you can retrieve the order again and check that awaiting_payment is now set to false and that documents have been issued for the order.
Request Body
{"data"=>{"order_id"=>"{{ORDER_ID}}", "payment"=>{"type"=>"balance", "amount"=>"{{ORDER_TOTAL_AMOUNT}}", "currency"=>"{{ORDER_TOTAL_CURRENCY}}"}}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string | ||
Duffel-Version | string |