# Convert barcodes, ASINs, SKUs and URLs with Affiliate.com's API

Affiliate.com's Tool Convert API maps one product's identifiers to each other: barcode to Amazon ASIN and back, barcode to a merchant's SKU and back, and a retailer's product page URL to its barcode. Each of the five operations is a `POST https://zeroclick.affiliate.com/zcj/p9azlk4u478n/v1/tools/convert/{operation}` with a list of identifiers in `data`, priced at $0.02 whatever the list holds. An unpaid call returns a 402, the price quote that you pay and retry, so nothing is charged until you pay.

## At a glance

- **Endpoint:** `POST https://zeroclick.affiliate.com/zcj/p9azlk4u478n/v1/tools/convert/{operation}`, where `{operation}` is `asin-to-barcode`, `barcode-to-asin`, `barcode-to-sku`, `sku-to-barcode` or `url-to-barcode`
- **Body:** `data`, a list of identifiers, on every operation. `asin-to-barcode` also requires `config.asin.locale`. `barcode-to-sku` and `sku-to-barcode` also require `config.merchant` with `name` or `url`.
- **Price:** $0.02 per request, however many identifiers `data` holds
- **Payment:** each call's 402 states its price; settle it in USDC over x402 or MPP and repeat the call. Nothing to sign up for. Prepaid Credits start at $0.50.
- **Response:** `data` maps each submitted identifier to its result. `meta` gives `from`, `to`, `from_total` (identifiers submitted), `to_total` (identifiers resolved) and `trace_id`.
- **No match:** the identifier stays in `data` with an empty list or `null`
- **Limits:** up to 10 ASINs per `asin-to-barcode` request. Barcodes are numeric strings, and URLs are full URL strings.
- **Full purchase flow:** [the buyer skill](https://zeroclick.affiliate.com/zcj/p9azlk4u478n/SKILL.md)

## Pick the conversion

The barcode links the other identifiers. A marketplace ASIN, a merchant SKU and a retailer page all convert to or from a barcode.

| You have | You want | Operation | `config` |
| --- | --- | --- | --- |
| Barcode | ASIN | `barcode-to-asin` | none |
| ASIN | Barcode | `asin-to-barcode` | `{"asin": {"locale": "US"}}` |
| Barcode | SKU at one merchant | `barcode-to-sku` | `{"merchant": {"name": "walmart"}}` |
| SKU at one merchant | Barcode | `sku-to-barcode` | `{"merchant": {"name": "walmart"}}` |
| Product page URL | Barcode | `url-to-barcode` | none |

`config.merchant` takes `name` or `url` (a domain such as `walmart.com`). When both are present, `name` takes precedence. There is no direct ASIN-to-SKU, URL-to-ASIN or SKU-to-SKU operation. Chain two requests through the barcode, for example `asin-to-barcode` and then `barcode-to-sku`, for $0.04.

## Convert barcodes to ASINs and back

1. Send the barcodes as a list:

   ```bash
   curl -sS -X POST https://zeroclick.affiliate.com/zcj/p9azlk4u478n/v1/tools/convert/barcode-to-asin \
     -H 'Content-Type: application/json' \
     -d '{"data": ["8806095074122", "0887276760049"]}'
   ```

   The first answer is a 402 for $0.02. You can stop here at no charge.

2. Pay the 402 and retry the same request. [The buyer skill](https://zeroclick.affiliate.com/zcj/p9azlk4u478n/SKILL.md) has the payment steps. A request with these two barcodes paid $0.02. The response maps each barcode to a list of objects, each with `asin` and `locale`:

   ```json
   {
     "data": {
       "8806095074122": [{"asin": "<asin>", "locale": "<locale>"}],
       "0887276760049": [{"asin": "<asin>", "locale": "<locale>"}]
     },
     "meta": {"from": "barcode", "to": "asin", "from_total": "<submitted>", "to_total": "<resolved>", "trace_id": "<id>"}
   }
   ```

3. Convert an ASIN back to barcodes. Set the Amazon marketplace in `config`:

   ```bash
   curl -sS -X POST https://zeroclick.affiliate.com/zcj/p9azlk4u478n/v1/tools/convert/asin-to-barcode \
     -H 'Content-Type: application/json' \
     -d '{"data": ["B0C792QRW6"], "config": {"asin": {"locale": "US"}}}'
   ```

   After the 402 is paid, the response maps the ASIN to a list of barcode strings, and `meta` repeats the `locale` and `config` used. This request paid $0.02. One product can carry more than one barcode, so read the whole list.

   ```json
   {
     "data": {"B0C792QRW6": ["<barcode>", "<barcode>"]},
     "meta": {"from": "asin", "to": "barcode", "from_total": "<number>", "to_total": "<number>", "locale": "<locale>", "config": {"asin": {"locale": "<locale>"}}, "trace_id": "<id>"}
   }
   ```

## Bodies for SKUs and URLs

```json
{"data": ["9349520733755", "648093563899"], "config": {"merchant": {"name": "walmart"}}}
```

That body goes to `barcode-to-sku`. Each barcode maps to one SKU string, or `null`.

```json
{"data": ["12987717129", "9853123116"], "config": {"merchant": {"name": "walmart"}}}
```

That body goes to `sku-to-barcode`. Each SKU maps to one barcode string, or `null`.

```json
{"data": ["https://www.abt.com/JBL-Charge-5-Black-Portable-Waterproof-Speaker-With-Powerbank-JBLCHARGE5BLKAM/p/159497.html"]}
```

That body goes to `url-to-barcode`. Each URL maps to a list of barcodes, empty when none were found.

## Boundaries

- An identifier with no match stays in the response: an empty list from `asin-to-barcode` and `url-to-barcode`, and `null` from `barcode-to-sku` and `sku-to-barcode`. When `to_total` is lower than `from_total`, some inputs did not resolve.
- A request is priced once. Ten ASINs in one request cost $0.02, and ten single-ASIN requests cost $0.20.
- An unpaid 402 charges nothing. Payment happens when you settle it.

## Errors

| Response | Meaning | Action |
| --- | --- | --- |
| `402` with a `payment` block | The price quote. Nothing is charged yet. | Pay and retry the same request, or stop |
| `400 invalid_request` | The body is malformed | Fix the JSON and resend |
| `settlement_failed` | The payment did not settle. `settlementReason` says why. | Fix the wallet, then send the request again for a fresh 402 |
| Another status after payment | Affiliate.com's API returned its own status and body | Read the body and correct the input, such as a missing `config` |

## Frequently asked questions

### Can I convert many barcodes to ASINs in one request?

Yes. Put the barcodes in the `data` list. The request costs $0.02 whatever the list holds, so one list is cheaper than one request per barcode. The API reference states a limit of 10 per request only for `asin-to-barcode`.

### Does the barcode to ASIN API take UPC codes?

`barcode-to-asin` takes each barcode as a valid numeric string in `data`, and the API reference's examples include 12- and 13-digit codes. Send a UPC as digits in a string, without spaces.

### What does the API return for an identifier with no match?

The identifier stays as a key in `data` with an empty list (`asin-to-barcode`, `url-to-barcode`) or `null` (`barcode-to-sku`, `sku-to-barcode`). Compare `meta.to_total` with `meta.from_total` to count the inputs that did not resolve.

### How do I get a merchant SKU from an ASIN or a product page URL?

Convert to the barcode first with `asin-to-barcode` or `url-to-barcode`, then send that barcode to `barcode-to-sku` with the merchant in `config.merchant`. The two requests cost $0.04.

### Do I need an account or API key?

No. Per-request calls are paid through the 402 over x402 or MPP, with no account, key or registration. An agent credential is needed only to buy prepaid Credits.

## Keep reading

- [Buyer skill](https://zeroclick.affiliate.com/zcj/p9azlk4u478n/SKILL.md): the full purchase flow
- [How to pay](https://zeroclick.affiliate.com/zcj/p9azlk4u478n/payment.md): the 402, x402, MPP, card and Credits
- [Tool Convert API reference](https://zeroclick.affiliate.com/zcj/p9azlk4u478n/services/tool-convert/openapi.json): every field of the five operations
- [Error reference](https://zeroclick.affiliate.com/zcj/p9azlk4u478n/errors.md): every error code and how to react

---

Updated 2026-10-16. All Affiliate.com guides: https://zeroclick.affiliate.com/guides.md. Storefront: https://zeroclick.affiliate.com/zcj/p9azlk4u478n/llms.txt.
