# Find every store that sells a product with Affiliate.com's API

Affiliate.com's API lists the merchants that sell a product you already know by an Amazon ASIN or a retailer product page URL. First convert the starting point to barcodes, then search the catalog by barcode. A conversion costs $0.02 and a search costs $0.02, so one ASIN and one barcode search cost $0.04.

## At a glance

- **Convert:** `POST https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/v1/tools/convert/asin-to-barcode` or `POST https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/v1/tools/convert/url-to-barcode`
- **Search:** `POST https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/v1/products`, with a `barcode` filter in `search`
- **Body:** for an ASIN, `data` (up to 10 ASINs) and `config.asin.locale`. For a URL, `data` (full URLs). For a search, `search` and an optional `per_page`.
- **Price:** $0.02 per conversion request, however many inputs it holds. $0.02 per search request.
- **Payment:** each request answers with a 402 price quote, paid from a wallet over x402 or MPP, or drawn from prepaid Credits. No account or API key is needed.
- **Response:** a conversion's `data` maps each input to an array of barcodes, which is empty when nothing matched. A search's `data` is an array of product records, each with a `merchant`.
- **Full purchase flow:** [the buyer skill](https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/SKILL.md)

## Choose the conversion

| You start from | Endpoint | Body |
| --- | --- | --- |
| An Amazon ASIN | `/v1/tools/convert/asin-to-barcode` | `data` and `config.asin.locale`, such as `US` |
| A retailer product page URL | `/v1/tools/convert/url-to-barcode` | `data`, each element a full URL |
| A barcode | No conversion | Go straight to the search |

## Find the stores for an ASIN

1. Send the ASIN with its marketplace locale:

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

   The call answers with a 402 that quotes $0.02. [The buyer skill](https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/SKILL.md) has the payment steps. After payment, the response has this shape:

   ```json
   {"data": {"B09Y2MYL5C": ["<barcode>", "..."]}, "meta": {"from": "asin", "to": "barcode", "from_total": "<inputs sent>", "to_total": "<inputs matched>", "config": {"asin": {"locale": "US"}}, "trace_id": "<trace id>"}}
   ```

   This example conversion paid $0.02.

2. Check the array for each input. An ASIN can map to several barcodes. If the array is empty, stop for that input, because there is no barcode to search.

3. Search the catalog for one barcode:

   ```bash
   curl -s -X POST https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/v1/products \
     -H 'Content-Type: application/json' \
     -d '{"search": [{"field": "barcode", "operator": "=", "value": "<barcode from step 1>"}], "per_page": 10}'
   ```

   The 402 quotes $0.02. After payment the response has this shape:

   ```json
   {"data": [{"id": "<id>", "barcode": "<barcode>", "name": "<name>", "brand": "<brand>", "merchant": {"id": "<id>", "name": "<merchant>", "canonical_id": "<id>", "canonical_name": "<merchant>"}, "currency": "<ISO 4217 code>", "final_price": "<number>", "regular_price": "<number>", "availability": "<InStock, OutOfStock or null>", "updated_at": "<UTC timestamp>"}], "meta": {"total": "<matching products>", "per_page": 10, "current_page": "<page>", "last_page": "<last page>"}}
   ```

   This example search paid $0.02.

4. Read `merchant.name` and `merchant.id` from each record to build the list of stores. When `fields` is omitted, each full record also carries `direct_url`, the direct product link. If `meta.last_page` is above `meta.current_page`, send the same body with `page` set to the next number. Each page is one more request at $0.02.

## Start from a retailer URL

Send the product page URL in `data`. No `config` is needed:

```bash
curl -s -X POST https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/v1/tools/convert/url-to-barcode \
  -H 'Content-Type: application/json' \
  -d '{"data": ["https://www.abt.com/JBL-Charge-5-Black-Portable-Waterproof-Speaker-With-Powerbank-JBLCHARGE5BLKAM/p/159497.html"]}'
```

This URL maps to no barcode. Its key holds an empty array, and the request paid $0.02:

```json
{"data": {"https://www.abt.com/JBL-Charge-5-Black-Portable-Waterproof-Speaker-With-Powerbank-JBLCHARGE5BLKAM/p/159497.html": []}, "meta": {"from": "url", "to": "barcode", "from_total": "<inputs sent>", "to_total": "<inputs matched>", "trace_id": "<trace id>"}}
```

An empty array ends the chain for that input after one conversion. `meta.to_total` counts the inputs that matched. When it is zero, no search is needed. A URL that matches returns barcodes in the same shape as an ASIN, and you continue at step 3.

## Limits

- One ASIN request takes up to 10 ASINs and one `config.asin.locale`.
- Filters in `search` combine with AND.
- Not every ASIN or URL maps to a barcode.
- A paid request reaches the API and is charged, even when an input has no match or the API rejects the body.
- `final_price` is the price after discounts. `updated_at` is when the record was last refreshed.
- Prepaid Credits and card payment are covered in [the buyer skill](https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/SKILL.md).

## Errors

| Response | Meaning | Action |
| --- | --- | --- |
| `402` with a `payment` block | The price quote | Pay and retry the same request, or stop |
| Empty array for an input | No barcode for that ASIN or URL. The conversion is charged. | Skip the search for that input |
| `422` | The API rejected the body. The paid request is charged. | Check the body against [the API reference](https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/openapi.json) before paying again |
| `settlement_failed` | The payment did not settle. `settlementReason` says why. | Fix the wallet, then send the request again for a fresh 402 |
| `payment_request_mismatch` | A payment was reused for a different request | Get a new 402 for each request |

## Frequently asked questions

### Can I convert several ASINs or URLs in one request?

Yes. Put them all in `data`. ASIN requests take up to 10 ASINs per request. The whole request is one charge at $0.02, and the response has one key per input, each with its own barcode array.

### What happens when an ASIN or URL has no barcode?

Its array in `data` is empty and the conversion is still charged. There is nothing to search, so the chain stops for that input without a product search.

### How much does it cost to find every store for one product?

One conversion plus one search per barcode, and one more search for each extra page of results. One ASIN with two barcodes searched costs $0.06. Each 402 states the exact price before you pay.

### What do final_price and updated_at mean in a product record?

`final_price` is the price after discounts, and `regular_price` is the original retail price. `updated_at` is the UTC timestamp of the record's last refresh.

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

Not for pay as you go, which needs no account and no API key. [The buyer skill](https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/SKILL.md) has the full purchase flow. An agent identity is needed only to buy prepaid Credits, and [the identity guide](https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/auth.md) explains how the storefront issues one.

## Keep reading

- [Buyer skill](https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/SKILL.md): the full purchase flow
- [How to pay](https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/payment.md): the 402, x402, MPP, card and Credits
- [Error reference](https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/errors.md): every error code and what to do
- [API reference](https://zeroclick.affiliate.com/zcj/0ikd35tlbk0e/openapi.json): every operation, field and price

---

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