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

# Errors and Troubleshooting

> How to read an error response and correct the common failures.

## What you can do

Every failed request uses `application/problem+json`. Quote `requestId` when you contact support. The same value is in the `X-Request-Id` response header.

```json theme={null}
{
  "errorCode": "E0001",
  "message": "Invalid request parameters",
  "errors": [
    { "field": "filename", "message": "Filename contains unsupported characters" }
  ],
  "requestId": "550e8400-e29b-41d4-a716-446655440000"
}
```

`errors[].code` is present for domain conflicts. `errors[].field` is present for invalid fields. Messages are English in this reference. A runtime message is shown as the service returns it.

## Before you start

Check three headers before you debug the body:

* `Authorization: Bearer` with the full Eaze Customs API credential.
* `X-Eaze-Client-Ref` on client resources, and not on [Get Credential Details](https://docs.eazecustoms.com/api-reference/auth/get-credential-details.md) or [List Clients](https://docs.eazecustoms.com/api-reference/auth/list-clients.md).
* `Idempotency-Key` on the write requests listed in [Idempotency](https://docs.eazecustoms.com/implementation/idempotency.md).

## Steps

**1. Read errorCode and the HTTP status**

They identify the class of failure. The table below is the action to take.

**2. Read errors**

Correct every listed field. For a conflict, follow `errors[].code`.

**3. Decide whether to retry**

Retry the same request and the same idempotency key only when the table says the failure can change without a new command. Otherwise correct the request first.

## HTTP errors

| Code | HTTP | What happened | Retry? | What to do |
| - | - | - | - | - |
| `E0001` | 400 | The request is malformed, or a field, query, or header is invalid. | No, until you change it | Correct the listed fields. For `invalid_cursor`, start the list again without `cursor`. |
| `E0002` | 401 | The credential is missing, malformed, unknown, expired, revoked, or the source IP is not allowed. | After access changes | Send the full `EZ_...` credential. Ask an Eaze administrator to check status, expiry, and the IP allow list. |
| `E0003` | 403 | The credential lacks the module, or the broker cannot access this client. | After access changes | Check `scopes` on Get Credential Details and choose a `clientRef` from List Clients. |
| `E0004` | 404 | The resource is missing or not visible for this client. | No | Check the public ID and `X-Eaze-Client-Ref`. Do not send an internal database ID. |
| `E0005` | 405 | The method is not supported. | No | Use the method in the API Reference. |
| `E0006` | 409 | The current state conflicts with the command. | Sometimes | Follow the conflict table. |
| `E0007` | 415 | The file type does not match CSV or Excel. | No | Send `text/csv` or the Excel content type, and a matching extension. |
| `E0008` | 429 | Too many requests. | Yes | Wait for the `Retry-After` header, then retry. The default limit is 100 requests per 60 seconds for the credential and client. An operator can change that limit. |
| `E0009` | 500 | Unexpected failure. Details are hidden. | Yes, cautiously | Retry an idempotent request with the same key. Report `requestId` if it continues. |
| `E0010` | 502 | An upstream response was invalid. | Yes | Retry with backoff and report a persistent `requestId`. |
| `E0011` | 503 | Storage or background processing is unavailable. | Yes, later | Retry with the same idempotency key after a delay. A download can also return 503 when the file is not in storage yet. |
| `E0012` | 504 | An upstream dependency timed out. | Yes | Retry with backoff and the same idempotency key. |
| `E9999` | 410, 413, or 422 | The upload expired, the file is too large, or the content or configuration was rejected. | Depends | 410: create a new upload. 413: use a file of at most 20 MiB. 422: correct the configuration or file. |

## Common conflicts and checks

| What you see | Why | What to do |
| - | - | - |
| `invalid_cursor` | The cursor expired or the filters, client, or sort changed. | Request the first page again. |
| `idempotency_key_reused` | The same key was sent with a different body. | Keep the original body to replay, or use a new key for a new command. |
| `idempotency_in_progress` | The same command is still running. | Wait briefly and send the same key and body. |
| Missing client reference | `X-Eaze-Client-Ref` was omitted on a client route. | Send `clientRef` from List Clients. |
| Client header on `/me` or `/clients` | Those routes reject the header. | Remove it. |
| `ncts_configuration_incomplete` | There is not exactly one default NCTS template, and `templateId` was omitted. | Send a template ID or ask for one default template. |
| Incorrect Manifest Template | Import Manifest returns HTTP 422 `E9999` immediately. `errors[].code` is `manifest_invalid`. | Read `errors[].message`. No Operation is created. Send the same `uploadId` again with the named template, or with a corrected file. The named alternative is not applied for you. |
| Invalid manifest rows | The import was accepted with HTTP 202, then the Operation finishes `requires_review`, `manifest_invalid`, `retryable: false`. When some rows are readable, `error.detail` is `Manifest contains invalid rows`. | Correct the file. Create a new upload and a new import. |
| Declaration Templates unavailable | The IDs are not eligible for this client, direction, and Manifest Template. The response is HTTP 400. | List Declaration Templates with `manifestTemplateId`, or omit the field to use mapped defaults. |
| `upload_expired` | The 15-minute upload session ended. | Create a new upload. |
| `upload_checksum_mismatch`, `upload_size_mismatch`, or `upload_content_type_mismatch` | The stored bytes do not match the metadata. | Create a new upload from the exact bytes you hashed. |
| `upload_not_completed` | The file is not visible in storage yet. | Retry Complete Upload with the same idempotency key. |
| Upload already used | HTTP 409. An earlier accepted import reserved the upload, including one that later failed or required review. A header HTTP 422 does not reserve it. | After HTTP 409, create and complete a fresh upload. After HTTP 422, send the same `uploadId` again. |
| Shipment manifest import already active | Another import is `queued` or `running`. | Wait for that Operation. `requires_review` does not hold this lock. |
| `import_file_invalid` | The NCTS goods file was rejected. | Existing details stay unchanged. Correct the file and use a new upload. |
| Invalid credential prefix | A value that does not start with `EZ_` is rejected. | Use the current credential. Older `ECZ_` credentials are not accepted. |

Operation errors stay on the Operation after HTTP 202. Polling Get Operation then returns 200 with `error` filled in. That is not an HTTP failure. A header mismatch is the HTTP 422 from Import Manifest, not an Operation error.

## Working example

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

```json theme={null}
{
  "errorCode": "E0001",
  "message": "Invalid request parameters",
  "errors": [
    { "code": "invalid_cursor", "message": "Pagination cursor is invalid or expired" }
  ],
  "requestId": "550e8400-e29b-41d4-a716-446655440000"
}
```

Support can find the request from `requestId`. Do not send the credential secret in the support message.

Next: [Examples](https://docs.eazecustoms.com/implementation/examples.md). Webhook delivery problems are in [Deliveries & Retries](https://docs.eazecustoms.com/webhooks/retries.md).


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