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

# Manifest and Declaration Templates

> Choose the template that matches your file, and the optional templates that fill declaration values.

## What you can do

Two different templates are involved when you import a Shipment manifest.

A **Manifest Template** describes how columns in your CSV or Excel file map to Eaze Customs fields. You must select one, and it must match the file.

A **Declaration Template** supplies predefined values for the Customs Declarations created from that file. It is optional.

## Before you start

You need `clientRef`, the Shipment direction (`IMPORT` or `EXPORT`), and a credential with the matching `import` or `export` module.

Call these with `X-Eaze-Client-Ref`:

* [List Manifest Templates](https://docs.eazecustoms.com/api-reference/shipments/list-manifest-templates.md) requires `shipmentType`.
* [List Declaration Templates](https://docs.eazecustoms.com/api-reference/shipments/list-declaration-templates.md) requires `shipmentType`. Add `manifestTemplateId` when you want only templates mapped to one Manifest Template.

NCTS uses a different template list. See [NCTS Overview](https://docs.eazecustoms.com/implementation/ncts-overview.md).

## Selection rules

* Manifest Template selection is required on import.
* Declaration Template selection is optional.
* An explicit Declaration Template must be assigned to the client, active, valid for the Shipment direction, and mapped to the selected Manifest Template.
* Send at most one Declaration Template for each procedure type. Import procedures are `H1` and `H7`. Export procedure is `B1`.
* A consolidated Manifest Template (`consolidated: true`) requires exactly one eligible Declaration Template, and that template cannot be `H7`.
* If you omit `declarationTemplateIds`, or send `[]`, Eaze Customs uses eligible default Declaration Templates that are mapped to the selected Manifest Template.
* Unrelated company defaults are not applied. If no mapped default exists, the file is still imported and the Declarations are created without those predefined template values.
* If a consolidated Manifest Template has no eligible non-`H7` template, the import is rejected.

The selected Manifest Template is not replaced automatically when the file headers do not match.

## Steps

**1. List Manifest Templates**

```bash theme={null}
curl 'https://staging.api.eazecustoms.com/public/v1/manifest-templates?shipmentType=IMPORT' \
  --header 'Authorization: Bearer EZ_11111111-1111-4111-8111-111111111111_exampleSecretValueNotReal' \
  --header 'X-Eaze-Client-Ref: ACME-AMS'
```

Keep the `id` of the template that matches your file layout. That value is `manifestTemplateId`.

**2. List Declaration Templates**

```bash theme={null}
curl 'https://staging.api.eazecustoms.com/public/v1/declaration-templates?shipmentType=IMPORT&manifestTemplateId=77777777-7777-4777-8777-777777777777' \
  --header 'Authorization: Bearer EZ_11111111-1111-4111-8111-111111111111_exampleSecretValueNotReal' \
  --header 'X-Eaze-Client-Ref: ACME-AMS'
```

`isDefault` marks a mapped default. Use an `id` from this list only when you want to select templates yourself.

**3. Import**

Pass the IDs to [Import Manifest](https://docs.eazecustoms.com/api-reference/shipments/import-manifest.md). See [Manifest Import](https://docs.eazecustoms.com/implementation/manifest-import.md).

## Working example

Use mapped defaults. Omit the field:

```json theme={null}
{
  "uploadId": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
  "manifestTemplateId": "77777777-7777-4777-8777-777777777777",
  "mode": "INITIAL"
}
```

The same default behavior, written explicitly:

```json theme={null}
{
  "uploadId": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
  "manifestTemplateId": "77777777-7777-4777-8777-777777777777",
  "declarationTemplateIds": [],
  "mode": "INITIAL"
}
```

Select eligible templates yourself:

```json theme={null}
{
  "uploadId": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
  "manifestTemplateId": "77777777-7777-4777-8777-777777777777",
  "declarationTemplateIds": ["88888888-8888-4888-8888-888888888888"],
  "mode": "INITIAL"
}
```

A template response looks like this:

```json theme={null}
{
  "data": [
    {
      "id": "77777777-7777-4777-8777-777777777777",
      "name": "Amsterdam air manifest",
      "description": "Commercial reference, description, and gross mass.",
      "consolidated": false
    }
  ],
  "pagination": { "limit": 20, "hasMore": false, "nextCursor": null }
}
```

## Statuses and errors

| Situation | What to do |
| - | - |
| HTTP 404 for a template ID | The template is not assigned to this client or does not match the direction. List templates again. |
| HTTP 400 during import | The Declaration Template is ineligible, a procedure is duplicated, or a consolidated manifest does not have exactly one eligible non-`H7` template. |
| HTTP 422 `manifest_invalid` | The file is missing configured headers for the Manifest Template. The same upload can be sent again. See [Manifest Import](https://docs.eazecustoms.com/implementation/manifest-import.md). |

Next: [Manifest Import](https://docs.eazecustoms.com/implementation/manifest-import.md).


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