新增批次提案單

批次提案 #

新增批次提案單 #

新增 批次提案單

Endpoint URL: https://tw.supplier.yahoo.com/api/spa/v1/proposal/batch
HTTP Method: POST

Request Body #

proposalType #

提案類型。
資料型態: String
必填: 是
欄位說明: 僅允許填入 updateImageV2,詳情請參考 Proposal Type 提案類型

batchSource #

批次提案來源,詳見 定義表
資料型態: String
必填: 是
欄位說明: 僅允許填入以下選項

  • excel
  • page
  • api

instantExecute #

是否為立刻執行的批次提案。設定為 true 時不需填寫 executeTs,系統將自動帶入 executeTs = nowexecuteStatus = finished,並且不進行預約執行
資料型態: Boolean
必填: 否
預設值: false

executeTs #

執行時間。
資料型態: String
必填: 是
格式: ISO-8601

revertTs #

回檔時間。
資料型態: String
必填: 是
格式: ISO-8601

Request/Response Syntax #

POST /api/spa/v1/proposal/batch

{
  "proposalType": string,
  "batchSource": string,
  "instantExecute": boolean,
  "executeTs": string,
  "revertTs": string
}
{
  "id": number,
  "supplierId": number,
  "proposalType": string,
  "batchSource": string,
  "instantExecute": boolean,
  "executeTs": string,
  "executeStatus": string,
  "executor": string,
  "executeDetail": string,
  "revertTs": string,
  "revertStatus": string,
  "reverter": string,
  "revertDetail": string,
  "creator": string,
  "createdTs": string,
  "modifier": string,
  "modifiedTs": string
}

Response Elements #

若操作成功,API 會回傳 HTTP 200 response。並以 JSON 格式回傳完整的 BatchProposal 物件。

id #

批次提案編號。
資料型態: Integer

supplierId #

供應商編號。
資料型態: Integer

proposalType #

提案類型。
資料型態: String
有效值: 詳見 Proposal Type 提案類型

batchSource #

批次提案來源,詳見 定義表
資料型態: String
有效值:

  • excel
  • page
  • api

instantExecute #

是否為立刻執行的批次提案。

executeTs #

執行時間。
資料型態: String
格式: ISO-8601

executeStatus #

執行狀態。
資料型態: String
有效值: 詳見 批次提案執行/回檔狀態

executor #

執行預約提案者。
資料型態: String
有效值:

  • Scheduler: 系統執行
  • 手動執行者 ID

executeDetail #

執行提案的詳情。
資料型態: String

revertTs #

回檔時間。
資料型態: String
格式: ISO-8601

revertStatus #

回檔狀態。
資料型態: String
有效值: 詳見 批次提案執行/回檔狀態

reverter #

執行回檔提案者。
資料型態: String
有效值:

  • Scheduler: 系統執行
  • 手動執行者 ID

revertDetail #

執行回檔提案的詳情。
資料型態: String

creator #

建檔者。
資料型態: String

createdTs #

建檔時間。
資料型態: String
格式: ISO-8601

modifier #

更新者。
資料型態: String

modifiedTs #

更新時間。
資料型態: String
格式: ISO-8601

Errors #

Bad Request #

輸入的參數不符合 API 定義的 Pattern。
HTTP Status Code: 400

Error Code Description
0 Invalid input
40000011 Invalid ISO-8601 format
40009214 Batch proposal revert time must appear in pairs with execute time
40009215 Batch proposal revert time should be at least 15 minutes after execute time
40009216 Batch proposal execute time must within +2 hours and +30 days
40009217 Batch proposal revert time must within +3 hours and +60 days

Unauthorized #

身分認證不通過,請檢查您的 Cookiewssid
HTTP Status Code: 401

Error Code Description
40100001 Missing or bad authentication
40100002 Invalid cookie
40100003 Missing or bad authentication
40100004 Check wssid failed
40100006 Cookie has expired

Forbidden #

權限驗證不通過,請確認您有權操作新增批次提案,且為您所提案的賣場的擁有者。
HTTP Status Code: 403

Error Code Description
40304001 No permission

Internal Server Error #

API 端發生錯誤,若持續發生請洽您的業務窗口。
HTTP Status Code: 500

Examples #

建立預約執行及預約回檔的批次提案單
POST /api/spa/v1/proposal/batch
{
  "proposalType": "updateImageV2",
  "batchSource": "excel",
  "instantExecute": false,
  "executeTs": "2024-04-10T02:00:00Z",
  "revertTs": "2024-04-10T05:00:00Z"
}

HTTP/1.1 201

{
  "id": 1,
  "supplierId": 99999,
  "proposalType": "updateImageV2",
  "batchSource": "excel",
  "instantExecute": false,
  "executeTs": "2024-04-10T02:00:00Z",
  "executeStatus": "idle",
  "revertTs": "2024-04-10T05:00:00Z",
  "revertStatus": "idle",
  "creator": "creator-id",
  "createdTs": "2024-04-09T10:00:00Z",
  "modifier": "modifier-id",
  "modifiedTs": "2024-04-09T10:00:00Z"
}
建立立刻執行的批次提案單
POST /api/spa/v1/proposal/batch
{
  "proposalType": "updateImageV2",
  "batchSource": "api",
  "instantExecute": true
}

HTTP/1.1 201

{
  "id": 1,
  "supplierId": 99999,
  "proposalType": "updateImageV2",
  "batchSource": "excel",
  "instantExecute": true,
  "executeTs": "2024-04-10T02:00:00Z",
  "executeStatus": "finished",
  "creator": "creator-id",
  "createdTs": "2024-04-09T10:00:00Z",
  "modifier": "modifier-id",
  "modifiedTs": "2024-04-09T10:00:00Z"
}
建立立刻執行的批次提案單,並預約回檔
POST /api/spa/v1/proposal/batch
{
  "proposalType": "updateImageV2",
  "batchSource": "api",
  "instantExecute": true,
  "revertTs": "2024-11-20T02:00:00Z"
}

HTTP/1.1 201

{
  "id": 1,
  "supplierId": 99999,
  "proposalType": "updateImageV2",
  "batchSource": "excel",
  "instantExecute": true,
  "executeTs": "2024-11-10T02:00:03Z",
  "executeStatus": "finished",
  "revertTs": "2024-11-20T02:00:00Z",
  "revertStatus": "idle",
  "creator": "creator-id",
  "createdTs": "2024-11-10T02:00:00Z",
  "modifier": "modifier-id",
  "modifiedTs": "2024-11-10T02:00:00Z"
}