> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eazecustoms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk-create allocations

> Bulk-allocate up to 500 declarations in one atomic request.

Bulk-allocate up to 500 declarations. The request is atomic: any one invalid row fails the whole batch. Any HAWB named by number is created if it does not already exist.

### Path Parameters

<ParamField path="id" type="string" required>
  Shipment Public ID (`shp_…`).
</ParamField>

### Headers

<ParamField header="Idempotency-Key" type="string" required>
  Unique key that makes retrying this request safe for 24 hours. A UUID is recommended.
</ParamField>

### Body

<ParamField body="allocations" type="array" required>
  Allocation rows (1–500). Each row includes procedure type, customs declaration type/number, package count, and gross weight. Optional `houseAirWaybillNumber` creates the HAWB when missing.
</ParamField>

```json JSON Payload theme={null}
{
  "allocations": [
    {
      "houseAirWaybillNumber": "HWB-101",
      "declarationProcedureType": "H1",
      "customsDocumentType": "X",
      "customsDeclarationType": "IM",
      "customsDeclarationNumber": "26NL12345678901234",
      "packageCount": 4,
      "grossWeightKg": 40
    },
    {
      "declarationProcedureType": "H1",
      "customsDeclarationType": "IM",
      "customsDeclarationNumber": "26NL12345678901235",
      "packageCount": 2,
      "grossWeightKg": 20
    }
  ]
}
```

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "data": [
      {
        "allocationId": "alc_3f9a1c0e5b7d4e2f8a6c1b9d0e3f7a25",
        "shipmentId": "shp_3f9a1c0e5b7d4e2f8a6c1b9d0e3f7a25",
        "hawbId": "hawb_3f9a1c0e5b7d4e2f8a6c1b9d0e3f7a25",
        "source": "EXTERNAL",
        "declarationId": null,
        "declarationProcedureType": "H1",
        "customsDocumentType": "X",
        "customsDeclarationType": "IM",
        "customsDeclarationNumber": "26NL12345678901234",
        "packageCount": 4,
        "grossWeightKg": 40,
        "isActive": true,
        "createdAt": "2026-06-10T08:30:00.000Z",
        "updatedAt": "2026-06-10T08:30:00.000Z"
      }
    ]
  }
  ```
</ResponseExample>
