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

# Import Manifest

> **Import a manifest into an empty Import or Export Clearance shipment.**

The API checks that the uploaded file contains the required headers before accepting the import.

- **Invalid headers (HTTP 422):** The API returns an error immediately. No import Operation is created, and you can reuse the same uploaded file after correcting the file or template selection.
- **Valid headers (HTTP 202):** The API accepts the import for background processing. Extra columns are allowed.
- **Check the result:** Use the returned `operationId` to track the import status and view any row validation errors.



## OpenAPI

````yaml /openapi/public-v1.json post /public/v1/shipments/{shipmentId}/details/import
openapi: 3.0.0
info:
  title: Eaze Customs Public API
  version: '1.0'
  description: >-
    Customer API for Shipments, Import and Export Declarations, NCTS Departure
    and Arrival, RTO, and documents. Configure webhook endpoints in the Eaze
    Customs Portal. Authenticate with an Eaze Customs API credential. Staging —
    For Integration Testing: https://staging.api.eazecustoms.com. All routes in
    this specification start with /public/v1.
servers:
  - url: https://staging.api.eazecustoms.com
    description: >-
      Staging — For Integration Testing. Do not append /public/v1. That prefix
      is already part of each path.
security:
  - bearer: []
paths:
  /public/v1/shipments/{shipmentId}/details/import:
    post:
      summary: Import Manifest
      description: >-
        **Import a manifest into an empty Import or Export Clearance shipment.**


        The API checks that the uploaded file contains the required headers
        before accepting the import.


        - **Invalid headers (HTTP 422):** The API returns an error immediately.
        No import Operation is created, and you can reuse the same uploaded file
        after correcting the file or template selection.

        - **Valid headers (HTTP 202):** The API accepts the import for
        background processing. Extra columns are allowed.

        - **Check the result:** Use the returned `operationId` to track the
        import status and view any row validation errors.
      operationId: PublicShipments_importDetails
      parameters:
        - name: X-Eaze-Client-Ref
          in: header
          description: >-
            Required. Send the clientRef returned by List Clients. Do not send
            this header on Get Credential Details or List Clients.
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 100
            example: ACME-AMS
          example: ACME-AMS
        - name: shipmentId
          required: true
          in: path
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 200
            pattern: ^[!-~]{1,200}$
            example: 6f1c0b3e-8a21-4c5d-9e10-1a2b3c4d5e6f
          description: >-
            Required. Use 1 to 200 visible ASCII characters. Create a new key
            for a new request. Send the same key only when you retry the exact
            same request after a network failure. The same key with a different
            body is rejected.
          example: 6f1c0b3e-8a21-4c5d-9e10-1a2b3c4d5e6f
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportPublicShipmentManifestDto'
            examples:
              defaults:
                summary: Use mapped default Declaration Templates
                value:
                  uploadId: aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa
                  manifestTemplateId: 77777777-7777-4777-8777-777777777777
                  mode: INITIAL
              emptySelection:
                summary: Explicitly request mapped defaults
                value:
                  uploadId: aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa
                  manifestTemplateId: 77777777-7777-4777-8777-777777777777
                  mode: INITIAL
                  declarationTemplateIds: []
              selectedTemplates:
                summary: Select eligible Declaration Templates
                value:
                  uploadId: aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa
                  manifestTemplateId: 77777777-7777-4777-8777-777777777777
                  mode: INITIAL
                  declarationTemplateIds:
                    - 88888888-8888-4888-8888-888888888888
      responses:
        '202':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicShipmentManifestImportAcceptedDto'
              example:
                operationId: bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb
                status: queued
        '400':
          description: E0001 — malformed or invalid request.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0001
                message: Invalid request parameters
                errors:
                  - field: shipmentType
                    message: 'Invalid option: expected one of "IMPORT"|"EXPORT"'
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '401':
          description: >-
            E0002 — missing, invalid, expired or revoked Eaze Customs API
            credential.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0002
                message: >-
                  Missing, invalid, expired or revoked Eaze Customs API
                  credential
                errors: []
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '403':
          description: E0003 — credential, module or client authorization denied.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0003
                message: The import module is not enabled for this credential
                errors: []
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '404':
          description: E0004 — authorized resource not found.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0004
                message: Shipment not found
                errors: []
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '409':
          description: E0006 — idempotency or resource-state conflict.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0006
                message: Idempotency-Key was already used with a different request
                errors:
                  - code: idempotency_key_reused
                    message: Idempotency-Key was already used with a different request
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '422':
          description: >-
            E9999 — the selected Manifest Template is missing configured headers
            from the uploaded file. The upload is not reserved.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E9999
                message: >-
                  Selected Manifest Template "Amsterdam air manifest"
                  (77777777-7777-4777-8777-777777777777) does not match the
                  uploaded file headers. The file exactly matches authorized
                  Manifest Template "Rotterdam sea manifest"
                  (12121212-1212-4212-8212-121212121299). Submit a new import
                  with that template; the template was not switched
                  automatically.
                errors:
                  - code: manifest_invalid
                    message: >-
                      Selected Manifest Template "Amsterdam air manifest"
                      (77777777-7777-4777-8777-777777777777) does not match the
                      uploaded file headers. The file exactly matches authorized
                      Manifest Template "Rotterdam sea manifest"
                      (12121212-1212-4212-8212-121212121299). Submit a new
                      import with that template; the template was not switched
                      automatically.
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '429':
          description: >-
            E0008 — Public API rate limit exceeded; retry after the indicated
            delay.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0008
                message: Public API rate limit exceeded
                errors: []
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '500':
          description: >-
            E0009 — unexpected server error; report requestId if the problem
            persists.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0009
                message: Unexpected server error
                errors: []
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '503':
          description: >-
            E0011 — required asynchronous processing is not enabled or
            available.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0011
                message: Public API background processing is not enabled
                errors: []
                requestId: 550e8400-e29b-41d4-a716-446655440000
      security:
        - bearer: []
