CUDA External API
Partner onboarding
This guide takes a new forwarder or partner from first login to receiving shipment updates. It’s also published at public.cudacartagetms.com/onboarding.
The full reference for every endpoint, with request and response schemas, is the live API documentation:
Build and test against the test environment first. Test and production are separate systems: a test key doesn’t work in production, and the data is different.
#1. Create your API key
Log in to the CUDA web app using the email credentials provided by your CUDA rep, then create your API key there.
- Go to the web app for the environment you want a key for (see the table above) and log in with the email and password your CUDA rep gave you.
- Open your user record and find the API Keys section.
- Click + Generate New API Key.
- Copy the key from the Your New API Key window and store it somewhere safe, such as a secrets manager.
The key is shown once. CUDA stores only a hash of it and can’t show it to you again. If you lose it, generate a new one and revoke the old one from the same API Keys section.
If you don’t see an API Keys section, ask your CUDA rep to enable API access for your login.
Your key sees the same organizations and forwarders as your login. A forwarder login sees only that forwarder’s shipments, and its webhooks fire only for those shipments.
#2. Make your first call
Send the key in the X-API-KEY header on every request. Production keys start with cdp_ and test keys with cdd_; send the whole value, prefix included.
BASE_URL=https://public-test.cudacartagetms.com
API_KEY=cdd_your-key
# Organizations and forwarders your key can use
curl -s "$BASE_URL/shipment/organizations" -H "X-API-KEY: $API_KEY"
curl -s "$BASE_URL/shipment/forwarders" -H "X-API-KEY: $API_KEY"
# Your most recent shipments
curl -s "$BASE_URL/shipment?limit=10" -H "X-API-KEY: $API_KEY"A missing or unknown key returns 401. A shipment outside your key’s scope returns 404, the same as a shipment that doesn’t exist.
#3. Create shipments
POST /shipment creates a shipment. It returns 201 with the shipment’s id (UUID) and cudaId (CUDA’s shipment number); keep the id for later calls.
organizationIdandforwarderIdmust be ones your key can use (step 2).- Each of
shipperandconsigneeneeds either a name and address, or the id of an existing contact (shipperContactId/consigneeContactId). - Before creating, you can check for a duplicate with
GET /shipment/search?q=<your reference>. An emptyresultsarray means no match. - To correct a shipment after creating it, use
PATCH /shipment/{id}with only the fields that changed. See the API docs for which fields are allowed and when.
The API docs have a complete example body for POST /shipment.
#4. Follow shipment status
You can poll, receive webhooks, or both.
| Endpoint | Returns |
|---|---|
GET /shipment/status | The list of CUDA status codes (code, name, id) |
GET /shipment/status/{id} | A shipment’s current status. {id} can be the UUID, the cudaId or your reference number. |
GET /shipment/status/{id}/history | Every status change for that shipment, oldest first |
#Webhooks
Register an HTTPS endpoint, and CUDA will POST to it when your shipments change:
curl -s -X POST "$BASE_URL/webhook" -H "X-API-KEY: $API_KEY" -H 'Content-Type: application/json' -d '{
"uri": "https://your-server.example.com/cuda-webhook",
"events": ["SHIPMENT_ALERT", "SHIPMENT_MILESTONE"],
"config": { "auth": [ { "Authorization": "Bearer <a secret your server checks>" } ] }
}'- Events:
SHIPMENT_ALERTfires on every status change, andSHIPMENT_MILESTONEfires on milestones such as POD and delivery.GET /webhook/eventslists them. Don’t subscribe toSHIPMENT_STATUS, which is obsolete. - Headers:
config.auth(optional) adds headers to every delivery, so your endpoint can check that a request came from CUDA. - Payload: each delivery is a JSON body with the shipment’s fields, plus
webhookIdandtimestamp. - Signature: when signing is on, deliveries carry an
X-Webhook-Signatureheader. Get the public key fromGET /webhook/key, or check a delivery withPOST /webhook/verify. - Testing:
GET /webhook/test/{id}sends a test delivery to your endpoint. Add?shipmentId=<uuid>to use a real shipment’s data. - Managing:
GET /webhooklists your webhooks;PUT /webhook/{id}andDELETE /webhook/{id}change or remove one.
Each delivery is sent once and not retried. If your endpoint is down or returns an error, that event is lost. Reconcile with GET /shipment/status/{id}/history, or poll GET /shipment for recent changes.
#5. Send your own statuses (optional)
If you move freight and want to report status back to CUDA:
- Map your status names to CUDA status ids with
PUT /partner/status-mappings, using the ids fromGET /shipment/status. Each PUT replaces your whole mapping. - Post each update to
POST /shipment/{id}/statuswithexternalEventId,status(your status name) andoccurredAt(ISO 8601).
A status that matches neither your mappings nor a CUDA status code or name is rejected with 422. The response names the status, so you can add a mapping.
#6. Documents
Attach files such as PODs with POST /shipment/attachments/{id}/upload (by shipment UUID) or POST /shipment/attachments/upload-by-reference (by reference number or cudaId). Both take multipart/form-data with file and attachmentType. List a shipment’s files with GET /shipment/attachments/{id}.
#Limits and conventions
- Pagination: list endpoints take
limit(default 25, maximum 100) andoffset, and returntotal. Page untiloffset >= total. - Dates: dates and timestamps are ISO 8601.
- Errors: errors return JSON with
statusCodeandmessage. Common statuses:
| Status | Meaning |
|---|---|
400 | Invalid input |
401 | Missing or unknown key |
403 | The key isn’t allowed to do this |
404 | Not found, or outside your scope |
409 | Conflict: the shipment changed since you read it, or it’s already invoiced |
422 | The request is valid but can’t be applied |
- Polling: poll gently and use webhooks where you can. A tight loop over every shipment slows the API for everyone.
#Getting help
Contact your CUDA rep for:
- access and API keys;
- which organizations and forwarders your key should cover;
- anything the API docs don’t answer.
When reporting a problem, include:
- the environment;
- the endpoint and time (with time zone);
- the shipment
idorcudaId; - the response body.
Never send your API key.
CUDA EXTERNAL API · REFERENCE /docs · THIS GUIDE /onboarding
