> For the complete documentation index, see [llms.txt](https://developer.esw.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.esw.com/getting-started/get-started-with-esw/quick-start-guide/customs-catalog.md).

# Customs Catalog

Upload your catalog so ESW can calculate duties and taxes at checkout. About 15 minutes.

ESW uses your product catalog data, such as HS code, country of origin, and material, to calculate duties and taxes at checkout and to support customs compliance for cross-border shipments. In this quick start you send your first catalog upload to sandbox.

**Time:** about 15 minutes

**Environment:** sandbox

### Before you begin

* Sandbox client credentials with the `logistics.catalog.api.upload` scope. If you have not requested a token yet, follow [Quick start: Authentication](https://developer.esw.com/getting-started/get-started-with-esw/quick-start-guide/authentication.md)
* Product master data. Each product needs at least a product code, name, description, material, and country of origin
* Your `tenantCode` for validation and reprocessing

### Choose your upload flow

| Situation                                              | Flow                                                                 |
| ------------------------------------------------------ | -------------------------------------------------------------------- |
| Onboarding, first time you synchronize your catalog    | Full catalog upload                                                  |
| ESW already has your catalog and you have new products | Add new products. Send **only** the new items                        |
| You want to change existing products                   | Update existing products. Send **only** the items you want to change |

{% hint style="danger" %}
When you update existing products, send the full updated item in the file. Any field that was previously populated with your catalog data is overwritten with the new values.
{% endhint %}

The steps below use the catalog upload endpoint. See the [API Methods](https://developer.esw.com/customs-catalog-api/customs-catalog-api/api-methods.md) page for the details of each flow.

{% stepper %}
{% step %}

#### Get an access token

Request a token with `scope=logistics.catalog.api.upload` using the request from [Quick start: Authentication](https://developer.esw.com/getting-started/get-started-with-esw/quick-start-guide/authentication.md). Store it in `ESW_TOKEN`.
{% endstep %}

{% step %}

#### Build the catalog payload

The request body is a JSON **array**. Each entry is one product or variant. Save this as `catalog.json`.

```json
[
  {
    "productCode": "SKU-00123",
    "name": "Classic Leather Wallet",
    "description": "Slim bifold wallet",
    "material": "Full-grain cowhide leather",
    "countryOfOrigin": "IT",
    "hsCode": "420232",
    "hsCodeRegion": "EU",
    "category": "ApparelAccessories",
    "weight": 0.15,
    "weightUnit": "Kg",
    "unitPrice": { "amount": 89.95, "currency": "EUR" }
  }
]
```

| Field                     | Required    | Notes                                            |
| ------------------------- | ----------- | ------------------------------------------------ |
| `productCode`             | Yes         | Your unique master identifier or SKU             |
| `name`                    | Yes         | Product name                                     |
| `description`             | Yes         | Short product description                        |
| `material`                | Yes         | What the product is made of                      |
| `countryOfOrigin`         | Yes         | Two-letter ISO country code                      |
| `hsCode`                  | No          | Minimum of 6 digits. Send `hsCodeRegion` with it |
| `weight` and `weightUnit` | No          | Send them together. `weightUnit` is `Lb` or `Kg` |
| `unitPrice`               | No          | Send `amount` and `currency` together            |
| `url`                     | Conditional | Mandatory when shipping to Russia or Japan       |
| `ean`, `upc`              | No          | `ean` is 8 or 13 digits. `upc` is 8 or 12 digits |

Other optional fields include `category`, `gender`, `ageGroup`, `size`, `imageUrl`, `dangerousGoods`, `isCustomized`, `restrictions`, `isRestricted`, `parentProductCode`, and `additionalProductCode`.

{% hint style="info" %}
In the Customs Catalog API, amounts and weights are JSON **numbers**. In the Checkout and Order APIs, amounts are strings.
{% endhint %}
{% endstep %}

{% step %}

#### Upload the catalog

```sh
curl --request POST "https://logistics-customscatalog-api.sandbox.eshopworld.com/api/v2/RetailerCatalog" \
  --header "Authorization: Bearer $ESW_TOKEN" \
  --header "Content-Type: application/json" \
  --data @catalog.json
```

A successful call returns `202 Accepted` with no body.
{% endstep %}

{% step %}

#### Check validation results

The API processes uploads **asynchronously**. A `202` confirms acceptance only.

Confirm the upload has completed in your catalog upload logs or with the timestamp supplied by ESW. Then list invalid products for your tenant:

```sh
curl --request POST \
  "https://logistics-customscatalog-api.sandbox.eshopworld.com/api/v2/InvalidProducts/Invalid" \
  --header "Authorization: Bearer $ESW_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "pageNumber": 1,
    "pageSize": 50,
    "tenantCode": "<tenantCode>",
    "searchType": "InvalidProducts"
  }'
```

To clear invalid products, do both of these in order:

1. **Fix the data.** Correct the products in your source catalog, then upload only the corrected items with the same `RetailerCatalog` call. Send each full item, as for any update.
2. **Queue reprocessing.** After that upload completes, ask ESW to run the tenant's invalid products back through validation and classification:

```sh
curl --request POST \
  "https://logistics-customscatalog-api.sandbox.eshopworld.com/api/v2/InvalidProducts/Reprocess/TenantCode?tenantCode=<tenantCode>" \
  --header "Authorization: Bearer $ESW_TOKEN"
```

This request also returns `202`. When processing completes, list the invalid products again to confirm the errors are gone. See [Uploading a Catalog](https://developer.esw.com/customs-catalog-api/resources/tutorials/uploading-a-catalog.md) for the full workflow, including reprocessing by brand.
{% endstep %}
{% endstepper %}

### Good practice

* Send the full catalog during onboarding. After that, send only new or changed items.
* Keep `productCode` identical to the `productCode` you use in Checkout, Order, and Package requests.
* Provide the best data you have for HS code, material, and country of origin. Good catalog data improves duty and VAT accuracy and reduces unclassified products and customs delays.

### Common errors

| Status                                            | Cause                                                | Fix                                                                                                        |
| ------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `400` with a list of `message` and `code` entries | A required field is missing or a value is invalid    | Fix the products named in the errors. Check required fields, enum values, and the `ean` and `upc` patterns |
| `400` on `weight`                                 | `weight` sent without `weightUnit`                   | Send both together                                                                                         |
| `400` on `unitPrice`                              | `amount` sent without `currency`                     | Send both together                                                                                         |
| `401`                                             | Token missing, malformed, or expired                 | Request a new token and resend                                                                             |
| `403`                                             | Token lacks the `logistics.catalog.api.upload` scope | Request a token with that scope                                                                            |

### Next steps

* Read the [Customs Catalog overview](https://developer.esw.com/customs-catalog-api/customs-catalog-api/overview.md) for how catalog data drives duties and taxes
* To send your catalog as a file instead, see [catalog file integration](https://developer.esw.com/integrations/integrations/catalog-file-integration.md)
* Return to the [Quick Start Guide](https://developer.esw.com/getting-started/get-started-with-esw/quick-start-guide.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.esw.com/getting-started/get-started-with-esw/quick-start-guide/customs-catalog.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
