POST Order Add Payment
Takes the payment you initialized on the order and applies it, the way POST /cart/{cart_id}/order does at checkout.
Pass the payment_init_hash from Order Payment Initialization, along with whatever the payment method produced — a one_time_token from a hosted card form, or gift card details. The response is the updated order, so read due_amount from it to confirm the balance is cleared.
Paying off a balance sends the customer a receipt. An order can only be paid while it is unpaid or partly paid, and never once it has been cancelled, failed or revised.
Path Parameters
- Type: stringFormat: uuidorder
_uuid requiredOrder UUID
Headers
- Type: stringAcceptrequired
Type of content accepted by the API (application/json in most cases)
- Type: stringApplicationrequired
Application key for specific client app
- Type: stringContent
- Type requiredContent-Type header
- Type: stringA
P I - V E R S I O N requiredVersion of the API to be used
- Type: stringAuthorizationrequired
Bearer token of the signed-in customer. The order must belong to them
- Type: stringX
- Request - I D requiredUnique request identifier
Body
- Properties: 4Type: objectpayment
_info - Type: array of objectsplit
_payment _info Properties: 1Pay the balance with several methods at once. Requires
is_split_payment_enabledon the brand.
Responses
- application/json
- 400
The order cannot be paid in its current state, the initialization hash is unknown or spent, or the amount does not match the balance due.
- 401
Missing or invalid customer token.
- 403
The brand is not on the NMG product structure.
- 404
The order does not exist, or does not belong to this customer.
curl https://api-public-demo.menu.app/api/orders/239e7982-3f23-11ed-936c-1a67b454859d/payments \
--request POST \
--header 'Accept: application/json' \
--header 'Application: application-key' \
--header 'Content-Type: application/json' \
--header 'API-VERSION: ' \
--header 'Authorization: ' \
--header 'X-Request-ID: c10b4a70-6274-490d-80a0-03e7bb826937' \
--data '{
"payment_info": {
"payment_init_hash": "032878b199f90e13e1bdce036e00f157"
}
}'
{
"status": "OK",
"code": 200,
"data": {
"order": {
"id": "239e7982-3f23-11ed-936c-1a67b454859d",
"status": "Sent",
"payment_status": 2,
"total": 48950,
"due_amount": 0
}
}
}