> ## 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.

# Create an allocation

> Allocate a declaration cleared elsewhere (EXTERNAL only).

Allocate a declaration cleared elsewhere. This endpoint creates EXTERNAL allocations only.

### Path Parameters

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

### Headers

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

### Body

<ParamField body="declarationProcedureType" type="string" required>
  Procedure type of the clearance, for example `H1`.
</ParamField>

<ParamField body="customsDeclarationType" type="string" required>
  Customs declaration type, for example `IM`.
</ParamField>

<ParamField body="customsDeclarationNumber" type="string" required>
  Customs declaration number / MRN.
</ParamField>

<ParamField body="packageCount" type="integer" required>
  Packages allocated from remaining stock.
</ParamField>

<ParamField body="grossWeightKg" type="number" required>
  Gross weight allocated in kilograms.
</ParamField>

<ParamField body="customsDocumentType" type="string" default="X">
  Customs document type. Defaults to `X`.
</ParamField>

<ParamField body="hawbId" type="string">
  HAWB Public ID (`hawb_…`). Omit to allocate to the shipment master AWB.
</ParamField>

```json JSON Payload theme={null}
{
  "hawbId": "hawb_3f9a1c0e5b7d4e2f8a6c1b9d0e3f7a25",
  "declarationProcedureType": "H1",
  "customsDocumentType": "X",
  "customsDeclarationType": "IM",
  "customsDeclarationNumber": "26NL12345678901234",
  "packageCount": 4,
  "grossWeightKg": 40
}
```

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "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>
