---
search:
  tags:
    - 在庫
    - POST
seo:
  description: 実際に戻った出荷済み個体を最大200件指定します。元の棚へ返品し、顧客保有のallocatedな新commitmentを作ります。応答のcommitmentIdは元のID、commitment.idは新しいID…
sidebar:
  label: 届かなかった個体の返品を記録する
  badge: POST
title: 届かなかった個体の返品を記録する
type: openapi-operation
---
実際に戻った出荷済み個体を最大200件指定します。元の棚へ返品し、顧客保有のallocatedな新commitmentを作ります。応答のcommitmentIdは元のID、commitment.idは新しいIDです。同じrequestIdでの再実行は作成済みを返します。 inventory:readに加え、この操作のスコープと許可したメンバーのinventory.write権限が必要です。

`POST /inventory/shipments/{id}/returns`

**Request body** (`application/json`, required)

- `requestId` (string<uuid>, required)
- `commitmentIds` (string<uuid>[], required)
- `reason` (string, required)

Request body example:

```json
{
  "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
  "commitmentIds": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ],
  "reason": "string"
}
```

**Responses**

- `200` — 成功
- `400` — \`invalid\_request\`。パラメーターが正しくありません。
- `401` — \`invalid\_token\`。トークンがない、期限切れ、または別のリソース向けです。
- `403` — \`insufficient\_scope\`、\`connection\_revoked\`、\`client\_disabled\`、\`forbidden\` のいずれかです。
- `404` — \`not\_found\`
- `409` — 競合・requestIdの流用・受取未確認
- `422` — 現在の状態・対象・値では実行できません。errorと対象IDを確認します。

Response example, 200:

```json
{
  "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"
      }
    }
  ]
}
```
