When to use bulk
Any workload that would otherwise loop/v1/calc should switch to
/v1/calc/bulk. One bulk call:
- Counts as one rate-limit request (60 rpm) and one quota entry.
- Pro-rates freight and insurance across rows by line value.
- Returns per-row results and per-row errors without failing the batch.
- Caps at 500 rows per call.
Request shape
Ship-level fields (destination, currency, incoterm, transport mode, freight, insurance) live at the top. Line-level fields go inrows[].
CSV to JSON mapping
If you are starting from a CSV, the column-to-field mapping is:
Ship-level fields (
destination_country, currency, incoterm,
transport_mode, freight, insurance) must come from a header
row, a form field, or a filename convention. They are not per-line.
Convert a CSV and post it
Response shape
Handling row errors
Row errors are non-fatal. A batch of 500 with 3 invalid rows returns200 with ok_rows: 497 and 3 entries in errors[]. Re-post the
failed rows after fixing them; use line_index to correlate back to
your source CSV.
If you need atomic behavior (“either all 500 succeed or none apply”),
implement it client-side: post the batch, and if error_rows > 0,
do not commit the results to your downstream system.