---
title: "Classify many products"
method: POST
path: "/classifications/batch"
tags: ["Classification"]
---

# Classify many products

`POST /classifications/batch`

## Request

- Base URL: `https://api.tarifflo.com/api/v2`
- URL: `https://api.tarifflo.com/api/v2/classifications/batch`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Bulk HTS classification of `items` (inline) or `inputKey` (an uploaded JSONL file). Answers 202 with the batch id; the results are delivered to the key environment's webhook URL (or `Tarifflo-Webhook-Url`) and pollable at GET /classifications/batch/{batchId}.

Requires the API key scope `classifications`.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `items` object[]: Up to 10000 rows inline; `id` is echoed back on each result.
    - `id` string
    - `text` string, required
  - `inputKey` string: A JSONL file of {id?,text} rows, from POST /classifications/batch/upload-url.
  - `dryRun` boolean: Price the request at the organization's card and reserve nothing; answers 200 with the estimate.

## Response `202`

Queued (or, for `dryRun`, priced with 200)

- union
  - object
    - `jobId` string, required: The batch id: poll GET /classifications/batch/{batchId}.
    - `credits` object, required: What the job has reserved, used and refunded so far, in credits.
      - `action` 'rate_lookup' | 'adcvd_screen' | 'pga_applicability' | 'code_classified' | 'export_control' | 'origin_determination' | 'entry_filed' | 'entry_prepared' | 'document_ocr' | 'document_extract' | 'document_sort' | 'product_enrich' | 'entry_review' | 'rationale_document' | 'audit_parse' | 'data_export', nullable, required
      - `reserved` number, required
      - `used` number, required
      - `refunded` number, required
    - `status` 'queued', required
    - `itemsQueued` number, required
    - `message` string, required
  - object
    - `dryRun` true, required
    - `estimatedCredits` number, required
    - `lines` object[], required
      - `action` 'rate_lookup' | 'adcvd_screen' | 'pga_applicability' | 'code_classified' | 'export_control' | 'origin_determination' | 'entry_filed' | 'entry_prepared' | 'document_ocr' | 'document_extract' | 'document_sort' | 'product_enrich' | 'entry_review' | 'rationale_document' | 'audit_parse' | 'data_export', required
      - `units` number, required
      - `credits` number, required
    - `balance` number, required
    - `unit` 'token' | 'credit', required
    - `note` string

## Other responses

- `400`: Invalid input data
- `401`: Authorization not provided
- `402`: Not enough credits
- `403`: Insufficient access
- `409`: The first request with this Idempotency-Key is still filing
- `413`: The file or the row count is over the limit
- `500`: Internal server error

---

[API](https://skmtc.dev/tarifflo/apis/tarifflo-api.md) - [All operations](https://skmtc.dev/tarifflo/apis/tarifflo-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tarifflo/apis/tarifflo-api/revisions/f048ebac1ac5?raw)
