Skip to main content
POST
Create Logistics Requests (Bulk)

Create Logistics Requests (Bulk)

Process multiple logistics requests in a single API call. Optimized for high-volume scenarios like daily batch uploads from logistics providers.
New API: This endpoint is part of the new API architecture with improved design and maintainability.

Key Features

High Volume

Process up to 5,000 records per request

Optimized Performance

Internal caching of TOCs, hubs, and distances for faster processing

Error Handling

Continue processing even if some records fail with continue_on_error

Same Schema

Uses the same record format as the single request endpoint

Request

Headers

string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Body Parameters

array
required
Array of logistics request objects. Each record uses the same schema as the single Create Logistics Request endpoint.Maximum items: 5,000
object
Processing options for the bulk operation.

Response

integer
Total number of records received in the request
integer
Total records processed (success + failed)
integer
Number of records processed successfully
integer
Number of records that failed
array
Array of successfully processed records with essential fields
array
Array of errors for failed records

Example

Successful Response

Response with Partial Errors

Performance Optimizations

The bulk endpoint includes several optimizations for high-volume processing:
All active vehicle types (TOCs) are pre-loaded at the start of the request, avoiding repeated database queries for each record.
Organization logistics hubs are pre-loaded, allowing instant name-to-address resolution without individual lookups.
Calculated distances are cached by route (origin, destination, category). Repeated routes reuse cached distances, reducing Google Maps API calls.Example: If 100 records share the same Madrid → Barcelona route, the distance is calculated only once.
Records are inserted in batches of 500 for efficient database writes.

Use Cases

Daily Batch Upload (Logistics Provider)

Process daily shipment data from a logistics provider:

Multi-leg Package Tracking (Bulk)

Track packages through multiple legs in a single request:

With Pre-calculated Distances

When you have pre-calculated distances (e.g., from your routing system), skip geocoding:

Common Errors

401 Unauthorized

Cause: Missing or invalid API key

403 Forbidden

Cause: The authenticated user is not a member of the organization

422 Validation Error

Cause: Invalid record format or missing required fields
Solution: Ensure each record has either toc or category, and either distance_km or both origin and destination.

Partial Failures

When some records fail but continue_on_error is true, the response includes both successful results and errors:
Solution: Review the errors array to identify and fix problematic records, then resubmit only the failed ones.

Limits

When the concurrency limit is exceeded, the API returns HTTP 429 with a Retry-After header.
For very large uploads (e.g. 1.5M records), split into batches of 2,000 records and send up to 5 requests in parallel. Wait for one to finish before sending the next. On a 429 response, wait the number of seconds indicated in the Retry-After header before retrying.

Create Single Request

Create a single logistics request

Get Requests

Retrieve all logistics requests with pagination

Get Packages

Retrieve packages with aggregated emissions

Get TOCs

Get available vehicle types