候补名单载荷示例

BatchGetWaitEstimates

以下示例说明了以下情况:一家餐厅通常允许 party_size 值介于 2 到 10 之间,但在请求时,party_size 值高于 7 时无法再容纳(例如接近打烊时间),而 party_size 值为 2 时实际上无需等待。

获取等待请求

{
  "merchant_id": "dining-1",
  "party_size": [2, 3, 4, 5, 6, 7, 8, 9, 10],
  "service_id": "reservation"
}

获取等待响应

{
  "waitlist_status": "OPEN",
  "wait_estimate": [
    { "party_size": 2, "wait_length": {} },
    { "party_size": 3, "wait_length": { "parties_ahead_count": 3 } },
    { "party_size": 4, "wait_length": { "parties_ahead_count": 3 } },
    { "party_size": 5, "wait_length": { "parties_ahead_count": 3 } },
    { "party_size": 6, "wait_length": { "parties_ahead_count": 3 } },
    { "party_size": 7, "wait_length": { "parties_ahead_count": 3 } }
  ]
}

CreateWaitlistEntry

创建请求

{
  "idempotency_token": "14620365692592881354",
  "merchant_id": "dining-1",
  "party_size": 3,
  "service_id": "reservation",
  "user_information": {
    "family_name": "John",
    "given_name": "Smith",
    "telephone": "+81 80-1111-2222",
    "user_id": "123456789"
  }
}

创建响应

{ "waitlist_entry_id": "MYS-1668739060" }

GetWaitlistEntry

Get 请求

{ "waitlist_entry_id": "MYS-1668739060" }

获取响应

{
  "waitlist_entry": {
    "wait_estimate": {
      "party_size": 3,
      "wait_length": { "parties_ahead_count": 3 }
    },
    "waitlist_entry_state": "WAITING",
    "waitlist_entry_state_times": { "created_time_seconds": 1234567890 }
  }
}

DeleteWaitlistEntry

删除请求

{ "waitlist_entry_id": "MYS-1668739060" }

删除回复

{}