修改批次提案單

批次提案 #

修改批次提案單 #

修改已建立的 批次提案單

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

Request Parameters #

id #

提案單號。
資料型態: Integer
必填: 是

Request Body #

executeTs #

執行時間。
資料型態: String
必填: 否
格式: ISO-8601
欄位說明: 僅允許當執行狀態為 idle 時更新

executeStatus #

執行狀態。
資料型態: String
必填: 否
欄位說明:

revertTs #

回檔時間。
資料型態: String
必填: 否
格式: ISO-8601
欄位說明: 僅允許當回檔狀態為 idle 時更新

revertStatus #

回檔狀態。
資料型態: String
必填: 否
欄位說明:

details #

提案明細。
資料型態: BatchProposalDetail[]

資料欄位說明
欄位名稱 資料型態 欄位說明
listingId Int32 賣場編號
executeProposalId Int32 執行提案編號
revertProposalId Int32 回檔提案編號
欄位說明: 若不是立刻執行的批次提案,僅允許當執行狀態和回檔狀態皆為 idle 時更新此欄位

Request/Response Syntax #

PATCH /api/spa/v1/proposal/batch/{id}

{
  "details": [
    {
      "listingId": number,
      "executeProposalId": number,
      "revertProposalId": number
    }
  ],
  "executeTs": string,
  "executeStatus": string,
  "revertTs": string,
  "revertStatus": string
}
{
  "id": number,
  "supplierId": number,
  "proposalType": string,
  "batchSource": string,
  "instantExecute": boolean,
  "details": [
    {
      "listingId": number,
      "executeProposalId": number,
      "revertProposalId": number
    }
  ],
  "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 #

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

details #

提案明細。
資料型態: BatchProposalDetail[]

欄位說明
欄位名稱 資料型態 欄位說明
listingId Int32 賣場編號
executeProposalId Int32 執行提案編號
revertProposalId Int32 回檔提案編號

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
40000010 Multiple bad parameters
40000013 The field is unchangeable
40000023 Constraint violation validate error
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
40009218 Mismatch batch proposal execute status and execute time
40009219 Mismatch batch proposal revert status and revert time
40009220 Invalid state flow of batch proposal status
40009221 Duplicated proposal ID
40009222 Duplicated listing ID
40009228 Invalid proposal ID

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

Unprocessable Entity #

提案單狀態驗證不通過,請確認提案單狀態。
HTTP Status Code: 422

Error Code Description
42209004 Supports PATCH canceled batch proposal execute / revert status only currently

Internal Server Error #

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

Examples #

更新提案單號為 1 的提案明細
PATCH /api/spa/v1/proposal/batch/1 HTTP/1.1
HOST: tw.supplier.yahoo.com
Content-Type: application/json; charset=UTF-8
{
  "details": [
    {
      "listingId": 12345,
      "executeProposalId": 1001,
      "revertProposalId": 1002
    },
    {
      "listingId": 22345,
      "executeProposalId": 1003,
      "revertProposalId": 1004
    }
  ],
  "modifier": "modifier-id"
}
{
  "id": 1,
  "supplierId": 99999,
  "proposalType": "updateImageV2",
  "batchSource": "excel",
  "details": [
    {
      "listingId": 12345,
      "executeProposalId": 1001,
      "revertProposalId": 1002
    },
    {
      "listingId": 22345,
      "executeProposalId": 1003,
      "revertProposalId": 1004
    }
  ],
  "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:05:00Z"
}
更新提案單號為 1 的回檔時間
PATCH /api/spa/v1/proposal/batch/1
{
  "revertTs": "2024-04-10T10:00:00Z",
  "modifier": "modifier-id"
}
{
  "id": 1,
  "supplierId": 99999,
  "proposalType": "updateImageV2",
  "batchSource": "excel",
  "details": [
    {
      "listingId": 12345,
      "executeProposalId": 103041001,
      "revertProposalId": 103041002
    },
    {
      "listingId": 22345,
      "executeProposalId": 103041003,
      "revertProposalId": 103041004
    }
  ],
  "executeTs": "2024-04-10T02:00:00Z",
  "executeStatus": "idle",
  "revertTs": "2024-04-10T10:00:00Z",
  "revertStatus": "idle",
  "creator": "creator-id",
  "createdTs": "2024-04-09T10:00:00Z",
  "modifier": "modifier-id",
  "modifiedTs": "2024-04-09T10:10:00Z"
}
更新提案單號為 1 的執行狀態
PATCH /api/spa/v1/proposal/batch/1
{
  "executeStatus": "canceled",
  "modifier": "modifier-id"
}

欄位說明: 當取消批次提案執行時,將同時自動取消批次提案回檔

{
  "id": 1,
  "supplierId": 99999,
  "proposalType": "updateImageV2",
  "batchSource": "excel",
  "details": [
    {
      "listingId": 12345,
      "executeProposalId": 1001,
      "revertProposalId": 1002
    },
    {
      "listingId": 22345,
      "executeProposalId": 1003,
      "revertProposalId": 1004
    }
  ],
  "executeTs": "2024-04-10T02:00:00Z",
  "executeStatus": "canceled",
  "revertTs": "2024-04-10T10:00:00Z",
  "revertStatus": "canceled",
  "creator": "creator-id",
  "createdTs": "2024-04-09T10:00:00Z",
  "modifier": "modifier-id",
  "modifiedTs": "2024-04-09T10:20:00Z"
}