{"openapi":"3.1.0","info":{"title":"HTS Pilot API","description":"HTS Pilot proposes tariff codes from a product description for three import markets, the United States (HTS), the\nEuropean Union (CN and TARIC) and Vietnam (the Vietnamese import tariff), with the reasons, the sources it used and\na review queue. The written documentation is at https://docs.htspilot.com/. This API does what the web application does: single lookups, batch files, a SKU catalog\nthat can be kept in step with an ERP or PIM, tariff data and duty estimates, usage, and the review queue.\n\nA result is a suggestion for reference. It is not a classification decision by a customs authority: the declarant\nand the authority decide. Duty and landed cost figures are estimates.\n\n## Authentication\n\nSend your API key in the `X-API-Key` header on every request:\n\n```\ncurl -H \"X-API-Key: YOUR_API_KEY\" https://htspilot.com/api/usage/me\n```\n\nAn administrator creates keys in the application under Admin, API keys. The key is shown once, when it is\ncreated. A key has a role (user, reviewer or admin) that never exceeds the role of the account that created it,\nand it can be revoked at any time. In the API explorer, press **Authorize** and paste the key: it is kept in\nmemory for that tab only and is gone when the page is reloaded.\n\nThe web application itself signs in with a session token sent as `Authorization: Bearer <token>`. Sessions are for\nthe application; integrations use an API key.\n\n## Calls from the API explorer are real\n\n\"Try it out\" sends the request to the live API with your key. A lookup spends credits, and anything you create,\nchange or delete here is created, changed or deleted in your account. Operations that change data say so in\nbold, and their ids are never filled in for you: type the id of the lookup, batch, SKU, alert or webhook you\nmean. The example SKUs are named `EXAMPLE-...` so that they cannot overwrite one of yours.\n\n## Conventions\n\n- Every path starts with `/api`. Requests and responses are JSON unless an operation says otherwise (file upload,\n  Excel and CSV downloads).\n- Lookups run in the background. `POST /api/classify` answers `202` with a lookup whose `status` is `queued`;\n  read `GET /api/lookups/{lookup_id}` until the status is no longer `queued` or `processing`, or subscribe to the\n  `lookup.completed` webhook. A batch is polled with `GET /api/batches/{batch_id}/progress`.\n- Errors carry a message in `detail`: `401` without a valid key, `403` when the role or the plan does not allow\n  the call, `402` when the credits are used up, `404` for something that does not exist or belongs to another\n  user, `409` when the state does not allow the call, `422` for invalid input (with `errors`, one entry per field).\n- Send `Accept-Language: en`, `vi`, `ja` or `ko` to get labels and messages in that language. The answer names its\n  language in `Content-Language`.\n- A lookup has an answer language of its own, returned as `language`: the optional `language` of\n  `POST /api/classify`, else the language of the request. The written reasons, the missing information, the\n  questions with their options and the legal findings of a lookup are returned in that language to every reader.\n  `review_flags` (and `result.flags`), status labels, the names of the checks, the disclaimer and legal notes\n  follow `Accept-Language`. This changed: questions, missing information and legal findings used to follow\n  `Accept-Language` on every read. A client that relied on that header for them now sets `language` when it\n  creates the lookup.\n- Users with the user role see their own lookups and batches. Reviewers and admins see all of them.\n\n## Webhooks\n\nRegister a URL under Webhooks (admin role). The API then sends an HTTP `POST` to it for the events\n`lookup.completed`, `lookup.decided`, `batch.completed`, `tariff.changed` and `sku.alert`, or for the ones you\nchose. The test call sends the event `ping`.\n\nThe body is JSON:\n\n```\n{\"event\": \"lookup.completed\", \"created_at\": \"2026-10-03T08:15:30.123456+00:00\", \"data\": {...}, \"id\": 4821}\n```\n\n| Header | Value |\n| --- | --- |\n| `Content-Type` | `application/json` |\n| `X-HTS-Event` | The event name |\n| `X-HTS-Delivery` | The delivery id, the same number as `id` in the body |\n| `X-HTS-Signature` | `sha256=` followed by the hex HMAC-SHA256 of the raw body, keyed with the webhook secret |\n| `User-Agent` | `HTS-Pilot-webhook/1.0` |\n\nCheck the signature against the raw bytes you received, before parsing them:\n\n```python\nimport hashlib, hmac\n\ndef is_ours(secret: str, raw_body: bytes, signature_header: str) -> bool:\n    expected = \"sha256=\" + hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()\n    return hmac.compare_digest(expected, signature_header)\n```\n\nAnswer with a `2xx` status promptly: a delivery times out after a short period. Any other answer, a timeout or a\nconnection error counts as a failure, and a delivery is attempted up to 3 times, with a short pause between\nattempts. Redirects are not\nfollowed. The same event can arrive more than once: use `id` to ignore a repeat. The URL must be `https` and must\nresolve to a public address; it is checked when it is registered and again before every delivery.\n\n## Errors and request identifiers\n\nEvery answer the API writes, successful or not, carries the header `X-Request-ID`: an identifier the API makes for\nthat one call, 32 hexadecimal characters. It is what to quote when you report a problem: support finds the\ncall with it.\n\nYou may also send a reference of your own in `X-Request-ID` with a request, to match a call with your own logs:\n8 to 64 characters of letters, digits, `.`, `_` and `-`, the first one a letter\nor a digit. It never replaces the identifier of the API. It comes back in the header `X-Client-Request-ID` and is\nrecorded next to the call. A value of any other shape is ignored, without an error. Sending one is optional.\n\nAn error is JSON with a message in `detail`, written in the language of the request, and a `code` that is the\nsame in every language:\n\n```\n{\"detail\": \"Lookup not found\", \"code\": \"not_found\"}\n```\n\nBranch on `code` and show `detail`. `details` (an object) and `errors` (one entry per invalid field) are added\nwhere there is more to say. An unexpected failure answers `500` and repeats the identifier in the body:\n\n```\n{\"detail\": \"System error, please try again later\", \"code\": \"internal_error\", \"request_id\": \"5f0c2a9e4b7d4e0f9a1b2c3d4e5f6a7b\"}\n```\n\n| Code | Status | Meaning |\n| --- | --- | --- |\n| `bad_request` | `400` | The request cannot be carried out as it was sent. |\n| `unauthenticated` | `401` | No valid API key or session was sent, or the credentials were not accepted. |\n| `out_of_credits` | `402` | The credits of the account are used up. |\n| `payment_required` | `402` | The call needs something the account has not paid for. |\n| `forbidden` | `403` | The call is refused for this caller, usually because of its role. |\n| `plan_feature` | `403` | The plan of the account does not include this function. `details.key` names it. |\n| `plan_limit` | `403` | The call goes over a limit of the plan. `details` has the limit and what was asked. |\n| `not_found` | `404` | The address or the record does not exist, or belongs to another user. |\n| `method_not_allowed` | `405` | The address exists and does not take this method. |\n| `conflict` | `409` | The state of the record does not allow the call, for example a lookup that is still being processed or is already decided. |\n| `payload_too_large` | `413` | The body or the file sent is larger than the API accepts. |\n| `validation_error` | `422` | The input is not valid. `errors` or `details` say which field. |\n| `rate_limited` | `429` | Too many calls in a short time. Wait before trying again: `Retry-After`, when the answer has it, says how many seconds. |\n| `internal_error` | `500` | An unexpected failure. The body also carries `request_id`. |\n| `upstream_error` | `502` | A service this API depends on failed or did not answer. Try again later. |\n| `service_unavailable` | `503` | The function is not available at the moment. Try again later. |\n\nMore specific codes may be added later. Treat a code you do not know like the status it came with.\n\nAn answer that was produced before the request reached the API may carry neither the header nor a `code`: a\n`502`, `503` or `504` during an outage or a release, or a refusal at the edge of the network. Fall back on the\nHTTP status then, and quote the time of the call when you report it.\n\nThe page you are reading shows the response headers this host lets a browser read, and the two headers above may\nnot be among them. A call made from your own system receives them.\n","version":"1.0.0"},"servers":[{"url":"https://htspilot.com"}],"paths":{"/api/classify":{"post":{"tags":["Lookups"],"summary":"Classify a product (in the background)","description":"**Changes data in your account when executed.** Creates a lookup with the status `queued` and classifies it in the background. Read `GET /api/lookups/{lookup_id}` until the status is no longer `queued` or `processing`. Spends credits.","operationId":"classifyProduct","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifyRequest"},"example":{"description":"Men's T-shirt, knitted, 100% cotton, short sleeves, crew neck","material":"cotton","use":"apparel","composition":"100% cotton","origin":"VN","notes":"","market":"US","language":"en"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupDetail"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/lookups":{"get":{"tags":["Lookups"],"summary":"Lookup history","operationId":"listLookups","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Q"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Status"}},{"name":"market","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}},{"name":"decision","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"},"example":1},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Page Size"},"example":20},{"name":"sort","in":"query","required":false,"schema":{"enum":["newest","oldest","confidence","risk"],"type":"string","description":"newest (default), oldest, confidence (least certain first), or risk (highest first, then oldest first). With confidence, queued, processing and failed lookups (confidence 0.0) come first","default":"newest","title":"Sort"},"description":"newest (default), oldest, confidence (least certain first), or risk (highest first, then oldest first). With confidence, queued, processing and failed lookups (confidence 0.0) come first"},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Created on or after this day (UTC)","title":"Date From"},"description":"Created on or after this day (UTC)"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Created on or before this day (UTC)","title":"Date To"},"description":"Created on or before this day (UTC)"},{"name":"created_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"description":"User id, or 'me'","title":"Created By"},"description":"User id, or 'me'"},{"name":"confidence_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}],"title":"Confidence Min"}},{"name":"confidence_max","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}],"title":"Confidence Max"}},{"name":"flag","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9_]{1,40}$"},{"type":"null"}],"description":"Review flag code, e.g. low_confidence","title":"Flag"},"description":"Review flag code, e.g. low_confidence"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/lookups/{lookup_id}":{"get":{"tags":["Lookups"],"summary":"Get a lookup: status, recommended code, candidates, reasons and sources","operationId":"getLookup","parameters":[{"name":"lookup_id","in":"path","required":true,"schema":{"type":"string","title":"Lookup Id"},"example":"5f0c2a9e4b7d4e0f9a1b2c3d4e5f6a7b"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupDetail"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/lookups/{lookup_id}/rerun":{"post":{"tags":["Lookups"],"summary":"Add information and rerun (in the background)","operationId":"rerunLookup","parameters":[{"name":"lookup_id","in":"path","required":true,"schema":{"type":"string","title":"Lookup Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RerunRequest"},"example":{"composition":"60% cotton, 40% polyester","notes":"Crew neck, no pockets"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupDetail"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** Runs the lookup again with the fields you send added to, or replacing, the ones it had. The answer is a new lookup; the old one is marked resolved. It is written in the language of the lookup it continues, unless the request names another `language`. Spends credits."}},"/api/stats":{"get":{"tags":["Lookups"],"summary":"Lookups per status, items waiting for review and open alerts","operationId":"getLookupCounts","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/review":{"get":{"tags":["Review"],"summary":"Review queue","operationId":"listReviewQueue","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Q"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Status"}},{"name":"market","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market"}},{"name":"include_resolved","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Resolved"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"},"example":1},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Page Size"},"example":20},{"name":"sort","in":"query","required":false,"schema":{"enum":["newest","oldest","confidence","risk"],"type":"string","description":"newest (default), oldest, confidence (least certain first), or risk (highest first, then oldest first). With confidence, failed lookups (confidence 0.0) come first","default":"newest","title":"Sort"},"description":"newest (default), oldest, confidence (least certain first), or risk (highest first, then oldest first). With confidence, failed lookups (confidence 0.0) come first","example":"risk"},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Created on or after this day (UTC)","title":"Date From"},"description":"Created on or after this day (UTC)"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Created on or before this day (UTC)","title":"Date To"},"description":"Created on or before this day (UTC)"},{"name":"created_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"description":"User id, or 'me'","title":"Created By"},"description":"User id, or 'me'"},{"name":"confidence_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}],"title":"Confidence Min"}},{"name":"confidence_max","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}],"title":"Confidence Max"}},{"name":"flag","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9_]{1,40}$"},{"type":"null"}],"description":"Review flag code, e.g. low_confidence","title":"Flag"},"description":"Review flag code, e.g. low_confidence"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"Lookups that need information, need review or failed, and have no decision yet."}},"/api/review/counts":{"get":{"tags":["Review"],"summary":"Review queue: how many items per status","description":"The number of queue items per status, for the same filters as `GET /api/review`.","operationId":"countReviewQueue","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Q"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Status"}},{"name":"market","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market"}},{"name":"include_resolved","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Resolved"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Created on or after this day (UTC)","title":"Date From"},"description":"Created on or after this day (UTC)"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Created on or before this day (UTC)","title":"Date To"},"description":"Created on or before this day (UTC)"},{"name":"created_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"description":"User id, or 'me'","title":"Created By"},"description":"User id, or 'me'"},{"name":"confidence_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}],"title":"Confidence Min"}},{"name":"confidence_max","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1,"minimum":0},{"type":"null"}],"title":"Confidence Max"}},{"name":"flag","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9_]{1,40}$"},{"type":"null"}],"description":"Review flag code, e.g. low_confidence","title":"Flag"},"description":"Review flag code, e.g. low_confidence"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCounts"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/lookups/{lookup_id}/decision":{"post":{"tags":["Review"],"summary":"Approve, override or reject the proposed code, reopen a decision, or comment","operationId":"decideLookup","parameters":[{"name":"lookup_id","in":"path","required":true,"schema":{"type":"string","title":"Lookup Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionRequest"},"example":{"action":"approve","note":"Checked against the heading notes"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupDetail"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** `approve` accepts the recommended code. `override` needs `code`, a declarable line of the lookup's tariff schedule, and a `note` with the reason. `reject` needs a `note`. `reopen` removes a decision. `comment` adds a note without deciding. Needs the reviewer or the admin role."}},"/api/lookups/{lookup_id}/resolve":{"post":{"tags":["Review"],"summary":"Take a lookup out of the queue without deciding on a code","operationId":"resolveLookup","parameters":[{"name":"lookup_id","in":"path","required":true,"schema":{"type":"string","title":"Lookup Id"}},{"name":"resolved","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Resolved"},"example":true}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupSummary"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** Needs the reviewer or the admin role."}},"/api/batches/template":{"get":{"tags":["Batches"],"summary":"Download the Excel template","operationId":"getBatchTemplate","responses":{"200":{"description":"The file","content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"An .xlsx file with the columns `description`, `material`, `use`, `composition`, `origin`, `notes`, `sku` and `hts_code`, example rows and a guide sheet."}},"/api/batches":{"post":{"tags":["Batches"],"summary":"Upload an .xlsx or .csv file","operationId":"uploadBatch","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/BatchUpload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchOut"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** Send the file as `multipart/form-data` in the field `file`. The first row holds the column names; `GET /api/batches/template` gives a file to start from. The answer lists the columns found, a suggested mapping and a preview; nothing is classified until the batch is started."},"get":{"tags":["Batches"],"summary":"List batches, newest first","operationId":"listBatches","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BatchOut"}}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/batches/{batch_id}":{"get":{"tags":["Batches"],"summary":"Get a batch","operationId":"getBatch","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"},"example":"5f0c2a9e4b7d4e0f9a1b2c3d4e5f6a7b"},{"name":"preview","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Preview"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchOut"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/batches/{batch_id}/progress":{"get":{"tags":["Batches"],"summary":"Status and counts of a batch, for polling","description":"The status, the counters and `version`, a token that changes whenever the batch or its rows changed. Poll this and read the rows again only when `version` differs from the one last seen. The token is opaque: compare it, do not parse it.","operationId":"getBatchProgress","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"},"example":"5f0c2a9e4b7d4e0f9a1b2c3d4e5f6a7b"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchProgressOut"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/batches/{batch_id}/validate":{"post":{"tags":["Batches"],"summary":"Check the rows with the chosen columns, without classifying","operationId":"validateBatch","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchStartRequest"},"example":{"column_mapping":{"description":"description","material":"material","origin":"origin","sku":"sku","existing_code":"hts_code"},"market":"US","save_to_catalog":false}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchOut"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.**"}},"/api/batches/{batch_id}/start":{"post":{"tags":["Batches"],"summary":"Start classifying a batch","operationId":"startBatch","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchStartRequest"},"example":{"column_mapping":{"description":"description","material":"material","origin":"origin","sku":"sku","existing_code":"hts_code"},"market":"US","save_to_catalog":false}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchOut"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** `column_mapping` names the column of the file for each field; only `description` is required. Spends credits for every row that is classified."}},"/api/batches/{batch_id}/rows":{"get":{"tags":["Batches"],"summary":"Rows of a batch with their results","operationId":"listBatchRows","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"},"example":"5f0c2a9e4b7d4e0f9a1b2c3d4e5f6a7b"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":1,"default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BatchRowOut"}}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/batches/{batch_id}/retry":{"post":{"tags":["Batches"],"summary":"Retry failed rows","operationId":"retryBatch","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchOut"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.**"}},"/api/batches/{batch_id}/rows/{row_index}":{"patch":{"tags":["Batches"],"summary":"Edit a row and reprocess it","operationId":"editBatchRow","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}},{"name":"row_index","in":"path","required":true,"schema":{"type":"integer","title":"Row Index"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RowEdit"},"example":{"values":{"description":"Men's T-shirt, knitted, 100% cotton, short sleeves"}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchOut"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** `values` maps column names of the file to their new text. `row_index` is the row number in the file (the first data row is 2)."}},"/api/batches/{batch_id}/export":{"get":{"tags":["Batches"],"summary":"Download results as Excel","operationId":"exportBatch","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"},"example":"5f0c2a9e4b7d4e0f9a1b2c3d4e5f6a7b"}],"responses":{"200":{"description":"The file","content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/skus":{"get":{"tags":["Catalog"],"summary":"List SKUs","operationId":"listSkus","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Q"}},{"name":"market","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market"}},{"name":"code_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code Status"}},{"name":"has_code","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"true: only SKUs with an existing code; false: only without","title":"Has Code"},"description":"true: only SKUs with an existing code; false: only without"},{"name":"has_alert","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"true: only SKUs with an open alert; false: only without","title":"Has Alert"},"description":"true: only SKUs with an open alert; false: only without"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"},"example":1},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Page Size"},"example":50}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}},"post":{"tags":["Catalog"],"summary":"Create a SKU, or update it when it exists","operationId":"createSku","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkuIn"},"example":{"sku":"EXAMPLE-TSH-001","market":"US","description":"Men's T-shirt, knitted, 100% cotton, short sleeves","material":"cotton","use":"apparel","composition":"100% cotton","origin":"VN","notes":"","external_ref":"ERP-100045","current_code":"6109.10.00.12"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** A SKU is identified by `sku` and `market`. `current_code`, when given, is checked against the active tariff schedule of the market."}},"/api/skus/template":{"get":{"tags":["Catalog"],"summary":"Download the Excel template of the SKU import","description":"An .xlsx file with the import columns and their lists: the countries of origin and the markets that are loaded.","operationId":"getSkuTemplate","responses":{"200":{"description":"The file","content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/skus/bulk":{"post":{"tags":["Catalog"],"summary":"Create or update many SKUs at once","operationId":"syncSkus","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRequest"},"example":{"items":[{"sku":"EXAMPLE-TSH-001","market":"US","description":"Men's T-shirt, knitted, 100% cotton, short sleeves","material":"cotton","use":"apparel","composition":"100% cotton","origin":"VN","notes":"","external_ref":"ERP-100045","current_code":"6109.10.00.12"},{"sku":"EXAMPLE-TWL-014","market":"US","description":"Cotton terry bath towel, 70 x 140 cm","origin":"IN","external_ref":"ERP-100046"}],"check_codes":true,"classify_missing":false}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** Up to 5000 items per call. With `check_codes` every `current_code` is checked against the active tariff schedule. With `classify_missing` the SKUs without a code are classified in the background, which spends credits."}},"/api/skus/{sku_id}":{"get":{"tags":["Catalog"],"summary":"Get a SKU with its alerts","operationId":"getSku","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"integer","title":"Sku Id"},"example":1}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}},"put":{"tags":["Catalog"],"summary":"Replace the details of a SKU","operationId":"updateSku","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"integer","title":"Sku Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkuIn"},"example":{"sku":"EXAMPLE-TSH-001","market":"US","description":"Men's T-shirt, knitted, 100% cotton, short sleeves","material":"cotton","use":"apparel","composition":"100% cotton","origin":"VN","notes":"","external_ref":"ERP-100045","current_code":"6109.10.00.12"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** `sku` and `market` identify the SKU and are not changed."},"delete":{"tags":["Catalog"],"summary":"Delete a SKU","operationId":"deleteSku","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"integer","title":"Sku Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Deletes for real when executed, and cannot be undone.** Needs the reviewer or the admin role."}},"/api/skus/{sku_id}/classify":{"post":{"tags":["Catalog"],"summary":"Classify a SKU and save the suggested code","operationId":"classifySku","parameters":[{"name":"sku_id","in":"path","required":true,"schema":{"type":"integer","title":"Sku Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** Runs a lookup for the SKU and stores the result as its suggested code. Spends credits."}},"/api/skus/check":{"post":{"tags":["Catalog"],"summary":"Check the codes in use against the active tariff schedule","operationId":"checkSkuCodes","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckRequest"},"example":{"market":"US"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** Checks every SKU that has a `current_code`, or only those of one market or the ones listed in `sku_ids`."}},"/api/alerts":{"get":{"tags":["Catalog"],"summary":"Alerts for SKUs affected by a change of the tariff schedule","operationId":"listAlerts","parameters":[{"name":"open_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Open Only"}},{"name":"sku_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sku Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/alerts/{alert_id}/ack":{"post":{"tags":["Catalog"],"summary":"Acknowledge an alert","operationId":"acknowledgeAlert","parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"integer","title":"Alert Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** Needs the reviewer or the admin role."}},"/api/countries":{"get":{"tags":["Tariff data"],"summary":"Countries of origin, named in the language of the request","description":"The values `origin` accepts on a lookup and on a SKU.","operationId":"listCountries","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/datasets":{"get":{"tags":["Tariff data"],"summary":"The tariff schedules that are loaded: market, version, source and effective date","operationId":"listDatasets","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DatasetOut"}}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/datasets/{dataset_id}/entries":{"get":{"tags":["Tariff data"],"summary":"Lines of one tariff schedule, by code prefix or by text","operationId":"listDatasetEntries","parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","title":"Dataset Id"},"example":"5f0c2a9e4b7d4e0f9a1b2c3d4e5f6a7b"},{"name":"code","in":"query","required":false,"schema":{"type":"string","maxLength":16,"default":"","title":"Code"},"example":"6109"},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200,"default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"},"example":50}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/hts/search":{"get":{"tags":["Tariff data"],"summary":"Search the tariff by code or keyword","operationId":"searchTariff","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Q"},"example":"cotton t-shirt"},{"name":"market","in":"query","required":false,"schema":{"type":"string","default":"","title":"Market"},"example":"US"},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"},"example":20}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/hts/tree":{"get":{"tags":["Tariff data"],"summary":"A code in the tree: its ancestors, children and siblings","operationId":"getTariffTree","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"title":"Code"},"example":"6109"},{"name":"market","in":"query","required":false,"schema":{"type":"string","default":"","title":"Market"},"example":"US"},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/hts/duty-estimate":{"post":{"tags":["Tariff data"],"summary":"Estimate import duty and landed cost","operationId":"estimateDuty","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DutyRequest"},"example":{"code":"6109.10.00.12","market":"US","origin":"VN","customs_value":10000,"quantity":1200,"freight":800,"insurance":50,"mode":"sea"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"An estimate for one declarable line and one origin. It is not a duty assessment."}},"/api/hts/compliance":{"get":{"tags":["Tariff data"],"summary":"Hints on agency requirements, anti-dumping and countervailing duties and trade preferences","operationId":"getComplianceHints","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","maxLength":24,"title":"Code"},"example":"6109.10.00.12"},{"name":"market","in":"query","required":false,"schema":{"type":"string","default":"US","title":"Market"},"example":"US"},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"}},{"name":"origin","in":"query","required":false,"schema":{"type":"string","default":"","title":"Origin"},"example":"CN"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/hts/rulings/{number}":{"get":{"tags":["Tariff data"],"summary":"Full text of a CBP CROSS ruling","operationId":"getRuling","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string","title":"Number"},"example":"N301234"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/tariff-changes/versions":{"get":{"tags":["Tariff data"],"summary":"Versions that changed a tariff schedule, with the number of changes of each kind","operationId":"listTariffChangeVersions","parameters":[{"name":"market","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/tariff-changes":{"get":{"tags":["Tariff data"],"summary":"Changes between two versions of a tariff schedule","operationId":"listTariffChanges","parameters":[{"name":"market","in":"query","required":false,"schema":{"type":"string","default":"US","title":"Market"},"example":"US"},{"name":"to_version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Version"}},{"name":"change_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Type"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":1,"default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/usage/me":{"get":{"tags":["Usage"],"summary":"Credit balance, lookups and credit history","operationId":"getMyUsage","parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/usage/ledger":{"get":{"tags":["Usage"],"summary":"Credit ledger: grants, adjustments and lookup fees","operationId":"listLedger","parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"User Id"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"enum":["signup","grant","usage"],"type":"string"},{"type":"null"}],"title":"Kind"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"},"example":1},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":25,"title":"Page Size"},"example":25}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/usage/ledger/export":{"get":{"tags":["Usage"],"summary":"The credit ledger as a CSV file (same filters as the ledger)","operationId":"exportLedger","parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"User Id"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"enum":["signup","grant","usage"],"type":"string"},{"type":"null"}],"title":"Kind"}}],"responses":{"200":{"description":"The file","content":{"text/csv":{"schema":{"type":"string","format":"binary"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/plans/me":{"get":{"tags":["Usage"],"summary":"The plan of the account and what it allows","operationId":"getMyPlan","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}},"/api/webhooks/events":{"get":{"tags":["Webhooks"],"summary":"Event names and their labels","operationId":"listWebhookEvents","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"Needs the admin role."}},"/api/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhooks","operationId":"listWebhooks","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"Needs the admin role."},"post":{"tags":["Webhooks"],"summary":"Register a webhook","operationId":"createWebhook","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreate"},"example":{"url":"https://erp.example.com/hooks/hts-pilot","events":["lookup.completed","lookup.decided"]}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** The answer contains `secret`, the key of the `X-HTS-Signature` header. It is shown only here. Leave `events` empty to receive every event. The URL must be `https` and resolve to a public address. Needs the admin role."}},"/api/webhooks/{hook_id}":{"patch":{"tags":["Webhooks"],"summary":"Change the URL or the events of a webhook, or pause it","operationId":"updateWebhook","parameters":[{"name":"hook_id","in":"path","required":true,"schema":{"type":"string","title":"Hook Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookUpdate"},"example":{"active":false}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** Needs the admin role."},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook","operationId":"deleteWebhook","parameters":[{"name":"hook_id","in":"path","required":true,"schema":{"type":"string","title":"Hook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Deletes for real when executed, and cannot be undone.** Needs the admin role."}},"/api/webhooks/{hook_id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a test event","operationId":"testWebhook","parameters":[{"name":"hook_id","in":"path","required":true,"schema":{"type":"string","title":"Hook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"**Changes data in your account when executed.** Sends the event `ping` now, with the same body shape, headers and signature as a real event, and answers with the result. Needs the admin role."}},"/api/webhooks/{hook_id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"The last 50 deliveries of a webhook","operationId":"listWebhookDeliveries","parameters":[{"name":"hook_id","in":"path","required":true,"schema":{"type":"string","title":"Hook Id"},"example":"5f0c2a9e4b7d4e0f9a1b2c3d4e5f6a7b"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"Needs the admin role."}},"/api/reports/productivity":{"get":{"tags":["Reports"],"summary":"Lookups, decisions and decision times for a period (the last 30 days by default)","operationId":"getProductivityReport","parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"description":"Needs the reviewer or the admin role."}},"/api/health":{"get":{"tags":["System"],"summary":"Service status","description":"Answers `200` while the service is up. `status` is `ok` or `degraded`, with the reasons in `issues`. No key is needed.","operationId":"getHealth","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}},"security":[]}},"/api/auth/me":{"get":{"tags":["System"],"summary":"The account and role behind the API key","operationId":"getMe","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"401":{"description":"No valid API key was sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"403":{"description":"The role of the key, or the plan of the account, does not allow this call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"422":{"description":"The request is not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}},"500":{"description":"An unexpected failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalError"}}},"headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Client-Request-ID":{"$ref":"#/components/headers/ClientRequestId"}}}}}}},"components":{"schemas":{"BatchOut":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"filename":{"type":"string","title":"Filename"},"status":{"type":"string","title":"Status"},"columns":{"items":{},"type":"array","title":"Columns"},"column_mapping":{"type":"object","title":"Column Mapping"},"market":{"type":"string","title":"Market"},"dataset_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset Version"},"validation":{"type":"object","title":"Validation"},"total_rows":{"type":"integer","title":"Total Rows"},"processed_rows":{"type":"integer","title":"Processed Rows"},"failed_rows":{"type":"integer","title":"Failed Rows"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"save_to_catalog":{"type":"boolean","title":"Save To Catalog","default":false},"counts":{"type":"object","title":"Counts"},"preview":{"items":{"type":"object"},"type":"array","title":"Preview"}},"type":"object","required":["id","created_at","updated_at","filename","status","columns","column_mapping","market","dataset_version","validation","total_rows","processed_rows","failed_rows","error"],"title":"BatchOut"},"BatchProgressOut":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"total_rows":{"type":"integer","title":"Total Rows"},"processed_rows":{"type":"integer","title":"Processed Rows"},"failed_rows":{"type":"integer","title":"Failed Rows"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"},"version":{"type":"string","title":"Version"}},"type":"object","required":["id","status","updated_at","total_rows","processed_rows","failed_rows","error","counts","version"],"title":"BatchProgressOut","description":"The part of a batch that changes while it runs (GET /batches/{id}/progress)."},"BatchRowOut":{"properties":{"row_index":{"type":"integer","title":"Row Index"},"raw":{"type":"object","title":"Raw"},"status":{"type":"string","title":"Status"},"issues":{"items":{},"type":"array","title":"Issues"},"duplicate_of":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duplicate Of"},"lookup_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lookup Id"},"attempts":{"type":"integer","title":"Attempts"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"result_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result Status"},"recommended_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommended Code"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"code_check":{"type":"object","title":"Code Check"},"final_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Code"}},"type":"object","required":["row_index","raw","status","issues","duplicate_of","lookup_id","attempts","error"],"title":"BatchRowOut"},"BatchStartRequest":{"properties":{"column_mapping":{"$ref":"#/components/schemas/ColumnMapping"},"market":{"type":"string","maxLength":8,"title":"Market","default":""},"tariff_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tariff Version"},"save_to_catalog":{"type":"boolean","title":"Save To Catalog","description":"Save/update the SKU in the shared catalog (requires a sku column)","default":false}},"type":"object","required":["column_mapping"],"title":"BatchStartRequest"},"BatchUpload":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"BatchUpload"},"BulkRequest":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SkuIn"},"type":"array","maxItems":5000,"title":"Items"},"check_codes":{"type":"boolean","title":"Check Codes","default":true},"classify_missing":{"type":"boolean","title":"Classify Missing","description":"Classify SKUs without a code (in the background)","default":false}},"type":"object","required":["items"],"title":"BulkRequest"},"CheckRequest":{"properties":{"market":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market"},"sku_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Sku Ids"}},"type":"object","title":"CheckRequest"},"ClassifyRequest":{"properties":{"description":{"type":"string","maxLength":2000,"minLength":1,"title":"Description","description":"Product description"},"material":{"type":"string","maxLength":500,"title":"Material","default":""},"use":{"type":"string","maxLength":500,"title":"Use","default":""},"composition":{"type":"string","maxLength":500,"title":"Composition","default":""},"origin":{"type":"string","maxLength":100,"title":"Origin","default":""},"notes":{"type":"string","maxLength":1000,"title":"Notes","description":"Other additional information","default":""},"market":{"type":"string","maxLength":8,"title":"Market","description":"Import market: US, EU or VN","default":""},"tariff_version":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Tariff Version"},"sku_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sku Id","description":"Link the result to a SKU in the catalog"},"language":{"anyOf":[{"type":"string","maxLength":35},{"type":"null"}],"enum":["vi","en","ja","ko",null],"title":"Language","description":"Language the answer is written in: the reasons and explanations, the questions about missing information with their options, the legal findings and the warnings. A tag with a region is read by its primary subtag (`en-US` is `en`, `ko-KR` is `ko`), in any case. Without it: the language of the request (Accept-Language). Review flags, status labels and the other responses are not affected: they follow `Accept-Language`."}},"type":"object","required":["description"],"title":"ClassifyRequest"},"ColumnMapping":{"properties":{"description":{"type":"string","title":"Description"},"material":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Material"},"use":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Use"},"composition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Composition"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"existing_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Existing Code","description":"Column with the HTS code currently in use: it is checked for validity and compared with the suggestion"}},"type":"object","required":["description"],"title":"ColumnMapping"},"DatasetOut":{"properties":{"id":{"type":"string","title":"Id"},"market":{"type":"string","title":"Market"},"version":{"type":"string","title":"Version"},"name":{"type":"string","title":"Name"},"national_digits":{"type":"integer","title":"National Digits"},"source_name":{"type":"string","title":"Source Name"},"source_url":{"type":"string","title":"Source Url"},"is_demo":{"type":"boolean","title":"Is Demo"},"active":{"type":"boolean","title":"Active"},"entry_count":{"type":"integer","title":"Entry Count"},"loaded_at":{"type":"string","format":"date-time","title":"Loaded At"},"official_domains":{"items":{},"type":"array","title":"Official Domains"},"notes":{"type":"string","title":"Notes"},"effective_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Effective Date"},"superseded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Superseded At"}},"type":"object","required":["id","market","version","name","national_digits","source_name","source_url","is_demo","active","entry_count","loaded_at","official_domains","notes"],"title":"DatasetOut"},"DecisionRequest":{"properties":{"action":{"type":"string","enum":["approve","override","reject","reopen","comment"],"title":"Action"},"code":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"title":"Code","description":"Final code when action=override"},"note":{"type":"string","maxLength":2000,"title":"Note","default":""}},"type":"object","required":["action"],"title":"DecisionRequest"},"DutyRequest":{"properties":{"code":{"type":"string","maxLength":24,"title":"Code"},"market":{"type":"string","maxLength":8,"title":"Market","default":"US"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"import_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Import Date","description":"Expected import date: selects the tariff schedule version in effect on that day"},"origin":{"type":"string","maxLength":100,"title":"Origin","default":""},"customs_value":{"type":"number","minimum":0,"title":"Customs Value","description":"Customs value in the estimate's `currency` (USD; EUR for EU; VND for VN)"},"quantity":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"title":"Quantity","description":"Quantity in the unit of measure (pieces, pairs, dozens...)"},"weight_kg":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"title":"Weight Kg"},"freight":{"type":"number","minimum":0,"title":"Freight","default":0},"insurance":{"type":"number","minimum":0,"title":"Insurance","default":0},"mode":{"type":"string","pattern":"^(sea|air|land)$","title":"Mode","default":"sea"}},"type":"object","required":["code","customs_value"],"title":"DutyRequest"},"LookupDetail":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"kind":{"type":"string","title":"Kind"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"},"row_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Row Index"},"parent_lookup_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Lookup Id"},"description":{"type":"string","title":"Description"},"market":{"type":"string","title":"Market"},"dataset_version":{"type":"string","title":"Dataset Version"},"status":{"type":"string","title":"Status"},"status_label":{"type":"string","title":"Status Label"},"recommended_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommended Code"},"recommended_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommended Description"},"hs6":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hs6"},"confidence":{"type":"number","title":"Confidence"},"review_flags":{"items":{},"type":"array","title":"Review Flags"},"risk":{"type":"integer","title":"Risk"},"risk_level":{"type":"string","enum":["high","medium","low"],"title":"Risk Level"},"resolved":{"type":"boolean","title":"Resolved"},"processing_ms":{"type":"integer","title":"Processing Ms"},"decision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision"},"decision_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Label"},"final_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Code"},"decided_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Decided At"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Name"},"sku_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sku Id"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","description":"Language the answer is, or will be, written in: vi, en, ja or ko. In the detail, the written reasons, the questions with their options, the missing information and the legal findings are in it for every reader. `review_flags` is not: it follows `Accept-Language`"},"comment_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Comment Count"},"input":{"type":"object","title":"Input"},"origin_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin Label"},"normalized":{"type":"object","title":"Normalized"},"result":{"type":"object","title":"Result"},"missing_info":{"items":{},"type":"array","title":"Missing Info"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"final_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Description"},"review_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Note"},"decided_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decided By Name"},"events":{"items":{"type":"object"},"type":"array","title":"Events"},"progress":{"anyOf":[{"$ref":"#/components/schemas/LookupProgressOut"},{"type":"null"}]}},"type":"object","required":["id","created_at","kind","batch_id","row_index","parent_lookup_id","description","market","dataset_version","status","status_label","recommended_code","recommended_description","hs6","confidence","review_flags","risk","risk_level","resolved","processing_ms","input","normalized","result","missing_info","error"],"title":"LookupDetail"},"LookupProgressOut":{"properties":{"stage":{"type":"string","title":"Stage"},"index":{"type":"integer","title":"Index"},"total":{"type":"integer","title":"Total"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"run_started_at":{"type":"string","format":"date-time","title":"Run Started At"},"stages":{"items":{"$ref":"#/components/schemas/StageOut"},"type":"array","title":"Stages"}},"type":"object","required":["stage","index","total","started_at","run_started_at","stages"],"title":"LookupProgressOut","description":"Where a lookup that is being processed is in the pipeline: measured, never estimated."},"LookupSummary":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"kind":{"type":"string","title":"Kind"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"},"row_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Row Index"},"parent_lookup_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Lookup Id"},"description":{"type":"string","title":"Description"},"market":{"type":"string","title":"Market"},"dataset_version":{"type":"string","title":"Dataset Version"},"status":{"type":"string","title":"Status"},"status_label":{"type":"string","title":"Status Label"},"recommended_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommended Code"},"recommended_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommended Description"},"hs6":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hs6"},"confidence":{"type":"number","title":"Confidence"},"review_flags":{"items":{},"type":"array","title":"Review Flags"},"risk":{"type":"integer","title":"Risk"},"risk_level":{"type":"string","enum":["high","medium","low"],"title":"Risk Level"},"resolved":{"type":"boolean","title":"Resolved"},"processing_ms":{"type":"integer","title":"Processing Ms"},"decision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision"},"decision_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Label"},"final_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Code"},"decided_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Decided At"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Name"},"sku_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sku Id"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","description":"Language the answer is, or will be, written in: vi, en, ja or ko. In the detail, the written reasons, the questions with their options, the missing information and the legal findings are in it for every reader. `review_flags` is not: it follows `Accept-Language`"},"comment_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Comment Count"}},"type":"object","required":["id","created_at","kind","batch_id","row_index","parent_lookup_id","description","market","dataset_version","status","status_label","recommended_code","recommended_description","hs6","confidence","review_flags","risk","risk_level","resolved","processing_ms"],"title":"LookupSummary"},"Page":{"properties":{"items":{"items":{"$ref":"#/components/schemas/LookupSummary"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["items","total","page","page_size"],"title":"Page"},"RerunRequest":{"properties":{"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"material":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Material"},"use":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Use"},"composition":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Composition"},"origin":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Origin"},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Notes"},"market":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Market"},"tariff_version":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Tariff Version"},"language":{"anyOf":[{"type":"string","maxLength":35},{"type":"null"}],"enum":["vi","en","ja","ko",null],"title":"Language","description":"Language the answer is written in: the reasons and explanations, the questions about missing information with their options, the legal findings and the warnings. A tag with a region is read by its primary subtag (`en-US` is `en`, `ko-KR` is `ko`), in any case. Without it: the language of the lookup that is run again. Review flags, status labels and the other responses are not affected: they follow `Accept-Language`."}},"type":"object","title":"RerunRequest"},"ReviewCounts":{"properties":{"total":{"type":"integer","title":"Total"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"}},"type":"object","required":["total","counts"],"title":"ReviewCounts","description":"Items of the review queue per status, for one set of filters (GET /review/counts)."},"RowEdit":{"properties":{"values":{"additionalProperties":{"type":"string"},"type":"object","title":"Values"}},"type":"object","required":["values"],"title":"RowEdit"},"SkuIn":{"properties":{"sku":{"type":"string","maxLength":128,"minLength":1,"title":"Sku"},"market":{"type":"string","maxLength":8,"title":"Market","default":"US"},"description":{"type":"string","maxLength":2000,"minLength":1,"title":"Description"},"material":{"type":"string","maxLength":500,"title":"Material","default":""},"use":{"type":"string","maxLength":500,"title":"Use","default":""},"composition":{"type":"string","maxLength":500,"title":"Composition","default":""},"origin":{"type":"string","maxLength":100,"title":"Origin","default":""},"notes":{"type":"string","maxLength":1000,"title":"Notes","default":""},"external_ref":{"type":"string","maxLength":255,"title":"External Ref","default":""},"current_code":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"title":"Current Code"}},"type":"object","required":["sku","description"],"title":"SkuIn"},"StageOut":{"properties":{"key":{"type":"string","title":"Key"},"state":{"type":"string","enum":["done","running","skipped","pending"],"title":"State"},"ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ms"}},"type":"object","required":["key","state"],"title":"StageOut"},"WebhookCreate":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events","description":"Empty = all events"}},"type":"object","required":["url"],"title":"WebhookCreate"},"WebhookUpdate":{"properties":{"url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Url"},"events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Events"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},"type":"object","title":"WebhookUpdate"},"Error":{"type":"object","title":"Error","required":["detail","code"],"description":"The body of an error the API wrote. An answer produced before the request reached the API may have another body, or none: fall back on the HTTP status.","properties":{"detail":{"type":"string","description":"What went wrong, in the language of the request"},"code":{"type":"string","pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$","maxLength":64,"description":"What went wrong, for a program: the same in every language, and not changed once published. The codes are listed under Errors and request identifiers.","example":"not_found"},"details":{"type":"object","description":"More about the error, when there is more to say"}}},"ValidationError":{"type":"object","title":"ValidationError","required":["detail","code"],"description":"The body of an error the API wrote. An answer produced before the request reached the API may have another body, or none: fall back on the HTTP status.","properties":{"detail":{"type":"string"},"code":{"type":"string","pattern":"^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$","maxLength":64,"description":"What went wrong, for a program: the same in every language, and not changed once published. The codes are listed under Errors and request identifiers.","example":"validation_error"},"errors":{"type":"array","description":"One entry per invalid field of the request","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}},"InternalError":{"type":"object","title":"InternalError","required":["detail","code","request_id"],"description":"The body of an error the API wrote. An answer produced before the request reached the API may have another body, or none: fall back on the HTTP status.","properties":{"detail":{"type":"string","description":"A general message, in the language of the request"},"code":{"type":"string","enum":["internal_error"]},"request_id":{"type":"string","description":"The value of the `X-Request-ID` header of this answer","example":"5f0c2a9e4b7d4e0f9a1b2c3d4e5f6a7b"}}}},"headers":{"RequestId":{"description":"The identifier the API made for this call. Quote it when you report a problem.","schema":{"type":"string","pattern":"^[0-9a-f]{32}$","example":"5f0c2a9e4b7d4e0f9a1b2c3d4e5f6a7b"}},"ClientRequestId":{"description":"Your own reference, when the request sent an acceptable one in `X-Request-ID`. Absent otherwise.","schema":{"type":"string","minLength":8,"maxLength":64,"example":"order-sync-2026-10-03.0042"}}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"An API key created in the application under Admin, API keys. It starts with `hts_`."}}},"tags":[{"name":"Lookups","description":"Classify one product and read the result: the recommended code, the other candidates, the reasons, the sources and what is still missing."},{"name":"Review","description":"The queue of lookups that need a person, and the reviewer's decision on a lookup."},{"name":"Batches","description":"Classify a file of products: upload an .xlsx or .csv file, choose the columns, start it, follow its progress and download the results."},{"name":"Catalog","description":"The shared SKU catalog: keep it in step with an ERP or PIM, check the codes in use against the active tariff schedule, and read the alerts raised when a schedule changes."},{"name":"Tariff data","description":"The loaded tariff schedules: search and browse codes, changes between versions, duty and landed cost estimates, compliance hints and CBP rulings."},{"name":"Usage","description":"The credit balance, what was spent, and what the plan of the account allows."},{"name":"Webhooks","description":"Signed notifications sent to your system when a lookup or a batch finishes, a reviewer decides or a tariff schedule changes. The contract is described above."},{"name":"Reports","description":"Review productivity and quality."},{"name":"System","description":"Whether the service is up, and who the API key belongs to."}],"security":[{"ApiKeyAuth":[]}]}