Pular para o conteúdo
Won.dev
DocumentaçãoReferência da API
API de comércio exterior

Buscar registros de embarque

Busca declarações aduaneiras e conhecimentos de embarque por produto ou por empresa. Cobrado por registro retornado.

Retorna declarações aduaneiras e conhecimentos de embarque, um registro por embarque: quem enviou o quê para quem, quando, quanto e por quais portos. Custa US$ 0,005 por registro retornado; um resultado vazio é grátis. Filtre por produto (hs_code ou product), por uma empresa (importer ou exporter), ou pelos dois. value_usd é null quando o registro não declara valor, como nos conhecimentos de embarque dos EUA. Um mesmo embarque pode aparecer duas vezes, uma nos registros do país importador e outra nos do exportador: reported_by diz de quem é o registro. Um registro guardado em duplicidade volta uma vez só, e com um ID de empresa ficam de fora os registros de outras empresas com o mesmo nome, então uma página pode trazer menos que limit. Use total para decidir entre continuar paginando e restringir a consulta; para contar ou somar, use POST /trade/stats/query em vez de paginar.

Uma chave de teste (won_test_...) responde a esta requisição com as mesmas empresas de exemplo, sem custo.

POST
/trade/shipments/search

Autenticação

apiKey
headerAuthorizationBearer <chave de API>

Authorization: Bearer won_live_..., a key from the console.

Parâmetros de cabeçalho

Idempotency-Key?string

Any unique string. A retry with the same key and the same body returns the first response and is not charged again.

Tamanholength <= 255

Corpo da requisição

application/json
  1. body
hs_code?string

HS code, digits only, 6 to 10 digits. Six digits are the same in every country; a longer code is one country's own tariff line, matched by prefix. Find the code of a product with GET /trade/hs-codes.

Tamanholength <= 20
product?string

Product keywords in English, such as office chair. A fuzzy match on the goods description. Use it when you do not know the HS code; an hs_code is more precise.

Tamanho2 <= length <= 100
importer?string

Only shipments this company received: its co_ ID, which matches exactly, or its name.

Tamanho2 <= length <= 200
exporter?string

Only shipments this company sent: its co_ ID, which matches exactly, or its name.

Tamanho2 <= length <= 200
importer_country?string

Country the goods are imported into: an ISO code such as US, or an English name such as United States.

Tamanholength <= 80
exporter_country?string

Country the goods are exported from: an ISO code such as VN, or an English name such as Vietnam.

Tamanholength <= 80
since?string

First day of the date range, YYYY-MM-DD. Default: the first day of the month 12 months before until.

Tamanholength <= 10
until?string

Last day of the date range, YYYY-MM-DD. Default: up to the latest records.

Tamanholength <= 10
sort?string

date_desc returns the latest records first, date_asc the earliest.

Padrão"date_desc"
Valores"date_desc""date_asc"
fields?array<>

The fields each shipment has, besides id. Default: date, importer, exporter, hs_code, description, quantity, quantity_unit, weight_kg, value_usd, origin_country, loading_port, unloading_port, transport, reported_by. Also available: unit_price_usd, incoterm, brand, bill_of_lading, description_full. default stands for the default set, so default,unit_price_usd adds one field and date,importer returns only those two.

Itensitems <= 40
limit?integer

How many results to return, 1 to 100. You pay for the results returned.

Intervalo1 <= value <= 100
Padrão10
cursor?string

To get the next page, pass next_cursor of the previous response back unchanged, with the same parameters.

Tamanholength <= 200
max_cost?number

Spending cap for this call in US dollars. If the call could cost more, it fails with budget_exceeded before anything is charged.

Intervalo0 < value
dry_run?boolean

If true, only return the maximum cost of this call. Nothing runs, nothing is charged.

Padrãofalse

Corpo da resposta

The result. With dry_run, only the maximum cost.

application/json
  1. response
data*array<>

The results of this page.

total*integer

How many results match in all. Use it to decide between paging on and narrowing the query.

has_more*boolean

Whether more results follow this page.

next_cursor*|

Pass it as cursor to get the next page. Null on the last page.

query*

The request as it was understood: country names as codes, the default dates filled in. data_through says how recent the records behind the answer are.

notice*|

A plain sentence when there is something to know about this result: why a part is missing, or what to try next. Null otherwise.

usage*

What this call was charged, and the balance left.

Requisição de exemplo
curl -X POST 'https://api.won.dev/v1/trade/shipments/search' \  -H 'Content-Type: application/json' \  -d '{  "hs_code": "940161",  "importer_country": "US",  "limit": 1}'
Resposta de exemplo
{  "data": [    {      "id": "shp_5k2m8x1q9d3f",      "date": "2026-11-11",      "importer": {        "id": "co_8f3k2m9x4p1q",        "name": "SAMPLE NORTHFIELD HOME FURNISHINGS INC",        "country": "US"      },      "exporter": {        "id": "co_2c7h5n0w6r8t",        "name": "SAMPLE DONG NAI COMFORT FURNITURE CO LTD",        "country": "VN"      },      "hs_code": "940161",      "description": "UPHOLSTERED SOFA WITH WOODEN FRAME, FABRIC COVER",      "quantity": 291,      "quantity_unit": "CTN",      "weight_kg": 8115.4,      "value_usd": null,      "origin_country": "VN",      "loading_port": "Cat Lai",      "unloading_port": "Savannah, Georgia",      "transport": "sea",      "reported_by": {        "country": "US",        "flow": "import"      }    }  ],  "total": 1165783,  "has_more": true,  "next_cursor": "cur_Qm93c2VyLTEuMXJ6ZzQ",  "query": {    "hs_code": "940161",    "importer_country": "US",    "since": "2025-11-01",    "until": "2026-11-20",    "sort": "date_desc",    "data_through": "2026-11-11"  },  "notice": null,  "usage": {    "unit": "trade_record",    "records": 1,    "already_paid": 0,    "cost": 0.005,    "balance": 48.08,    "replayed": false  }}

Última atualização em