{ "type": "https://code.dcycle.io/api-reference/errors#BULK_RECORDS_REJECTED", "title": "Unprocessable Entity", "status": 422, "code": "BULK_RECORDS_REJECTED", "detail": "1 of the submitted records are invalid; nothing was written.", "errors": [ { "source_row_index": 0, "client_row_id": "SHIP-001", "error_code": "INVALID_LOAD", "error_params": { "detail": "Load cannot be negative or 0" } } ], "rejected": 1, "request_id": "b2248a31-0f5e-4a54-9f0a-3d1f2b6c7e90"}
{ "dry_run": true, "submitted": 1, "valid": 1}
← Logistics APICreates one or up to 5,000 logistics legs (shipments) in one request. The legs are written at once and their distance and
emissions are calculated asynchronously by an ingest job: the answer is the job
(202, processing), never the legs (see how bulk ingestion works).
All or nothing. If any record is invalid the answer is 422 BULK_RECORDS_REJECTED and nothing is written: no
leg, package or hub. rejected is the number of invalid records and errors lists them (up to 100).
Idempotent.Idempotency-Key is required: retrying within 24 hours with the same key and body returns the
original job, with Idempotent-Replayed: true.
Per-leg results. A leg whose distance or emissions could not be calculated is a failed item of the job, with
its reason (error_code), and stays stored without emissions.
Beta. This endpoint is in beta: the contract may still change before general availability. Pin your
integration to the fields documented here and handle unknown fields in responses gracefully. Feedback is welcome
through your Dcycle contact.
Changed on 2026-10-16. This route used to be POST /v2/logistics/requests/bulk; only the path changed. One
route now creates one or many legs, as POST /v2/wastes and POST /v2/facilities do. See the
changelog.
1 to 255 characters. Send one key per batch (a UUID works well). The key is looked up per organization, across every
v2 bulk route. Within 24 hours, the same key with the same route and body returns the original job (with
Idempotent-Replayed: true) instead of writing the legs again; the same key with another body or on another route
is 422 IDEMPOTENCY_KEY_REUSED, and while the first request is still being processed 409 IDEMPOTENCY_KEY_IN_PROGRESS.
After 24 hours the key is free, and a request with it is a new one. See
The Idempotency-Key.
Validate only: the same checks and 422, but nothing is written and no job is created; a valid batch answers 200
with {"dry_run": true, "submitted": n, "valid": n}. The Idempotency-Key header is still required, but a dry run
does not check or store it, so you can send the real request with the same key afterwards.
The legs to create, 1 to 5,000. Fields a record does not define are ignored without an error, so a misspelled field
name (e.g. distance instead of distance_km) is lost. How the fields are read has the
details that change the result.
Destination address, or the name of an active hub of your organization (replaced by its address). Max 500
characters. Needed when you do not send distance_km.
true if a subcontractor moved the leg, false if your own fleet did. Own-fleet legs are calculated from your
recharges, subcontracted ones from the TOC’s factor. Required
since 2026-11-06: a record without it, or with null, is SCHEMA_INVALID.
Your identifier of the package the leg carries (max 255 characters); legs with the same package_key form one
package. Requires movement_id. Part of the business key.
The hub the leg leaves from, by its name in your organization, matched exactly (max 255 characters): for
example your own code for the hub, if you created it with that name. Send hub_id or hub_name, not both.
Several mistakes are accepted with 202 and calculated with a value you did not intend. Check these before you
integrate:
toc: copy the toc of List TOCs exactly, e.g. van_3_5_t_diesel. It
is matched loosely (case, spaces and dots are ignored, and a TOC whose vehicle and type both appear in the text
matches), so a near miss can resolve to another TOC. It is looked up in the region of origin_country (GLO when
omitted), then in GLO, then in EU. If it matches no TOC and you sent category, the leg is calculated with that
category’s generic average, without an error. Send category alone only when you want that average.
load_unit:kg (default), t or ton, pallet or pallets (1,500 kg each), teu (10,000 kg) and feu
(20,000 kg), in any case. Any other value is read as kilograms, without an error.
load: optional; without it, the TOC’s default load is used. load_factor multiplies the load, the default
load included. The load is stored in kg with two decimals.
distance_km: used as sent. When you omit it, the distance is computed from origin and destination and
multiplied by a distance adjustment factor: 0.95 for road, 0.85 for maritime, 1 for rail and air. A distance
you send is not adjusted.
origin and destination: a leg without distance_km needs both (a hub in hub_id or hub_name supplies
the origin); a record missing either is rejected with ADDRESS_REQUIRED. A destination equal to the name of an
active hub of your organization is replaced by the hub’s address. origin is not read as a hub name here; use
hub_name.
hub_id / hub_name: the hub the leg leaves from, by its Dcycle id or by its exact name. The hub must exist:
no hub is created. Create your hubs first with
Create Logistic Hubs (v2). The leg’s origin is the hub’s address, and the
origin you send is ignored. A hub that does not exist, is another organization’s, or is not active is
REFERENCE_NOT_FOUND. An empty hub_id or hub_name ("") means no hub, as if omitted.
shipment_date: optional; without it the leg is dated at the upload time (UTC).
year and tkm: not used to calculate the leg. Its year is the year of shipment_date, and tkm is
recalculated as load in tonnes × distance; a tkm you send stays on the leg only if its calculation fails. The
emission factor is the TOC’s (for an electric TOC, the grid factor of origin_country), whatever the date.
The business key of a leg is, within your organization, movement_id, movement_stretch, movement_stage,
client (default_client when omitted) and package_key. A key field you omit counts as empty.
Sending a leg again in a later batch replaces it: every field takes the value you send or its default (an
omitted shipment_date becomes the upload time, a leg sent without hub_id or hub_name unlinks the hub), its emissions are cleared,
and it is calculated again. Its id is kept. Changing a key field, such as package_key, creates a new leg and
leaves the old one.
Two records of the same batch with the same key are rejected (DUPLICATE_RECORD).
Legs created by any other route (the app, file uploads, the v1 endpoints) share the key: a leg sent here
replaces the leg with the same key, wherever it came from.
Send a unique movement_id per leg. Legs without movement_id that share client, movement_stretch and
movement_stage are the same leg: in one batch the second and later ones are rejected with DUPLICATE_RECORD, and
with them the whole batch; in a later batch each one replaces the previous one.
The job, with Location: /v2/ingest-jobs/{id}. A retry with the same Idempotency-Key and body answers 202 with
the same job and Location, showing its current status and counts.
submitted: legs in the request, all of them stored. succeeded: legs calculated. failed: legs whose
calculation failed; the job’s items say which ones and why.
Poll GET /v2/ingest-jobs/{id} or, for a job submitted with an API key, subscribe
to ingest_job.finished. GET /v2/ingest-jobs/{id}/items maps each record
(source_row_index, client_row_id) to its leg (entity_id) and its result.
status
Meaning
processing
The legs are stored; their distance and emissions are being calculated.
completed
Every leg was calculated.
completed_with_errors
At least one leg (possibly all of them) failed to calculate (counts.failed > 0): every chunk ran, or the job stopped moving and was closed within 4 to 5 hours, its pending legs JOB_TIMED_OUT (see A job that does not finish).
failed is reserved: treat every status other than processing as finished.
If chunks_done stops moving, see A job that does not finish.
Resending the batch with a new Idempotency-Key starts a second job, which updates the same legs (they are
upserted on their business key); the first one is closed within 4 to 5 hours without progress, its pending legs
JOB_TIMED_OUT.
The job calculates each leg and its package’s totals, not the organization’s logistics intensity values (by TOC and
year, hub and project). A TOC and year that appear for the first time get the TOC’s well-to-wheel factor. An
organization with own-fleet energy (recharges, or supercharger
invoices, assigned to a TOC) has its values recalculated every night. Those values are what
List Logistics Requests (kgco2e) and the
logistics report apply to each tonne-kilometre; the package totals of
Get Logistics Packages (v2) do not use them.
Read the result per package, with Get Logistics Packages (v2): up to 100
packages per request, each with total_co2e and total_distance_km over its active legs. It takes the packages’
Dcycle ids. The job’s items give each record’s leg (entity_id), not its package: get the package ids from
List Packages, filtered by your package_key (its movement_id filter
matches only the package’s first leg). Read the packages once the job has finished: until then their totals miss the
legs not yet calculated. A leg that failed to calculate still counts in its package’s total with the tonne-kilometres
stored when it was received, if it had any (your tkm, or your distance_km and its load).
A failed item’s error_code says why, and error_params.message explains it. The leg stays stored without emissions
(and without a distance, unless you sent one); the reason is only on the job item. Fix the cause and send the leg
again: with the same business key it is updated in place.
error_code
Cause
Fix
DISTANCE_CALCULATION_ERROR
An address could not be located, the route between origin and destination gave 0 km between points more than 1 km apart, or there is no route. A geocoding service that did not answer also ends here
Send a more precise address, or distance_km; send the leg again if the addresses are right
SEA_CROSSING_REQUIRES_MARITIME_MODE
Origin and destination are separated by sea, so the leg cannot go by road or rail
Declare a maritime toc/category, or split the leg
NO_DISTANCE
The route gave 0 km between points 1 km or less apart (e.g. an air or maritime leg whose two addresses are the same place)
Send distance_km
NO_LOAD
The load converted to kilograms is below 0.005 kg, so it is stored as 0
Send the real load
CALCULATION_FAILED
The calculation failed unexpectedly, for example emissions too large to store; error_params is null
Check the leg’s load and distance; if they are right, contact support with the job id
An address the distance engine cannot geocode, or one made only of punctuation, comes as
DISTANCE_CALCULATION_ERROR; error_params.message says what failed. An empty or blank address is rejected with the
request (ADDRESS_REQUIRED), when the leg has no distance_km. A road or rail leg whose two addresses are
the same place is not an error: it is calculated as 3 km (2.85 km for road, after the adjustment factor).
The legs are calculated after the 202, reading each leg as it is at that moment.
error_code
Cause
Fix
NO_TOC
The leg’s TOC was retired from the catalogue before the leg was calculated
Send it again with a current toc
NOT_FOUND
The leg was deleted before it was calculated
Send it again if you still need it
If you send a leg again while an earlier job that contains it is still processing, both jobs calculate it with the
data it has when their chunk runs, and both report it as succeeded. Wait for the first job to finish before you send
a leg again.
Errors follow RFC 9457 problem details (Content-Type: application/problem+json): a stable
code, a human detail, errors when there is a list of problems, and the request_id to quote to support.
Nothing was written. rejected is how many records are invalid and errors lists them (up to 100) in submission
order, with source_row_index (starting at 0), your client_row_id and a stable error_code.Each record carries oneerror_code: the first rule it breaks. A record with two problems shows the second one
only after you fix the first, so validate again with ?dry_run=true before sending the batch. (SCHEMA_INVALID is
the exception inside a record: its error_params.errors lists the record’s schema problems, up to 10.)
{ "type": "https://code.dcycle.io/api-reference/errors#BULK_RECORDS_REJECTED", "title": "Unprocessable Entity", "status": 422, "code": "BULK_RECORDS_REJECTED", "detail": "3 of the submitted records are invalid; nothing was written.", "errors": [ {"source_row_index": 1, "client_row_id": "row-2", "error_code": "INVALID_LOAD", "error_params": {"detail": "Load cannot be negative or 0"}}, {"source_row_index": 2, "client_row_id": "row-3", "error_code": "SCHEMA_INVALID", "error_params": {"errors": [{"loc": ["category"], "type": "value_error", "msg": "Value error, Invalid category"}]}}, {"source_row_index": 3, "client_row_id": "row-4", "error_code": "DUPLICATE_RECORD", "error_params": {"duplicate_of": 0}} ], "rejected": 3, "request_id": "b2248a31-0f5e-4a54-9f0a-3d1f2b6c7e90"}
error_code
Cause
Fix
SCHEMA_INVALID
The record does not match the schema: a wrong type; category other than road, rail, maritime or air (lowercase), or null without a toc; origin_country not ISO 3166-1 alpha-2 or GLO; load_factor outside (0, 1]; package_key without movement_id; subcontractor missing or null; subcontractor_type other than fis/nis, or with subcontractor: false; movement_id, movement_stretch, movement_stage, client, package_key, hub_name or a license plate over 255 characters; hub_id that is not a UUID; both hub_id and hub_name; a text with a NUL character (string_contains_nul; in origin and destination it is dropped instead) or a lone surrogate such as \ud800 (string_unicode); client_row_id over 255 characters; or the record is not a JSON object. error_params.errors lists each problem (loc, type, msg)
Fix the fields listed
INVALID_LOAD
load is 0 or negative (error_params.detail)
Send a positive load, or omit it to use the TOC’s default
INVALID_DISTANCE
distance_km is 0 or negative (error_params.detail)
Send a positive distance_km, or omit it to have it computed
ACTIVITY_DATE_OUT_OF_RANGE
The year of shipment_date is before 1970 or after next year (error_params.detail)
Fix the date
ADDRESS_REQUIRED
No distance_km, and origin or destination is missing or blank (with hub_id or hub_name, the hub has no address), so the distance could not be computed (error_params.fields: the missing ones)
Send both addresses, or distance_km
ADDRESS_TOO_LONG
origin or destination (the hub’s address, when a hub replaces it) is over 500 characters (error_params: field, length, max)
Send the address alone
REFERENCE_NOT_FOUND
No active hub of your organization has this hub_id or hub_name (error_params: field, value; plus status, the hub’s status (archived or error), when your organization’s hub exists but is not active). Another organization’s hub answers the same as an unknown one
No TOC matches toc, and no generic average of category exists, in the region of origin_country, in GLO or in EU; also when neither toc nor category is sent (error_params: toc, category, region)
The Idempotency-Key was already used in this organization, within the last 24 hours, with a different body or on
another route. Nothing is written. Send a new key for a new batch; to retry the original batch, resend exactly the same
body to the same route. The order of the fields and how a whole number is written (1000 or 1000.0) do not matter,
but the values must be identical: null and an omitted field are a different body.
{ "type": "https://code.dcycle.io/api-reference/errors#IDEMPOTENCY_KEY_REUSED", "title": "Unprocessable Entity", "status": 422, "code": "IDEMPOTENCY_KEY_REUSED", "detail": "This Idempotency-Key was already used with a different request body or on another route. Use a new key per batch.", "request_id": "b2248a31-0f5e-4a54-9f0a-3d1f2b6c7e90"}
Another request with the same Idempotency-Key was still being processed, typically your own retry after a timeout.
This request wrote no leg and created no job (packages it named may have been created; later requests reuse
them). Wait the Retry-After seconds and retry with the same key and body: you get the job of the request that went
through. See IDEMPOTENCY_KEY_IN_PROGRESS.
The request itself is invalid: the Idempotency-Key header is missing, empty or over 255 characters; the body is not
JSON; or records is missing, empty or has more than 5,000 entries. errors lists each problem with where it is
(loc). See Errors.
Before the records are looked at, the API key and the organization are checked. Each code has its section in
Errors:
401: no API key (AUTHENTICATION_REQUIRED), a wrong or revoked one (INVALID_API_KEY), an expired one
(API_KEY_EXPIRED), a key of an organization that is neither this one nor one of its parents
(API_KEY_ORG_MISMATCH) or one too old to have an owner (API_KEY_NO_OWNER).
400 ORGANIZATION_ID_REQUIRED: no x-organization-id.
403: the key’s creator is not a member of the organization in x-organization-id (LOGGED_USER_NOT_MEMBER),
the key is read-only (API_KEY_SCOPE_DENIED), or its creator is a Viewer (VIEWER_CANNOT_WRITE).
More than 10 requests in flight at once with your API key on this endpoint. The request was not processed. Wait the
Retry-After seconds (10, rising to 20 if you keep hitting the limit) and retry.
import osimport timeimport uuidimport requestsBASE = "https://api.dcycle.io"HEADERS = { "x-api-key": os.environ["DCYCLE_API_KEY"], "x-organization-id": os.environ["DCYCLE_ORG_ID"],}records = [ { "client_row_id": "SHIP-001", "movement_id": "SHIP-001", # unique per leg: it is part of the leg's business key "origin": "Madrid, Spain", "destination": "Barcelona, Spain", "origin_country": "ES", "load": 1000, "load_unit": "kg", "toc": "van_3_5_t_diesel", # copied from GET /v1/logistics/tocs "subcontractor": True, # required: False for your own fleet "shipment_date": "2026-10-01", }]# One key per batch: reuse it only to retry this same batch.response = requests.post( f"{BASE}/v2/logistics/requests", headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())}, json={"records": records}, timeout=120,)if response.status_code == 422 and response.json().get("code") == "BULK_RECORDS_REJECTED": for rejection in response.json()["errors"]: print(rejection["source_row_index"], rejection["client_row_id"], rejection["error_code"], rejection["error_params"]) raise SystemExit("Fix the listed records and send the whole batch again")response.raise_for_status()job_url = BASE + response.headers["Location"]deadline = time.monotonic() + 60 * 60while True: job_response = requests.get(job_url, headers=HEADERS, timeout=30) job_response.raise_for_status() job = job_response.json() if job["status"] != "processing": break if time.monotonic() > deadline: raise SystemExit(f"Job {job['id']} is still processing after an hour: contact support with its id") time.sleep(10)page = 1while job["status"] == "completed_with_errors": # read every page of failures failed = requests.get( f"{job_url}/items", headers=HEADERS, params={"status": "failed", "size": 500, "page": page}, timeout=30, ).json() for item in failed["items"]: print("not calculated:", item["client_row_id"], item["error_code"], item["error_params"]) if page * failed["size"] >= failed["total"]: break page += 1
Network error or timeout: retry with the sameIdempotency-Key and the same body. If the first attempt
was accepted you get its job back, and nothing is written twice.
409 IDEMPOTENCY_KEY_IN_PROGRESS: the first request with that key is still being processed. Wait
Retry-After seconds and retry with the same key and body.
422 BULK_RECORDS_REJECTED: nothing was written. Fix the records and send the batch again; the same key works,
since the first request created no job.
422 IDEMPOTENCY_KEY_REUSED: the key already belongs to another batch. Use a new key, or resend the original
body unchanged.
429: too many requests in flight for your API key on this endpoint (unlike the Idempotency-Key, the
limit is per key, not per organization). Wait Retry-After seconds; the request was not processed.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Dcycle Platform Docs","colors":{"primary":"#006ad4","light":"#006ad4","dark":"#006ad4"},"favicon":"https://mintcdn.com/dcyleio/3p55kB8fgLjSeubO/images/favicon.svg?fit=max\u0026auto=format\u0026n=3p55kB8fgLjSeubO\u0026q=85\u0026s=b60bb57384c71b7a5a59fbc458538887","api":{"params":{"expanded":"all"},"playground":{"display":"interactive","proxy":true},"examples":{"languages":["javascript","python","curl"],"prefill":true},"mdx":{"server":"https://api.dcycle.io"}},"navbar":{"links":[{"href":"https://app.dcycle.io","label":"App"}],"primary":{"type":"button","label":"Get API Key","href":"/docs/authentication#get-an-api-key"}},"search":{"prompt":"Search API endpoints and guides..."},"seo":{"indexing":"all"},"styling":{"eyebrows":"breadcrumbs","codeblocks":{"theme":{"light":"github-light","dark":"github-dark"}},"latex":false},"contextual":{"options":["copy","view","claude","chatgpt"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"dcyleio","hasAudioNarration":false,"actualSubdomain":"dcyleio","customDomains":["code.dcycle.io"],"gitSource":{"type":"github","owner":"dcycle-by-wum","repo":"dcycle-backend-app","deployBranch":"main","contentDirectory":"docs/developer-center","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6aef6f67b69215f74376dc6d","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"default","tag":"API","count":454},{"language":"default","tag":"Guides","count":48},{"language":"default","tag":"CLI","count":40},{"language":"default","tag":"Employees","count":38},{"language":"default","tag":"Vehicles","count":38},{"language":"default","tag":"Own Workforce","count":37},{"language":"default","tag":"Logistics","count":34},{"language":"default","tag":"Custom KPI","count":33},{"language":"default","tag":"Commands","count":33},{"language":"default","tag":"MCP","count":32}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/logistics/create-requests-v2","slug":"/api-reference/logistics/create-requests-v2","pageMetadata":{"title":"Create Logistics Requests (v2)","api":"POST /v2/logistics/requests","description":"Create one or up to 5,000 logistics legs in one request; their distance and emissions are calculated by an ingest job","tag":"BETA","href":"/api-reference/logistics/create-requests-v2"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Create one or up to 5,000 logistics legs in one request; their distance and emissions are calculated by an ingest job\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Expandable,Heading,ParamField,ResponseField,Table,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:_jsx(_components.a,{href:`/api-reference/logistics/overview`,children:`← Logistics API`})}),`\n`,_jsxs(_components.p,{children:[`Creates one or up to 5,000 logistics legs (shipments) in one request. The legs are written at once and their distance and\nemissions are calculated asynchronously by an `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/get`,children:`ingest job`}),`: the answer is the job\n(`,_jsx(_components.code,{children:`202`}),`, `,_jsx(_components.code,{children:`processing`}),`), never the legs (see `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/overview`,children:`how bulk ingestion works`}),`).`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`All or nothing.`}),` If any record is invalid the answer is `,_jsx(_components.code,{children:`422 BULK_RECORDS_REJECTED`}),` and nothing is written: no\nleg, package or hub. `,_jsx(_components.code,{children:`rejected`}),` is the number of invalid records and `,_jsx(_components.code,{children:`errors`}),` lists them (up to 100).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Idempotent.`}),` `,_jsx(_components.code,{children:`Idempotency-Key`}),` is required: retrying within 24 hours with the same key and body returns the\noriginal job, with `,_jsx(_components.code,{children:`Idempotent-Replayed: true`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Per-leg results.`}),` A leg whose distance or emissions could not be calculated is a failed item of the job, with\nits reason (`,_jsx(_components.code,{children:`error_code`}),`), and stays stored without emissions.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Beta.`}),` This endpoint is in beta: the contract may still change before general availability. Pin your\nintegration to the fields documented here and handle unknown fields in responses gracefully. Feedback is welcome\nthrough your Dcycle contact.`]})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Changed on 2026-10-16.`}),` This route used to be `,_jsx(_components.code,{children:`POST /v2/logistics/requests/bulk`}),`; only the path changed. One\nroute now creates one or many legs, as `,_jsx(_components.code,{children:`POST /v2/wastes`}),` and `,_jsx(_components.code,{children:`POST /v2/facilities`}),` do. See the\n`,_jsx(_components.a,{href:`/api-reference/changelog`,children:`changelog`}),`.`]})}),`\n`,`\n`,`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsx(Heading,{level:`3`,id:`headers`,children:`Headers`}),`\n`,_jsx(ParamField,{header:`x-api-key`,type:`string`,required:true,id:`param-x-api-key`,children:_jsxs(_components.p,{children:[`Your API key. Jobs submitted with an API key notify `,_jsx(_components.code,{children:`ingest_job.finished`}),` to the\n`,_jsx(_components.a,{href:`/api-reference/webhooks/overview`,children:`webhook endpoints`}),` of the `,_jsx(_components.code,{children:`x-organization-id`}),` organization.`]})}),`\n`,_jsx(ParamField,{header:`x-organization-id`,type:`string`,required:true,id:`param-x-organization-id`,children:_jsx(_components.p,{children:`UUID of the organization the legs belong to.`})}),`\n`,_jsx(ParamField,{header:`Content-Type`,type:`string`,required:true,id:`param-content-type`,children:_jsxs(_components.p,{children:[`Must be `,_jsx(_components.code,{children:`application/json`})]})}),`\n`,_jsx(ParamField,{header:`Idempotency-Key`,type:`string`,required:true,id:`param-idempotency-key`,children:_jsxs(_components.p,{children:[`1 to 255 characters. Send one key per batch (a UUID works well). The key is looked up per organization, across every\nv2 bulk route. Within 24 hours, the same key with the same route and body returns the original job (with\n`,_jsx(_components.code,{children:`Idempotent-Replayed: true`}),`) instead of writing the legs again; the same key with another body or on another route\nis `,_jsx(_components.code,{children:`422 IDEMPOTENCY_KEY_REUSED`}),`, and while the first request is still being processed `,_jsx(_components.code,{children:`409 IDEMPOTENCY_KEY_IN_PROGRESS`}),`.\nAfter 24 hours the key is free, and a request with it is a new one. See\n`,_jsx(_components.a,{href:`/api-reference/ingest-jobs/overview#the-idempotency-key`,children:`The Idempotency-Key`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`query-parameters`,children:`Query Parameters`}),`\n`,_jsx(ParamField,{query:`dry_run`,type:`boolean`,default:`false`,id:`param-dry-run`,children:_jsxs(_components.p,{children:[`Validate only: the same checks and `,_jsx(_components.code,{children:`422`}),`, but nothing is written and no job is created; a valid batch answers `,_jsx(_components.code,{children:`200`}),`\nwith `,_jsx(_components.code,{children:`{\"dry_run\": true, \"submitted\": n, \"valid\": n}`}),`. The `,_jsx(_components.code,{children:`Idempotency-Key`}),` header is still required, but a dry run\ndoes not check or store it, so you can send the real request with the same key afterwards.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`body-parameters`,children:`Body Parameters`}),`\n`,_jsxs(ParamField,{body:`records`,type:`array[object]`,required:true,id:`param-records`,children:[_jsxs(_components.p,{children:[`The legs to create, 1 to 5,000. Fields a record does not define are ignored without an error, so a misspelled field\nname (e.g. `,_jsx(_components.code,{children:`distance`}),` instead of `,_jsx(_components.code,{children:`distance_km`}),`) is lost. `,_jsx(_components.a,{href:`#how-the-fields-are-read`,children:`How the fields are read`}),` has the\ndetails that change the result.`]}),_jsxs(Expandable,{title:`record fields`,children:[_jsx(ParamField,{body:`toc`,type:`string`,id:`param-toc`,children:_jsxs(_components.p,{children:[`The transport operation category (vehicle type), as `,_jsx(_components.code,{children:`toc`}),` in `,_jsx(_components.a,{href:`/api-reference/logistics/list-tocs`,children:`List TOCs`}),`,\ne.g. `,_jsx(_components.code,{children:`van_3_5_t_diesel`}),`. Required unless you send `,_jsx(_components.code,{children:`category`}),`.`]})}),_jsx(ParamField,{body:`category`,type:`string`,id:`param-category`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`road`}),`, `,_jsx(_components.code,{children:`rail`}),`, `,_jsx(_components.code,{children:`maritime`}),` or `,_jsx(_components.code,{children:`air`}),`. Required without `,_jsx(_components.code,{children:`toc`}),`: the leg then uses that category’s generic average.`]})}),_jsx(ParamField,{body:`origin`,type:`string`,id:`param-origin`,children:_jsxs(_components.p,{children:[`Origin address (max 500 characters). With `,_jsx(_components.code,{children:`destination`}),`, needed when you do not send `,_jsx(_components.code,{children:`distance_km`}),`; a hub in\n`,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),` supplies it instead.`]})}),_jsx(ParamField,{body:`destination`,type:`string`,id:`param-destination`,children:_jsxs(_components.p,{children:[`Destination address, or the name of an active hub of your organization (replaced by its address). Max 500\ncharacters. Needed when you do not send `,_jsx(_components.code,{children:`distance_km`}),`.`]})}),_jsx(ParamField,{body:`distance_km`,type:`number`,id:`param-distance-km`,children:_jsxs(_components.p,{children:[`Distance in km, greater than 0. Used as sent. When omitted, it is computed from `,_jsx(_components.code,{children:`origin`}),` and `,_jsx(_components.code,{children:`destination`}),`.`]})}),_jsx(ParamField,{body:`origin_country`,type:`string`,default:`GLO`,id:`param-origin-country`,children:_jsxs(_components.p,{children:[`ISO 3166-1 alpha-2 code of the origin country, or `,_jsx(_components.code,{children:`GLO`}),`. Selects the region’s TOCs and emission factors.`]})}),_jsx(ParamField,{body:`load`,type:`number`,id:`param-load`,children:_jsxs(_components.p,{children:[`The load, greater than 0, in `,_jsx(_components.code,{children:`load_unit`}),`. When omitted, the TOC’s default load is used.`]})}),_jsx(ParamField,{body:`load_unit`,type:`string`,default:`kg`,id:`param-load-unit`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`kg`}),`, `,_jsx(_components.code,{children:`t`}),`/`,_jsx(_components.code,{children:`ton`}),`, `,_jsx(_components.code,{children:`pallet`}),`/`,_jsx(_components.code,{children:`pallets`}),` (1,500 kg each), `,_jsx(_components.code,{children:`teu`}),` (10,000 kg) or `,_jsx(_components.code,{children:`feu`}),` (20,000 kg).`]})}),_jsx(ParamField,{body:`load_factor`,type:`number`,default:`1`,id:`param-load-factor`,children:_jsx(_components.p,{children:`In (0, 1]; multiplies the load.`})}),_jsx(ParamField,{body:`shipment_date`,type:`date`,id:`param-shipment-date`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`YYYY-MM-DD`}),`, from 1970 to next year: the leg’s date in reports and lists. It does not change the emission\nfactor. Default: the upload date (UTC).`]})}),_jsx(ParamField,{body:`cleaning`,type:`boolean`,default:`false`,id:`param-cleaning`,children:_jsx(_components.p,{children:`Whether the vehicle was cleaned; it increases the emissions.`})}),_jsx(ParamField,{body:`subcontractor`,type:`boolean`,required:true,id:`param-subcontractor`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` if a subcontractor moved the leg, `,_jsx(_components.code,{children:`false`}),` if your own fleet did. Own-fleet legs are calculated from your\n`,_jsx(_components.a,{href:`/api-reference/logistics/create-recharges-bulk`,children:`recharges`}),`, subcontracted ones from the TOC’s factor. Required\nsince 2026-11-06: a record without it, or with `,_jsx(_components.code,{children:`null`}),`, is `,_jsx(_components.code,{children:`SCHEMA_INVALID`}),`.`]})}),_jsx(ParamField,{body:`subcontractor_type`,type:`string`,id:`param-subcontractor-type`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`fis`}),` (fully integrated) or `,_jsx(_components.code,{children:`nis`}),` (non-integrated) subcontractor, as in SQAS / ISO 14083. Only with\n`,_jsx(_components.code,{children:`subcontractor: true`}),`.`]})}),_jsx(ParamField,{body:`movement_id`,type:`string`,id:`param-movement-id`,children:_jsxs(_components.p,{children:[`Your identifier of the movement (max 255 characters). Part of the\n`,_jsx(_components.a,{href:`#legs-are-upserted-on-their-business-key`,children:`business key`}),`: send one per leg.`]})}),_jsx(ParamField,{body:`movement_stretch`,type:`string`,id:`param-movement-stretch`,children:_jsx(_components.p,{children:`The leg’s stretch within the movement (max 255 characters). Part of the business key.`})}),_jsx(ParamField,{body:`movement_stage`,type:`string`,id:`param-movement-stage`,children:_jsx(_components.p,{children:`The leg’s stage within the movement (max 255 characters). Part of the business key.`})}),_jsx(ParamField,{body:`client`,type:`string`,default:`default_client`,id:`param-client`,children:_jsx(_components.p,{children:`Your customer for this leg (max 255 characters). Part of the business key.`})}),_jsx(ParamField,{body:`package_key`,type:`string`,id:`param-package-key`,children:_jsxs(_components.p,{children:[`Your identifier of the package the leg carries (max 255 characters); legs with the same `,_jsx(_components.code,{children:`package_key`}),` form one\npackage. Requires `,_jsx(_components.code,{children:`movement_id`}),`. Part of the business key.`]})}),_jsx(ParamField,{body:`hub_id`,type:`uuid`,id:`param-hub-id`,children:_jsxs(_components.p,{children:[`The hub the leg leaves from, by its Dcycle id: the `,_jsx(_components.code,{children:`id`}),` that\n`,_jsx(_components.a,{href:`/api-reference/logistic-hubs/create-v2`,children:`Create Logistic Hubs (v2)`}),` answers, or that\n`,_jsx(_components.a,{href:`/api-reference/logistics/list-hubs`,children:`List Logistics Hubs`}),` lists. Send `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),`, not both. See\n`,_jsx(_components.a,{href:`#how-the-fields-are-read`,children:`How the fields are read`}),`.`]})}),_jsx(ParamField,{body:`hub_name`,type:`string`,id:`param-hub-name`,children:_jsxs(_components.p,{children:[`The hub the leg leaves from, by its `,_jsx(_components.code,{children:`name`}),` in your organization, matched exactly (max 255 characters): for\nexample your own code for the hub, if you created it with that name. Send `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),`, not both.`]})}),_jsx(ParamField,{body:`vehicle_license_plate`,type:`string`,id:`param-vehicle-license-plate`,children:_jsx(_components.p,{children:`Max 255 characters.`})}),_jsx(ParamField,{body:`trailer_license_plate`,type:`string`,id:`param-trailer-license-plate`,children:_jsx(_components.p,{children:`Max 255 characters.`})}),_jsx(ParamField,{body:`request_date`,type:`date`,id:`param-request-date`,children:_jsx(_components.p,{children:`The date your customer placed the order. Stored for reference; not used to calculate.`})}),_jsx(ParamField,{body:`client_row_id`,type:`string`,id:`param-client-row-id`,children:_jsxs(_components.p,{children:[`Your key for the record (max 255 characters), echoed on its job item and in a `,_jsx(_components.code,{children:`422`}),`.`]})}),_jsx(ParamField,{body:`year`,type:`integer`,id:`param-year`,children:_jsxs(_components.p,{children:[`Accepted but not used: the leg’s year is the year of `,_jsx(_components.code,{children:`shipment_date`}),`.`]})}),_jsx(ParamField,{body:`tkm`,type:`number`,id:`param-tkm`,children:_jsx(_components.p,{children:`Accepted but recalculated as load in tonnes × distance; kept only if the leg’s calculation fails.`})})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`how-the-fields-are-read`,children:`How the fields are read`}),`\n`,_jsxs(_components.p,{children:[`Several mistakes are accepted with `,_jsx(_components.code,{children:`202`}),` and calculated with a value you did not intend. Check these before you\nintegrate:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`toc`}),`:`]}),` copy the `,_jsx(_components.code,{children:`toc`}),` of `,_jsx(_components.a,{href:`/api-reference/logistics/list-tocs`,children:`List TOCs`}),` exactly, e.g. `,_jsx(_components.code,{children:`van_3_5_t_diesel`}),`. It\nis matched loosely (case, spaces and dots are ignored, and a TOC whose vehicle and type both appear in the text\nmatches), so a near miss can resolve to another TOC. It is looked up in the region of `,_jsx(_components.code,{children:`origin_country`}),` (`,_jsx(_components.code,{children:`GLO`}),` when\nomitted), then in `,_jsx(_components.code,{children:`GLO`}),`, then in `,_jsx(_components.code,{children:`EU`}),`. If it matches no TOC and you sent `,_jsx(_components.code,{children:`category`}),`, the leg is calculated with that\ncategory’s generic average, `,_jsx(_components.strong,{children:`without an error`}),`. Send `,_jsx(_components.code,{children:`category`}),` alone only when you want that average.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`load_unit`}),`:`]}),` `,_jsx(_components.code,{children:`kg`}),` (default), `,_jsx(_components.code,{children:`t`}),` or `,_jsx(_components.code,{children:`ton`}),`, `,_jsx(_components.code,{children:`pallet`}),` or `,_jsx(_components.code,{children:`pallets`}),` (1,500 kg each), `,_jsx(_components.code,{children:`teu`}),` (10,000 kg) and `,_jsx(_components.code,{children:`feu`}),`\n(20,000 kg), in any case. `,_jsx(_components.strong,{children:`Any other value is read as kilograms, without an error.`})]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`load`}),`:`]}),` optional; without it, the TOC’s default load is used. `,_jsx(_components.code,{children:`load_factor`}),` multiplies the load, the default\nload included. The load is stored in kg with two decimals.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`distance_km`}),`:`]}),` used as sent. When you omit it, the distance is computed from `,_jsx(_components.code,{children:`origin`}),` and `,_jsx(_components.code,{children:`destination`}),` and\nmultiplied by a distance adjustment factor: 0.95 for `,_jsx(_components.code,{children:`road`}),`, 0.85 for `,_jsx(_components.code,{children:`maritime`}),`, 1 for `,_jsx(_components.code,{children:`rail`}),` and `,_jsx(_components.code,{children:`air`}),`. A distance\nyou send is not adjusted.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`origin`}),` and `,_jsx(_components.code,{children:`destination`}),`:`]}),` a leg without `,_jsx(_components.code,{children:`distance_km`}),` needs both (a hub in `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),` supplies\nthe origin); a record missing either is rejected with `,_jsx(_components.code,{children:`ADDRESS_REQUIRED`}),`. A `,_jsx(_components.code,{children:`destination`}),` equal to the name of an\nactive hub of your organization is replaced by the hub’s address. `,_jsx(_components.code,{children:`origin`}),` is not read as a hub name here; use\n`,_jsx(_components.code,{children:`hub_name`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`hub_id`}),` / `,_jsx(_components.code,{children:`hub_name`}),`:`]}),` the hub the leg leaves from, by its Dcycle id or by its exact name. The hub must exist:\n`,_jsx(_components.strong,{children:`no hub is created`}),`. Create your hubs first with\n`,_jsx(_components.a,{href:`/api-reference/logistic-hubs/create-v2`,children:`Create Logistic Hubs (v2)`}),`. The leg’s origin is the hub’s address, and the\n`,_jsx(_components.code,{children:`origin`}),` you send is ignored. A hub that does not exist, is another organization’s, or is not active is\n`,_jsx(_components.code,{children:`REFERENCE_NOT_FOUND`}),`. An empty `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),` (`,_jsx(_components.code,{children:`\"\"`}),`) means no hub, as if omitted.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`shipment_date`}),`:`]}),` optional; without it the leg is dated at the upload time (UTC).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`year`})}),` and `,_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`tkm`}),`:`]}),` not used to calculate the leg. Its year is the year of `,_jsx(_components.code,{children:`shipment_date`}),`, and `,_jsx(_components.code,{children:`tkm`}),` is\nrecalculated as load in tonnes × distance; a `,_jsx(_components.code,{children:`tkm`}),` you send stays on the leg only if its calculation fails. The\nemission factor is the TOC’s (for an electric TOC, the grid factor of `,_jsx(_components.code,{children:`origin_country`}),`), whatever the date.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`legs-are-upserted-on-their-business-key`,children:`Legs are upserted on their business key`}),`\n`,_jsxs(_components.p,{children:[`The business key of a leg is, within your organization, `,_jsx(_components.code,{children:`movement_id`}),`, `,_jsx(_components.code,{children:`movement_stretch`}),`, `,_jsx(_components.code,{children:`movement_stage`}),`,\n`,_jsx(_components.code,{children:`client`}),` (`,_jsx(_components.code,{children:`default_client`}),` when omitted) and `,_jsx(_components.code,{children:`package_key`}),`. A key field you omit counts as empty.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Sending a leg again`}),` in a later batch replaces it: every field takes the value you send or its default (an\nomitted `,_jsx(_components.code,{children:`shipment_date`}),` becomes the upload time, a leg sent without `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),` unlinks the hub), its emissions are cleared,\nand it is calculated again. Its id is kept. Changing a key field, such as `,_jsx(_components.code,{children:`package_key`}),`, creates a new leg and\nleaves the old one.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Two records of the same batch with the same key`}),` are rejected (`,_jsx(_components.code,{children:`DUPLICATE_RECORD`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Legs created by any other route`}),` (the app, file uploads, the v1 endpoints) share the key: a leg sent here\nreplaces the leg with the same key, wherever it came from.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[`Send a unique `,_jsx(_components.code,{children:`movement_id`}),` per leg.`]}),` Legs without `,_jsx(_components.code,{children:`movement_id`}),` that share `,_jsx(_components.code,{children:`client`}),`, `,_jsx(_components.code,{children:`movement_stretch`}),` and\n`,_jsx(_components.code,{children:`movement_stage`}),` are the same leg: in one batch the second and later ones are rejected with `,_jsx(_components.code,{children:`DUPLICATE_RECORD`}),`, and\nwith them the whole batch; in a later batch each one replaces the previous one.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(Heading,{level:`3`,id:`202-accepted`,children:`202 Accepted`}),`\n`,_jsxs(_components.p,{children:[`The job, with `,_jsx(_components.code,{children:`Location: /v2/ingest-jobs/{id}`}),`. A retry with the same `,_jsx(_components.code,{children:`Idempotency-Key`}),` and body answers `,_jsx(_components.code,{children:`202`}),` with\nthe same job and `,_jsx(_components.code,{children:`Location`}),`, showing its current status and counts.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`16`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"4f0b8b3e-6a41-4b7e-9d0c-2c1f3a5e8d10\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"processing\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"entity_type\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"logistics\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"operation\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"create\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"source\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"api_bulk\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"counts\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: { `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"submitted\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"succeeded\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"failed\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"chunks_total\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"chunks_done\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"2026-10-15T08:00:00.000Z\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"finished_at\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`null`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"links\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"self\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"/v2/ingest-jobs/4f0b8b3e-6a41-4b7e-9d0c-2c1f3a5e8d10\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"items\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"/v2/ingest-jobs/4f0b8b3e-6a41-4b7e-9d0c-2c1f3a5e8d10/items\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})}),`\n`,_jsx(ResponseField,{name:`id`,type:`uuid`,id:`param-id`,children:_jsxs(_components.p,{children:[`Ingest job id. Use it with `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/get`,children:_jsx(_components.code,{children:`GET /v2/ingest-jobs/{job_id}`})}),`.`]})}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`processing`}),` right after the request. See `,_jsx(_components.a,{href:`#job-status`,children:`Job status`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`entity_type`,type:`string`,id:`param-entity-type`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`logistics`}),` for this endpoint.`]})}),`\n`,_jsx(ResponseField,{name:`operation`,type:`string`,id:`param-operation`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`create`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`source`,type:`string`,id:`param-source`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`api_bulk`}),` when sent with an API key; `,_jsx(_components.code,{children:`app`}),` when sent by a person signed in to Dcycle.`]})}),`\n`,_jsx(ResponseField,{name:`counts`,type:`object`,id:`param-counts`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`submitted`}),`: legs in the request, all of them stored. `,_jsx(_components.code,{children:`succeeded`}),`: legs calculated. `,_jsx(_components.code,{children:`failed`}),`: legs whose\ncalculation failed; the job’s items say which ones and why.`]})}),`\n`,_jsx(ResponseField,{name:`chunks_total`,type:`integer`,id:`param-chunks-total`,children:_jsx(_components.p,{children:`Number of chunks the legs are calculated in.`})}),`\n`,_jsx(ResponseField,{name:`chunks_done`,type:`integer`,id:`param-chunks-done`,children:_jsxs(_components.p,{children:[`Chunks already calculated. `,_jsx(_components.code,{children:`chunks_done / chunks_total`}),` is the job’s progress.`]})}),`\n`,_jsx(ResponseField,{name:`created_at`,type:`datetime`,id:`param-created-at`,children:_jsx(_components.p,{children:`When the job was created (UTC).`})}),`\n`,_jsx(ResponseField,{name:`finished_at`,type:`datetime | null`,id:`param-finished-at`,children:_jsxs(_components.p,{children:[`When the last chunk finished (UTC), `,_jsx(_components.code,{children:`null`}),` while the job is processing.`]})}),`\n`,_jsx(ResponseField,{name:`links`,type:`object`,id:`param-links`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`self`}),`: the job. `,_jsx(_components.code,{children:`items`}),`: its per-leg outcomes.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`job-status`,children:`Job status`}),`\n`,_jsxs(_components.p,{children:[`Poll `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/get`,children:_jsx(_components.code,{children:`GET /v2/ingest-jobs/{id}`})}),` or, for a job submitted with an API key, subscribe\nto `,_jsx(_components.code,{children:`ingest_job.finished`}),`. `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/list-items`,children:_jsx(_components.code,{children:`GET /v2/ingest-jobs/{id}/items`})}),` maps each record\n(`,_jsx(_components.code,{children:`source_row_index`}),`, `,_jsx(_components.code,{children:`client_row_id`}),`) to its leg (`,_jsx(_components.code,{children:`entity_id`}),`) and its result.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`status`})}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`processing`})}),_jsx(_components.td,{children:`The legs are stored; their distance and emissions are being calculated.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`completed`})}),_jsx(_components.td,{children:`Every leg was calculated.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`completed_with_errors`})}),_jsxs(_components.td,{children:[`At least one leg (possibly all of them) failed to calculate (`,_jsx(_components.code,{children:`counts.failed > 0`}),`): every chunk ran, or the job stopped moving and was closed within 4 to 5 hours, its pending legs `,_jsx(_components.code,{children:`JOB_TIMED_OUT`}),` (see `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/get#a-job-that-does-not-finish`,children:`A job that does not finish`}),`).`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`failed`}),` is reserved: treat every status other than `,_jsx(_components.code,{children:`processing`}),` as finished.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`If `,_jsx(_components.code,{children:`chunks_done`}),` stops moving, see `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/get#a-job-that-does-not-finish`,children:`A job that does not finish`}),`.\nResending the batch with a new `,_jsx(_components.code,{children:`Idempotency-Key`}),` starts a second job, which updates the same legs (they are\nupserted on their business key); the first one is closed within 4 to 5 hours without progress, its pending legs\n`,_jsx(_components.code,{children:`JOB_TIMED_OUT`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[`The job calculates each leg and its package’s totals, not the organization’s logistics intensity values (by TOC and\nyear, hub and project). A TOC and year that appear for the first time get the TOC’s well-to-wheel factor. An\norganization with own-fleet energy (`,_jsx(_components.a,{href:`/api-reference/logistics/create-recharges-bulk`,children:`recharges`}),`, or supercharger\ninvoices, assigned to a TOC) has its values recalculated every night. Those values are what\n`,_jsx(_components.a,{href:`/api-reference/logistics/list-requests`,children:`List Logistics Requests`}),` (`,_jsx(_components.code,{children:`kgco2e`}),`) and the\n`,_jsx(_components.a,{href:`/api-reference/logistics/get-report`,children:`logistics report`}),` apply to each tonne-kilometre; the package totals of\n`,_jsx(_components.a,{href:`/api-reference/logistics/get-packages-v2`,children:`Get Logistics Packages (v2)`}),` do not use them.`]}),`\n`,_jsx(Heading,{level:`3`,id:`reading-the-emissions`,children:`Reading the emissions`}),`\n`,_jsxs(_components.p,{children:[`Read the result per package, with `,_jsx(_components.a,{href:`/api-reference/logistics/get-packages-v2`,children:`Get Logistics Packages (v2)`}),`: up to 100\npackages per request, each with `,_jsx(_components.code,{children:`total_co2e`}),` and `,_jsx(_components.code,{children:`total_distance_km`}),` over its active legs. It takes the packages’\nDcycle ids. The job’s items give each record’s leg (`,_jsx(_components.code,{children:`entity_id`}),`), not its package: get the package ids from\n`,_jsx(_components.a,{href:`/api-reference/logistics/list-packages`,children:`List Packages`}),`, filtered by your `,_jsx(_components.code,{children:`package_key`}),` (its `,_jsx(_components.code,{children:`movement_id`}),` filter\nmatches only the package’s first leg). Read the packages once the job has finished: until then their totals miss the\nlegs not yet calculated. A leg that failed to calculate still counts in its package’s total with the tonne-kilometres\nstored when it was received, if it had any (your `,_jsx(_components.code,{children:`tkm`}),`, or your `,_jsx(_components.code,{children:`distance_km`}),` and its load).`]}),`\n`,_jsx(Heading,{level:`3`,id:`why-a-leg-failed-to-calculate`,children:`Why a leg failed to calculate`}),`\n`,_jsxs(_components.p,{children:[`A failed item’s `,_jsx(_components.code,{children:`error_code`}),` says why, and `,_jsx(_components.code,{children:`error_params.message`}),` explains it. The leg stays stored without emissions\n(and without a distance, unless you sent one); the reason is only on the job item. Fix the cause and send the leg\nagain: with the same business key it is updated in place.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`error_code`})}),_jsx(_components.th,{children:`Cause`}),_jsx(_components.th,{children:`Fix`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`DISTANCE_CALCULATION_ERROR`})}),_jsxs(_components.td,{children:[`An address could not be located, the route between `,_jsx(_components.code,{children:`origin`}),` and `,_jsx(_components.code,{children:`destination`}),` gave 0 km between points more than 1 km apart, or there is no route. A geocoding service that did not answer also ends here`]}),_jsxs(_components.td,{children:[`Send a more precise address, or `,_jsx(_components.code,{children:`distance_km`}),`; send the leg again if the addresses are right`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`SEA_CROSSING_REQUIRES_MARITIME_MODE`})}),_jsx(_components.td,{children:`Origin and destination are separated by sea, so the leg cannot go by road or rail`}),_jsxs(_components.td,{children:[`Declare a maritime `,_jsx(_components.code,{children:`toc`}),`/`,_jsx(_components.code,{children:`category`}),`, or split the leg`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`NO_DISTANCE`})}),_jsxs(_components.td,{children:[`The route gave 0 km between points 1 km or less apart (e.g. an `,_jsx(_components.code,{children:`air`}),` or `,_jsx(_components.code,{children:`maritime`}),` leg whose two addresses are the same place)`]}),_jsxs(_components.td,{children:[`Send `,_jsx(_components.code,{children:`distance_km`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`NO_LOAD`})}),_jsx(_components.td,{children:`The load converted to kilograms is below 0.005 kg, so it is stored as 0`}),_jsx(_components.td,{children:`Send the real load`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`CALCULATION_FAILED`})}),_jsxs(_components.td,{children:[`The calculation failed unexpectedly, for example emissions too large to store; `,_jsx(_components.code,{children:`error_params`}),` is `,_jsx(_components.code,{children:`null`})]}),_jsxs(_components.td,{children:[`Check the leg’s load and distance; if they are right, contact support with the job `,_jsx(_components.code,{children:`id`})]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`An address the distance engine cannot geocode, or one made only of punctuation, comes as\n`,_jsx(_components.code,{children:`DISTANCE_CALCULATION_ERROR`}),`; `,_jsx(_components.code,{children:`error_params.message`}),` says what failed. An empty or blank address is rejected with the\nrequest (`,_jsx(_components.code,{children:`ADDRESS_REQUIRED`}),`), when the leg has no `,_jsx(_components.code,{children:`distance_km`}),`. A `,_jsx(_components.code,{children:`road`}),` or `,_jsx(_components.code,{children:`rail`}),` leg whose two addresses are\nthe same place is not an error: it is calculated as 3 km (2.85 km for `,_jsx(_components.code,{children:`road`}),`, after the adjustment factor).`]}),`\n`,_jsx(Heading,{level:`4`,id:`the-leg-changed-while-the-job-was-running-rare`,children:`The leg changed while the job was running (rare)`}),`\n`,_jsxs(_components.p,{children:[`The legs are calculated after the `,_jsx(_components.code,{children:`202`}),`, reading each leg as it is at that moment.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`error_code`})}),_jsx(_components.th,{children:`Cause`}),_jsx(_components.th,{children:`Fix`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`NO_TOC`})}),_jsx(_components.td,{children:`The leg’s TOC was retired from the catalogue before the leg was calculated`}),_jsxs(_components.td,{children:[`Send it again with a current `,_jsx(_components.code,{children:`toc`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`NOT_FOUND`})}),_jsx(_components.td,{children:`The leg was deleted before it was calculated`}),_jsx(_components.td,{children:`Send it again if you still need it`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`If you send a leg again while an earlier job that contains it is still `,_jsx(_components.code,{children:`processing`}),`, both jobs calculate it with the\ndata it has when their chunk runs, and both report it as succeeded. Wait for the first job to finish before you send\na leg again.`]}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(_components.p,{children:[`Errors follow `,_jsx(_components.a,{href:`/api-reference/errors`,children:`RFC 9457 problem details`}),` (`,_jsx(_components.code,{children:`Content-Type: application/problem+json`}),`): a stable\n`,_jsx(_components.code,{children:`code`}),`, a human `,_jsx(_components.code,{children:`detail`}),`, `,_jsx(_components.code,{children:`errors`}),` when there is a list of problems, and the `,_jsx(_components.code,{children:`request_id`}),` to quote to support.`]}),`\n`,_jsx(Heading,{level:`3`,id:`422-bulk_records_rejected-—-invalid-records`,children:`422 BULK_RECORDS_REJECTED — invalid records`}),`\n`,_jsxs(_components.p,{children:[`Nothing was written. `,_jsx(_components.code,{children:`rejected`}),` is how many records are invalid and `,_jsx(_components.code,{children:`errors`}),` lists them (up to 100) in submission\norder, with `,_jsx(_components.code,{children:`source_row_index`}),` (starting at 0), your `,_jsx(_components.code,{children:`client_row_id`}),` and a stable `,_jsx(_components.code,{children:`error_code`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Each record carries `,_jsx(_components.strong,{children:`one`}),` `,_jsx(_components.code,{children:`error_code`}),`: the first rule it breaks. A record with two problems shows the second one\nonly after you fix the first, so validate again with `,_jsx(_components.code,{children:`?dry_run=true`}),` before sending the batch. (`,_jsx(_components.code,{children:`SCHEMA_INVALID`}),` is\nthe exception inside a record: its `,_jsx(_components.code,{children:`error_params.errors`}),` lists the record’s schema problems, up to 10.)`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"https://code.dcycle.io/api-reference/errors#BULK_RECORDS_REJECTED\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"title\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Unprocessable Entity\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`422`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"BULK_RECORDS_REJECTED\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"detail\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"3 of the submitted records are invalid; nothing was written.\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"errors\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"source_row_index\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"client_row_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"row-2\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"error_code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"INVALID_LOAD\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"error_params\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: {`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"detail\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Load cannot be negative or 0\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"source_row_index\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`2`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"client_row_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"row-3\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"error_code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"SCHEMA_INVALID\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"error_params\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: {`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"errors\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: [{`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"loc\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: [`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"category\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`], `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"value_error\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"msg\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Value error, Invalid category\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}]}},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"source_row_index\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`3`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"client_row_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"row-4\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"error_code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"DUPLICATE_RECORD\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"error_params\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: {`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"duplicate_of\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"rejected\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`3`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"request_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"b2248a31-0f5e-4a54-9f0a-3d1f2b6c7e90\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`error_code`})}),_jsx(_components.th,{children:`Cause`}),_jsx(_components.th,{children:`Fix`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`SCHEMA_INVALID`})}),_jsxs(_components.td,{children:[`The record does not match the schema: a wrong type; `,_jsx(_components.code,{children:`category`}),` other than `,_jsx(_components.code,{children:`road`}),`, `,_jsx(_components.code,{children:`rail`}),`, `,_jsx(_components.code,{children:`maritime`}),` or `,_jsx(_components.code,{children:`air`}),` (lowercase), or `,_jsx(_components.code,{children:`null`}),` without a `,_jsx(_components.code,{children:`toc`}),`; `,_jsx(_components.code,{children:`origin_country`}),` not ISO 3166-1 alpha-2 or `,_jsx(_components.code,{children:`GLO`}),`; `,_jsx(_components.code,{children:`load_factor`}),` outside (0, 1]; `,_jsx(_components.code,{children:`package_key`}),` without `,_jsx(_components.code,{children:`movement_id`}),`; `,_jsx(_components.code,{children:`subcontractor`}),` missing or `,_jsx(_components.code,{children:`null`}),`; `,_jsx(_components.code,{children:`subcontractor_type`}),` other than `,_jsx(_components.code,{children:`fis`}),`/`,_jsx(_components.code,{children:`nis`}),`, or with `,_jsx(_components.code,{children:`subcontractor: false`}),`; `,_jsx(_components.code,{children:`movement_id`}),`, `,_jsx(_components.code,{children:`movement_stretch`}),`, `,_jsx(_components.code,{children:`movement_stage`}),`, `,_jsx(_components.code,{children:`client`}),`, `,_jsx(_components.code,{children:`package_key`}),`, `,_jsx(_components.code,{children:`hub_name`}),` or a license plate over 255 characters; `,_jsx(_components.code,{children:`hub_id`}),` that is not a UUID; both `,_jsx(_components.code,{children:`hub_id`}),` and `,_jsx(_components.code,{children:`hub_name`}),`; a text with a NUL character (`,_jsx(_components.code,{children:`string_contains_nul`}),`; in `,_jsx(_components.code,{children:`origin`}),` and `,_jsx(_components.code,{children:`destination`}),` it is dropped instead) or a lone surrogate such as `,_jsx(_components.code,{children:`\\\\ud800`}),` (`,_jsx(_components.code,{children:`string_unicode`}),`); `,_jsx(_components.code,{children:`client_row_id`}),` over 255 characters; or the record is not a JSON object. `,_jsx(_components.code,{children:`error_params.errors`}),` lists each problem (`,_jsx(_components.code,{children:`loc`}),`, `,_jsx(_components.code,{children:`type`}),`, `,_jsx(_components.code,{children:`msg`}),`)`]}),_jsx(_components.td,{children:`Fix the fields listed`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`INVALID_LOAD`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`load`}),` is 0 or negative (`,_jsx(_components.code,{children:`error_params.detail`}),`)`]}),_jsxs(_components.td,{children:[`Send a positive `,_jsx(_components.code,{children:`load`}),`, or omit it to use the TOC’s default`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`INVALID_DISTANCE`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`distance_km`}),` is 0 or negative (`,_jsx(_components.code,{children:`error_params.detail`}),`)`]}),_jsxs(_components.td,{children:[`Send a positive `,_jsx(_components.code,{children:`distance_km`}),`, or omit it to have it computed`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ACTIVITY_DATE_OUT_OF_RANGE`})}),_jsxs(_components.td,{children:[`The year of `,_jsx(_components.code,{children:`shipment_date`}),` is before 1970 or after next year (`,_jsx(_components.code,{children:`error_params.detail`}),`)`]}),_jsx(_components.td,{children:`Fix the date`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ADDRESS_REQUIRED`})}),_jsxs(_components.td,{children:[`No `,_jsx(_components.code,{children:`distance_km`}),`, and `,_jsx(_components.code,{children:`origin`}),` or `,_jsx(_components.code,{children:`destination`}),` is missing or blank (with `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),`, the hub has no address), so the distance could not be computed (`,_jsx(_components.code,{children:`error_params.fields`}),`: the missing ones)`]}),_jsxs(_components.td,{children:[`Send both addresses, or `,_jsx(_components.code,{children:`distance_km`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ADDRESS_TOO_LONG`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`origin`}),` or `,_jsx(_components.code,{children:`destination`}),` (the hub’s address, when a hub replaces it) is over 500 characters (`,_jsx(_components.code,{children:`error_params`}),`: `,_jsx(_components.code,{children:`field`}),`, `,_jsx(_components.code,{children:`length`}),`, `,_jsx(_components.code,{children:`max`}),`)`]}),_jsx(_components.td,{children:`Send the address alone`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`REFERENCE_NOT_FOUND`})}),_jsxs(_components.td,{children:[`No active hub of your organization has this `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),` (`,_jsx(_components.code,{children:`error_params`}),`: `,_jsx(_components.code,{children:`field`}),`, `,_jsx(_components.code,{children:`value`}),`; plus `,_jsx(_components.code,{children:`status`}),`, the hub’s status (`,_jsx(_components.code,{children:`archived`}),` or `,_jsx(_components.code,{children:`error`}),`), when your organization’s hub exists but is not active). Another organization’s hub answers the same as an unknown one`]}),_jsxs(_components.td,{children:[`Create the hub first with `,_jsx(_components.a,{href:`/api-reference/logistic-hubs/create-v2`,children:`Create Logistic Hubs (v2)`}),`, or reactivate it, or fix the reference`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`TOC_NOT_FOUND`})}),_jsxs(_components.td,{children:[`No TOC matches `,_jsx(_components.code,{children:`toc`}),`, and no generic average of `,_jsx(_components.code,{children:`category`}),` exists, in the region of `,_jsx(_components.code,{children:`origin_country`}),`, in `,_jsx(_components.code,{children:`GLO`}),` or in `,_jsx(_components.code,{children:`EU`}),`; also when neither `,_jsx(_components.code,{children:`toc`}),` nor `,_jsx(_components.code,{children:`category`}),` is sent (`,_jsx(_components.code,{children:`error_params`}),`: `,_jsx(_components.code,{children:`toc`}),`, `,_jsx(_components.code,{children:`category`}),`, `,_jsx(_components.code,{children:`region`}),`)`]}),_jsxs(_components.td,{children:[`Use a TOC from `,_jsx(_components.a,{href:`/api-reference/logistics/list-tocs`,children:`List TOCs`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`LOAD_NOT_AVAILABLE`})}),_jsxs(_components.td,{children:[`No `,_jsx(_components.code,{children:`load`}),`, and the TOC has no default load (`,_jsx(_components.code,{children:`error_params`}),`: `,_jsx(_components.code,{children:`toc`}),`, `,_jsx(_components.code,{children:`category`}),`)`]}),_jsxs(_components.td,{children:[`Send `,_jsx(_components.code,{children:`load`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`DUPLICATE_RECORD`})}),_jsxs(_components.td,{children:[`Another record of the batch has the same `,_jsx(_components.a,{href:`#legs-are-upserted-on-their-business-key`,children:`business key`}),` (`,_jsx(_components.code,{children:`error_params.duplicate_of`}),`: its index)`]}),_jsxs(_components.td,{children:[`Send each leg once, each with its own `,_jsx(_components.code,{children:`movement_id`})]})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`422-idempotency_key_reused`,children:`422 IDEMPOTENCY_KEY_REUSED`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`Idempotency-Key`}),` was already used in this organization, within the last 24 hours, with a different body or on\nanother route. Nothing is written. Send a new key for a new batch; to retry the original batch, resend exactly the same\nbody to the same route. The order of the fields and how a whole number is written (`,_jsx(_components.code,{children:`1000`}),` or `,_jsx(_components.code,{children:`1000.0`}),`) do not matter,\nbut the values must be identical: `,_jsx(_components.code,{children:`null`}),` and an omitted field are a different body.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"https://code.dcycle.io/api-reference/errors#IDEMPOTENCY_KEY_REUSED\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"title\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Unprocessable Entity\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`422`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"IDEMPOTENCY_KEY_REUSED\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"detail\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"This Idempotency-Key was already used with a different request body or on another route. Use a new key per batch.\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"request_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"b2248a31-0f5e-4a54-9f0a-3d1f2b6c7e90\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`409-idempotency_key_in_progress`,children:`409 IDEMPOTENCY_KEY_IN_PROGRESS`}),`\n`,_jsxs(_components.p,{children:[`Another request with the same `,_jsx(_components.code,{children:`Idempotency-Key`}),` was still being processed, typically your own retry after a timeout.\nThis request wrote no leg and created no job (packages it named may have been created; later requests reuse\nthem). Wait the `,_jsx(_components.code,{children:`Retry-After`}),` seconds and retry with the same key and body: you get the job of the request that went\nthrough. See `,_jsx(_components.a,{href:`/api-reference/errors#IDEMPOTENCY_KEY_IN_PROGRESS`,children:`IDEMPOTENCY_KEY_IN_PROGRESS`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`422-request_validation_failed-—-malformed-request`,children:`422 REQUEST_VALIDATION_FAILED — malformed request`}),`\n`,_jsxs(_components.p,{children:[`The request itself is invalid: the `,_jsx(_components.code,{children:`Idempotency-Key`}),` header is missing, empty or over 255 characters; the body is not\nJSON; or `,_jsx(_components.code,{children:`records`}),` is missing, empty or has more than 5,000 entries. `,_jsx(_components.code,{children:`errors`}),` lists each problem with where it is\n(`,_jsx(_components.code,{children:`loc`}),`). See `,_jsx(_components.a,{href:`/api-reference/errors`,children:`Errors`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`401-400-and-403-key-and-organization`,children:`401, 400 and 403: key and organization`}),`\n`,_jsxs(_components.p,{children:[`Before the records are looked at, the API key and the organization are checked. Each code has its section in\n`,_jsx(_components.a,{href:`/api-reference/errors#codes`,children:`Errors`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`401`}),`: no API key (`,_jsx(_components.code,{children:`AUTHENTICATION_REQUIRED`}),`), a wrong or revoked one (`,_jsx(_components.code,{children:`INVALID_API_KEY`}),`), an expired one\n(`,_jsx(_components.code,{children:`API_KEY_EXPIRED`}),`), a key of an organization that is neither this one nor one of its parents\n(`,_jsx(_components.code,{children:`API_KEY_ORG_MISMATCH`}),`) or one too old to have an owner (`,_jsx(_components.code,{children:`API_KEY_NO_OWNER`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`400 ORGANIZATION_ID_REQUIRED`}),`: no `,_jsx(_components.code,{children:`x-organization-id`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`403`}),`: the key’s creator is not a member of the organization in `,_jsx(_components.code,{children:`x-organization-id`}),` (`,_jsx(_components.code,{children:`LOGGED_USER_NOT_MEMBER`}),`),\nthe key is read-only (`,_jsx(_components.code,{children:`API_KEY_SCOPE_DENIED`}),`), or its creator is a Viewer (`,_jsx(_components.code,{children:`VIEWER_CANNOT_WRITE`}),`).`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`429-too_many_requests`,children:`429 TOO_MANY_REQUESTS`}),`\n`,_jsxs(_components.p,{children:[`More than 10 requests in flight at once with your API key on this endpoint. The request was not processed. Wait the\n`,_jsx(_components.code,{children:`Retry-After`}),` seconds (10, rising to 20 if you keep hitting the limit) and retry.`]}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsx(Heading,{level:`3`,id:`create-a-batch-and-wait-for-the-calculation`,children:`Create a batch and wait for the calculation`}),`\n`,_jsx(CodeBlock,{filename:`Python`,numberOfLines:`65`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`65`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` time`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` uuid`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`BASE`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"https://api.dcycle.io\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`HEADERS`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"x-api-key\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: os.environ[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"DCYCLE_API_KEY\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"x-organization-id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: os.environ[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"DCYCLE_ORG_ID\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`records `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"client_row_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"SHIP-001\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"movement_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"SHIP-001\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:`# unique per leg: it is part of the leg's business key`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"origin\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Madrid, Spain\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"destination\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Barcelona, Spain\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"origin_country\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"ES\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"load\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1000`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"load_unit\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"kg\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"toc\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"van_3_5_t_diesel\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:`# copied from GET /v1/logistics/tocs`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"subcontractor\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`True`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:`# required: False for your own fleet`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"shipment_date\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"2026-10-01\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:`# One key per batch: reuse it only to retry this same batch.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`response `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` f`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`{BASE}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`/v2/logistics/requests\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` headers`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`**`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`HEADERS`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Idempotency-Key\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`str`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(uuid.uuid4())},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` json`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"records\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: records},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` timeout`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`120`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` response.status_code `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`==`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 422`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` and`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` response.json().get(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`) `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`==`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"BULK_RECORDS_REJECTED\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` for`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` rejection `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`in`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` response.json()[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"errors\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` print`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(rejection[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"source_row_index\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`], rejection[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"client_row_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`], rejection[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"error_code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` rejection[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"error_params\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` raise`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` SystemExit`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Fix the listed records and send the whole batch again\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`response.raise_for_status()`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`job_url `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` BASE`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` +`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` response.headers[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Location\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`deadline `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` time.monotonic() `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`+`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 60`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` *`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 60`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`while`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` True`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` job_response `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` requests.get(job_url, `}),_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:`headers`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`HEADERS`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:`timeout`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`30`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` job_response.raise_for_status()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` job `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` job_response.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` job[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`] `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`!=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"processing\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` time.monotonic() `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`>`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` deadline:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` raise`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` SystemExit`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`f`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Job `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`{`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`job[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'id'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` is still processing after an hour: contact support with its id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` time.sleep(`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`10`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`page `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`while`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` job[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`] `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`==`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"completed_with_errors\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:`# read every page of failures`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` failed `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` requests.get(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` f`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`{`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`job_url`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`/items\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` headers`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`HEADERS`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` params`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"failed\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"size\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`500`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"page\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: page},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` timeout`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`30`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` ).json()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` for`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` item `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`in`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` failed[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"items\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` print`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"not calculated:\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, item[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"client_row_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`], item[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"error_code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`], item[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"error_params\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` page `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`*`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` failed[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"size\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`] `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`>=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` failed[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"total\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` page `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`+=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 1`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`retries-and-idempotency`,children:`Retries and idempotency`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Network error or timeout:`}),` retry with the `,_jsx(_components.strong,{children:`same`}),` `,_jsx(_components.code,{children:`Idempotency-Key`}),` and the same body. If the first attempt\nwas accepted you get its job back, and nothing is written twice.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`409 IDEMPOTENCY_KEY_IN_PROGRESS`}),`:`]}),` the first request with that key is still being processed. Wait\n`,_jsx(_components.code,{children:`Retry-After`}),` seconds and retry with the same key and body.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`422 BULK_RECORDS_REJECTED`}),`:`]}),` nothing was written. Fix the records and send the batch again; the same key works,\nsince the first request created no job.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`422 IDEMPOTENCY_KEY_REUSED`}),`:`]}),` the key already belongs to another batch. Use a new key, or resend the original\nbody unchanged.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`429`}),`:`]}),` too many requests in flight for your API key on this endpoint (unlike the `,_jsx(_components.code,{children:`Idempotency-Key`}),`, the\nlimit is per key, not per organization). Wait `,_jsx(_components.code,{children:`Retry-After`}),` seconds; the request was not processed.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`A new batch needs a new key.`}),`\n`,_jsx(Heading,{level:`2`,id:`limits`,children:`Limits`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Limit`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Records per request`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1 to 5,000`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Maximum concurrent requests`}),_jsx(_components.td,{children:`10 per API key, per endpoint`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Requests over the cap get HTTP `,_jsx(_components.code,{children:`429`}),` with a `,_jsx(_components.code,{children:`Retry-After`}),` header. The cap is on requests in flight at once, not on\nrequests per second — see `,_jsx(_components.a,{href:`/api-reference/rate-limits`,children:`Rate Limits`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`related-endpoints`,children:`Related Endpoints`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Get Ingest Job`,icon:`clock`,href:`/api-reference/ingest-jobs/get`,children:_jsx(_components.p,{children:`Follow the calculation`})}),_jsx(Card,{title:`List Ingest Job Items`,icon:`list-check`,href:`/api-reference/ingest-jobs/list-items`,children:_jsx(_components.p,{children:`Per-leg outcomes, including calculation failures`})}),_jsx(Card,{title:`List TOCs`,icon:`truck`,href:`/api-reference/logistics/list-tocs`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`toc`}),` values to send`]})}),_jsx(Card,{title:`List Requests`,icon:`list`,href:`/api-reference/logistics/list-requests`,children:_jsx(_components.p,{children:`Retrieve requests with filtering and pagination`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light","dark":"github-dark"}},"config":{},"pageMetadata":{"title":"Create Logistics Requests (v2)","api":"POST /v2/logistics/requests","description":"Create one or up to 5,000 logistics legs in one request; their distance and emissions are calculated by an ingest job","tag":"BETA","href":"/api-reference/logistics/create-requests-v2"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Expandable,Heading,ParamField,RequestExample,ResponseExample,ResponseField,Table,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:_jsx(_components.a,{href:`/api-reference/logistics/overview`,children:`← Logistics API`})}),`\n`,_jsxs(_components.p,{children:[`Creates one or up to 5,000 logistics legs (shipments) in one request. The legs are written at once and their distance and\nemissions are calculated asynchronously by an `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/get`,children:`ingest job`}),`: the answer is the job\n(`,_jsx(_components.code,{children:`202`}),`, `,_jsx(_components.code,{children:`processing`}),`), never the legs (see `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/overview`,children:`how bulk ingestion works`}),`).`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`All or nothing.`}),` If any record is invalid the answer is `,_jsx(_components.code,{children:`422 BULK_RECORDS_REJECTED`}),` and nothing is written: no\nleg, package or hub. `,_jsx(_components.code,{children:`rejected`}),` is the number of invalid records and `,_jsx(_components.code,{children:`errors`}),` lists them (up to 100).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Idempotent.`}),` `,_jsx(_components.code,{children:`Idempotency-Key`}),` is required: retrying within 24 hours with the same key and body returns the\noriginal job, with `,_jsx(_components.code,{children:`Idempotent-Replayed: true`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Per-leg results.`}),` A leg whose distance or emissions could not be calculated is a failed item of the job, with\nits reason (`,_jsx(_components.code,{children:`error_code`}),`), and stays stored without emissions.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Beta.`}),` This endpoint is in beta: the contract may still change before general availability. Pin your\nintegration to the fields documented here and handle unknown fields in responses gracefully. Feedback is welcome\nthrough your Dcycle contact.`]})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Changed on 2026-10-16.`}),` This route used to be `,_jsx(_components.code,{children:`POST /v2/logistics/requests/bulk`}),`; only the path changed. One\nroute now creates one or many legs, as `,_jsx(_components.code,{children:`POST /v2/wastes`}),` and `,_jsx(_components.code,{children:`POST /v2/facilities`}),` do. See the\n`,_jsx(_components.a,{href:`/api-reference/changelog`,children:`changelog`}),`.`]})}),`\n`,_jsx(RequestExample,{children:_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`21`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`curl`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -i`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -X`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` POST`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"https://api.dcycle.io/v2/logistics/requests\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:' \"x-api-key: ${'}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`DCYCLE_API_KEY`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`}\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:' \"x-organization-id: ${'}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`DCYCLE_ORG_ID`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`}\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -H`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"Idempotency-Key: 7b1f9c2e-4d3a-4f8e-9a61-2c5d8e0f1a37\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -d`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"records\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"client_row_id\": \"SHIP-001\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"movement_id\": \"SHIP-001\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"origin\": \"Madrid, Spain\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"destination\": \"Barcelona, Spain\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"origin_country\": \"ES\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"load\": 1000,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"load_unit\": \"kg\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"toc\": \"van_3_5_t_diesel\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"subcontractor\": true,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"shipment_date\": \"2026-10-01\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` }'`})}),`\n`]})})})}),`\n`,_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`202`,numberOfLines:`16`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`16`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"4f0b8b3e-6a41-4b7e-9d0c-2c1f3a5e8d10\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"processing\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"entity_type\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"logistics\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"operation\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"create\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"source\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"api_bulk\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"counts\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: { `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"submitted\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"succeeded\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"failed\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"chunks_total\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"chunks_done\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"2026-10-15T08:00:00.000Z\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"finished_at\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`null`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"links\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"self\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"/v2/ingest-jobs/4f0b8b3e-6a41-4b7e-9d0c-2c1f3a5e8d10\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"items\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"/v2/ingest-jobs/4f0b8b3e-6a41-4b7e-9d0c-2c1f3a5e8d10/items\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`422`,numberOfLines:`17`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"https://code.dcycle.io/api-reference/errors#BULK_RECORDS_REJECTED\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"title\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Unprocessable Entity\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`422`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"BULK_RECORDS_REJECTED\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"detail\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"1 of the submitted records are invalid; nothing was written.\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"errors\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"source_row_index\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"client_row_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"SHIP-001\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"error_code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"INVALID_LOAD\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"error_params\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: { `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"detail\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Load cannot be negative or 0\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"rejected\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"request_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"b2248a31-0f5e-4a54-9f0a-3d1f2b6c7e90\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`200 (dry_run=true)`,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"dry_run\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`true`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"submitted\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"valid\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsx(Heading,{level:`3`,id:`headers`,children:`Headers`}),`\n`,_jsx(ParamField,{header:`x-api-key`,type:`string`,required:true,id:`param-x-api-key`,children:_jsxs(_components.p,{children:[`Your API key. Jobs submitted with an API key notify `,_jsx(_components.code,{children:`ingest_job.finished`}),` to the\n`,_jsx(_components.a,{href:`/api-reference/webhooks/overview`,children:`webhook endpoints`}),` of the `,_jsx(_components.code,{children:`x-organization-id`}),` organization.`]})}),`\n`,_jsx(ParamField,{header:`x-organization-id`,type:`string`,required:true,id:`param-x-organization-id`,children:_jsx(_components.p,{children:`UUID of the organization the legs belong to.`})}),`\n`,_jsx(ParamField,{header:`Content-Type`,type:`string`,required:true,id:`param-content-type`,children:_jsxs(_components.p,{children:[`Must be `,_jsx(_components.code,{children:`application/json`})]})}),`\n`,_jsx(ParamField,{header:`Idempotency-Key`,type:`string`,required:true,id:`param-idempotency-key`,children:_jsxs(_components.p,{children:[`1 to 255 characters. Send one key per batch (a UUID works well). The key is looked up per organization, across every\nv2 bulk route. Within 24 hours, the same key with the same route and body returns the original job (with\n`,_jsx(_components.code,{children:`Idempotent-Replayed: true`}),`) instead of writing the legs again; the same key with another body or on another route\nis `,_jsx(_components.code,{children:`422 IDEMPOTENCY_KEY_REUSED`}),`, and while the first request is still being processed `,_jsx(_components.code,{children:`409 IDEMPOTENCY_KEY_IN_PROGRESS`}),`.\nAfter 24 hours the key is free, and a request with it is a new one. See\n`,_jsx(_components.a,{href:`/api-reference/ingest-jobs/overview#the-idempotency-key`,children:`The Idempotency-Key`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`query-parameters`,children:`Query Parameters`}),`\n`,_jsx(ParamField,{query:`dry_run`,type:`boolean`,default:`false`,id:`param-dry-run`,children:_jsxs(_components.p,{children:[`Validate only: the same checks and `,_jsx(_components.code,{children:`422`}),`, but nothing is written and no job is created; a valid batch answers `,_jsx(_components.code,{children:`200`}),`\nwith `,_jsx(_components.code,{children:`{\"dry_run\": true, \"submitted\": n, \"valid\": n}`}),`. The `,_jsx(_components.code,{children:`Idempotency-Key`}),` header is still required, but a dry run\ndoes not check or store it, so you can send the real request with the same key afterwards.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`body-parameters`,children:`Body Parameters`}),`\n`,_jsxs(ParamField,{body:`records`,type:`array[object]`,required:true,id:`param-records`,children:[_jsxs(_components.p,{children:[`The legs to create, 1 to 5,000. Fields a record does not define are ignored without an error, so a misspelled field\nname (e.g. `,_jsx(_components.code,{children:`distance`}),` instead of `,_jsx(_components.code,{children:`distance_km`}),`) is lost. `,_jsx(_components.a,{href:`#how-the-fields-are-read`,children:`How the fields are read`}),` has the\ndetails that change the result.`]}),_jsxs(Expandable,{title:`record fields`,children:[_jsx(ParamField,{body:`toc`,type:`string`,id:`param-toc`,children:_jsxs(_components.p,{children:[`The transport operation category (vehicle type), as `,_jsx(_components.code,{children:`toc`}),` in `,_jsx(_components.a,{href:`/api-reference/logistics/list-tocs`,children:`List TOCs`}),`,\ne.g. `,_jsx(_components.code,{children:`van_3_5_t_diesel`}),`. Required unless you send `,_jsx(_components.code,{children:`category`}),`.`]})}),_jsx(ParamField,{body:`category`,type:`string`,id:`param-category`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`road`}),`, `,_jsx(_components.code,{children:`rail`}),`, `,_jsx(_components.code,{children:`maritime`}),` or `,_jsx(_components.code,{children:`air`}),`. Required without `,_jsx(_components.code,{children:`toc`}),`: the leg then uses that category’s generic average.`]})}),_jsx(ParamField,{body:`origin`,type:`string`,id:`param-origin`,children:_jsxs(_components.p,{children:[`Origin address (max 500 characters). With `,_jsx(_components.code,{children:`destination`}),`, needed when you do not send `,_jsx(_components.code,{children:`distance_km`}),`; a hub in\n`,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),` supplies it instead.`]})}),_jsx(ParamField,{body:`destination`,type:`string`,id:`param-destination`,children:_jsxs(_components.p,{children:[`Destination address, or the name of an active hub of your organization (replaced by its address). Max 500\ncharacters. Needed when you do not send `,_jsx(_components.code,{children:`distance_km`}),`.`]})}),_jsx(ParamField,{body:`distance_km`,type:`number`,id:`param-distance-km`,children:_jsxs(_components.p,{children:[`Distance in km, greater than 0. Used as sent. When omitted, it is computed from `,_jsx(_components.code,{children:`origin`}),` and `,_jsx(_components.code,{children:`destination`}),`.`]})}),_jsx(ParamField,{body:`origin_country`,type:`string`,default:`GLO`,id:`param-origin-country`,children:_jsxs(_components.p,{children:[`ISO 3166-1 alpha-2 code of the origin country, or `,_jsx(_components.code,{children:`GLO`}),`. Selects the region’s TOCs and emission factors.`]})}),_jsx(ParamField,{body:`load`,type:`number`,id:`param-load`,children:_jsxs(_components.p,{children:[`The load, greater than 0, in `,_jsx(_components.code,{children:`load_unit`}),`. When omitted, the TOC’s default load is used.`]})}),_jsx(ParamField,{body:`load_unit`,type:`string`,default:`kg`,id:`param-load-unit`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`kg`}),`, `,_jsx(_components.code,{children:`t`}),`/`,_jsx(_components.code,{children:`ton`}),`, `,_jsx(_components.code,{children:`pallet`}),`/`,_jsx(_components.code,{children:`pallets`}),` (1,500 kg each), `,_jsx(_components.code,{children:`teu`}),` (10,000 kg) or `,_jsx(_components.code,{children:`feu`}),` (20,000 kg).`]})}),_jsx(ParamField,{body:`load_factor`,type:`number`,default:`1`,id:`param-load-factor`,children:_jsx(_components.p,{children:`In (0, 1]; multiplies the load.`})}),_jsx(ParamField,{body:`shipment_date`,type:`date`,id:`param-shipment-date`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`YYYY-MM-DD`}),`, from 1970 to next year: the leg’s date in reports and lists. It does not change the emission\nfactor. Default: the upload date (UTC).`]})}),_jsx(ParamField,{body:`cleaning`,type:`boolean`,default:`false`,id:`param-cleaning`,children:_jsx(_components.p,{children:`Whether the vehicle was cleaned; it increases the emissions.`})}),_jsx(ParamField,{body:`subcontractor`,type:`boolean`,required:true,id:`param-subcontractor`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` if a subcontractor moved the leg, `,_jsx(_components.code,{children:`false`}),` if your own fleet did. Own-fleet legs are calculated from your\n`,_jsx(_components.a,{href:`/api-reference/logistics/create-recharges-bulk`,children:`recharges`}),`, subcontracted ones from the TOC’s factor. Required\nsince 2026-11-06: a record without it, or with `,_jsx(_components.code,{children:`null`}),`, is `,_jsx(_components.code,{children:`SCHEMA_INVALID`}),`.`]})}),_jsx(ParamField,{body:`subcontractor_type`,type:`string`,id:`param-subcontractor-type`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`fis`}),` (fully integrated) or `,_jsx(_components.code,{children:`nis`}),` (non-integrated) subcontractor, as in SQAS / ISO 14083. Only with\n`,_jsx(_components.code,{children:`subcontractor: true`}),`.`]})}),_jsx(ParamField,{body:`movement_id`,type:`string`,id:`param-movement-id`,children:_jsxs(_components.p,{children:[`Your identifier of the movement (max 255 characters). Part of the\n`,_jsx(_components.a,{href:`#legs-are-upserted-on-their-business-key`,children:`business key`}),`: send one per leg.`]})}),_jsx(ParamField,{body:`movement_stretch`,type:`string`,id:`param-movement-stretch`,children:_jsx(_components.p,{children:`The leg’s stretch within the movement (max 255 characters). Part of the business key.`})}),_jsx(ParamField,{body:`movement_stage`,type:`string`,id:`param-movement-stage`,children:_jsx(_components.p,{children:`The leg’s stage within the movement (max 255 characters). Part of the business key.`})}),_jsx(ParamField,{body:`client`,type:`string`,default:`default_client`,id:`param-client`,children:_jsx(_components.p,{children:`Your customer for this leg (max 255 characters). Part of the business key.`})}),_jsx(ParamField,{body:`package_key`,type:`string`,id:`param-package-key`,children:_jsxs(_components.p,{children:[`Your identifier of the package the leg carries (max 255 characters); legs with the same `,_jsx(_components.code,{children:`package_key`}),` form one\npackage. Requires `,_jsx(_components.code,{children:`movement_id`}),`. Part of the business key.`]})}),_jsx(ParamField,{body:`hub_id`,type:`uuid`,id:`param-hub-id`,children:_jsxs(_components.p,{children:[`The hub the leg leaves from, by its Dcycle id: the `,_jsx(_components.code,{children:`id`}),` that\n`,_jsx(_components.a,{href:`/api-reference/logistic-hubs/create-v2`,children:`Create Logistic Hubs (v2)`}),` answers, or that\n`,_jsx(_components.a,{href:`/api-reference/logistics/list-hubs`,children:`List Logistics Hubs`}),` lists. Send `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),`, not both. See\n`,_jsx(_components.a,{href:`#how-the-fields-are-read`,children:`How the fields are read`}),`.`]})}),_jsx(ParamField,{body:`hub_name`,type:`string`,id:`param-hub-name`,children:_jsxs(_components.p,{children:[`The hub the leg leaves from, by its `,_jsx(_components.code,{children:`name`}),` in your organization, matched exactly (max 255 characters): for\nexample your own code for the hub, if you created it with that name. Send `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),`, not both.`]})}),_jsx(ParamField,{body:`vehicle_license_plate`,type:`string`,id:`param-vehicle-license-plate`,children:_jsx(_components.p,{children:`Max 255 characters.`})}),_jsx(ParamField,{body:`trailer_license_plate`,type:`string`,id:`param-trailer-license-plate`,children:_jsx(_components.p,{children:`Max 255 characters.`})}),_jsx(ParamField,{body:`request_date`,type:`date`,id:`param-request-date`,children:_jsx(_components.p,{children:`The date your customer placed the order. Stored for reference; not used to calculate.`})}),_jsx(ParamField,{body:`client_row_id`,type:`string`,id:`param-client-row-id`,children:_jsxs(_components.p,{children:[`Your key for the record (max 255 characters), echoed on its job item and in a `,_jsx(_components.code,{children:`422`}),`.`]})}),_jsx(ParamField,{body:`year`,type:`integer`,id:`param-year`,children:_jsxs(_components.p,{children:[`Accepted but not used: the leg’s year is the year of `,_jsx(_components.code,{children:`shipment_date`}),`.`]})}),_jsx(ParamField,{body:`tkm`,type:`number`,id:`param-tkm`,children:_jsx(_components.p,{children:`Accepted but recalculated as load in tonnes × distance; kept only if the leg’s calculation fails.`})})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`how-the-fields-are-read`,children:`How the fields are read`}),`\n`,_jsxs(_components.p,{children:[`Several mistakes are accepted with `,_jsx(_components.code,{children:`202`}),` and calculated with a value you did not intend. Check these before you\nintegrate:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`toc`}),`:`]}),` copy the `,_jsx(_components.code,{children:`toc`}),` of `,_jsx(_components.a,{href:`/api-reference/logistics/list-tocs`,children:`List TOCs`}),` exactly, e.g. `,_jsx(_components.code,{children:`van_3_5_t_diesel`}),`. It\nis matched loosely (case, spaces and dots are ignored, and a TOC whose vehicle and type both appear in the text\nmatches), so a near miss can resolve to another TOC. It is looked up in the region of `,_jsx(_components.code,{children:`origin_country`}),` (`,_jsx(_components.code,{children:`GLO`}),` when\nomitted), then in `,_jsx(_components.code,{children:`GLO`}),`, then in `,_jsx(_components.code,{children:`EU`}),`. If it matches no TOC and you sent `,_jsx(_components.code,{children:`category`}),`, the leg is calculated with that\ncategory’s generic average, `,_jsx(_components.strong,{children:`without an error`}),`. Send `,_jsx(_components.code,{children:`category`}),` alone only when you want that average.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`load_unit`}),`:`]}),` `,_jsx(_components.code,{children:`kg`}),` (default), `,_jsx(_components.code,{children:`t`}),` or `,_jsx(_components.code,{children:`ton`}),`, `,_jsx(_components.code,{children:`pallet`}),` or `,_jsx(_components.code,{children:`pallets`}),` (1,500 kg each), `,_jsx(_components.code,{children:`teu`}),` (10,000 kg) and `,_jsx(_components.code,{children:`feu`}),`\n(20,000 kg), in any case. `,_jsx(_components.strong,{children:`Any other value is read as kilograms, without an error.`})]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`load`}),`:`]}),` optional; without it, the TOC’s default load is used. `,_jsx(_components.code,{children:`load_factor`}),` multiplies the load, the default\nload included. The load is stored in kg with two decimals.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`distance_km`}),`:`]}),` used as sent. When you omit it, the distance is computed from `,_jsx(_components.code,{children:`origin`}),` and `,_jsx(_components.code,{children:`destination`}),` and\nmultiplied by a distance adjustment factor: 0.95 for `,_jsx(_components.code,{children:`road`}),`, 0.85 for `,_jsx(_components.code,{children:`maritime`}),`, 1 for `,_jsx(_components.code,{children:`rail`}),` and `,_jsx(_components.code,{children:`air`}),`. A distance\nyou send is not adjusted.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`origin`}),` and `,_jsx(_components.code,{children:`destination`}),`:`]}),` a leg without `,_jsx(_components.code,{children:`distance_km`}),` needs both (a hub in `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),` supplies\nthe origin); a record missing either is rejected with `,_jsx(_components.code,{children:`ADDRESS_REQUIRED`}),`. A `,_jsx(_components.code,{children:`destination`}),` equal to the name of an\nactive hub of your organization is replaced by the hub’s address. `,_jsx(_components.code,{children:`origin`}),` is not read as a hub name here; use\n`,_jsx(_components.code,{children:`hub_name`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`hub_id`}),` / `,_jsx(_components.code,{children:`hub_name`}),`:`]}),` the hub the leg leaves from, by its Dcycle id or by its exact name. The hub must exist:\n`,_jsx(_components.strong,{children:`no hub is created`}),`. Create your hubs first with\n`,_jsx(_components.a,{href:`/api-reference/logistic-hubs/create-v2`,children:`Create Logistic Hubs (v2)`}),`. The leg’s origin is the hub’s address, and the\n`,_jsx(_components.code,{children:`origin`}),` you send is ignored. A hub that does not exist, is another organization’s, or is not active is\n`,_jsx(_components.code,{children:`REFERENCE_NOT_FOUND`}),`. An empty `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),` (`,_jsx(_components.code,{children:`\"\"`}),`) means no hub, as if omitted.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`shipment_date`}),`:`]}),` optional; without it the leg is dated at the upload time (UTC).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`year`})}),` and `,_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`tkm`}),`:`]}),` not used to calculate the leg. Its year is the year of `,_jsx(_components.code,{children:`shipment_date`}),`, and `,_jsx(_components.code,{children:`tkm`}),` is\nrecalculated as load in tonnes × distance; a `,_jsx(_components.code,{children:`tkm`}),` you send stays on the leg only if its calculation fails. The\nemission factor is the TOC’s (for an electric TOC, the grid factor of `,_jsx(_components.code,{children:`origin_country`}),`), whatever the date.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`legs-are-upserted-on-their-business-key`,children:`Legs are upserted on their business key`}),`\n`,_jsxs(_components.p,{children:[`The business key of a leg is, within your organization, `,_jsx(_components.code,{children:`movement_id`}),`, `,_jsx(_components.code,{children:`movement_stretch`}),`, `,_jsx(_components.code,{children:`movement_stage`}),`,\n`,_jsx(_components.code,{children:`client`}),` (`,_jsx(_components.code,{children:`default_client`}),` when omitted) and `,_jsx(_components.code,{children:`package_key`}),`. A key field you omit counts as empty.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Sending a leg again`}),` in a later batch replaces it: every field takes the value you send or its default (an\nomitted `,_jsx(_components.code,{children:`shipment_date`}),` becomes the upload time, a leg sent without `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),` unlinks the hub), its emissions are cleared,\nand it is calculated again. Its id is kept. Changing a key field, such as `,_jsx(_components.code,{children:`package_key`}),`, creates a new leg and\nleaves the old one.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Two records of the same batch with the same key`}),` are rejected (`,_jsx(_components.code,{children:`DUPLICATE_RECORD`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Legs created by any other route`}),` (the app, file uploads, the v1 endpoints) share the key: a leg sent here\nreplaces the leg with the same key, wherever it came from.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[`Send a unique `,_jsx(_components.code,{children:`movement_id`}),` per leg.`]}),` Legs without `,_jsx(_components.code,{children:`movement_id`}),` that share `,_jsx(_components.code,{children:`client`}),`, `,_jsx(_components.code,{children:`movement_stretch`}),` and\n`,_jsx(_components.code,{children:`movement_stage`}),` are the same leg: in one batch the second and later ones are rejected with `,_jsx(_components.code,{children:`DUPLICATE_RECORD`}),`, and\nwith them the whole batch; in a later batch each one replaces the previous one.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(Heading,{level:`3`,id:`202-accepted`,children:`202 Accepted`}),`\n`,_jsxs(_components.p,{children:[`The job, with `,_jsx(_components.code,{children:`Location: /v2/ingest-jobs/{id}`}),`. A retry with the same `,_jsx(_components.code,{children:`Idempotency-Key`}),` and body answers `,_jsx(_components.code,{children:`202`}),` with\nthe same job and `,_jsx(_components.code,{children:`Location`}),`, showing its current status and counts.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`16`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"4f0b8b3e-6a41-4b7e-9d0c-2c1f3a5e8d10\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"processing\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"entity_type\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"logistics\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"operation\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"create\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"source\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"api_bulk\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"counts\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: { `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"submitted\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"succeeded\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"failed\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"chunks_total\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"chunks_done\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"2026-10-15T08:00:00.000Z\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"finished_at\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`null`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"links\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"self\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"/v2/ingest-jobs/4f0b8b3e-6a41-4b7e-9d0c-2c1f3a5e8d10\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"items\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"/v2/ingest-jobs/4f0b8b3e-6a41-4b7e-9d0c-2c1f3a5e8d10/items\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})}),`\n`,_jsx(ResponseField,{name:`id`,type:`uuid`,id:`param-id`,children:_jsxs(_components.p,{children:[`Ingest job id. Use it with `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/get`,children:_jsx(_components.code,{children:`GET /v2/ingest-jobs/{job_id}`})}),`.`]})}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`processing`}),` right after the request. See `,_jsx(_components.a,{href:`#job-status`,children:`Job status`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`entity_type`,type:`string`,id:`param-entity-type`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`logistics`}),` for this endpoint.`]})}),`\n`,_jsx(ResponseField,{name:`operation`,type:`string`,id:`param-operation`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`create`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`source`,type:`string`,id:`param-source`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`api_bulk`}),` when sent with an API key; `,_jsx(_components.code,{children:`app`}),` when sent by a person signed in to Dcycle.`]})}),`\n`,_jsx(ResponseField,{name:`counts`,type:`object`,id:`param-counts`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`submitted`}),`: legs in the request, all of them stored. `,_jsx(_components.code,{children:`succeeded`}),`: legs calculated. `,_jsx(_components.code,{children:`failed`}),`: legs whose\ncalculation failed; the job’s items say which ones and why.`]})}),`\n`,_jsx(ResponseField,{name:`chunks_total`,type:`integer`,id:`param-chunks-total`,children:_jsx(_components.p,{children:`Number of chunks the legs are calculated in.`})}),`\n`,_jsx(ResponseField,{name:`chunks_done`,type:`integer`,id:`param-chunks-done`,children:_jsxs(_components.p,{children:[`Chunks already calculated. `,_jsx(_components.code,{children:`chunks_done / chunks_total`}),` is the job’s progress.`]})}),`\n`,_jsx(ResponseField,{name:`created_at`,type:`datetime`,id:`param-created-at`,children:_jsx(_components.p,{children:`When the job was created (UTC).`})}),`\n`,_jsx(ResponseField,{name:`finished_at`,type:`datetime | null`,id:`param-finished-at`,children:_jsxs(_components.p,{children:[`When the last chunk finished (UTC), `,_jsx(_components.code,{children:`null`}),` while the job is processing.`]})}),`\n`,_jsx(ResponseField,{name:`links`,type:`object`,id:`param-links`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`self`}),`: the job. `,_jsx(_components.code,{children:`items`}),`: its per-leg outcomes.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`job-status`,children:`Job status`}),`\n`,_jsxs(_components.p,{children:[`Poll `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/get`,children:_jsx(_components.code,{children:`GET /v2/ingest-jobs/{id}`})}),` or, for a job submitted with an API key, subscribe\nto `,_jsx(_components.code,{children:`ingest_job.finished`}),`. `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/list-items`,children:_jsx(_components.code,{children:`GET /v2/ingest-jobs/{id}/items`})}),` maps each record\n(`,_jsx(_components.code,{children:`source_row_index`}),`, `,_jsx(_components.code,{children:`client_row_id`}),`) to its leg (`,_jsx(_components.code,{children:`entity_id`}),`) and its result.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`status`})}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`processing`})}),_jsx(_components.td,{children:`The legs are stored; their distance and emissions are being calculated.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`completed`})}),_jsx(_components.td,{children:`Every leg was calculated.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`completed_with_errors`})}),_jsxs(_components.td,{children:[`At least one leg (possibly all of them) failed to calculate (`,_jsx(_components.code,{children:`counts.failed > 0`}),`): every chunk ran, or the job stopped moving and was closed within 4 to 5 hours, its pending legs `,_jsx(_components.code,{children:`JOB_TIMED_OUT`}),` (see `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/get#a-job-that-does-not-finish`,children:`A job that does not finish`}),`).`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`failed`}),` is reserved: treat every status other than `,_jsx(_components.code,{children:`processing`}),` as finished.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`If `,_jsx(_components.code,{children:`chunks_done`}),` stops moving, see `,_jsx(_components.a,{href:`/api-reference/ingest-jobs/get#a-job-that-does-not-finish`,children:`A job that does not finish`}),`.\nResending the batch with a new `,_jsx(_components.code,{children:`Idempotency-Key`}),` starts a second job, which updates the same legs (they are\nupserted on their business key); the first one is closed within 4 to 5 hours without progress, its pending legs\n`,_jsx(_components.code,{children:`JOB_TIMED_OUT`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[`The job calculates each leg and its package’s totals, not the organization’s logistics intensity values (by TOC and\nyear, hub and project). A TOC and year that appear for the first time get the TOC’s well-to-wheel factor. An\norganization with own-fleet energy (`,_jsx(_components.a,{href:`/api-reference/logistics/create-recharges-bulk`,children:`recharges`}),`, or supercharger\ninvoices, assigned to a TOC) has its values recalculated every night. Those values are what\n`,_jsx(_components.a,{href:`/api-reference/logistics/list-requests`,children:`List Logistics Requests`}),` (`,_jsx(_components.code,{children:`kgco2e`}),`) and the\n`,_jsx(_components.a,{href:`/api-reference/logistics/get-report`,children:`logistics report`}),` apply to each tonne-kilometre; the package totals of\n`,_jsx(_components.a,{href:`/api-reference/logistics/get-packages-v2`,children:`Get Logistics Packages (v2)`}),` do not use them.`]}),`\n`,_jsx(Heading,{level:`3`,id:`reading-the-emissions`,children:`Reading the emissions`}),`\n`,_jsxs(_components.p,{children:[`Read the result per package, with `,_jsx(_components.a,{href:`/api-reference/logistics/get-packages-v2`,children:`Get Logistics Packages (v2)`}),`: up to 100\npackages per request, each with `,_jsx(_components.code,{children:`total_co2e`}),` and `,_jsx(_components.code,{children:`total_distance_km`}),` over its active legs. It takes the packages’\nDcycle ids. The job’s items give each record’s leg (`,_jsx(_components.code,{children:`entity_id`}),`), not its package: get the package ids from\n`,_jsx(_components.a,{href:`/api-reference/logistics/list-packages`,children:`List Packages`}),`, filtered by your `,_jsx(_components.code,{children:`package_key`}),` (its `,_jsx(_components.code,{children:`movement_id`}),` filter\nmatches only the package’s first leg). Read the packages once the job has finished: until then their totals miss the\nlegs not yet calculated. A leg that failed to calculate still counts in its package’s total with the tonne-kilometres\nstored when it was received, if it had any (your `,_jsx(_components.code,{children:`tkm`}),`, or your `,_jsx(_components.code,{children:`distance_km`}),` and its load).`]}),`\n`,_jsx(Heading,{level:`3`,id:`why-a-leg-failed-to-calculate`,children:`Why a leg failed to calculate`}),`\n`,_jsxs(_components.p,{children:[`A failed item’s `,_jsx(_components.code,{children:`error_code`}),` says why, and `,_jsx(_components.code,{children:`error_params.message`}),` explains it. The leg stays stored without emissions\n(and without a distance, unless you sent one); the reason is only on the job item. Fix the cause and send the leg\nagain: with the same business key it is updated in place.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`error_code`})}),_jsx(_components.th,{children:`Cause`}),_jsx(_components.th,{children:`Fix`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`DISTANCE_CALCULATION_ERROR`})}),_jsxs(_components.td,{children:[`An address could not be located, the route between `,_jsx(_components.code,{children:`origin`}),` and `,_jsx(_components.code,{children:`destination`}),` gave 0 km between points more than 1 km apart, or there is no route. A geocoding service that did not answer also ends here`]}),_jsxs(_components.td,{children:[`Send a more precise address, or `,_jsx(_components.code,{children:`distance_km`}),`; send the leg again if the addresses are right`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`SEA_CROSSING_REQUIRES_MARITIME_MODE`})}),_jsx(_components.td,{children:`Origin and destination are separated by sea, so the leg cannot go by road or rail`}),_jsxs(_components.td,{children:[`Declare a maritime `,_jsx(_components.code,{children:`toc`}),`/`,_jsx(_components.code,{children:`category`}),`, or split the leg`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`NO_DISTANCE`})}),_jsxs(_components.td,{children:[`The route gave 0 km between points 1 km or less apart (e.g. an `,_jsx(_components.code,{children:`air`}),` or `,_jsx(_components.code,{children:`maritime`}),` leg whose two addresses are the same place)`]}),_jsxs(_components.td,{children:[`Send `,_jsx(_components.code,{children:`distance_km`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`NO_LOAD`})}),_jsx(_components.td,{children:`The load converted to kilograms is below 0.005 kg, so it is stored as 0`}),_jsx(_components.td,{children:`Send the real load`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`CALCULATION_FAILED`})}),_jsxs(_components.td,{children:[`The calculation failed unexpectedly, for example emissions too large to store; `,_jsx(_components.code,{children:`error_params`}),` is `,_jsx(_components.code,{children:`null`})]}),_jsxs(_components.td,{children:[`Check the leg’s load and distance; if they are right, contact support with the job `,_jsx(_components.code,{children:`id`})]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`An address the distance engine cannot geocode, or one made only of punctuation, comes as\n`,_jsx(_components.code,{children:`DISTANCE_CALCULATION_ERROR`}),`; `,_jsx(_components.code,{children:`error_params.message`}),` says what failed. An empty or blank address is rejected with the\nrequest (`,_jsx(_components.code,{children:`ADDRESS_REQUIRED`}),`), when the leg has no `,_jsx(_components.code,{children:`distance_km`}),`. A `,_jsx(_components.code,{children:`road`}),` or `,_jsx(_components.code,{children:`rail`}),` leg whose two addresses are\nthe same place is not an error: it is calculated as 3 km (2.85 km for `,_jsx(_components.code,{children:`road`}),`, after the adjustment factor).`]}),`\n`,_jsx(Heading,{level:`4`,id:`the-leg-changed-while-the-job-was-running-rare`,children:`The leg changed while the job was running (rare)`}),`\n`,_jsxs(_components.p,{children:[`The legs are calculated after the `,_jsx(_components.code,{children:`202`}),`, reading each leg as it is at that moment.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`error_code`})}),_jsx(_components.th,{children:`Cause`}),_jsx(_components.th,{children:`Fix`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`NO_TOC`})}),_jsx(_components.td,{children:`The leg’s TOC was retired from the catalogue before the leg was calculated`}),_jsxs(_components.td,{children:[`Send it again with a current `,_jsx(_components.code,{children:`toc`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`NOT_FOUND`})}),_jsx(_components.td,{children:`The leg was deleted before it was calculated`}),_jsx(_components.td,{children:`Send it again if you still need it`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`If you send a leg again while an earlier job that contains it is still `,_jsx(_components.code,{children:`processing`}),`, both jobs calculate it with the\ndata it has when their chunk runs, and both report it as succeeded. Wait for the first job to finish before you send\na leg again.`]}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(_components.p,{children:[`Errors follow `,_jsx(_components.a,{href:`/api-reference/errors`,children:`RFC 9457 problem details`}),` (`,_jsx(_components.code,{children:`Content-Type: application/problem+json`}),`): a stable\n`,_jsx(_components.code,{children:`code`}),`, a human `,_jsx(_components.code,{children:`detail`}),`, `,_jsx(_components.code,{children:`errors`}),` when there is a list of problems, and the `,_jsx(_components.code,{children:`request_id`}),` to quote to support.`]}),`\n`,_jsx(Heading,{level:`3`,id:`422-bulk_records_rejected-—-invalid-records`,children:`422 BULK_RECORDS_REJECTED — invalid records`}),`\n`,_jsxs(_components.p,{children:[`Nothing was written. `,_jsx(_components.code,{children:`rejected`}),` is how many records are invalid and `,_jsx(_components.code,{children:`errors`}),` lists them (up to 100) in submission\norder, with `,_jsx(_components.code,{children:`source_row_index`}),` (starting at 0), your `,_jsx(_components.code,{children:`client_row_id`}),` and a stable `,_jsx(_components.code,{children:`error_code`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Each record carries `,_jsx(_components.strong,{children:`one`}),` `,_jsx(_components.code,{children:`error_code`}),`: the first rule it breaks. A record with two problems shows the second one\nonly after you fix the first, so validate again with `,_jsx(_components.code,{children:`?dry_run=true`}),` before sending the batch. (`,_jsx(_components.code,{children:`SCHEMA_INVALID`}),` is\nthe exception inside a record: its `,_jsx(_components.code,{children:`error_params.errors`}),` lists the record’s schema problems, up to 10.)`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"https://code.dcycle.io/api-reference/errors#BULK_RECORDS_REJECTED\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"title\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Unprocessable Entity\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`422`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"BULK_RECORDS_REJECTED\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"detail\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"3 of the submitted records are invalid; nothing was written.\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"errors\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"source_row_index\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"client_row_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"row-2\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"error_code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"INVALID_LOAD\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"error_params\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: {`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"detail\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Load cannot be negative or 0\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"source_row_index\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`2`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"client_row_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"row-3\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"error_code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"SCHEMA_INVALID\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"error_params\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: {`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"errors\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: [{`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"loc\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: [`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"category\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`], `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"value_error\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"msg\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Value error, Invalid category\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}]}},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"source_row_index\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`3`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"client_row_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"row-4\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"error_code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"DUPLICATE_RECORD\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"error_params\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: {`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`\"duplicate_of\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`0`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"rejected\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`3`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"request_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"b2248a31-0f5e-4a54-9f0a-3d1f2b6c7e90\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`error_code`})}),_jsx(_components.th,{children:`Cause`}),_jsx(_components.th,{children:`Fix`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`SCHEMA_INVALID`})}),_jsxs(_components.td,{children:[`The record does not match the schema: a wrong type; `,_jsx(_components.code,{children:`category`}),` other than `,_jsx(_components.code,{children:`road`}),`, `,_jsx(_components.code,{children:`rail`}),`, `,_jsx(_components.code,{children:`maritime`}),` or `,_jsx(_components.code,{children:`air`}),` (lowercase), or `,_jsx(_components.code,{children:`null`}),` without a `,_jsx(_components.code,{children:`toc`}),`; `,_jsx(_components.code,{children:`origin_country`}),` not ISO 3166-1 alpha-2 or `,_jsx(_components.code,{children:`GLO`}),`; `,_jsx(_components.code,{children:`load_factor`}),` outside (0, 1]; `,_jsx(_components.code,{children:`package_key`}),` without `,_jsx(_components.code,{children:`movement_id`}),`; `,_jsx(_components.code,{children:`subcontractor`}),` missing or `,_jsx(_components.code,{children:`null`}),`; `,_jsx(_components.code,{children:`subcontractor_type`}),` other than `,_jsx(_components.code,{children:`fis`}),`/`,_jsx(_components.code,{children:`nis`}),`, or with `,_jsx(_components.code,{children:`subcontractor: false`}),`; `,_jsx(_components.code,{children:`movement_id`}),`, `,_jsx(_components.code,{children:`movement_stretch`}),`, `,_jsx(_components.code,{children:`movement_stage`}),`, `,_jsx(_components.code,{children:`client`}),`, `,_jsx(_components.code,{children:`package_key`}),`, `,_jsx(_components.code,{children:`hub_name`}),` or a license plate over 255 characters; `,_jsx(_components.code,{children:`hub_id`}),` that is not a UUID; both `,_jsx(_components.code,{children:`hub_id`}),` and `,_jsx(_components.code,{children:`hub_name`}),`; a text with a NUL character (`,_jsx(_components.code,{children:`string_contains_nul`}),`; in `,_jsx(_components.code,{children:`origin`}),` and `,_jsx(_components.code,{children:`destination`}),` it is dropped instead) or a lone surrogate such as `,_jsx(_components.code,{children:`\\\\ud800`}),` (`,_jsx(_components.code,{children:`string_unicode`}),`); `,_jsx(_components.code,{children:`client_row_id`}),` over 255 characters; or the record is not a JSON object. `,_jsx(_components.code,{children:`error_params.errors`}),` lists each problem (`,_jsx(_components.code,{children:`loc`}),`, `,_jsx(_components.code,{children:`type`}),`, `,_jsx(_components.code,{children:`msg`}),`)`]}),_jsx(_components.td,{children:`Fix the fields listed`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`INVALID_LOAD`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`load`}),` is 0 or negative (`,_jsx(_components.code,{children:`error_params.detail`}),`)`]}),_jsxs(_components.td,{children:[`Send a positive `,_jsx(_components.code,{children:`load`}),`, or omit it to use the TOC’s default`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`INVALID_DISTANCE`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`distance_km`}),` is 0 or negative (`,_jsx(_components.code,{children:`error_params.detail`}),`)`]}),_jsxs(_components.td,{children:[`Send a positive `,_jsx(_components.code,{children:`distance_km`}),`, or omit it to have it computed`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ACTIVITY_DATE_OUT_OF_RANGE`})}),_jsxs(_components.td,{children:[`The year of `,_jsx(_components.code,{children:`shipment_date`}),` is before 1970 or after next year (`,_jsx(_components.code,{children:`error_params.detail`}),`)`]}),_jsx(_components.td,{children:`Fix the date`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ADDRESS_REQUIRED`})}),_jsxs(_components.td,{children:[`No `,_jsx(_components.code,{children:`distance_km`}),`, and `,_jsx(_components.code,{children:`origin`}),` or `,_jsx(_components.code,{children:`destination`}),` is missing or blank (with `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),`, the hub has no address), so the distance could not be computed (`,_jsx(_components.code,{children:`error_params.fields`}),`: the missing ones)`]}),_jsxs(_components.td,{children:[`Send both addresses, or `,_jsx(_components.code,{children:`distance_km`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ADDRESS_TOO_LONG`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`origin`}),` or `,_jsx(_components.code,{children:`destination`}),` (the hub’s address, when a hub replaces it) is over 500 characters (`,_jsx(_components.code,{children:`error_params`}),`: `,_jsx(_components.code,{children:`field`}),`, `,_jsx(_components.code,{children:`length`}),`, `,_jsx(_components.code,{children:`max`}),`)`]}),_jsx(_components.td,{children:`Send the address alone`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`REFERENCE_NOT_FOUND`})}),_jsxs(_components.td,{children:[`No active hub of your organization has this `,_jsx(_components.code,{children:`hub_id`}),` or `,_jsx(_components.code,{children:`hub_name`}),` (`,_jsx(_components.code,{children:`error_params`}),`: `,_jsx(_components.code,{children:`field`}),`, `,_jsx(_components.code,{children:`value`}),`; plus `,_jsx(_components.code,{children:`status`}),`, the hub’s status (`,_jsx(_components.code,{children:`archived`}),` or `,_jsx(_components.code,{children:`error`}),`), when your organization’s hub exists but is not active). Another organization’s hub answers the same as an unknown one`]}),_jsxs(_components.td,{children:[`Create the hub first with `,_jsx(_components.a,{href:`/api-reference/logistic-hubs/create-v2`,children:`Create Logistic Hubs (v2)`}),`, or reactivate it, or fix the reference`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`TOC_NOT_FOUND`})}),_jsxs(_components.td,{children:[`No TOC matches `,_jsx(_components.code,{children:`toc`}),`, and no generic average of `,_jsx(_components.code,{children:`category`}),` exists, in the region of `,_jsx(_components.code,{children:`origin_country`}),`, in `,_jsx(_components.code,{children:`GLO`}),` or in `,_jsx(_components.code,{children:`EU`}),`; also when neither `,_jsx(_components.code,{children:`toc`}),` nor `,_jsx(_components.code,{children:`category`}),` is sent (`,_jsx(_components.code,{children:`error_params`}),`: `,_jsx(_components.code,{children:`toc`}),`, `,_jsx(_components.code,{children:`category`}),`, `,_jsx(_components.code,{children:`region`}),`)`]}),_jsxs(_components.td,{children:[`Use a TOC from `,_jsx(_components.a,{href:`/api-reference/logistics/list-tocs`,children:`List TOCs`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`LOAD_NOT_AVAILABLE`})}),_jsxs(_components.td,{children:[`No `,_jsx(_components.code,{children:`load`}),`, and the TOC has no default load (`,_jsx(_components.code,{children:`error_params`}),`: `,_jsx(_components.code,{children:`toc`}),`, `,_jsx(_components.code,{children:`category`}),`)`]}),_jsxs(_components.td,{children:[`Send `,_jsx(_components.code,{children:`load`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`DUPLICATE_RECORD`})}),_jsxs(_components.td,{children:[`Another record of the batch has the same `,_jsx(_components.a,{href:`#legs-are-upserted-on-their-business-key`,children:`business key`}),` (`,_jsx(_components.code,{children:`error_params.duplicate_of`}),`: its index)`]}),_jsxs(_components.td,{children:[`Send each leg once, each with its own `,_jsx(_components.code,{children:`movement_id`})]})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`422-idempotency_key_reused`,children:`422 IDEMPOTENCY_KEY_REUSED`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`Idempotency-Key`}),` was already used in this organization, within the last 24 hours, with a different body or on\nanother route. Nothing is written. Send a new key for a new batch; to retry the original batch, resend exactly the same\nbody to the same route. The order of the fields and how a whole number is written (`,_jsx(_components.code,{children:`1000`}),` or `,_jsx(_components.code,{children:`1000.0`}),`) do not matter,\nbut the values must be identical: `,_jsx(_components.code,{children:`null`}),` and an omitted field are a different body.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"https://code.dcycle.io/api-reference/errors#IDEMPOTENCY_KEY_REUSED\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"title\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Unprocessable Entity\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`422`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"IDEMPOTENCY_KEY_REUSED\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"detail\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"This Idempotency-Key was already used with a different request body or on another route. Use a new key per batch.\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \"request_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"b2248a31-0f5e-4a54-9f0a-3d1f2b6c7e90\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`409-idempotency_key_in_progress`,children:`409 IDEMPOTENCY_KEY_IN_PROGRESS`}),`\n`,_jsxs(_components.p,{children:[`Another request with the same `,_jsx(_components.code,{children:`Idempotency-Key`}),` was still being processed, typically your own retry after a timeout.\nThis request wrote no leg and created no job (packages it named may have been created; later requests reuse\nthem). Wait the `,_jsx(_components.code,{children:`Retry-After`}),` seconds and retry with the same key and body: you get the job of the request that went\nthrough. See `,_jsx(_components.a,{href:`/api-reference/errors#IDEMPOTENCY_KEY_IN_PROGRESS`,children:`IDEMPOTENCY_KEY_IN_PROGRESS`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`422-request_validation_failed-—-malformed-request`,children:`422 REQUEST_VALIDATION_FAILED — malformed request`}),`\n`,_jsxs(_components.p,{children:[`The request itself is invalid: the `,_jsx(_components.code,{children:`Idempotency-Key`}),` header is missing, empty or over 255 characters; the body is not\nJSON; or `,_jsx(_components.code,{children:`records`}),` is missing, empty or has more than 5,000 entries. `,_jsx(_components.code,{children:`errors`}),` lists each problem with where it is\n(`,_jsx(_components.code,{children:`loc`}),`). See `,_jsx(_components.a,{href:`/api-reference/errors`,children:`Errors`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`401-400-and-403-key-and-organization`,children:`401, 400 and 403: key and organization`}),`\n`,_jsxs(_components.p,{children:[`Before the records are looked at, the API key and the organization are checked. Each code has its section in\n`,_jsx(_components.a,{href:`/api-reference/errors#codes`,children:`Errors`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`401`}),`: no API key (`,_jsx(_components.code,{children:`AUTHENTICATION_REQUIRED`}),`), a wrong or revoked one (`,_jsx(_components.code,{children:`INVALID_API_KEY`}),`), an expired one\n(`,_jsx(_components.code,{children:`API_KEY_EXPIRED`}),`), a key of an organization that is neither this one nor one of its parents\n(`,_jsx(_components.code,{children:`API_KEY_ORG_MISMATCH`}),`) or one too old to have an owner (`,_jsx(_components.code,{children:`API_KEY_NO_OWNER`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`400 ORGANIZATION_ID_REQUIRED`}),`: no `,_jsx(_components.code,{children:`x-organization-id`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`403`}),`: the key’s creator is not a member of the organization in `,_jsx(_components.code,{children:`x-organization-id`}),` (`,_jsx(_components.code,{children:`LOGGED_USER_NOT_MEMBER`}),`),\nthe key is read-only (`,_jsx(_components.code,{children:`API_KEY_SCOPE_DENIED`}),`), or its creator is a Viewer (`,_jsx(_components.code,{children:`VIEWER_CANNOT_WRITE`}),`).`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`429-too_many_requests`,children:`429 TOO_MANY_REQUESTS`}),`\n`,_jsxs(_components.p,{children:[`More than 10 requests in flight at once with your API key on this endpoint. The request was not processed. Wait the\n`,_jsx(_components.code,{children:`Retry-After`}),` seconds (10, rising to 20 if you keep hitting the limit) and retry.`]}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsx(Heading,{level:`3`,id:`create-a-batch-and-wait-for-the-calculation`,children:`Create a batch and wait for the calculation`}),`\n`,_jsx(CodeBlock,{filename:`Python`,numberOfLines:`65`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`65`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` time`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` uuid`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`import`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`BASE`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"https://api.dcycle.io\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`HEADERS`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` =`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"x-api-key\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: os.environ[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"DCYCLE_API_KEY\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"x-organization-id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: os.environ[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"DCYCLE_ORG_ID\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`records `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"client_row_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"SHIP-001\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"movement_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"SHIP-001\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:`# unique per leg: it is part of the leg's business key`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"origin\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Madrid, Spain\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"destination\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Barcelona, Spain\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"origin_country\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"ES\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"load\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`1000`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"load_unit\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"kg\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"toc\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"van_3_5_t_diesel\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:`# copied from GET /v1/logistics/tocs`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"subcontractor\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`True`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:`# required: False for your own fleet`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"shipment_date\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"2026-10-01\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:`# One key per batch: reuse it only to retry this same batch.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`response `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` f`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`{BASE}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`/v2/logistics/requests\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` headers`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`**`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`HEADERS`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Idempotency-Key\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`str`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(uuid.uuid4())},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` json`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"records\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: records},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` timeout`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`120`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` response.status_code `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`==`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 422`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` and`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` response.json().get(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`) `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`==`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"BULK_RECORDS_REJECTED\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` for`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` rejection `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`in`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` response.json()[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"errors\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` print`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(rejection[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"source_row_index\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`], rejection[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"client_row_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`], rejection[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"error_code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` rejection[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"error_params\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` raise`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` SystemExit`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Fix the listed records and send the whole batch again\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`response.raise_for_status()`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`job_url `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` BASE`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` +`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` response.headers[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Location\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`deadline `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` time.monotonic() `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`+`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 60`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` *`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 60`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`while`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` True`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` job_response `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` requests.get(job_url, `}),_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:`headers`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`HEADERS`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:`timeout`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`30`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` job_response.raise_for_status()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` job `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` job_response.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` job[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`] `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`!=`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"processing\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` time.monotonic() `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`>`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` deadline:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` raise`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` SystemExit`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`f`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"Job `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`{`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`job[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`'id'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` is still processing after an hour: contact support with its id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` time.sleep(`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`10`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`page `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`while`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` job[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`] `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`==`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"completed_with_errors\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#6A737D`,\"--shiki-dark\":`#6A737D`},children:`# read every page of failures`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` failed `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` requests.get(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` f`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`{`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`job_url`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`}`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`/items\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` headers`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`HEADERS`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` params`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`{`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"failed\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"size\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: `}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`500`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, `}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"page\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`: page},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#E36209`,\"--shiki-dark\":`#FFAB70`},children:` timeout`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`30`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` ).json()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` for`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` item `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`in`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` failed[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"items\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` print`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`(`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"not calculated:\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`, item[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"client_row_id\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`], item[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"error_code\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`], item[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"error_params\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` if`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` page `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`*`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` failed[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"size\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`] `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`>=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` failed[`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"total\"`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`]:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:` page `}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`+=`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` 1`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`retries-and-idempotency`,children:`Retries and idempotency`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Network error or timeout:`}),` retry with the `,_jsx(_components.strong,{children:`same`}),` `,_jsx(_components.code,{children:`Idempotency-Key`}),` and the same body. If the first attempt\nwas accepted you get its job back, and nothing is written twice.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`409 IDEMPOTENCY_KEY_IN_PROGRESS`}),`:`]}),` the first request with that key is still being processed. Wait\n`,_jsx(_components.code,{children:`Retry-After`}),` seconds and retry with the same key and body.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`422 BULK_RECORDS_REJECTED`}),`:`]}),` nothing was written. Fix the records and send the batch again; the same key works,\nsince the first request created no job.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`422 IDEMPOTENCY_KEY_REUSED`}),`:`]}),` the key already belongs to another batch. Use a new key, or resend the original\nbody unchanged.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`429`}),`:`]}),` too many requests in flight for your API key on this endpoint (unlike the `,_jsx(_components.code,{children:`Idempotency-Key`}),`, the\nlimit is per key, not per organization). Wait `,_jsx(_components.code,{children:`Retry-After`}),` seconds; the request was not processed.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`A new batch needs a new key.`}),`\n`,_jsx(Heading,{level:`2`,id:`limits`,children:`Limits`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Limit`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Records per request`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1 to 5,000`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Maximum concurrent requests`}),_jsx(_components.td,{children:`10 per API key, per endpoint`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Requests over the cap get HTTP `,_jsx(_components.code,{children:`429`}),` with a `,_jsx(_components.code,{children:`Retry-After`}),` header. The cap is on requests in flight at once, not on\nrequests per second — see `,_jsx(_components.a,{href:`/api-reference/rate-limits`,children:`Rate Limits`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`related-endpoints`,children:`Related Endpoints`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Get Ingest Job`,icon:`clock`,href:`/api-reference/ingest-jobs/get`,children:_jsx(_components.p,{children:`Follow the calculation`})}),_jsx(Card,{title:`List Ingest Job Items`,icon:`list-check`,href:`/api-reference/ingest-jobs/list-items`,children:_jsx(_components.p,{children:`Per-leg outcomes, including calculation failures`})}),_jsx(Card,{title:`List TOCs`,icon:`truck`,href:`/api-reference/logistics/list-tocs`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`toc`}),` values to send`]})}),_jsx(Card,{title:`List Requests`,icon:`list`,href:`/api-reference/logistics/list-requests`,children:_jsx(_components.p,{children:`Retrieve requests with filtering and pagination`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light","dark":"github-dark"}},"config":{},"pageMetadata":{"title":"Create Logistics Requests (v2)","api":"POST /v2/logistics/requests","description":"Create one or up to 5,000 logistics legs in one request; their distance and emissions are calculated by an ingest job","tag":"BETA","href":"/api-reference/logistics/create-requests-v2"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Request","slug":"request","depth":2,"children":[{"title":"Headers","slug":"headers","depth":3,"children":[]},{"title":"Query Parameters","slug":"query-parameters","depth":3,"children":[]},{"title":"Body Parameters","slug":"body-parameters","depth":3,"children":[]},{"title":"How the fields are read","slug":"how-the-fields-are-read","depth":3,"children":[]},{"title":"Legs are upserted on their business key","slug":"legs-are-upserted-on-their-business-key","depth":3,"children":[]}]},{"title":"Response","slug":"response","depth":2,"children":[{"title":"202 Accepted","slug":"202-accepted","depth":3,"children":[]},{"title":"Job status","slug":"job-status","depth":3,"children":[]},{"title":"Reading the emissions","slug":"reading-the-emissions","depth":3,"children":[]},{"title":"Why a leg failed to calculate","slug":"why-a-leg-failed-to-calculate","depth":3,"children":[]},{"title":"The leg changed while the job was running (rare)","slug":"the-leg-changed-while-the-job-was-running-rare","depth":4,"children":[]}]},{"title":"Errors","slug":"errors","depth":2,"children":[{"title":"422 BULK_RECORDS_REJECTED — invalid records","slug":"422-bulk_records_rejected-—-invalid-records","depth":3,"children":[]},{"title":"422 IDEMPOTENCY_KEY_REUSED","slug":"422-idempotency_key_reused","depth":3,"children":[]},{"title":"409 IDEMPOTENCY_KEY_IN_PROGRESS","slug":"409-idempotency_key_in_progress","depth":3,"children":[]},{"title":"422 REQUEST_VALIDATION_FAILED — malformed request","slug":"422-request_validation_failed-—-malformed-request","depth":3,"children":[]},{"title":"401, 400 and 403: key and organization","slug":"401-400-and-403-key-and-organization","depth":3,"children":[]},{"title":"429 TOO_MANY_REQUESTS","slug":"429-too_many_requests","depth":3,"children":[]}]},{"title":"Examples","slug":"examples","depth":2,"children":[{"title":"Create a batch and wait for the calculation","slug":"create-a-batch-and-wait-for-the-calculation","depth":3,"children":[]}]},{"title":"Retries and idempotency","slug":"retries-and-idempotency","depth":2,"children":[]},{"title":"Limits","slug":"limits","depth":2,"children":[]},{"title":"Related Endpoints","slug":"related-endpoints","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"21\">\u003cspan class=\"line\">\u003cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">curl\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> -i\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> -X\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> POST\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"https://api.dcycle.io/v2/logistics/requests\"\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> -H\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"x-api-key: ${\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">DCYCLE_API_KEY\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">}\"\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> -H\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"x-organization-id: ${\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">DCYCLE_ORG_ID\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">}\"\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> -H\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> -H\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"Idempotency-Key: 7b1f9c2e-4d3a-4f8e-9a61-2c5d8e0f1a37\"\u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> -d\u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> '{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"records\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"client_row_id\": \"SHIP-001\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"movement_id\": \"SHIP-001\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"origin\": \"Madrid, Spain\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"destination\": \"Barcelona, Spain\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"origin_country\": \"ES\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"load\": 1000,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"load_unit\": \"kg\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"toc\": \"van_3_5_t_diesel\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"subcontractor\": true,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> \"shipment_date\": \"2026-10-01\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"202","html":"\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"16\">\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"id\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"4f0b8b3e-6a41-4b7e-9d0c-2c1f3a5e8d10\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"status\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"processing\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"entity_type\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"logistics\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"operation\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"create\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"source\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"api_bulk\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"counts\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: { \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\"submitted\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">1\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\"succeeded\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">0\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\"failed\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">0\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"chunks_total\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">1\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"chunks_done\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">0\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"created_at\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"2026-10-15T08:00:00.000Z\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"finished_at\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">null\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"links\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"self\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"/v2/ingest-jobs/4f0b8b3e-6a41-4b7e-9d0c-2c1f3a5e8d10\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"items\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"/v2/ingest-jobs/4f0b8b3e-6a41-4b7e-9d0c-2c1f3a5e8d10/items\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"422","html":"\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"17\">\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"type\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"https://code.dcycle.io/api-reference/errors#BULK_RECORDS_REJECTED\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"title\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"Unprocessable Entity\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"status\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">422\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"code\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"BULK_RECORDS_REJECTED\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"detail\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"1 of the submitted records are invalid; nothing was written.\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"errors\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"source_row_index\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">0\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"client_row_id\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"SHIP-001\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"error_code\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"INVALID_LOAD\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"error_params\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: { \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">\"detail\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"Load cannot be negative or 0\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"rejected\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">1\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"request_id\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">\"b2248a31-0f5e-4a54-9f0a-3d1f2b6c7e90\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"200 (dry_run=true)","html":"\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"5\">\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"dry_run\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">true\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"submitted\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">1\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> \"valid\"\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\">1\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Create Logistics Requests (v2)","path":"/v2/logistics/requests","servers":[{"url":"https://api.dcycle.io"}],"method":"post","request":{"security":[],"parameters":{"query":{"dry_run":{"schema":[{"type":"boolean","description":"Validate only: the same checks and `422` , but nothing is written and no job is created; a valid batch answers `200` with `{\"dry_run\": true, \"submitted\": n, \"valid\": n}` . The `Idempotency-Key` header is still required, but a dry run does not check or store it, so you can send the real request with the same key afterwards."}]}},"header":{"x-api-key":{"schema":[{"type":"string","description":"Your API key. Jobs submitted with an API key notify `ingest_job.finished` to the webhook endpoints of the `x-organization-id` organization.","required":true}]},"x-organization-id":{"schema":[{"type":"string","description":"UUID of the organization the legs belong to.","required":true}]},"Content-Type":{"schema":[{"type":"string","description":"Must be `application/json`","required":true}]},"Idempotency-Key":{"schema":[{"type":"string","description":"1 to 255 characters. Send one key per batch (a UUID works well). The key is looked up per organization, across every v2 bulk route. Within 24 hours, the same key with the same route and body returns the original job (with `Idempotent-Replayed: true` ) instead of writing the legs again; the same key with another body or on another route is `422 IDEMPOTENCY_KEY_REUSED` , and while the first request is still being processed `409 IDEMPOTENCY_KEY_IN_PROGRESS` . After 24 hours the key is free, and a request with it is a new one. See The Idempotency-Key .","required":true}]}},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"records":[{"type":"object","properties":{"toc":[{"type":"string","description":"The transport operation category (vehicle type), as `toc` in List TOCs , e.g. `van_3_5_t_diesel` . Required unless you send `category` ."}],"category":[{"type":"string","description":"`road` , `rail` , `maritime` or `air` . Required without `toc` : the leg then uses that category’s generic average."}],"origin":[{"type":"string","description":"Origin address (max 500 characters). With `destination` , needed when you do not send `distance_km` ; a hub in `hub_id` or `hub_name` supplies it instead."}],"destination":[{"type":"string","description":"Destination address, or the name of an active hub of your organization (replaced by its address). Max 500 characters. Needed when you do not send `distance_km` ."}],"distance_km":[{"type":"number","description":"Distance in km, greater than 0. Used as sent. When omitted, it is computed from `origin` and `destination` ."}],"origin_country":[{"type":"string","description":"ISO 3166-1 alpha-2 code of the origin country, or `GLO` . Selects the region’s TOCs and emission factors."}],"load":[{"type":"number","description":"The load, greater than 0, in `load_unit` . When omitted, the TOC’s default load is used."}],"load_unit":[{"type":"string","description":"`kg` , `t` / `ton` , `pallet` / `pallets` (1,500 kg each), `teu` (10,000 kg) or `feu` (20,000 kg)."}],"load_factor":[{"type":"number","description":"In (0, 1]; multiplies the load."}],"shipment_date":[{"type":"string","description":"`YYYY-MM-DD` , from 1970 to next year: the leg’s date in reports and lists. It does not change the emission factor. Default: the upload date (UTC)."}],"cleaning":[{"type":"boolean","description":"Whether the vehicle was cleaned; it increases the emissions."}],"subcontractor":[{"type":"boolean","description":"`true` if a subcontractor moved the leg, `false` if your own fleet did. Own-fleet legs are calculated from your recharges , subcontracted ones from the TOC’s factor. Required since 2026-11-06: a record without it, or with `null` , is `SCHEMA_INVALID` .","required":true}],"subcontractor_type":[{"type":"string","description":"`fis` (fully integrated) or `nis` (non-integrated) subcontractor, as in SQAS / ISO 14083. Only with `subcontractor: true` ."}],"movement_id":[{"type":"string","description":"Your identifier of the movement (max 255 characters). Part of the business key : send one per leg."}],"movement_stretch":[{"type":"string","description":"The leg’s stretch within the movement (max 255 characters). Part of the business key."}],"movement_stage":[{"type":"string","description":"The leg’s stage within the movement (max 255 characters). Part of the business key."}],"client":[{"type":"string","description":"Your customer for this leg (max 255 characters). Part of the business key."}],"package_key":[{"type":"string","description":"Your identifier of the package the leg carries (max 255 characters); legs with the same `package_key` form one package. Requires `movement_id` . Part of the business key."}],"hub_id":[{"type":"string","description":"The hub the leg leaves from, by its Dcycle id: the `id` that Create Logistic Hubs (v2) answers, or that List Logistics Hubs lists. Send `hub_id` or `hub_name` , not both. See How the fields are read ."}],"hub_name":[{"type":"string","description":"The hub the leg leaves from, by its `name` in your organization, matched exactly (max 255 characters): for example your own code for the hub, if you created it with that name. Send `hub_id` or `hub_name` , not both."}],"vehicle_license_plate":[{"type":"string","description":"Max 255 characters."}],"trailer_license_plate":[{"type":"string","description":"Max 255 characters."}],"request_date":[{"type":"string","description":"The date your customer placed the order. Stored for reference; not used to calculate."}],"client_row_id":[{"type":"string","description":"Your key for the record (max 255 characters), echoed on its job item and in a `422` ."}],"year":[{"type":"integer","description":"Accepted but not used: the leg’s year is the year of `shipment_date` ."}],"tkm":[{"type":"number","description":"Accepted but recalculated as load in tonnes × distance; kept only if the leg’s calculation fails."}]},"description":"The legs to create, 1 to 5,000. Fields a record does not define are ignored without an error, so a misspelled field name (e.g. `distance` instead of `distance_km` ) is lost. How the fields are read has the details that change the result.","required":true}]}}],"examples":{"example":{"value":{"records":{"toc":"\u003cstring>","category":"\u003cstring>","origin":"\u003cstring>","destination":"\u003cstring>","distance_km":123,"origin_country":"\u003cstring>","load":123,"load_unit":"\u003cstring>","load_factor":123,"shipment_date":"\u003cstring>","cleaning":true,"subcontractor":true,"subcontractor_type":"\u003cstring>","movement_id":"\u003cstring>","movement_stretch":"\u003cstring>","movement_stage":"\u003cstring>","client":"\u003cstring>","package_key":"\u003cstring>","hub_id":"\u003cstring>","hub_name":"\u003cstring>","vehicle_license_plate":"\u003cstring>","trailer_license_plate":"\u003cstring>","request_date":"\u003cstring>","client_row_id":"\u003cstring>","year":123,"tkm":123}}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"id":[{"type":"string","description":"Ingest job id. Use it with `GET /v2/ingest-jobs/{job_id}` ."}],"status":[{"type":"string","description":"`processing` right after the request. See Job status ."}],"entity_type":[{"type":"string","description":"Always `logistics` for this endpoint."}],"operation":[{"type":"string","description":"Always `create` ."}],"source":[{"type":"string","description":"`api_bulk` when sent with an API key; `app` when sent by a person signed in to Dcycle."}],"counts":[{"type":"object","properties":{},"description":"`submitted` : legs in the request, all of them stored. `succeeded` : legs calculated. `failed` : legs whose calculation failed; the job’s items say which ones and why."}],"chunks_total":[{"type":"integer","description":"Number of chunks the legs are calculated in."}],"chunks_done":[{"type":"integer","description":"Chunks already calculated. `chunks_done / chunks_total` is the job’s progress."}],"created_at":[{"type":"object","properties":{},"description":"When the job was created (UTC)."}],"finished_at":[{"type":"object","properties":{},"description":"When the last chunk finished (UTC), `null` while the job is processing."}],"links":[{"type":"object","properties":{},"description":"`self` : the job. `items` : its per-leg outcomes."}]}}],"examples":{"example":{"value":{"id":"\u003cstring>","status":"\u003cstring>","entity_type":"\u003cstring>","operation":"\u003cstring>","source":"\u003cstring>","counts":{},"chunks_total":123,"chunks_done":123,"created_at":{},"finished_at":{},"links":{}}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"dcyleio","siteName":"Dcycle Platform Docs","title":"Create Logistics Requests (v2) - Dcycle Platform Docs","navMaps":{"firstHrefInVersion":{"New API (Recommended)":{"href":"/api-reference/logistics/create-requests-v2","matchLevel":0},"Legacy API":{"href":"/api-reference/legacy/logistics/calculate-shipment","matchLevel":2}},"firstHrefInLanguage":{}},"lastModified":"2026-11-07T18:35:53.996Z","originalFileLocation":"api-reference/logistics/create-requests-v2.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create one or up to 5,000 logistics legs in one request; their distance and emissions are calculated by an ingest job\">\u003cmeta data-mint-head name=\"application-name\" content=\"Dcycle Platform Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dcyleio/q7dxVY1vTbgXGd35/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/dcyleio/q7dxVY1vTbgXGd35/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dcyleio/q7dxVY1vTbgXGd35/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dcyleio/q7dxVY1vTbgXGd35/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dcyleio/q7dxVY1vTbgXGd35/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dcyleio/q7dxVY1vTbgXGd35/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dcyleio/q7dxVY1vTbgXGd35/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dcyleio/q7dxVY1vTbgXGd35/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dcyleio/q7dxVY1vTbgXGd35/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create Logistics Requests (v2) - Dcycle Platform Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create one or up to 5,000 logistics legs in one request; their distance and emissions are calculated by an ingest job\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Dcycle Platform Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://code.dcycle.io/api-reference/logistics/create-requests-v2\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://dcyleio.mintlify.site/_mintlify/api/og/v2?division=Requests\u0026amp;title=Create+Logistics+Requests+%28v2%29\u0026amp;description=Create+one+or+up+to+5%2C000+logistics+legs+in+one+request%3B+their+distance+and+emissions+are+calculated+by+an+ingest+job\u0026amp;theme=d115002796afa8d4456400b7\u0026amp;signature=1ee8c09e0b6a685b4b48fa8e58a5a25572dae04f487d88fe4acb2e399a4a3b2b\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create Logistics Requests (v2) - Dcycle Platform Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create one or up to 5,000 logistics legs in one request; their distance and emissions are calculated by an ingest job\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://dcyleio.mintlify.site/_mintlify/api/og/v2?division=Requests\u0026amp;title=Create+Logistics+Requests+%28v2%29\u0026amp;description=Create+one+or+up+to+5%2C000+logistics+legs+in+one+request%3B+their+distance+and+emissions+are+calculated+by+an+ingest+job\u0026amp;theme=d115002796afa8d4456400b7\u0026amp;signature=1ee8c09e0b6a685b4b48fa8e58a5a25572dae04f487d88fe4acb2e399a4a3b2b\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/dcyleio/q7dxVY1vTbgXGd35/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Dcycle Platform Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#006ad4\">\u003clink data-mint-head rel=\"canonical\" href=\"https://code.dcycle.io/api-reference/logistics/create-requests-v2\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/logistics/create-requests-v2.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://code.dcycle.io/#organization\",\"name\":\"Dcycle Platform Docs\",\"url\":\"https://code.dcycle.io\"},{\"@type\":\"WebSite\",\"@id\":\"https://code.dcycle.io#website\",\"name\":\"Dcycle Platform Docs\",\"url\":\"https://code.dcycle.io\",\"publisher\":{\"@id\":\"https://code.dcycle.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://code.dcycle.io/api-reference/logistics/create-requests-v2#webpage\",\"url\":\"https://code.dcycle.io/api-reference/logistics/create-requests-v2\",\"name\":\"Create Logistics Requests (v2)\",\"description\":\"Create one or up to 5,000 logistics legs in one request; their distance and emissions are calculated by an ingest job\",\"dateModified\":\"2026-11-07T18:35:53.996Z\",\"isPartOf\":{\"@id\":\"https://code.dcycle.io#website\"},\"breadcrumb\":{\"@id\":\"https://code.dcycle.io/api-reference/logistics/create-requests-v2#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://code.dcycle.io/api-reference/logistics/create-requests-v2#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Logistics\",\"item\":\"https://code.dcycle.io/api-reference/logistics/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Requests\",\"item\":\"https://code.dcycle.io/api-reference/logistics/list-requests\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Create Logistics Requests (v2)\",\"item\":\"https://code.dcycle.io/api-reference/logistics/create-requests-v2\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://code.dcycle.io/api-reference/logistics/create-requests-v2#apireference\",\"headline\":\"Create Logistics Requests (v2)\",\"name\":\"Create Logistics Requests (v2)\",\"description\":\"Create one or up to 5,000 logistics legs in one request; their distance and emissions are calculated by an ingest job\",\"url\":\"https://code.dcycle.io/api-reference/logistics/create-requests-v2\",\"mainEntityOfPage\":{\"@id\":\"https://code.dcycle.io/api-reference/logistics/create-requests-v2#webpage\"},\"dateModified\":\"2026-11-07T18:35:53.996Z\",\"publisher\":{\"@id\":\"https://code.dcycle.io/#organization\"},\"isPartOf\":{\"@id\":\"https://code.dcycle.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Dcycle Platform Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Dcycle Platform Docs","nav":{"global":null,"tabs":[{"tab":"Get Started","pages":[{"title":"Get Started","href":"/docs/introduction"}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/guides/emissions/overview"}]},{"tab":"API","versions":[{"version":"New API (Recommended)","groups":[{"group":"Introduction","pages":[{"title":"API Introduction","href":"/api-reference/introduction"},{"title":"Changelog","href":"/api-reference/changelog"},{"title":"Errors","href":"/api-reference/errors"},{"title":"OpenAPI \u0026 SDKs","href":"/api-reference/openapi-sdks"},{"title":"Rate Limits","href":"/api-reference/rate-limits"}]},{"group":"Business Travels","pages":[{"title":"Business Travels API","href":"/api-reference/business-travels/overview"},{"title":"Get Business Travel Totals","api":"GET /v1/business-travels/totals","href":"/api-reference/business-travels/totals"},{"title":"Get Business Travel Version History","api":"GET /v1/business-travels/{business_travel_id}/versions","href":"/api-reference/business-travels/versions"},{"title":"List Business Travels","api":"GET /v1/business-travels","href":"/api-reference/business-travels/list"},{"title":"Get Business Travel","api":"GET /v1/business-travels/{business_travel_id}","href":"/api-reference/business-travels/get"},{"title":"Create Business Travel","api":"POST /v1/business-travels","deprecated":true,"href":"/api-reference/business-travels/create"},{"title":"Create Business Travels (v2)","api":"POST /v2/business-travels","tag":"BETA","href":"/api-reference/business-travels/create-v2"},{"title":"Delete Business Travels (v2)","api":"POST /v2/business-travels/delete","tag":"BETA","href":"/api-reference/business-travels/delete-v2"},{"title":"Update Business Travel","api":"PATCH /v1/business-travels/{business_travel_id}","href":"/api-reference/business-travels/update"},{"title":"Delete Business Travel","api":"DELETE /v1/business-travels/{business_travel_id}","deprecated":true,"href":"/api-reference/business-travels/delete"},{"title":"Bulk Delete Business Travels","api":"POST /v1/business-travels/bulk-delete","deprecated":true,"href":"/api-reference/business-travels/bulk-delete"},{"title":"Bulk Delete Business Travels by Filters","api":"POST /v1/business-travels/bulk-delete-by-filters","href":"/api-reference/business-travels/bulk-delete-by-filters"}]},{"group":"Custom Emission Factors","pages":[{"title":"Custom Emission Factor Databases","tag":"BETA","href":"/api-reference/custom-emission-factors/overview"},{"title":"List Custom Database Versions","api":"GET /v1/emission-factors/custom-databases/{database_id}/versions","tag":"BETA","href":"/api-reference/custom-emission-factors/list-versions"},{"title":"List Custom Databases","api":"GET /v1/emission-factors/custom-databases","tag":"BETA","href":"/api-reference/custom-emission-factors/list-databases"},{"title":"List Custom Records","api":"GET /v1/emission-factors/custom-databases/{database_id}/versions/{source_id}/records","tag":"BETA","href":"/api-reference/custom-emission-factors/list-records"},{"title":"Get Custom Record","api":"GET /v1/emission-factors/custom-databases/record/{record_id}","tag":"BETA","href":"/api-reference/custom-emission-factors/get-record"},{"title":"Create Custom Database","api":"POST /v1/emission-factors/custom-databases","tag":"BETA","href":"/api-reference/custom-emission-factors/create-database"},{"title":"Create Custom Database Version","api":"POST /v1/emission-factors/custom-databases/{database_id}/versions","tag":"BETA","href":"/api-reference/custom-emission-factors/create-version"},{"title":"Create Custom Record","api":"POST /v1/emission-factors/custom-databases/{database_id}/versions/{source_id}/records","tag":"BETA","href":"/api-reference/custom-emission-factors/create-record"},{"title":"Update Custom Record","api":"PATCH /v1/emission-factors/custom-databases/{database_id}/versions/{source_id}/records/{record_id}","tag":"BETA","href":"/api-reference/custom-emission-factors/update-record"},{"title":"Delete Custom Record","api":"DELETE /v1/emission-factors/custom-databases/{database_id}/versions/{source_id}/records/{record_id}","tag":"BETA","href":"/api-reference/custom-emission-factors/delete-record"}]},{"group":"Custom Emission Groups","pages":[{"title":"List Custom Emission Groups","api":"GET /custom_emission_groups/light","href":"/api-reference/custom-emission-groups/list-light"}]},{"group":"Custom KPI","pages":[{"title":"Custom KPI","href":"/api-reference/custom-kpi/overview"},{"title":"List Dataset Values","api":"GET /v1/custom-kpi-datasets/{dataset_id}/values","href":"/api-reference/custom-kpi/list-dataset-values"},{"title":"List Datasets","api":"GET /v1/custom-kpi-datasets","href":"/api-reference/custom-kpi/list-datasets"},{"title":"Get Dataset","api":"GET /v1/custom-kpi-datasets/{dataset_id}","href":"/api-reference/custom-kpi/get-dataset"},{"title":"Create Dataset","api":"POST /v1/custom-kpi-datasets","href":"/api-reference/custom-kpi/create-dataset"},{"title":"Download Excel","api":"POST /v1/custom-kpi-datasets/{dataset_id}/download_excel","href":"/api-reference/custom-kpi/download-excel"},{"title":"Submit Response","api":"POST /v1/custom-kpi-datasets/{dataset_id}/responses","href":"/api-reference/custom-kpi/submit-response"},{"title":"Update Dataset","api":"PATCH /v1/custom-kpi-datasets/{dataset_id}","href":"/api-reference/custom-kpi/update-dataset"},{"title":"Delete Dataset","api":"DELETE /v1/custom-kpi-datasets/{dataset_id}","href":"/api-reference/custom-kpi/delete-dataset"},{"title":"Presigned URL","api":"POST /v1/custom-kpi-datasets/{dataset_id}/responses/attachments/presigned-url","href":"/api-reference/custom-kpi/presigned-url"},{"group":"Assignments","expanded":true,"pages":[{"title":"List Assignments","api":"GET /v1/custom-kpi-datasets/{dataset_id}/assignments","href":"/api-reference/custom-kpi/list-assignments"},{"title":"Create Assignment","api":"POST /v1/custom-kpi-datasets/{dataset_id}/assignments","href":"/api-reference/custom-kpi/create-assignment"},{"title":"Update Assignment","api":"PATCH /v1/custom-kpi-datasets/{dataset_id}/assignments/{assignment_id}","href":"/api-reference/custom-kpi/update-assignment"},{"title":"Delete Assignment","api":"DELETE /v1/custom-kpi-datasets/{dataset_id}/assignments/{assignment_id}","href":"/api-reference/custom-kpi/delete-assignment"}]},{"group":"Campaigns","expanded":true,"pages":[{"title":"Assignment Versions","api":"GET /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}/assignments/{campaign_assignment_id}/versions","href":"/api-reference/custom-kpi/assignment-versions"},{"title":"Get Assignment Values","api":"GET /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}/assignments/{campaign_assignment_id}/values","href":"/api-reference/custom-kpi/get-assignment-values"},{"title":"List Campaign Values","api":"GET /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}/values","href":"/api-reference/custom-kpi/list-campaign-values"},{"title":"List Campaigns","api":"GET /v1/custom-kpi-datasets/{dataset_id}/campaigns","href":"/api-reference/custom-kpi/list-campaigns"},{"title":"List Response Sets","api":"GET /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}/response-sets","href":"/api-reference/custom-kpi/list-response-sets"},{"title":"Get Campaign","api":"GET /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}","href":"/api-reference/custom-kpi/get-campaign"},{"title":"Add Campaign Recipient","api":"POST /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}/assignments","href":"/api-reference/custom-kpi/add-campaign-recipient"},{"title":"Create Campaign","api":"POST /v1/custom-kpi-datasets/{dataset_id}/campaigns","href":"/api-reference/custom-kpi/create-campaign"},{"title":"Lock Campaign","api":"POST /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}/lock","href":"/api-reference/custom-kpi/lock-campaign"},{"title":"Resend Invite","api":"POST /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}/assignments/{campaign_assignment_id}/resend","href":"/api-reference/custom-kpi/resend-invite"},{"title":"Send Invites","api":"POST /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}/send-invites","href":"/api-reference/custom-kpi/send-invites"},{"title":"Unlock Campaign","api":"POST /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}/unlock","href":"/api-reference/custom-kpi/unlock-campaign"},{"title":"Edit Assignment Values","api":"PATCH /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}/assignments/{campaign_assignment_id}/values","href":"/api-reference/custom-kpi/edit-assignment-values"},{"title":"Update Campaign","api":"PATCH /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}","href":"/api-reference/custom-kpi/update-campaign"},{"title":"Delete Campaign","api":"DELETE /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}","href":"/api-reference/custom-kpi/delete-campaign"},{"title":"Remove Campaign Recipient","api":"DELETE /v1/custom-kpi-datasets/{dataset_id}/campaigns/{campaign_id}/assignments/{campaign_assignment_id}","href":"/api-reference/custom-kpi/remove-campaign-recipient"}]},{"group":"KPIs","expanded":true,"pages":[{"title":"Create KPI","api":"POST /v1/custom-kpi-datasets/{dataset_id}/kpis","href":"/api-reference/custom-kpi/create-kpi"},{"title":"Update KPI","api":"PATCH /v1/custom-kpi-datasets/{dataset_id}/kpis/{kpi_id}","href":"/api-reference/custom-kpi/update-kpi"},{"title":"Delete KPI","api":"DELETE /v1/custom-kpi-datasets/{dataset_id}/kpis/{kpi_id}","href":"/api-reference/custom-kpi/delete-kpi"}]}]},{"group":"Dashboards","pages":[{"title":"Dashboards API","href":"/api-reference/dashboards/overview"},{"title":"List Dashboards","api":"GET /v2/dashboard","href":"/api-reference/dashboards/list"},{"title":"Get Dashboard","api":"GET /v2/dashboard/{dashboard_id}","href":"/api-reference/dashboards/get"},{"title":"Create Dashboard","api":"POST /v2/dashboard","href":"/api-reference/dashboards/create"},{"title":"Update Dashboard","api":"PATCH /v2/dashboard/{dashboard_id}","href":"/api-reference/dashboards/update"},{"title":"Delete Dashboard","api":"DELETE /v2/dashboard/{dashboard_id}","href":"/api-reference/dashboards/delete"}]},{"group":"Datasets","pages":[{"title":"Get Dataset Schema","api":"GET /v1/datasets/{key}/schema","href":"/api-reference/datasets/schema"},{"title":"List Available Datasets","api":"GET /v1/datasets","href":"/api-reference/datasets/list"},{"title":"Query datasets","api":"POST /v1/datasets/{key}/query","href":"/api-reference/datasets/query"}]},{"group":"Emissions","pages":[{"title":"Emissions","href":"/api-reference/emissions/overview"},{"title":"Get Emissions Summary","api":"GET /v1/total-impacts","href":"/api-reference/emissions/get-summary"}]},{"group":"Employees","pages":[{"title":"Employees API","href":"/api-reference/employees/overview"},{"title":"List Employees","api":"GET /v1/employees","href":"/api-reference/employees/list"},{"title":"List Employees (V2)","api":"GET /v2/employees","href":"/api-reference/employees/list-v2"},{"title":"List Survey Rows","api":"GET /v2/employees/survey-rows","href":"/api-reference/employees/survey-rows"},{"title":"Queue Pending Mobility Survey Export","api":"GET /v2/employees/pending-survey/download","href":"/api-reference/employees/pending-survey-download"},{"title":"Get Commuting Response (v2)","api":"GET /v2/employees/commuting/responses/{response_id}","tag":"BETA","href":"/api-reference/employees/commuting-response-get-v2"},{"title":"Get Employee","api":"GET /v1/employees/{employee_id}","href":"/api-reference/employees/get"},{"title":"Create Commuting Periods (v2)","api":"POST /v2/employees/commuting","tag":"BETA","href":"/api-reference/employees/commuting-create-v2"},{"title":"Create Employee","api":"POST /v1/employees","deprecated":true,"href":"/api-reference/employees/create"},{"title":"Create Employees (v2)","api":"POST /v2/employees","tag":"BETA","href":"/api-reference/employees/create-v2"},{"title":"Delete Commuting Periods (v2)","api":"POST /v2/employees/commuting/delete","tag":"BETA","href":"/api-reference/employees/commuting-delete-v2"},{"title":"Delete Employees (v2)","api":"POST /v2/employees/delete","tag":"BETA","href":"/api-reference/employees/delete-v2"},{"title":"Download Survey Rows","api":"POST /v2/employees/survey-rows/export","href":"/api-reference/employees/survey-rows-export"},{"title":"Resend Commuting Survey","api":"POST /v1/employees/resend-survey","href":"/api-reference/employees/resend-survey"},{"title":"Replace Commuting Response (v2)","api":"PUT /v2/employees/commuting/responses/{response_id}","tag":"BETA","href":"/api-reference/employees/commuting-response-replace-v2"},{"title":"Update Employee","api":"PATCH /v1/employees/{employee_id}","href":"/api-reference/employees/update"},{"title":"Delete Employee","api":"DELETE /v1/employees/{employee_id}","deprecated":true,"href":"/api-reference/employees/delete"},{"title":"Bulk Delete Employees","api":"POST /v2/employees/bulk-delete","deprecated":true,"href":"/api-reference/employees/bulk-delete"},{"title":"Bulk Delete Employees by Filters","api":"POST /v2/employees/bulk-delete-by-filters","href":"/api-reference/employees/bulk-delete-by-filters"},{"title":"CSV Import","api":"POST /v1/employees/csv","href":"/api-reference/employees/csv-import"},{"title":"Recalculate Employees","api":"POST /v2/employees/recalculate","href":"/api-reference/employees/recalculate"},{"group":"Commuting Periods","expanded":true,"pages":[{"title":"Calculation Steps","api":"GET /v1/employee-historic/{employee_historic_id}/steps","href":"/api-reference/employees/commuting-periods/calculation-steps"},{"title":"List Commuting Periods","api":"GET /v1/employee-historic","href":"/api-reference/employees/commuting-periods/list"},{"title":"Get Commuting Period","api":"GET /v1/employee-historic/{employee_historic_id}","href":"/api-reference/employees/commuting-periods/get"},{"title":"Create Commuting Period","api":"POST /v1/employee-historic","deprecated":true,"href":"/api-reference/employees/commuting-periods/create"},{"title":"Update Commuting Period","api":"PATCH /v1/employee-historic/{employee_historic_id}","href":"/api-reference/employees/commuting-periods/update"},{"title":"Delete Commuting Period","api":"DELETE /v1/employee-historic/{employee_historic_id}","deprecated":true,"href":"/api-reference/employees/commuting-periods/delete"},{"title":"CSV Upload","api":"POST /v1/employee-historic/bulk/csv","deprecated":true,"href":"/api-reference/employees/commuting-periods/csv-upload"}]},{"group":"Survey Templates","expanded":true,"pages":[{"title":"Survey Templates API","href":"/api-reference/employees/survey-templates/overview"},{"title":"List Survey Templates","api":"GET /v1/employee-survey-templates","href":"/api-reference/employees/survey-templates/list"},{"title":"Get Survey Template","api":"GET /v1/employee-survey-templates/{template_id}","href":"/api-reference/employees/survey-templates/get"},{"title":"Create Survey Template","api":"POST /v1/employee-survey-templates","href":"/api-reference/employees/survey-templates/create"},{"title":"Block Template","api":"PATCH /v1/employee-survey-templates/{template_id}/block","href":"/api-reference/employees/survey-templates/block"},{"title":"Set Default Template","api":"PATCH /v1/employee-survey-templates/{template_id}/default","href":"/api-reference/employees/survey-templates/set-default"},{"title":"Unblock Template","api":"PATCH /v1/employee-survey-templates/{template_id}/unblock","href":"/api-reference/employees/survey-templates/unblock"},{"title":"Update Survey Template","api":"PATCH /v1/employee-survey-templates/{template_id}","href":"/api-reference/employees/survey-templates/update"},{"title":"Delete Survey Template","api":"DELETE /v1/employee-survey-templates/{template_id}","href":"/api-reference/employees/survey-templates/delete"},{"title":"Clone Survey Template","api":"POST /v1/employee-survey-templates/{template_id}/clone","href":"/api-reference/employees/survey-templates/clone"}]}]},{"group":"Facilities","pages":[{"title":"Facilities API","href":"/api-reference/facilities/overview"},{"title":"Get Facility Version History","api":"GET /v1/facilities/{facility_id}/versions","href":"/api-reference/facilities/versions"},{"title":"List Facilities","api":"GET /v1/facilities","href":"/api-reference/facilities/list"},{"title":"Get Facility","api":"GET /v1/facilities/{facility_id}","href":"/api-reference/facilities/get"},{"title":"Create Facilities (v2)","api":"POST /v2/facilities","tag":"BETA","href":"/api-reference/facilities/create-v2"},{"title":"Create Facility","api":"POST /v1/facilities","deprecated":true,"href":"/api-reference/facilities/create"},{"title":"Create Waste Water Facility","api":"POST /v1/facilities/waste_water","deprecated":true,"href":"/api-reference/facilities/create-waste-water"},{"title":"Delete Facilities (v2)","api":"POST /v2/facilities/delete","tag":"BETA","href":"/api-reference/facilities/delete-v2"},{"title":"Update Facility","api":"PUT /v1/facilities/{facility_id}","href":"/api-reference/facilities/update"},{"title":"Delete Facility","api":"DELETE /v1/facilities/{facility_id}","deprecated":true,"href":"/api-reference/facilities/delete"}]},{"group":"Files","pages":[{"title":"Files","href":"/api-reference/files/overview"},{"title":"Get a File's Sheets","api":"GET /v2/files/{file_id}/sheets","tag":"BETA","href":"/api-reference/files/sheets-v2"},{"title":"List File Readings","api":"GET /v1/files/readings","href":"/api-reference/files/readings"},{"title":"Get a File (v2)","api":"GET /v2/files/{file_id}","tag":"BETA","href":"/api-reference/files/get-v2"},{"title":"Create Records From File Reading","api":"POST /v1/files/readings","href":"/api-reference/files/create-records"},{"title":"Retry File Processing","api":"POST /v1/files/send-event","href":"/api-reference/files/process"},{"title":"Update File Reading","api":"PUT /v1/files/readings/{file_reading_id}","href":"/api-reference/files/update-reading"},{"title":"Open an Import Session","api":"POST /v2/files/{file_id}/import-sessions","tag":"BETA","href":"/api-reference/files/import-sessions-v2"},{"title":"Upload a File (v2)","api":"POST /v2/files","tag":"BETA","href":"/api-reference/files/upload-v2"},{"title":"Upload Files","api":"POST /v1/files/presigned-urls","href":"/api-reference/files/upload"}]},{"group":"Historical Emissions","pages":[{"title":"Historical Emissions","href":"/api-reference/historical-emissions/overview"},{"title":"Get Historical Emission Version History","api":"GET /v1/historical-emissions/{historical_emission_id}/versions","href":"/api-reference/historical-emissions/versions"},{"title":"List Historical Emissions","api":"GET /v1/historical-emissions/","href":"/api-reference/historical-emissions/list"},{"title":"Get Historical Emission","api":"GET /v1/historical-emissions/{historical_emission_id}","href":"/api-reference/historical-emissions/get"},{"title":"Create Historical Emission","api":"POST /v1/historical-emissions/","href":"/api-reference/historical-emissions/create"},{"title":"Update Historical Emission","api":"PATCH /v1/historical-emissions/{historical_emission_id}","href":"/api-reference/historical-emissions/update"},{"title":"Delete Historical Emission","api":"DELETE /v1/historical-emissions/{historical_emission_id}","href":"/api-reference/historical-emissions/delete"}]},{"group":"Hotel Stays","pages":[{"title":"Hotel Stays API","href":"/api-reference/hotel-stays/overview"},{"title":"Get Hotel Stay Totals","api":"GET /v1/hotel-stays/totals","href":"/api-reference/hotel-stays/totals"},{"title":"Hotel Stay Calculation Steps","api":"GET /v1/hotel-stays/{hotel_stay_id}/steps","href":"/api-reference/hotel-stays/impact-calculation"},{"title":"List Available Countries","api":"GET /v1/hotel-stays/available-countries","href":"/api-reference/hotel-stays/available-countries"},{"title":"List Hotel Stays","api":"GET /v1/hotel-stays","href":"/api-reference/hotel-stays/list"},{"title":"Get Hotel Stay","api":"GET /v1/hotel-stays/{hotel_stay_id}","href":"/api-reference/hotel-stays/get"},{"title":"Create Hotel Stay","api":"POST /v1/hotel-stays","deprecated":true,"href":"/api-reference/hotel-stays/create"},{"title":"Create Hotel Stays (v2)","api":"POST /v2/hotel-stays","tag":"BETA","href":"/api-reference/hotel-stays/create-v2"},{"title":"Delete Hotel Stays (v2)","api":"POST /v2/hotel-stays/delete","tag":"BETA","href":"/api-reference/hotel-stays/delete-v2"},{"title":"Update Hotel Stay","api":"PATCH /v1/hotel-stays/{hotel_stay_id}","href":"/api-reference/hotel-stays/update"},{"title":"Delete Hotel Stay","api":"DELETE /v1/hotel-stays/{hotel_stay_id}","deprecated":true,"href":"/api-reference/hotel-stays/delete"},{"title":"Bulk Delete Hotel Stays","api":"POST /v1/hotel-stays/bulk-delete","deprecated":true,"href":"/api-reference/hotel-stays/bulk-delete"},{"title":"Bulk Delete Hotel Stays by Filters","api":"POST /v1/hotel-stays/bulk-delete-by-filters","href":"/api-reference/hotel-stays/bulk-delete-by-filters"},{"title":"CSV Upload","api":"POST /v1/hotel-stays/bulk/csv","deprecated":true,"href":"/api-reference/hotel-stays/csv-upload"},{"title":"Recalculate Hotel Stays","api":"POST /v1/hotel-stays/recalculate","href":"/api-reference/hotel-stays/recalculate"}]},{"group":"Imports","pages":[{"title":"Imports","href":"/api-reference/imports/overview"},{"title":"Get Import Rows","api":"GET /v2/imports/{import_id}/rows","href":"/api-reference/imports/get-rows"},{"title":"Get Import Status","api":"GET /v2/imports/{import_id}/status","href":"/api-reference/imports/get-status"},{"title":"List Import Sessions","api":"GET /v2/imports/sessions","href":"/api-reference/imports/list"},{"title":"Get Provider Options","api":"GET /v2/imports/options/{source_key}","href":"/api-reference/imports/get-options-source"},{"title":"Get Import Template","api":"GET /v2/imports/templates/{template_id}","href":"/api-reference/imports/get-template"},{"title":"Own Workforce Import Templates","href":"/api-reference/imports/own-workforce-templates"},{"title":"Get Unique Values","api":"POST /v2/imports/{import_id}/unique-values","href":"/api-reference/imports/get-unique-values"},{"title":"Confirm Mapping","api":"POST /v2/imports/{import_id}/mapping","href":"/api-reference/imports/confirm-mapping"},{"title":"Create Import Session","api":"POST /v2/imports/sessions","href":"/api-reference/imports/create-session"},{"title":"Delete Import Rows","api":"POST /v2/imports/{import_id}/rows/delete","href":"/api-reference/imports/delete-rows"},{"title":"Submit Import","api":"POST /v2/imports/{import_id}/submit","href":"/api-reference/imports/submit"},{"title":"Suggest Mapping","api":"POST /v2/imports/{import_id}/mapping/suggest","href":"/api-reference/imports/suggest-mapping"},{"title":"Validate Import","api":"POST /v2/imports/{import_id}/validate","href":"/api-reference/imports/validate"},{"title":"Patch Import Rows","api":"PATCH /v2/imports/{import_id}/rows","href":"/api-reference/imports/patch-rows"},{"title":"Delete Import Session","api":"DELETE /v2/imports/sessions/{import_id}","href":"/api-reference/imports/delete-session"}]},{"group":"Ingest Jobs","pages":[{"title":"How Bulk Ingestion Works","tag":"BETA","href":"/api-reference/ingest-jobs/overview"},{"title":"List Ingest Job Items","api":"GET /v2/ingest-jobs/{job_id}/items","tag":"BETA","href":"/api-reference/ingest-jobs/list-items"},{"title":"List Ingest Jobs","api":"GET /v2/ingest-jobs","tag":"BETA","href":"/api-reference/ingest-jobs/list"},{"title":"Get Ingest Job","api":"GET /v2/ingest-jobs/{job_id}","tag":"BETA","href":"/api-reference/ingest-jobs/get"}]},{"group":"Invoices","pages":[{"title":"Invoices API","href":"/api-reference/invoices/overview"},{"title":"Get Invoice Totals","api":"GET /v1/invoices/totals","href":"/api-reference/invoices/totals"},{"title":"List Invoice Filter Options","api":"GET /v1/invoices/filter-options","href":"/api-reference/invoices/filter-options"},{"title":"List Invoices","api":"GET /v1/invoices","href":"/api-reference/invoices/list"},{"title":"List Refrigerant Gases","api":"GET /v1/recharge/gases","href":"/api-reference/invoices/refrigerant-gases-list"},{"title":"List Stationary Fuels","api":"GET /v1/stationary/fuels","href":"/api-reference/invoices/stationary-fuels-list"},{"title":"List Suppliers (v2)","api":"GET /v2/suppliers","href":"/api-reference/invoices/suppliers-list-v2"},{"title":"Get Invoice","api":"GET /v1/invoices/{invoice_id}","href":"/api-reference/invoices/get"},{"title":"Create District Cooling Invoices (v2)","api":"POST /v2/invoices/district-cooling","tag":"BETA","href":"/api-reference/invoices/district-cooling-create-v2"},{"title":"Create District Heating Invoices (v2)","api":"POST /v2/invoices/district-heating","tag":"BETA","href":"/api-reference/invoices/district-heating-create-v2"},{"title":"Create Electricity Invoices (v2)","api":"POST /v2/invoices/electricity","tag":"BETA","href":"/api-reference/invoices/electricity-create-v2"},{"title":"Create Fuel Invoices (v2)","api":"POST /v2/invoices/fuels","tag":"BETA","href":"/api-reference/invoices/fuels-create-v2"},{"title":"Create Invoice","api":"POST /v1/invoices","deprecated":true,"href":"/api-reference/invoices/create"},{"title":"Create Process Invoices (v2)","api":"POST /v2/invoices/process","tag":"BETA","href":"/api-reference/invoices/process-create-v2"},{"title":"Create Refrigerant Invoices (v2)","api":"POST /v2/invoices/refrigerants","tag":"BETA","href":"/api-reference/invoices/refrigerants-create-v2"},{"title":"Create Water Invoices (v2)","api":"POST /v2/invoices/water","tag":"BETA","href":"/api-reference/invoices/water-create-v2"},{"title":"Delete Invoices (v2)","api":"POST /v2/invoices/delete","tag":"BETA","href":"/api-reference/invoices/delete-v2"},{"title":"Replace Invoice","api":"PUT /v1/invoices/{invoice_id}","href":"/api-reference/invoices/replace"},{"title":"Update Invoice","api":"PATCH /v1/invoices/{invoice_id}","href":"/api-reference/invoices/update"},{"title":"Delete Invoice","api":"DELETE /v1/invoices/{invoice_id}","deprecated":true,"href":"/api-reference/invoices/delete"},{"title":"Bulk Delete Invoices","api":"POST /v1/invoices/bulk-delete","deprecated":true,"href":"/api-reference/invoices/bulk-delete"},{"title":"Bulk Delete Invoices by Filters","api":"POST /v1/invoices/bulk-delete-by-filters","href":"/api-reference/invoices/bulk-delete-by-filters"},{"title":"Bulk Update","api":"POST /v1/invoices/bulk-update","href":"/api-reference/invoices/bulk-update"},{"title":"Recalculate Invoices","api":"POST /v1/invoices/recalculate","href":"/api-reference/invoices/recalculate"},{"title":"Create Invoice with PDF Attachment","href":"/api-reference/invoices/invoice-with-pdf"},{"title":"Invoice Comments","href":"/api-reference/invoices/comments"}]},{"group":"Life Cycle Assessment (LCA)","pages":[{"title":"LCA API","href":"/api-reference/lca/overview"},{"title":"Get LCA Calculation Errors","api":"GET /lca/portfolio/{lca_id}/calculation-errors","href":"/api-reference/lca/calculation-errors"},{"title":"Get LCA Dashboard","api":"GET /lca/portfolio/{lca_id}/dashboard","href":"/api-reference/lca/dashboard"},{"title":"List LCA Portfolios","api":"GET /lca/portfolio","href":"/api-reference/lca/list"},{"title":"Get LCA Impacts","api":"GET /lca/impacts/{lca_id}","href":"/api-reference/lca/impacts"},{"title":"Get LCA Portfolio","api":"GET /lca/portfolio/{lca_id}","href":"/api-reference/lca/get"},{"title":"Validate LCA","api":"GET /lca/validate/{lca_id}","href":"/api-reference/lca/validate"},{"title":"Create LCA from Excel","api":"POST /lca/create-from-excel","href":"/api-reference/lca/create-from-excel"},{"title":"Create LCA from JSON","api":"POST /lca/create-from-json","href":"/api-reference/lca/create-from-json"},{"title":"Create LCA Portfolio","api":"POST /v1/lca/portfolio","href":"/api-reference/lca/create"},{"title":"Export LCA to Excel","api":"POST /lca/export-xlsx/{lca_id}","href":"/api-reference/lca/export-xlsx"},{"title":"Update LCA Portfolio","api":"PATCH /lca/portfolio/{lca_id}","href":"/api-reference/lca/update"},{"title":"Delete LCA Portfolio","api":"DELETE /lca/portfolio/{lca_id}","href":"/api-reference/lca/delete"}]},{"group":"Logistic Hubs","pages":[{"title":"Logistic Hubs API","href":"/api-reference/logistic-hubs/overview"},{"title":"List Logistic Hubs","api":"GET /v1/logistic-hubs","href":"/api-reference/logistic-hubs/list"},{"title":"Get Logistic Hub","api":"GET /v1/logistic-hubs/{hub_id}","href":"/api-reference/logistic-hubs/get"},{"title":"Create Logistic Hub","api":"POST /v1/logistic-hubs","href":"/api-reference/logistic-hubs/create"},{"title":"Create Logistic Hubs (v2)","api":"POST /v2/logistic-hubs","tag":"BETA","href":"/api-reference/logistic-hubs/create-v2"},{"title":"Update Logistic Hub","api":"PUT /v1/logistic-hubs/{hub_id}","href":"/api-reference/logistic-hubs/update"},{"title":"Delete Logistic Hub","api":"DELETE /v1/logistic-hubs/{hub_id}","href":"/api-reference/logistic-hubs/delete"}]},{"group":"Logistics","pages":[{"title":"Logistics API","href":"/api-reference/logistics/overview"},{"title":"Export Detailed Report","api":"GET /v1/logistics/report/export","href":"/api-reference/logistics/get-report-export"},{"title":"Generate Report","api":"GET /v1/logistics/report","href":"/api-reference/logistics/get-report"},{"title":"Get Logistics Packages (v2)","api":"GET /v2/logistics/packages","tag":"BETA","href":"/api-reference/logistics/get-packages-v2"},{"title":"Get Logistics Summary","api":"GET /v1/logistics/summary","href":"/api-reference/logistics/get-summary"},{"title":"List Available Fuel Types","api":"GET /v1/logistics/fuels","href":"/api-reference/logistics/list-fuels"},{"title":"List Available Vehicle Types","api":"GET /v1/logistics/tocs","href":"/api-reference/logistics/list-tocs"},{"title":"List Clients","api":"GET /v1/logistics/clients","href":"/api-reference/logistics/list-clients"},{"title":"List HOCs","api":"GET /v1/logistics/hocs","href":"/api-reference/logistics/list-hocs"},{"title":"List Logistics Hubs","api":"GET /v1/logistics/hubs","href":"/api-reference/logistics/list-hubs"},{"title":"List Packages","api":"GET /v1/logistics/packages","href":"/api-reference/logistics/list-packages"},{"title":"Get Package by ID","api":"GET /v1/logistics/packages/{package_id}","href":"/api-reference/logistics/get-package"},{"title":"CSV Upload","api":"POST /v1/logistics/upload","href":"/api-reference/logistics/upload"},{"group":"Recharges","expanded":true,"pages":[{"title":"List Logistics Recharges","api":"GET /v1/logistics/recharges","href":"/api-reference/logistics/list-recharges"},{"title":"List Recharge Filter Values","api":"GET /v1/logistics/recharges/unique-values","href":"/api-reference/logistics/recharges-unique-values"},{"title":"Create Logistics Recharge","api":"POST /v1/logistics/recharges","href":"/api-reference/logistics/create-recharge"},{"title":"Delete Logistics Recharge","api":"DELETE /v1/logistics/recharges/{recharge_id}","href":"/api-reference/logistics/delete-recharge"},{"title":"Batch Delete Logistics Recharges","api":"POST /v1/logistics/recharges/batch-delete","href":"/api-reference/logistics/batch-delete-recharges"},{"title":"Bulk Delete Recharges by Filters","api":"POST /v1/logistics/recharges/bulk-delete-by-filters","href":"/api-reference/logistics/recharges-bulk-delete-by-filters"},{"title":"Create Logistics Recharges (Bulk)","api":"POST /v1/logistics/recharges/bulk","href":"/api-reference/logistics/create-recharges-bulk"}]},{"group":"Requests","expanded":true,"pages":[{"title":"List Logistics Requests","api":"GET /v1/logistics/requests","href":"/api-reference/logistics/list-requests"},{"title":"List Shipment Filter Values","api":"GET /v1/logistics/requests/unique-values","href":"/api-reference/logistics/requests-unique-values"},{"title":"Create Logistics Request","api":"POST /v1/logistics/requests","description":"Calculate CO2e emissions for a logistics shipment","href":"/api-reference/logistics/create-request"},{"title":"Create Logistics Requests (v2)","api":"POST /v2/logistics/requests","tag":"BETA","href":"/api-reference/logistics/create-requests-v2"},{"title":"Delete Logistics Requests (v2)","api":"POST /v2/logistics/requests/delete","description":"Delete up to 5,000 logistics legs by id, asynchronously, as an ingest job","tag":"BETA","href":"/api-reference/logistics/delete-requests-v2"},{"title":"Delete Logistics Request","api":"DELETE /v1/logistics/requests/{request_id}","href":"/api-reference/logistics/delete-request"},{"title":"Batch Delete Logistics Requests","api":"POST /v1/logistics/requests/batch-delete","href":"/api-reference/logistics/batch-delete-requests"},{"title":"Bulk Delete Requests by Filters","api":"POST /v1/logistics/requests/bulk-delete-by-filters","href":"/api-reference/logistics/requests-bulk-delete-by-filters"},{"title":"Create Logistics Requests (Bulk)","api":"POST /v1/logistics/requests/bulk","href":"/api-reference/logistics/create-requests-bulk"}]}]},{"group":"Organizations","pages":[{"title":"Organizations API","href":"/api-reference/organizations/overview"},{"title":"Organization Metrics","api":"GET /v1/organizations/{organization_id}/metrics","href":"/api-reference/organizations/metrics"},{"title":"Organization Tree","api":"GET /v2/organizations/tree","href":"/api-reference/organizations/tree"}]},{"group":"Own Workforce","pages":[{"title":"Own Workforce API","href":"/api-reference/own-workforce/overview"},{"title":"Get Workforce Unique Values","api":"GET /v1/own_workforces/unique-values","href":"/api-reference/own-workforce/unique-values"},{"title":"Get Workforce Verification Data","api":"GET /v1/own_workforces/verification-data","href":"/api-reference/own-workforce/verification-data"},{"title":"List Workforce Countries","api":"GET /v1/own_workforces/countries","href":"/api-reference/own-workforce/countries"},{"title":"List Workforce Employees","api":"GET /v1/own_workforces","href":"/api-reference/own-workforce/list"},{"title":"List Workforce Employees With Contracts","api":"GET /v1/own_workforces/with-contracts-and-remunerations","href":"/api-reference/own-workforce/with-contracts"},{"title":"List Workforce Job Categories","api":"GET /v1/own_workforces/job-categories","href":"/api-reference/own-workforce/job-categories"},{"title":"Get Workforce Employee","api":"GET /v1/own_workforces/{own_workforce_id}","href":"/api-reference/own-workforce/get"},{"title":"Create Workforce Employees (v2)","api":"POST /v2/own-workforce/employees","tag":"BETA","href":"/api-reference/own-workforce/employees-create-v2"},{"title":"Delete Workforce Employees (v2)","api":"POST /v2/own-workforce/employees/delete","tag":"BETA","href":"/api-reference/own-workforce/employees-delete-v2"},{"title":"Delete Workforce Employee","api":"DELETE /v1/own_workforces/{own_workforce_id}","deprecated":true,"href":"/api-reference/own-workforce/delete"},{"title":"Bulk Delete Workforce Employees","api":"POST /v1/own_workforces/bulk-delete","deprecated":true,"href":"/api-reference/own-workforce/bulk-delete"},{"title":"Bulk Delete Workforce Employees by Filters","api":"POST /v1/own_workforces/bulk-delete-by-filters","href":"/api-reference/own-workforce/bulk-delete-by-filters"},{"title":"Upload Workforce Employees CSV","api":"POST /v1/own_workforces/bulk/csv","deprecated":true,"href":"/api-reference/own-workforce/csv-upload"},{"group":"Absenteeisms \u0026 Accidents","expanded":true,"pages":[{"title":"Get Workforce Absences Unique Values","api":"GET /v1/own_workforce_absenteeisms_accidents/unique-values","href":"/api-reference/own-workforce/unique-values-absences"},{"title":"List Workforce Absences","api":"GET /v1/own_workforce_absenteeisms_accidents","href":"/api-reference/own-workforce/list-absences"},{"title":"List Workforce Absences Paginated","api":"GET /v1/own_workforce_absenteeisms_accidents/paginated","href":"/api-reference/own-workforce/list-absences-paginated"},{"title":"List Workforce Absences by Employee","api":"GET /v1/own_workforce_absenteeisms_accidents/own_workforce/{own_workforce_id}","href":"/api-reference/own-workforce/list-absences-by-employee"},{"title":"Create Workforce Absences (v2)","api":"POST /v2/own-workforce/absences","tag":"BETA","href":"/api-reference/own-workforce/absences-create-v2"},{"title":"Delete Workforce Absences (v2)","api":"POST /v2/own-workforce/absences/delete","tag":"BETA","href":"/api-reference/own-workforce/absences-delete-v2"},{"title":"Delete Workforce Absence","api":"DELETE /v1/own_workforce_absenteeisms_accidents/{absenteeism_accident_id}","deprecated":true,"href":"/api-reference/own-workforce/delete-absence"},{"title":"Bulk Delete Workforce Absences","api":"POST /v1/own_workforce_absenteeisms_accidents/bulk-delete","deprecated":true,"href":"/api-reference/own-workforce/bulk-delete-absences"},{"title":"Bulk Delete Workforce Absences by Filters","api":"POST /v1/own_workforce_absenteeisms_accidents/bulk-delete-by-filters","href":"/api-reference/own-workforce/bulk-delete-absences-by-filters"},{"title":"Upload Workforce Absences CSV","api":"POST /v1/own_workforce_absenteeisms_accidents/bulk/csv","deprecated":true,"href":"/api-reference/own-workforce/csv-upload-absences"}]},{"group":"Contracts \u0026 Remuneration","expanded":true,"pages":[{"title":"List Workforce Contracts","api":"GET /v1/own_workforce_contracts","href":"/api-reference/own-workforce/list-contracts"},{"title":"List Workforce Remunerations","api":"GET /v1/own_workforce_remunerations","href":"/api-reference/own-workforce/list-remunerations"},{"title":"Get Workforce Contract","api":"GET /v1/own_workforce_contracts/{contract_id}","href":"/api-reference/own-workforce/get-contract"}]},{"group":"Trainings","expanded":true,"pages":[{"title":"Get Workforce Trainings Unique Values","api":"GET /v1/own_workforce_trainings/unique-values","href":"/api-reference/own-workforce/unique-values-trainings"},{"title":"List Workforce Trainings","api":"GET /v1/own_workforce_trainings","href":"/api-reference/own-workforce/list-trainings"},{"title":"List Workforce Trainings Paginated","api":"GET /v1/own_workforce_trainings/paginated","href":"/api-reference/own-workforce/list-trainings-paginated"},{"title":"List Workforce Trainings by Employee","api":"GET /v1/own_workforce_trainings/own_workforce/{own_workforce_id}","href":"/api-reference/own-workforce/list-trainings-by-employee"},{"title":"Create Workforce Trainings (v2)","api":"POST /v2/own-workforce/trainings","tag":"BETA","href":"/api-reference/own-workforce/trainings-create-v2"},{"title":"Delete Workforce Trainings (v2)","api":"POST /v2/own-workforce/trainings/delete","tag":"BETA","href":"/api-reference/own-workforce/trainings-delete-v2"},{"title":"Delete Workforce Training","api":"DELETE /v1/own_workforce_trainings/{training_id}","deprecated":true,"href":"/api-reference/own-workforce/delete-training"},{"title":"Bulk Delete Workforce Trainings","api":"POST /v1/own_workforce_trainings/bulk-delete","deprecated":true,"href":"/api-reference/own-workforce/bulk-delete-trainings"},{"title":"Bulk Delete Workforce Trainings by Filters","api":"POST /v1/own_workforce_trainings/bulk-delete-by-filters","href":"/api-reference/own-workforce/bulk-delete-trainings-by-filters"},{"title":"Upload Workforce Trainings CSV","api":"POST /v1/own_workforce_trainings/bulk/csv","deprecated":true,"href":"/api-reference/own-workforce/csv-upload-trainings"}]}]},{"group":"Projects","pages":[{"title":"Projects API","href":"/api-reference/projects/overview"},{"title":"Consolidated Emissions","api":"GET /v1/projects/{project_id}/consolidated","href":"/api-reference/projects/consolidated"},{"title":"List Projects","api":"GET /v1/projects/extended","href":"/api-reference/projects/list"},{"title":"Recent Activities","api":"GET /v1/projects/{project_id}/recent-activities","href":"/api-reference/projects/recent-activities"},{"title":"Get Project","api":"GET /v1/projects/{project_id}","href":"/api-reference/projects/get"},{"title":"Create Project","api":"POST /v1/projects","href":"/api-reference/projects/create"},{"title":"Link Entities by Filters","api":"POST /v1/projects/{project_id}/entities/link-by-filters","href":"/api-reference/projects/link-by-filters"},{"title":"Link Entities to Project","api":"POST /v1/projects/{project_id}/entities/link","href":"/api-reference/projects/link-entities"},{"title":"Unlink Entities from Project","api":"POST /v1/projects/{project_id}/entities/unlink","href":"/api-reference/projects/unlink-entities"},{"title":"Update Project","api":"PUT /v1/projects/{project_id}","href":"/api-reference/projects/update"},{"title":"Delete Project","api":"DELETE /v1/projects/{project_id}","href":"/api-reference/projects/delete"},{"group":"Tasks","expanded":true,"pages":[{"title":"Get Subtasks","api":"GET /v1/tasks/{task_id}/subtasks","href":"/api-reference/projects/subtasks"},{"title":"List All Tasks","api":"GET /v1/projects/tasks","href":"/api-reference/projects/list-tasks"},{"title":"List Project Tasks","api":"GET /v1/projects/{project_id}/tasks","href":"/api-reference/projects/project-tasks"},{"title":"Task Versions","api":"GET /v1/tasks/{task_id}/versions","href":"/api-reference/projects/task-versions"},{"title":"Get Task","api":"GET /v1/tasks/{task_id}","href":"/api-reference/projects/get-task"},{"title":"Create Task","api":"POST /v2/tasks","href":"/api-reference/projects/create-task"},{"title":"Update Task","api":"PATCH /v1/tasks/{task_id}","href":"/api-reference/projects/update-task"},{"title":"Delete Task","api":"DELETE /v1/tasks/{task_id}","href":"/api-reference/projects/delete-task"}]}]},{"group":"Purchases","pages":[{"title":"Purchases API","href":"/api-reference/purchases/overview"},{"title":"Get Purchase Totals","api":"GET /v1/purchases/totals","href":"/api-reference/purchases/totals"},{"title":"Get Purchase Version History","api":"GET /v1/purchases/{purchase_id}/versions","href":"/api-reference/purchases/versions"},{"title":"List Purchase Suppliers","api":"GET /v1/purchases/suppliers","href":"/api-reference/purchases/suppliers-list"},{"title":"List Purchases","api":"GET /v1/purchases","href":"/api-reference/purchases/list"},{"title":"Get Purchase","api":"GET /v1/purchases/{purchase_id}","href":"/api-reference/purchases/get"},{"title":"Create Purchase","api":"POST /v1/purchases","deprecated":true,"href":"/api-reference/purchases/create"},{"title":"Create Purchase Suppliers (v2)","api":"POST /v2/purchases/suppliers","tag":"BETA","href":"/api-reference/purchases/suppliers-create-v2"},{"title":"Create Purchases (v2)","api":"POST /v2/purchases","tag":"BETA","href":"/api-reference/purchases/create-v2"},{"title":"Delete Purchase Suppliers (v2)","api":"POST /v2/purchases/suppliers/delete","tag":"BETA","href":"/api-reference/purchases/suppliers-delete-v2"},{"title":"Delete Purchases (v2)","api":"POST /v2/purchases/delete","tag":"BETA","href":"/api-reference/purchases/delete-v2"},{"title":"Classify Purchase Suppliers (v2)","api":"PATCH /v2/purchases/suppliers","tag":"BETA","href":"/api-reference/purchases/suppliers-update-v2"},{"title":"Update Purchase","api":"PATCH /v1/purchases/{purchase_id}","href":"/api-reference/purchases/update"},{"title":"Delete Purchase","api":"DELETE /v1/purchases/{purchase_id}","deprecated":true,"href":"/api-reference/purchases/delete"},{"title":"Bulk Delete Purchases","api":"POST /v1/purchases/bulk-delete","deprecated":true,"href":"/api-reference/purchases/bulk-delete"},{"title":"Bulk Delete Purchases by Filters","api":"POST /v1/purchases/bulk-delete-by-filters","href":"/api-reference/purchases/bulk-delete-by-filters"}]},{"group":"Reports \u0026 Dashboards (v1)","pages":[{"title":"Reports \u0026 Dashboards API","href":"/api-reference/reports/overview"},{"title":"Get Kpis","deprecated":null,"version":null,"openapi":"/openapi-kpi.json get /v1/report_builder/kpis","href":"/api-reference/reportbuilder/get-kpis"}]},{"group":"Sold Products","pages":[{"title":"Sold Products API","href":"/api-reference/sold-products/overview"},{"title":"Check Period Overlap","api":"GET /v1/sold-products/periods/check-overlap","href":"/api-reference/sold-products/check-overlap"},{"title":"List Existing Country Sales","api":"GET /v1/sold-products/existing-country-sales","href":"/api-reference/sold-products/existing-country-sales"},{"title":"List Periods","api":"GET /v1/sold-products/{sold_product_id}/periods","href":"/api-reference/sold-products/list-periods"},{"title":"List Sold Products","api":"GET /v1/sold-products/","href":"/api-reference/sold-products/list"},{"title":"Period Country Sales","api":"GET /v1/sold-products/{sold_product_id}/periods/{period_id}/country-sales","href":"/api-reference/sold-products/country-sales"},{"title":"Period Emissions","api":"GET /v1/sold-products/{sold_product_id}/periods/{period_id}/emissions","href":"/api-reference/sold-products/emissions"},{"title":"Create Sold Products (v2)","api":"POST /v2/sold-products","tag":"BETA","href":"/api-reference/sold-products/create-v2"},{"title":"Delete Sold Products (v2)","api":"POST /v2/sold-products/delete","tag":"BETA","href":"/api-reference/sold-products/delete-v2"},{"title":"Delete Period","api":"DELETE /v1/sold-products/{sold_product_id}/periods/{period_id}","href":"/api-reference/sold-products/delete-period"},{"title":"Delete Sold Product","api":"DELETE /v1/sold-products/{sold_product_id}","deprecated":true,"href":"/api-reference/sold-products/delete"},{"group":"Use of Sold Products","expanded":true,"pages":[{"title":"Create Use of Sold Products (v2)","api":"POST /v2/use-of-sold-products","tag":"BETA","href":"/api-reference/use-of-sold-products/create-v2"},{"title":"Delete Use of Sold Products (v2)","api":"POST /v2/use-of-sold-products/delete","tag":"BETA","href":"/api-reference/use-of-sold-products/delete-v2"}]}]},{"group":"Transport","pages":[{"title":"Transport API","href":"/api-reference/transport/overview"},{"title":"Get Route Counts","api":"GET /v1/transports/counts","href":"/api-reference/transport/counts"},{"title":"Get Transport Route Totals","api":"GET /v1/transports/totals","href":"/api-reference/transport/totals"},{"title":"Get Transport Route Version History","api":"GET /v1/transports/{transport_route_id}/versions","href":"/api-reference/transport/versions"},{"title":"List Transport Combinations","api":"GET /v1/transports/combinations","href":"/api-reference/transport/combinations"},{"title":"List Transport Routes","api":"GET /v1/transports","href":"/api-reference/transport/list"},{"title":"Get Transport Route","api":"GET /v1/transports/{transport_route_id}","href":"/api-reference/transport/get"},{"title":"Create Freight Transports (v2)","api":"POST /v2/transports","tag":"BETA","href":"/api-reference/transport/create-v2"},{"title":"Create Transport Route","api":"POST /v1/transports","deprecated":true,"href":"/api-reference/transport/create"},{"title":"Delete Freight Transports (v2)","api":"POST /v2/transports/delete","tag":"BETA","href":"/api-reference/transport/delete-v2"},{"title":"Update Transport Route","api":"PUT /v1/transports/{transport_route_id}","href":"/api-reference/transport/update"},{"title":"Update Transport Route Attachment","api":"PATCH /v1/transports/{transport_route_id}","href":"/api-reference/transport/update-attachment"},{"title":"Delete Transport Route","api":"DELETE /v1/transports/{transport_route_id}","deprecated":true,"href":"/api-reference/transport/delete"},{"title":"Bulk Delete Transport Routes","api":"POST /v1/transports/bulk-delete","deprecated":true,"href":"/api-reference/transport/bulk-delete"},{"title":"Bulk Delete Transport Routes by Filters","api":"POST /v1/transports/bulk-delete-by-filters","href":"/api-reference/transport/bulk-delete-by-filters"},{"title":"Get Presigned Upload URL","api":"POST /v1/transports/upload/presigned-url","deprecated":true,"href":"/api-reference/transport/presigned-url"},{"title":"Upload Transport File","api":"POST /v1/transports/upload","deprecated":true,"href":"/api-reference/transport/upload"},{"title":"Transport Type Inference (do_not_know)","href":"/api-reference/transport/do-not-know-inference"}]},{"group":"Units","pages":[{"title":"List Units","api":"GET /v2/units","href":"/api-reference/units/list"}]},{"group":"Vehicles","pages":[{"title":"Vehicles API","href":"/api-reference/vehicles/overview"},{"title":"List Market Segments","api":"GET /v1/vehicles/market_segments","href":"/api-reference/vehicles/market-segments"},{"title":"List Vehicles","api":"GET /v1/vehicles","href":"/api-reference/vehicles/list"},{"title":"Vehicle Versions","api":"GET /v1/vehicles/{vehicle_id}/versions","href":"/api-reference/vehicles/versions"},{"title":"Get Vehicle","api":"GET /v1/vehicles/{vehicle_id}","href":"/api-reference/vehicles/get"},{"title":"Create Vehicle","api":"POST /v1/vehicles","deprecated":true,"href":"/api-reference/vehicles/create"},{"title":"Create Vehicles (v2)","api":"POST /v2/vehicles","tag":"BETA","href":"/api-reference/vehicles/create-v2"},{"title":"Delete Vehicles (v2)","api":"POST /v2/vehicles/delete","tag":"BETA","href":"/api-reference/vehicles/delete-v2"},{"title":"Update Vehicle","api":"PATCH /v1/vehicles/{vehicle_id}","href":"/api-reference/vehicles/update"},{"title":"Delete Vehicle","api":"DELETE /v1/vehicles/{vehicle_id}","deprecated":true,"href":"/api-reference/vehicles/delete"},{"title":"Bulk Delete Vehicles","api":"POST /v1/vehicles/bulk-delete","deprecated":true,"href":"/api-reference/vehicles/bulk-delete"},{"title":"Bulk Delete Vehicles by Filters","api":"POST /v1/vehicles/bulk-delete-by-filters","href":"/api-reference/vehicles/bulk-delete-by-filters"},{"title":"CSV Import","api":"POST /v1/vehicles/bulk/csv","deprecated":true,"href":"/api-reference/vehicles/csv-import"},{"group":"Unknown Vehicles","expanded":true,"pages":[{"title":"Unknown Vehicles API","href":"/api-reference/unknown-vehicles/overview"},{"title":"List Unknown Vehicles","api":"GET /v1/unknown-vehicles","href":"/api-reference/unknown-vehicles/list"}]},{"group":"Vehicle Consumptions","expanded":true,"pages":[{"title":"Consumption Calculation Steps","api":"GET /v1/vehicle_consumptions/{vehicle_consumption_id}/steps","href":"/api-reference/vehicles/consumptions-steps"},{"title":"Consumption Totals (Organization)","api":"GET /v2/vehicle_consumptions/totals","href":"/api-reference/vehicles/consumptions-org-totals"},{"title":"List All Vehicle Consumptions (Organization)","api":"GET /v2/vehicle_consumptions","href":"/api-reference/vehicles/consumptions-org-list"},{"title":"List Consumption Filter Values","api":"GET /v1/vehicles/{vehicle_id}/consumptions/unique-values","href":"/api-reference/vehicles/consumptions-unique-values"},{"title":"List Consumption Filter Values (Organization)","api":"GET /v2/vehicle_consumptions/unique-values","href":"/api-reference/vehicles/consumptions-org-unique-values"},{"title":"Vehicle Consumptions","api":"GET /v1/vehicles/{vehicle_id}/consumptions","href":"/api-reference/vehicles/consumptions"},{"title":"Get Consumption","api":"GET /v1/vehicle_consumptions/{vehicle_consumption_id}","href":"/api-reference/vehicles/consumptions-get"},{"title":"Create Vehicle Consumptions (v2)","api":"POST /v2/vehicle-consumptions","tag":"BETA","href":"/api-reference/vehicles/consumptions-create-v2"},{"title":"Delete Vehicle Consumptions (v2)","api":"POST /v2/vehicle-consumptions/delete","tag":"BETA","href":"/api-reference/vehicles/consumptions-delete-v2"},{"title":"Delete Vehicle Consumption","api":"DELETE /v1/vehicle_consumptions/{vehicle_consumption_id}","deprecated":true,"href":"/api-reference/vehicles/consumptions-delete"},{"title":"Delete Vehicle Consumptions by File","api":"DELETE /v1/vehicle_consumptions/by-file/{file_id}","href":"/api-reference/vehicles/consumptions-delete-by-file"},{"title":"Bulk Delete Vehicle Consumptions","api":"POST /v1/vehicles/{vehicle_id}/consumptions/bulk-delete","deprecated":true,"href":"/api-reference/vehicles/consumptions-bulk-delete"},{"title":"Bulk Delete Vehicle Consumptions (Organization)","api":"POST /v2/vehicle_consumptions/bulk-delete","deprecated":true,"href":"/api-reference/vehicles/consumptions-org-bulk-delete"},{"title":"Bulk Delete Vehicle Consumptions by Filters","api":"POST /v1/vehicles/{vehicle_id}/consumptions/bulk-delete-by-filters","href":"/api-reference/vehicles/consumptions-bulk-delete-by-filters"},{"title":"Bulk Delete Vehicle Consumptions by Filters (Organization)","api":"POST /v2/vehicle_consumptions/bulk-delete-by-filters","href":"/api-reference/vehicles/consumptions-org-bulk-delete-by-filters"},{"title":"Consumptions CSV Import","api":"POST /v1/vehicle_consumptions/bulk/csv","deprecated":true,"href":"/api-reference/vehicles/consumptions-csv-import"}]},{"group":"Vehicle Fuels","expanded":true,"pages":[{"title":"Vehicle Fuels API","href":"/api-reference/vehicle-fuels/overview"},{"title":"List Vehicle Fuels","api":"GET /v1/vehicle-fuels","href":"/api-reference/vehicle-fuels/list"}]}]},{"group":"Waste Water Treatments","pages":[{"title":"Get Waste Water Treatment by ID","api":"GET /v1/waste-water-treatments/{wwt_id}/detail","href":"/api-reference/waste-water-treatments/detail"},{"title":"Get Waste Water Treatment Version History","api":"GET /v1/waste-water-treatments/{waste_water_treatment_id}/versions","href":"/api-reference/waste-water-treatments/versions"},{"title":"List Waste Water Treatments","api":"GET /v1/waste-water-treatments","href":"/api-reference/waste-water-treatments/list"},{"title":"Create Waste Water Treatment","api":"POST /v1/waste-water-treatments","deprecated":true,"href":"/api-reference/waste-water-treatments/create"},{"title":"Create Waste Water Treatments (v2)","api":"POST /v2/waste-water-treatments","tag":"BETA","href":"/api-reference/waste-water-treatments/create-v2"},{"title":"Delete Waste Water Treatments (v2)","api":"POST /v2/waste-water-treatments/delete","tag":"BETA","href":"/api-reference/waste-water-treatments/delete-v2"},{"title":"Update Waste Water Treatment","api":"PATCH /v1/waste-water-treatments/{wwt_id}","href":"/api-reference/waste-water-treatments/update"}]},{"group":"Wastes","pages":[{"title":"Wastes API","href":"/api-reference/wastes/overview"},{"title":"Get Waste","api":"GET /v1/wastes/{waste_id}/detail","href":"/api-reference/wastes/get"},{"title":"Get Waste Version History","api":"GET /v1/wastes/{waste_id}/versions","href":"/api-reference/wastes/versions"},{"title":"List LER Codes","api":"GET /v1/wastes/ler-codes","href":"/api-reference/wastes/ler-codes"},{"title":"List R/D Codes","api":"GET /v1/wastes/rd-codes","href":"/api-reference/wastes/rd-codes"},{"title":"List Waste Emission Factors","api":"GET /v1/waste-efs","href":"/api-reference/wastes/emission-factors"},{"title":"List Waste Filter Values","api":"GET /v1/waste/unique-values","href":"/api-reference/wastes/unique-values"},{"title":"List Wastes","api":"GET /v1/wastes","href":"/api-reference/wastes/list"},{"title":"Create Waste","api":"POST /v1/wastes","deprecated":true,"href":"/api-reference/wastes/create"},{"title":"Create Wastes (v2)","api":"POST /v2/wastes","tag":"BETA","href":"/api-reference/wastes/create-v2"},{"title":"Delete Wastes (v2)","api":"POST /v2/wastes/delete","tag":"BETA","href":"/api-reference/wastes/delete-v2"},{"title":"Update Waste","api":"PATCH /v1/wastes/{waste_id}","href":"/api-reference/wastes/update"},{"title":"Bulk Delete Wastes","api":"POST /v1/waste/bulk-delete","deprecated":true,"href":"/api-reference/wastes/bulk-delete"},{"title":"Bulk Delete Wastes by Filters","api":"POST /v1/waste/bulk-delete-by-filters","href":"/api-reference/wastes/bulk-delete-by-filters"}]},{"group":"Webhooks","pages":[{"title":"Webhooks","tag":"BETA","href":"/api-reference/webhooks/overview"},{"title":"List Webhook Deliveries","api":"GET /v2/webhook-endpoints/{endpoint_id}/deliveries","tag":"BETA","href":"/api-reference/webhooks/list-deliveries"},{"title":"List Webhook Endpoints","api":"GET /v2/webhook-endpoints","tag":"BETA","href":"/api-reference/webhooks/list-endpoints"},{"title":"Get Webhook Endpoint","api":"GET /v2/webhook-endpoints/{endpoint_id}","tag":"BETA","href":"/api-reference/webhooks/get-endpoint"},{"title":"Create Webhook Endpoint","api":"POST /v2/webhook-endpoints","tag":"BETA","href":"/api-reference/webhooks/create-endpoint"},{"title":"Retry Webhook Delivery","api":"POST /v2/webhook-endpoints/{endpoint_id}/deliveries/{delivery_id}/retry","tag":"BETA","href":"/api-reference/webhooks/retry-delivery"},{"title":"Rotate Webhook Secret","api":"POST /v2/webhook-endpoints/{endpoint_id}/rotate-secret","tag":"BETA","href":"/api-reference/webhooks/rotate-secret"},{"title":"Send Test Event","api":"POST /v2/webhook-endpoints/{endpoint_id}/test","tag":"BETA","href":"/api-reference/webhooks/test-endpoint"},{"title":"Update Webhook Endpoint","api":"PATCH /v2/webhook-endpoints/{endpoint_id}","tag":"BETA","href":"/api-reference/webhooks/update-endpoint"},{"title":"Delete Webhook Endpoint","api":"DELETE /v2/webhook-endpoints/{endpoint_id}","tag":"BETA","href":"/api-reference/webhooks/delete-endpoint"}]}]},{"version":"Legacy API","pages":[{"title":"Legacy API","href":"/api-reference/legacy/logistics/calculate-shipment"}]}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli/overview"}]},{"tab":"MCP","pages":[{"title":"MCP","href":"/mcp/overview"}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/docs/release-notes"}]}]},"basePath":"","title":"Create Logistics Requests (v2) - Dcycle Platform Docs","buildId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","deploymentId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-CBsVopKK.js","utils-DZAk68jJ.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-D32AYZrP.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-D_A5_cny.js","snippetPresets-xNRfS9th.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BIB25-tq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CydJ4w4j.js","shallow-CYPBeQSG.js","getApiPlaygroundDisplay-A5xJVBOu.js","CodeSnippet-BVRTgi3m.js","CodeSnippets-DjD6BSlt.js","Page-Dr40SSJq.js","getPastedJson-D4V4JyrR.js","icon-uhcnG22T.js","MethodPill-CM-ZQdGH.js","DuplicateIcon-B_WnOiNf.js","createIcon-CJsb8utt.js","DynamicMarkdown-D-2HDKEp.js","SectionHeading-KP5xmMgQ.js","axios-vUo_bRtp.js"]}