components:
  schemas:
    ImportPublicShipmentManifestDto:
      type: object
      properties:
        uploadId:
          type: string
          format: uuid
          description: >-
            Upload ID returned by Create Upload after Complete Upload reports
            status available. An accepted import reserves the upload. HTTP 422
            for missing headers does not.
        manifestTemplateId:
          type: string
          format: uuid
          description: >-
            Required. Public ID of the Manifest Template that matches the file
            columns. Take it from List Manifest Templates.
        declarationTemplateIds:
          maxItems: 20
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Optional. Public IDs of eligible Declaration Templates. Omit this
            field, or send an empty array, to use only the eligible defaults
            mapped to the selected Manifest Template. Explicit templates must be
            active, assigned to the client, allowed for the Shipment direction,
            and mapped to the Manifest Template. At most one template per
            procedure type, and at most 20 IDs.
        mode:
          type: string
          enum:
            - INITIAL
          description: >-
            Must be INITIAL. This imports a manifest into an empty Shipment.
            Replacing existing declarations is not available.
      required:
        - uploadId
        - manifestTemplateId
        - mode
    PublicShipmentManifestImportAcceptedDto:
      type: object
      properties:
        operationId:
          type: string
          format: uuid
          description: Public Operation ID. Use Get Operation to follow this import.
        status:
          type: string
          enum:
            - queued
          description: >-
            queued means the manifest import has been accepted and has not
            started yet.
      required:
        - operationId
        - status
    PublicApiError:
      type: object
      required:
        - errorCode
        - message
        - errors
        - requestId
      properties:
        errorCode:
          type: string
          example: E0001
        message:
          type: string
          example: Invalid request parameters
        errors:
          type: array
          items:
            $ref: '#/components/schemas/PublicApiValidationIssue'
        requestId:
          type: string
          format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
    PublicApiValidationIssue:
      type: object
      required:
        - message
      properties:
        field:
          type: string
          example: filename
        code:
          type: string
          example: invalid_format
        message:
          type: string
          example: Filename contains unsupported characters
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: EZ_<credential-id>_<secret>
      type: http
      description: >-
        Send Authorization: Bearer followed by the full Eaze Customs API
        credential. The credential looks like EZ_<credential-id>_<secret>. It is
        shown only when Eaze Customs creates or rotates it.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.