Set Store Sale Method Status
Description
設置門市各銷售方式當前接單狀態
Resource
POST /v1/store/{store_id}/sale-method/status
Authorization
採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login。
Request Body Parameters
| Name | Type | Description |
|---|---|---|
| client_device | string | 裝置來源 ALLOWED VALUES:
|
| sale_methods | array | 異動的銷售方式列表 |
sale_methods 陣列元素欄位定義:
| Name | Type | Description |
|---|---|---|
| id | integer | 銷售方式 ID (例如 1 代表內用) |
| is_paused | boolean | 是否暫停接單。若為 false 則為開啟 |
| hours | integer | 自訂暫停時間-小時 (Option) |
| min | integer | 自訂暫停時間-分鐘 (Option) |
| resume_at | string | 現有暫停倒數結束時間,格式 YYYY-MM-DD HH:mm:ss (Option) |
| suspend_reason | string | 暫停原因 (Option) |
| suspend_reason_color | string | 暫停原因色碼 (Option) |
Request Body Example
{
"client_device": "PWA",
"sale_methods": [
{
"id": 1,
"is_paused": true,
"hours": 2,
"min": 0,
"suspend_reason": "天候不佳,暫停接單",
"suspend_reason_color": "#FF0000"
},
{
"id": 2,
"is_paused": false
}
]
}
Responses
Success Response
- Code: 204 No Content
(成功時不回傳任何 Body 內容)
Error Responses
- Code: 400 Bad Request
- Content-Type:
application/json
情境 1:無此門市
{
"message": "無此門市"
}
情境 2:傳入不支援的裝置來源
{
"message": "目前暫時不支援此裝置"
}
情境 3:傳入完全未知的裝置來源
{
"message": "未知的裝置來源: UNKNOWN_DEVICE"
}
情境 4:傳入該門市未開通的銷售方式 ID
{
"message": "銷售方式 999 不存在或未啟用"
}