Docs menu
Get started
Using the API
API reference
Classification
Landed cost
Compliance
- POSTRegulate: find an agency product code
- POSTCheck restricted goods
- GETRestricted-goods checks
- GETAgency filing checks
- POSTCheck agency filings (Comply)
- POSTCross: classify, restrict, comply, regulate and calculate in one call
- GETYour restricted-goods rules
- POSTAdd a restricted-goods rule
- DELETERemove a restricted-goods rule
- POSTScreen a person or company
- GETYour screening checks
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
Check restricted goods
POST https://api.border.bot/v1/restrictions
Requires an access token from an API client (Authorization: Bearer <access_token>).
Check items against the destination’s import prohibitions and restrictions and, when originCountry is given, the origin’s export rules (sanctions, agency requirements such as FDA or APHIS), plus your own rules (/restrictions/rules). It costs the Restrict price per item (free by default; see GET /pricing) and is limited to 10 checks per minute per workspace (up to 100 items each). Destinations without coverage return 422 unsupported_country.
API client scope: compliance.
Request body (JSON)#
| Name | Type | Required | Description |
|---|---|---|---|
destinationCountry |
string | yes | Ship-to country — its import rules are checked. ISO 3166-1 alpha-2, case-insensitive. |
originCountry |
string | no | Ship-from country — its export rules are checked when given. ISO 3166-1 alpha-2, case-insensitive. |
items |
RestrictionItem[] | yes | 1–100 items. |
reference |
string | no | Your reference (an order or customer id), kept with the check as evidence. |
Responses#
200: Matches per item (an emptyrestrictionslist means nothing matched). (RestrictionsResponse)400: Invalid input (invalid_input). (Error)401: Missing, invalid or expired access token, or a revoked or expired API client (unauthorized). (Error)403: The API client doesn’t have thecompliancescope (forbidden,details.reason: "missing_scope"). (Error)422: Restricted-goods checks are not available for this destination (unsupported_country). (Error)429: Rate limited (rate_limited). Retry afterRetry-Afterseconds;RateLimitsays which limit was hit (r=0,tseconds until its window ends) andRateLimit-Policyits quota. (Error)500: Unexpected error (internal). (Error)502: The engine failed (upstream_error). (Error)504: The engine timed out (upstream_timeout). (Error)
Example request#
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": "LAMP-01",
"title": "Lithium battery desk lamp",
"hsCode": "9405.21"
}
]
}'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": "LAMP-01",
"title": "Lithium battery desk lamp",
"hsCode": "9405.21"
}
]
}),
});
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": "LAMP-01",
"title": "Lithium battery desk lamp",
"hsCode": "9405.21",
},
],
},
)
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' => 'LAMP-01',
'title' => 'Lithium battery desk lamp',
'hsCode' => '9405.21',
],
],
]),
]);
$data = json_decode(curl_exec($ch), true);Example response (200)#
{
"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
}