Change an order #
Only orders waiting for payment can change.
参数 #
路径参数
orderIdstring必填
请求体 #
{
"note": "note",string · ≤ 140 字符
"pickup_at": "2026-01-15T09:30:00Z"string(date-time)
}
响应 #
The changed order.
{
"id": "id",string · 必填
"status": "pending_payment",OrderStatus · pending_payment | paid | ready | cancelled · 必填
"store_id": "store_id",string · 必填
"total": {Money · 必填
"amount": 0,integer · ≥ 0 · 必填2.3.0 起
"currency": "CNY"string · CNY · 必填2.3.0 起
},
"items": [LineItem[] · 必填
{LineItem
"menu_item_id": "menu_item_id",string · 必填
"quantity": 1,integer · 1–10 · 必填
"options": {object
"milk": "whole",string · whole | skim | oat
"size": "grande"string · tall | grande | venti
}
}
],
"pay_url": "https://example.com/resource",string(uri)
"created_at": "2026-01-15T09:30:00Z"string(date-time) · 必填
}
代码示例 #
curl -X PATCH "https://api.kawa-coffee.example/v2/orders/ord_8f2k1" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"note": "note",
"pickup_at": "2026-01-15T09:30:00Z"
}'const response = await fetch('https://api.kawa-coffee.example/v2/orders/ord_8f2k1', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"note": "note",
"pickup_at": "2026-01-15T09:30:00Z"
}),
})
const data = await response.json()import os
import requests
response = requests.patch(
"https://api.kawa-coffee.example/v2/orders/ord_8f2k1",
headers={"Authorization": f"Bearer {os.environ["TOKEN"]}"},
json={
"note": "note",
"pickup_at": "2026-01-15T09:30:00Z"
},
)
data = response.json()

评论