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

# Submit Manifest

> Submit a shipping manifest (AWB) linking parcels to a shipment

Submits a manifest that groups multiple parcels under an Air Waybill (AWB) for a single shipment. This is typically done before parcels are handed over to the carrier.

## Request Body

<ParamField body="idempotencyKey" type="string">
  Optional unique key to prevent duplicate submissions (8-64 characters).
</ParamField>

<ParamField body="awbNumber" type="string" required>
  Air Waybill number (8-20 characters). Format: `XXX-XXXXXXXX` (carrier prefix + 8 digits).
</ParamField>

<ParamField body="flightNumber" type="string">
  Flight number (e.g., `LA2480`).
</ParamField>

<ParamField body="flightDate" type="string">
  Scheduled flight date in `YYYY-MM-DD` format.
</ParamField>

<ParamField body="originAirport" type="string">
  Origin airport code (e.g., `MIA`).
</ParamField>

<ParamField body="destinationAirport" type="string">
  Destination airport code (e.g., `UIO`).
</ParamField>

<ParamField body="carrier" type="string">
  Carrier name (e.g., `LATAM Airlines`).
</ParamField>

<ParamField body="country" type="string">
  Destination country code (2-letter ISO).
</ParamField>

<ParamField body="parcels" type="array" required>
  List of parcels to include in the manifest.

  <Expandable title="Parcel fields">
    <ParamField body="parcels[].trackingNumber" type="string" required>
      Tracking number of an existing parcel.
    </ParamField>

    <ParamField body="parcels[].bagCode" type="string">
      Bag code for grouping parcels (e.g., `BAG-A001-001`).
    </ParamField>

    <ParamField body="parcels[].ConsigneeName" type="string">
      Receiver name (for validation).
    </ParamField>

    <ParamField body="parcels[].Dni" type="string">
      Receiver national ID (for validation).
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="attachment" type="string">
  Base64-encoded AWB PDF document.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the manifest was submitted successfully
</ResponseField>

<ResponseField name="shipment" type="object">
  The created shipment details

  <Expandable title="Shipment fields">
    <ResponseField name="shipment.id" type="string">
      Unique shipment ID
    </ResponseField>

    <ResponseField name="shipment.awbNumber" type="string">
      The AWB number
    </ResponseField>

    <ResponseField name="shipment.status" type="string">
      Shipment status (`MANIFEST_SUBMITTED`)
    </ResponseField>

    <ResponseField name="shipment.parcelCount" type="integer">
      Number of parcels in the manifest
    </ResponseField>

    <ResponseField name="shipment.totalWeight" type="number">
      Combined weight of all parcels (lbs)
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="linked" type="integer">
  Number of parcels successfully linked to the shipment
</ResponseField>

<ResponseField name="notFound" type="array">
  Tracking numbers that were not found in the system
</ResponseField>

<RequestExample>
  ```json Example Request theme={null}
  {
    "idempotencyKey": "manifest-2024-001",
    "awbNumber": "180-12345678",
    "flightNumber": "LA2480",
    "flightDate": "2024-12-25",
    "originAirport": "MIA",
    "destinationAirport": "UIO",
    "carrier": "LATAM Airlines",
    "country": "EC",
    "parcels": [
      {
        "trackingNumber": "CBECUSD123456789",
        "bagCode": "BAG-A001-001",
        "ConsigneeName": "María García",
        "Dni": "1234567890"
      },
      {
        "trackingNumber": "CBECUSD123456790",
        "bagCode": "BAG-A001-001"
      },
      {
        "trackingNumber": "CBECUSD123456791",
        "bagCode": "BAG-A001-002"
      }
    ]
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "success": true,
    "shipment": {
      "id": "shp_abc123def456",
      "awbNumber": "180-12345678",
      "status": "MANIFEST_SUBMITTED",
      "parcelCount": 3,
      "totalWeight": 7.5
    },
    "linked": 3,
    "notFound": []
  }
  ```

  ```json 200 - Partial Success theme={null}
  {
    "success": true,
    "shipment": {
      "id": "shp_abc123def456",
      "awbNumber": "180-12345678",
      "status": "MANIFEST_SUBMITTED",
      "parcelCount": 2,
      "totalWeight": 5.0
    },
    "linked": 2,
    "notFound": ["INVALID123456789"]
  }
  ```

  ```json 409 - AWB Already Submitted theme={null}
  {
    "success": false,
    "error": {
      "code": "MANIFEST_LOCKED",
      "message": "This AWB has already been submitted and cannot be modified",
      "message_es": "Esta guía aérea ya fue enviada y no puede ser modificada",
      "requestId": "req_abc123"
    }
  }
  ```
</ResponseExample>

## Validation Rules

<AccordionGroup>
  <Accordion title="Tracking Number Validation">
    * All tracking numbers must exist in the system
    * Parcels must be in `LABEL_GENERATED` or `ORDERED` status
    * Parcels cannot already be assigned to another manifest
  </Accordion>

  <Accordion title="AWB Validation">
    * AWB number format: 3-digit carrier prefix + 8 digits (e.g., `180-12345678`)
    * Cannot reuse an AWB that has already been submitted
    * Cannot modify a manifest after submission
  </Accordion>

  <Accordion title="Country Validation">
    * Ecuador: Receiver ID (Cédula/RUC) validated against SRI database
    * Mexico: RFC format validated if provided
    * Colombia: Cédula format validated
  </Accordion>
</AccordionGroup>

## Bag Codes

Parcels can be grouped into bags using the `bagCode` field. This is optional but recommended for large shipments.

```json theme={null}
{
  "parcels": [
    { "trackingNumber": "...", "bagCode": "BAG-001" },
    { "trackingNumber": "...", "bagCode": "BAG-001" },
    { "trackingNumber": "...", "bagCode": "BAG-002" }
  ]
}
```

Bags help with:

* Physical grouping during shipping
* Customs documentation
* Weight tracking per container
