Order and pay #

From picking a drink to hearing that the payment went through.

Inputs

  • storeId string — The store the customer picks up from.

Steps #

  1. GET/menu-itemsList drinks
    Find the drink the customer wants.
    Parameterscategory=coffee
    Get · 200
    {
    "data": [
    {
    "id": "mi_oat_latte",
    "name": "Oat latte",
    "category": "coffee",
    "price": {
    "amount": 3200,
    "currency": "CNY"
    }
    },
    … 1 more
    ],
    "next_cursor": null
    }
  2. POST/ordersCreate an order
    Order two cups of it at the customer's store.
    ← itemId from step 1← input storeId
    Send
    {
    "store_id": "$inputs.storeId",
    "items": [
    {
    "menu_item_id": "mi_oat_latte",
    "quantity": 2
    }
    ]
    }
    Get · 201
    {
    "id": "ord_8f2k1",
    "status": "pending_payment",
    "store_id": "st_shanghai_01",
    "total": {
    "amount": 6400,
    "currency": "CNY"
    },
    "items": [
    {
    "menu_item_id": "mi_oat_latte",
    "quantity": 2,
    "options": {
    "milk": "oat",
    "size": "grande"
    }
    }
    ],
    "pay_url": "https://pay.kawa-coffee.example/p/ord_8f2k1",
    "created_at": "2026-11-30T23:41:07+08:00"
    }
  3. POST/paymentsPay for an order
    Pay with WeChat Pay.
    ← orderId from step 2
    Send
    {
    "order_id": "ord_8f2k1",
    "method": "wechat"
    }
    Get · 201
    {
    "id": "pay_3qx9",
    "order_id": "ord_8f2k1",
    "status": "succeeded",
    "amount": {
    "amount": 0,
    "currency": "CNY"
    }
    }
  4. HOOKorder.paidOrder paid
    Your webhook hears about it.
    ← orderId from step 2← paymentId from step 3
    You receive
    {
    "order_id": "ord_8f2k1",
    "payment_id": "pay_3qx9",
    "paid_at": "2026-12-01T08:21:44+08:00"
    }

Source: order-flow.arazzo.yaml · orderAndPay

Comments