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

# Convert Amazon ASINs to product barcodes

> Look up barcodes for Amazon Standard Identification Numbers. Requires an Amazon locale in config. Submit up to 10 ASINs per call; returns an array per ASIN.

The `POST /tools/convert/ASIN-to-barcode` endpoint converts Amazon Standard Identification Numbers (ASINs) to their corresponding barcodes. Each ASIN can map to multiple barcodes, so the API returns an array for each one.

## Endpoint

```
POST /v1/tools/convert/ASIN-to-barcode
```

<Warning>
  You can submit a maximum of 10 ASINs per request. Requests with more than 10 ASINs will return a validation error.
</Warning>

## Request body

<ParamField body="data" type="array of strings" required>
  The ASINs to convert. Maximum 10 per request.
</ParamField>

<ParamField body="config" type="object" required>
  Configuration for the conversion. You must specify the Amazon locale.

  <Expandable title="config fields">
    <ParamField body="config.asin.locale" type="string" required>
      The Amazon marketplace locale (e.g. `"US"`).
    </ParamField>
  </Expandable>
</ParamField>

```json theme={null}
{
  "data": [
    "B0C792QRW6",
    "B00AQUO5RI",
    "B0C792QRW9"
  ],
  "config": {
    "asin": {
      "locale": "US"
    }
  }
}
```

## Example request

```bash theme={null}
curl --request POST \
  --url 'https://api.affiliate.com/v1/tools/convert/ASIN-to-barcode' \
  --header 'Authorization: Bearer {your_api_key}' \
  --header 'Content-Type: application/json' \
  --data '{
    "data": [
      "B0C792QRW6",
      "B00AQUO5RI",
      "B0C792QRW9"
    ],
    "config": {
      "asin": {
        "locale": "US"
      }
    }
  }'
```

## Example response

```json theme={null}
{
  "meta": {
    "from": "asin",
    "to": "barcode",
    "from_total": 3,
    "to_total": 2,
    "config": {
      "asin": {
        "locale": "US"
      }
    },
    "trace_id": "0192f58a-0fde-7201-9bc7-653d0a6c4168"
  },
  "data": {
    "B0C792QRW6": [
      "0887276760049",
      "8806095074122"
    ],
    "B00AQUO5RI": [
      "0706487014362",
      "0615822003643"
    ],
    "B0C792QRW9": []
  }
}
```

In this example, `B0C792QRW6` and `B00AQUO5RI` each map to two barcodes, while `B0C792QRW9` returns an empty array because no barcode was found. `to_total` is `2` because only two ASINs produced results.

## Response fields

### `meta` object

| Field        | Type    | Description                                          |
| ------------ | ------- | ---------------------------------------------------- |
| `from`       | string  | Always `"asin"` for this endpoint.                   |
| `to`         | string  | Always `"barcode"` for this endpoint.                |
| `from_total` | integer | Number of ASINs you submitted.                       |
| `to_total`   | integer | Number of ASINs that returned at least one barcode.  |
| `config`     | object  | The ASIN config used in the request.                 |
| `trace_id`   | string  | Unique request identifier for debugging and support. |

### `data` object

Each key is an ASIN from your request. Each value is an **array** of barcode strings. An ASIN can correspond to multiple barcodes (e.g. different regional packaging). An empty array `[]` means no barcode was found for that ASIN.

<ResponseField name="data" type="object">
  Key-value pairs where each ASIN maps to an array of barcode strings.
</ResponseField>

<Note>
  ASIN conversions always return an array of barcodes, not a single string. Check for an empty array `[]` to identify ASINs where no barcode was found.
</Note>
