Skip to Content
API ReferenceTrack Cargo

Track Cargo

Get the current status of a submitted request.

GET /cargo/{cargo_id}/tracking

Path Parameters

ParameterTypeDescription
cargo_idstringThe cargo ID from /cargo/load response

Response

{ "cargo_id": "crg_abc123def456", "status": "processing", "status_description": "Batch is being processed by the provider", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:35:00Z" }
FieldDescription
cargo_idRequest identifier
statusCurrent status (see below)
status_descriptionHuman-readable status
created_atWhen request was submitted
updated_atLast status change

Status Values

StatusDescription
pendingWaiting to be assigned to a batch
batchedAssigned to a batch job
processingBatch is being processed
completedProcessing completed
failedProcessing failed
callback_pendingResult ready, delivering callback
callback_deliveredCallback sent successfully
callback_failedCallback delivery failed

See Cargo Lifecycle for the full state diagram.

Examples

curl

curl http://localhost:8000/cargo/crg_abc123def456/tracking

Python

import httpx cargo_id = "crg_abc123def456" response = httpx.get(f"http://localhost:8000/cargo/{cargo_id}/tracking") data = response.json() print(f"Status: {data['status']}") print(f"Description: {data['status_description']}")

Polling Example

import httpx import time def wait_for_completion(cargo_id: str, timeout: int = 3600) -> dict: """Poll until cargo is processed or timeout.""" start = time.time() terminal_statuses = {"callback_delivered", "callback_failed", "failed"} while time.time() - start < timeout: response = httpx.get( f"http://localhost:8000/cargo/{cargo_id}/tracking" ) data = response.json() if data["status"] in terminal_statuses: return data time.sleep(30) # Poll every 30 seconds raise TimeoutError(f"Cargo {cargo_id} not completed in {timeout}s")

Errors

StatusDescription
404Cargo not found
500Internal server error
Last updated on