> ## 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 product barcodes to Amazon ASINs

> Resolve barcodes to Amazon ASINs and their marketplace locales. Each barcode can map to multiple ASIN-locale pairs across Amazon marketplaces.

The `POST /tools/convert/barcode-to-asin` endpoint converts barcodes to Amazon Standard Identification Numbers (ASINs). Because the same product can appear under different ASINs in different Amazon marketplaces, each barcode maps to an array of objects — one per ASIN and locale combination found.

## Endpoint

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

## Request body

<ParamField body="data" type="array of strings" required>
  The barcodes to convert. Each element must be a valid numeric barcode string.
</ParamField>

```json theme={null}
{
  "data": [
    "8806095074122",
    "0887276760049"
  ]
}
```

## Example request

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

## Example response

```json theme={null}
{
  "meta": {
    "from": "barcode",
    "to": "asin",
    "from_total": 2,
    "to_total": 1,
    "trace_id": "0196f461-079d-73c5-9c4e-aab8c4834d53"
  },
  "data": {
    "8806095074122": [
      {
        "asin": "B0C792QRW6",
        "locale": "us"
      }
    ]
  }
}
```

In this example, `8806095074122` resolves to ASIN `B0C792QRW6` in the `us` locale. Barcode `0887276760049` is absent from `data` because no matching ASIN was found — `to_total` reflects only the barcodes that produced results.

## Response fields

### `meta` object

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

### `data` object

Each key is a barcode from your request that produced a match. Each value is an array of objects, one per ASIN-locale pair found.

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

<ResponseField name="data[barcode][].asin" type="string">
  The Amazon Standard Identification Number.
</ResponseField>

<ResponseField name="data[barcode][].locale" type="string">
  The Amazon marketplace locale where this ASIN was found (e.g. `"us"`).
</ResponseField>
