border.bot
Esc
  • Loading…
↑ ↓ to move↵ to openEsc to close
Docs menu

Duty stacking

POST https://api.border.bot/v1/calculate/stacking

Requires an access token from an API client (Authorization: Bearer <access_token>).

Which duty lines apply to a code from an origin on a date, without a shipment: the base duty, then every additional measure (Section 301, 232, reciprocal…), which exemption codes remove which, the measures that depend on metal content or a claim, and the claim codes you could file. Up to 100 lines; free unless your pricing says otherwise. Answers from border.bot’s own data: a destination it doesn’t cover returns 422 unsupported_country.

API client scope: calculate.

Headers#

Name Type Required Description
idempotency-key string no Make retries safe: a repeat with the same key returns the original result without charging again (keys are scoped to your workspace).

Request body (JSON)#

Name Type Required Description
items object[] yes

Responses#

  • 200: Each line’s stack. (StackingResponse)
  • 400: Invalid input (invalid_input). (Error)
  • 401: Missing, invalid or expired access token, or a revoked or expired API client (unauthorized). (Error)
  • 402: Not enough credits (insufficient_credits). Nothing was charged. (Error)
  • 403: Workspace suspended, action disabled, or the client lacks the scope (org_suspended, action_disabled, forbidden). (Error)
  • 409: A request with this Idempotency-Key is still in progress (conflict). (Error)
  • 422: A destination border.bot’s own data doesn’t cover yet (unsupported_country). (Error)
  • 429: Rate limited (rate_limited). Retry after Retry-After seconds; RateLimit says which limit was hit (r=0, t seconds until its window ends) and RateLimit-Policy its quota. (Error)
  • 500: Unexpected error (internal). (Error)
  • 502: The engine failed (upstream_error). The credits are refunded automatically. (Error)
  • 504: The engine timed out (upstream_timeout). The credits are refunded automatically. (Error)

Example request#

curl -X POST https://api.border.bot/v1/calculate/stacking \
  -H "Authorization: Bearer $BORDERBOT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "items": [
      {
        "hsCode": "8479.89.94",
        "originCountry": "CN",
        "destinationCountry": "US"
      }
    ]
  }'

Example response (200)#

JSON
{
  "data": {
    "results": [
      {
        "index": 0,
        "ref": "string",
        "hsCode": "string",
        "hsCodeFormatted": "string",
        "originCountry": "string",
        "destinationCountry": "string",
        "schedule": "string",
        "entryDate": "string",
        "rateFound": false,
        "lines": [
          {
            "kind": "base",
            "type": "string",
            "name": "string",
            "code": "string",
            "rate": "string",
            "exemptedBy": "string",
            "exemption": {
              "code": "9903.05.86",
              "name": "Products listed in U.S. note 52(b)",
              "application": "automatic",
              "kind": "string",
              "legalBasis": "U.S. note 52(b)",
              "sourceUrl": "https://www.federalregister.gov/d/2026-15181",
              "proof": null,
              "alternatives": [
                {
                  "code": "9903.05.86",
                  "name": "Products listed in U.S. note 52(b)",
                  "application": "automatic",
                  "kind": null,
                  "legalBasis": "U.S. note 52(b)",
                  "sourceUrl": "https://www.federalregister.gov/d/2026-15181"
                }
              ]
            },
            "legalBasis": "string",
            "sourceUrl": "string"
          }
        ],
        "conditional": [
          {
            "name": "string",
            "code": "string",
            "rate": "string",
            "condition": "string"
          }
        ],
        "claimable": [
          {
            "code": "9903.94.06",
            "name": "string",
            "affects": "string",
            "affectsCode": "9903.94.05",
            "kind": "string",
            "legalBasis": "U.S. note 33(h)",
            "sourceUrl": "string",
            "proof": "string",
            "condition": null
          }
        ],
        "entryCodes": [
          {
            "code": "9903.05.90",
            "role": "exemption",
            "name": "Goods under Section 232 aren’t subject to the forced-labour duties (U.S. note 52(f))",
            "type": "S301_FORCED_LABOUR",
            "lines": [
              "9903.05.31"
            ]
          },
          {
            "code": "9903.94.05",
            "role": "additional",
            "name": "Section 232 automobile parts (25%)",
            "type": "S232_AUTO_PARTS",
            "lines": [
              "9903.94.05"
            ]
          },
          {
            "code": "8471300100",
            "role": "tariff",
            "name": "General rate",
            "type": "CUSTOMS_DUTY",
            "lines": [
              "84713001"
            ]
          }
        ],
        "entryCodeOrder": {
          "label": "string",
          "url": "string"
        },
        "notes": [
          "string"
        ],
        "dataSource": {
          "version": "string",
          "importedAt": "string",
          "datasets": [
            {
              "dataset": "US:rates",
              "seq": 0,
              "releaseId": "0199c3a2-7b4e-7d21-9f3a-2c5e8b1d4f60",
              "version": "string",
              "liveSince": "string"
            }
          ]
        }
      }
    ]
  },
  "credits": {
    "charged": 0,
    "remaining": 0,
    "usageId": "string"
  },
  "replayed": false
}