コンテンツにスキップ
トレカクラウド
Esc
↑↓移動↵開く⌘Jプレビュー

届かなかった個体の返品を記録する

実際に戻った出荷済み個体を最大200件指定します。元の棚へ返品し、顧客保有のallocatedな新commitmentを作ります。応答のcommitmentIdは元のID、commitment.idは新しいIDです。同じrequestIdでの再実行は作成済みを返します。 inventory:readに加え、この操作のスコープと許可したメンバーのinventory.write権限が必要です。

POST/inventory/shipments/{id}/returns
認証
AuthorizationOAuth2 アクセストークン · header必須

認可コードフロー(PKCE S256 必須)。認可・トークン・更新のリクエストには resource=https://api.toreca-cloud.com/partner/v1 を付けます。アクセストークンは15分、リフレッシュトークンは90日有効で、更新のたびに入れ替わります。

スコープ:inventory:readinventory:write
パスパラメーター
idstring<uuid>必須
リクエストボディ
必須application/json
requestIdstring<uuid>必須
commitmentIdsstring<uuid>[]必須
最小項目数 1 · 最大項目数 200
reasonstring必須
最小長 1 · 最大長 2000
レスポンス
200

成功

returnsobject[]必須
プロパティを表示
object の配列
commitmentIdstring<uuid>必須
commitmentCommitment必須
プロパティを表示
idstring<uuid>必須
createdAtstring<date-time>必須
updatedAtstring<date-time>必須
inventoryItemIdstring<uuid>必須
assetNumberstring必須
purposestring必須
許可される値:oripasale
labelstring必須
externalRefstring | null必須
プロパティを表示
いずれか 1 つ:
string
string
null
null
statusstring必須
許可される値:on_saleallocatedshippingblockedshippedreleasedended
allocatedAtstring<date-time> | null必須
プロパティを表示
いずれか 1 つ:
string<date-time>
string<date-time>
null
null
allocationRefstring | null必須
プロパティを表示
いずれか 1 つ:
string
string
null
null
shipmentIdstring<uuid> | null必須
プロパティを表示
いずれか 1 つ:
string<uuid>
string<uuid>
null
null
closedAtstring<date-time> | null必須
プロパティを表示
いずれか 1 つ:
string<date-time>
string<date-time>
null
null
400

invalid_request。パラメーターが正しくありません。

errorstring必須

エラーのコード

scopestring

insufficient_scope のとき、足りない権限

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
401

invalid_token。トークンがない、期限切れ、または別のリソース向けです。

errorstring必須

エラーのコード

scopestring

insufficient_scope のとき、足りない権限

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
403

insufficient_scope、connection_revoked、client_disabled、forbidden のいずれかです。

errorstring必須

エラーのコード

scopestring

insufficient_scope のとき、足りない権限

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
404

not_found

errorstring必須

エラーのコード

scopestring

insufficient_scope のとき、足りない権限

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
409

競合・requestIdの流用・受取未確認

errorstring必須

エラーのコード

scopestring

insufficient_scope のとき、足りない権限

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
422

現在の状態・対象・値では実行できません。errorと対象IDを確認します。

errorstring必須

エラーのコード

scopestring

insufficient_scope のとき、足りない権限

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
試してみる
サーバー
認証
パラメーター
ボディapplication/json
リクエスト
curl -X POST 'https://api.toreca-cloud.com/partner/v1/inventory/shipments/497f6eca-6276-4993-bfeb-53cbbbba6f08/returns' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
  "commitmentIds": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ],
  "reason": "string"
}'
レスポンス
{
  "returns": [
    {
      "commitmentId": "4e1ecf7c-8127-4207-92b0-010ff43ff54d",
      "commitment": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "createdAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z",
        "inventoryItemId": "ef1bc09e-447a-46aa-a9d9-d86e3d490831",
        "assetNumber": "string",
        "purpose": "oripa",
        "label": "string",
        "externalRef": "string",
        "status": "on_sale",
        "allocatedAt": "2019-08-24T14:15:22Z",
        "allocationRef": "string",
        "shipmentId": "47efd5a2-af91-4417-950a-7f546cd1b5cf",
        "closedAt": "2019-08-24T14:15:22Z"
      }
    }
  ]
}

このページは役に立ちましたか?