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

  • Order UUID

Headers

  • Type of content accepted by the API (application/json in most cases)

  • Application key for specific client app

  • Content-Type header

  • Version of the API to be used

  • Bearer token of the signed-in customer. The order must belong to them

  • Unique request identifier

Body

required
application/json
  • Properties: 4
  • Pay the balance with several methods at once. Requires is_split_payment_enabled on the brand.

    Properties: 1

Responses

  • application/json
  • 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.

  • Missing or invalid customer token.

  • The brand is not on the NMG product structure.

  • The order does not exist, or does not belong to this customer.

Request Example for post/orders/{order_uuid}/payments
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
    }
  }
}