> ## Documentation Index
> Fetch the complete documentation index at: https://traddal.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Calculate multiple codes

> One shipment, up to 50 HS codes — a full basket in one call.

Requires the `calculate:read` scope.

<ParamField body="destination_country" type="string" required>
  ISO alpha-2 destination shared by every line.
</ParamField>

<ParamField body="codes" type="array" required>
  1–50 lines. Each line requires `hs_code`, `origin_country`, and
  `declared_value` (**per unit**), plus optional `currency`, `quantity`,
  `weight`, `weight_unit` — line values fall back to the batch-level ones.
</ParamField>

<ParamField body="reference" type="string">
  Your reference, echoed back in the response.
</ParamField>

<ParamField body="currency" type="string">
  Batch-level ISO 4217 currency, used by lines without their own.
</ParamField>

<ParamField body="quantity" type="number">
  Batch-level default quantity for lines without their own.
</ParamField>

<ParamField body="weight" type="number">
  Batch-level default weight, in `weight_unit`.
</ParamField>

<ParamField body="weight_unit" type="string" default="kg">
  `kg` or `lb`.
</ParamField>

<ParamField body="shipping_cost" type="number" default="0">
  Shipment-level freight. (Not apportioned into per-line customs values in
  this endpoint.)
</ParamField>

<ParamField body="insurance_cost" type="number" default="0">
  Shipment-level insurance.
</ParamField>

<ParamField body="transport_mode" type="string" default="sea">
  `sea`, `air`, `road`, or `rail`.
</ParamField>

<ParamField body="shipping_terms" type="string" default="FOB">
  `FOB`, `CIF`, `EXW`, or `DDP`.
</ParamField>

<ParamField body="shipment_channel" type="string">
  `postal` or `courier`.
</ParamField>

<ParamField body="entry_date" type="string">
  `YYYY-MM-DD` — rates resolved as of this date.
</ParamField>

## Response

<ResponseField name="results" type="array">
  One entry per line, in request order — each carries the full
  [single-calculation response](/api-reference/calculate/calculate-duty)
  (`values`, `estimated_duties`, `totals`, `rate_found`, `request_id`, …).
  A line that failed carries `{ hs_code, origin_country, rate_found: false,
      error }` instead, without failing the batch.
</ResponseField>

<ResponseField name="totals" type="object">
  `{ total }` — the grand total of every line's duty + fees + VAT, in the
  destination currency.
</ResponseField>

<ResponseField name="data_source" type="object | null">
  Which tariff publication answered: `{ version, source, imported_at }`.
</ResponseField>

<ResponseField name="execution_time" type="number">
  Processing time in milliseconds.
</ResponseField>

Like the single endpoint, partner validation-rule failures reject the whole
batch with `400 { "errors": [{ "code", "description" }] }`. Shipment-level
money rules aggregate across every line (FX-converted).

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://{partner}.mytraddal.com/admin/api/v1/calculate/multiple \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer {access_token}' \
    -d '{
      "destination_country": "US",
      "reference": "ORDER-4412",
      "currency": "USD",
      "codes": [
        { "hs_code": "4202.92.3120", "origin_country": "VN", "declared_value": 45.0, "quantity": 2 },
        { "hs_code": "6404.11", "origin_country": "CN", "declared_value": 55.0 }
      ]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "message": "",
    "reference": "ORDER-4412",
    "destination_country": "US",
    "results": [
      {
        "hs_code": "4202923120",
        "origin_country": "VN",
        "destination_country": "US",
        "entry_date": "2026-07-30",
        "transport_mode": null,
        "shipping_terms": "FOB",
        "quantity": 2,
        "currencies": { "declared": "USD", "destination": "USD", "exchange_rate": 1, "source": "same_currency", "rate_date": null },
        "values": { "declared_value_per_unit": 45.0, "declared_value_total": 90.0, "customs_value": 90.0, "shipping_cost": 0, "insurance_cost": 0 },
        "exemptions": { "de_minimis_threshold": 0, "de_minimis_exempt": false },
        "estimated_duties": {
          "tariffs": [ { "name": "Customs duty (general)", "rate": "17.6%", "amount": 15.84, "type": "general" } ],
          "normal_tariff": { "tariffs": [ { "name": "Customs duty (general)", "rate": "17.6%", "amount": 15.84, "type": "general" } ], "total_duty": 15.84 },
          "total_duty": 15.84
        },
        "totals": { "duty": 15.84, "fees": 0.31, "vat": 0, "total": 16.15 },
        "rate_found": true,
        "request_id": "9f0f4b7c-1f3a-4d0e-9c5a-6c1f2a7b8d90"
      }
    ],
    "totals": { "total": 16.15 },
    "data_source": { "version": "2026 Rev 7", "source": "hts_rates_2026_rev7.csv", "imported_at": "2026-06-30T08:11:02.000Z" },
    "execution_time": 412
  }
  ```
</ResponseExample>
