POST Order Payment Initialization
Starts a payment against an order that already exists, for the amount still outstanding on it.
This is not how you pay at checkout — that is the cart flow, described in Make a Payment. Use this one when an order was placed with a balance left to settle: a catering order paid with a deposit, a house-account order, or an order that was only partly paid.
The response is the same envelope as the cart initialization, so everything in that guide about actions, additional_info and expires_in applies here too. Follow the actions, then post the hash to Order Add Payment.
payment_info.amount must equal the order's due_amount exactly, and the payment method has to be one the brand allows for balance payments — a card or a wallet, not cash.
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: 3Type: objectpayment
_info required
Responses
- application/json
- 400
The order cannot be paid in its current state, the amount does not match the balance due, or the payment method is not allowed for a balance payment.
- 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/init \
--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": {
"stored_payment_method_id": "85688223-b4ee-4c0f-8593-513c182ef7b1",
"amount": 4500
}
}'
{
"status": "OK",
"code": 200,
"data": {
"payment_init_hash": "032878b199f90e13e1bdce036e00f157",
"payment_method_id": "0d6b5a4e-3f23-11ed-936c-1a67b454859d",
"payment_processor_type_id": 32,
"amount": 4500,
"is_deposit": false,
"allows_webhooks": false,
"expires_in": 1799,
"status_polling_interval": 5,
"additional_info": null
}
}