Skip to Content
Won.dev

Responses

Every answer has the same top-level fields, in the same order. What each one holds, how errors look, and the headers that come with them.

Every endpoint answers with the same top-level fields, always in this order. An endpoint leaves out the ones it has no use for and never adds others: anything else it has to say is inside one of them.

FieldWhereWhat it holds
dataEvery answerWhat you asked for: an object, or a list of them.
totalTrade data and enrichment listsHow many results match in all, not only on this page.
has_moreListsWhether another page follows. See Pagination.
next_cursorListsWhat to pass as cursor for the next page. null on the last page.
queryTrade data, enrichment, accountThe request as it was understood.
noticeEvery answernull, or a sentence about this answer.
usageEvery answerWhat the call cost, and the balance left.

A search for the buyers of a product, cut to one result:

{
  "data": [
    {
      "id": "co_8f3k2m9x4p1q",
      "name": "SAMPLE NORTHFIELD HOME FURNISHINGS INC",
      "role": "importer",
      "country": "US",
      "shipments": 1840,
      "recorded_value_usd": 21480350.4,
      "website": "northfield-home.example",
      "sample_product": "UPHOLSTERED SOFA WITH WOODEN FRAME, FABRIC COVER"
    }
  ],
  "total": 4087,
  "has_more": true,
  "next_cursor": "cur_Zx81kQp4b2JtMW0uMXJ6ZzQ",
  "query": {
    "role": "importer",
    "hs_code": "940161",
    "importer_country": "US",
    "exclude_forwarders": true,
    "sort": "shipments",
    "since": "2025-11-01",
    "until": "2026-11-20",
    "data_through": "2026-11-11"
  },
  "notice": null,
  "usage": {
    "unit": "trade_company",
    "records": 1,
    "already_paid": 0,
    "cost": 0.01,
    "balance": 48.09,
    "replayed": false
  }
}

data

The answer itself. A list is an array, anything else an object. Finding nothing is not an error: the answer is a 200 with an empty array, or null where the object would be, and it is free.

query

The request as the server understood it, with defaults filled in and countries, codes and dates normalized. Check it first when a result surprises you. It also holds what the server decided for this answer:

FieldWhat it says
query.data_throughThe date of the newest record a trade data answer could include.
query.domainThe website that contacts or a work email were looked for on.
query.resolutionHow a waterfall search went. exhausted: true means asking again will not find more.
query.scannedHow many companies POST /trade/leads/find looked at to fill the page.

Cold email answers have no query: what you sent is in data.

notice

null, or one or two plain sentences about this answer: why it is empty, what was left out, what to call next. It is written for an agent to read. Branch on fields, never on the text of notice, which may change.

usage

The last field of every answer. Its shape follows how the endpoint is billed.

One kind of result, counted:

{
  "unit": "trade_company",
  "records": 20,
  "already_paid": 5,
  "cost": 0.2,
  "balance": 48.8,
  "replayed": false
}

Several kinds in one call, such as a company profile with its contacts:

{
  "cost": 0.13,
  "breakdown": [
    { "unit": "trade_company_profile", "records": 1, "already_paid": 0, "cost": 0.04 },
    { "unit": "person_email", "records": 3, "already_paid": 0, "cost": 0.09 }
  ],
  "balance": 48.62,
  "replayed": false
}

A free endpoint:

{ "cost": 0, "balance": 48.75, "replayed": false }

records counts the results that were charged. already_paid counts the ones that came back for free, because your organization paid for each of them in the last 30 days, through any endpoint: the same shipment record, company, profile, contact, person, phone number or job posting. An answer to one question is charged each time the question is asked: a lookup by name (trade_lookup), a market statistics query, an address check (email_verification) and every email sent.

replayed: true with cost: 0 means the answer is the stored one of the same request within the last 24 hours. See Idempotency. Prices are in Billing by result.

Dry runs

Every paid endpoint takes dry_run: true. Nothing runs and nothing is charged: data holds the most the call can cost, and total how many results match when that is already known.

{
  "data": {
    "dry_run": true,
    "max_cost": 0.25,
    "breakdown": [
      { "unit": "trade_company", "max_records": 25, "unit_price": 0.01, "max_cost": 0.25 }
    ]
  },
  "total": 4087,
  "query": { "role": "importer", "hs_code": "940161", "importer_country": "US", "limit": 25 },
  "notice": null,
  "usage": {
    "unit": "trade_company",
    "records": 0,
    "already_paid": 0,
    "cost": 0,
    "balance": 49,
    "replayed": false
  }
}

POST /email/campaigns and POST /email/campaigns/{id}/recipients answer a dry run with a preview instead: the same data as the real call, with nothing created and nothing sent.

Errors

An error has a 4xx or 5xx status and one field, error, instead of the ones above. Branch on code: it is stable, the message is not. invalid_input lists every parameter that needs fixing in issues, so one round trip is enough.

{
  "error": {
    "code": "invalid_input",
    "message": "`role` must be one of: importer, exporter.",
    "hint": "This endpoint accepts: role, hs_code, product, importer_country, exporter_country, trading_with, exclude_forwarders, sort, since, until, limit, cursor, max_cost, dry_run.",
    "issues": [
      { "param": "role", "message": "`role` must be one of: importer, exporter." },
      { "param": "limt", "message": "Unknown parameter `limt`." }
    ],
    "docs_url": "https://won.dev/docs/errors#invalid_input",
    "retry_after": null,
    "request_id": "req_6f1c0d3a9b8e4f2a8c7d5e4b3a2f1e0d"
  }
}

A failed request is never charged. Errors lists every code and what to do about it.

Headers

HeaderOnWhat it says
X-Request-IdEvery responseThe ID of the request, also error.request_id. Quote it to support.
RateLimit-LimitEvery response to a valid keyRequests the key can send back to back.
RateLimit-RemainingEvery response to a valid keyHow many more it can send before it has to pause.
RateLimit-ResetEvery response to a valid keySeconds of quiet after which the count starts over.
Retry-AfterErrors where waiting helpsSeconds to wait, the same number as error.retry_after.

See Rate limits for the RateLimit-* headers.

Formats

  • IDs are stable strings that start with their type, and an ID only works with the endpoints of its type.
  • Dates are YYYY-MM-DD, times are ISO 8601 in UTC, countries are ISO 3166 two-letter codes and money is a number of US dollars.
PrefixWhat it is
co_A company
shp_A shipment record
per_A person
job_A job posting
sig_A signal: something that happened at a company
snd_A sender
cmp_A campaign
rcp_A recipient of a campaign
msg_An email that was sent
rpl_A reply
att_A file attached to an email
evt_An event
whk_A webhook
sup_An entry on the do-not-contact list
task_A task: many calls run in the background
req_A request

On this page