Docs menu
Get started
API reference
Classification
Landed cost
Products
Compliance
Reference
Origin
Shipping documents
Bulk
Catalogue
- GETList products
- POSTCreate a product
- GETGet a product
- PATCHUpdate a product
- POSTArchive a product
- GETA product’s history
- GETA product’s codes
- POSTAdd a code
- POSTSuggest codes
- POSTApprove a code
- POSTReject a code
- POSTClassify many products
- GETYour imports
- POSTImport a CSV file
- GETAn import
- GETExport as CSV
- POSTSync records from a source
- GETApproved codes to write back
- GETCatalogue vocabularies
- GETSource kinds
- GETDefault target markets
- POSTSet default target markets
Products
Restrict
Check goods against a destination's import prohibitions and restrictions, agency requirements and the origin's export rules with the border.bot API, plus rules of your own, kept as evidence.
Restrict checks items against what the destination prohibits or restricts on import (agency requirements such as FDA or APHIS data at entry), what the origin restricts on export, and rules your workspace adds. The Restrict page explains how it works.
Endpoints#
| Endpoint | What it does |
|---|---|
POST /v1/restrictions |
Check up to 100 items |
GET /v1/restrictions/checks |
Your past checks, kept as evidence |
/v1/restrictions/rules |
List, add and remove your workspace's own rules |
Check items#
curl -X POST https://api.border.bot/v1/restrictions \
-H "Authorization: Bearer $BORDERBOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"destinationCountry": "US",
"originCountry": "CN",
"items": [
{
"sku": "LAPTOP-14",
"title": "14-inch laptop",
"hsCode": "8471.30.01.00"
}
]
}'const response = await fetch('https://api.border.bot/v1/restrictions', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.BORDERBOT_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"destinationCountry": "US",
"originCountry": "CN",
"items": [
{
"sku": "LAPTOP-14",
"title": "14-inch laptop",
"hsCode": "8471.30.01.00"
}
]
}),
});
const data = await response.json();import os
import requests
response = requests.post(
"https://api.border.bot/v1/restrictions",
headers={"Authorization": f"Bearer {os.environ['BORDERBOT_TOKEN']}"},
json={
"destinationCountry": "US",
"originCountry": "CN",
"items": [
{
"sku": "LAPTOP-14",
"title": "14-inch laptop",
"hsCode": "8471.30.01.00",
},
],
},
)
data = response.json()<?php
$ch = curl_init('https://api.border.bot/v1/restrictions');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('BORDERBOT_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'destinationCountry' => 'US',
'originCountry' => 'CN',
'items' => [
[
'sku' => 'LAPTOP-14',
'title' => '14-inch laptop',
'hsCode' => '8471.30.01.00',
],
],
]),
]);
$data = json_decode(curl_exec($ch), true);Give each item its code, a title or description, or both: codes match rules by prefix, and text matches rules by keywords (a keyword match is confirmed by a model and comes with a probability). With originCountry, the origin's export rules and sanctions are checked too.
What comes back#
For each item, its restrictions: each rule's type (prohibition, restriction or observation), the agency and whether its data is required or may_be_required, the title and summary, the source and the confidence. The check says whether anything is prohibited or restricted (hasProhibitions, hasRestrictions) and returns a checkId, the evidence that the goods were checked.
{
"data": {
"items": [
{
"sku": "LAPTOP-14",
"title": "14-inch laptop",
"hsCode": "8471300100",
"restrictions": [
{
"id": "restriction_17f4af75ba5554",
"source": "platform",
"hsCode": "8471300100",
"imposingCountry": "US",
"direction": "IMPORT",
"ruleType": "restriction",
"title": "FDA: may be required",
"summary": "FDA data may be required (radiation-emitting electronic products).",
"agency": "FDA",
"requirement": "may_be_required",
"sourceUrl": "https://www.cbp.gov/document/technical-documentation/ace-appendix-pga",
"confidence": "HIGH",
"probability": null
}
]
}
],
"matchCount": 1,
"hasProhibitions": false,
"hasRestrictions": true,
"upstreamRequestId": null,
"engine": "borderbot",
"checkId": "01a15ac1-27b3-72dd-9b4d-5e1f66b46892"
},
"credits": {
"charged": 0,
"remaining": 96,
"usageId": "usg_01m5dc29tdkdmpffnd43jmg1w5"
},
"replayed": false
}Costs and limits#
A restricted-goods check costs the Restrict price per item, free by default (GET /v1/pricing), and the response carries credits like other priced calls. Checks are limited to 10 checks a minute per workspace. A destination without coverage returns 422 unsupported_country.
Also from#
Last updated