Example cURL requests

Replace YOUR_API_KEY with your test or live key.

Parcel customers

Create a parcel customer (address suffix only)

curl -X POST "https://api.trysend.com/v1/parcel-customers" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"parcel_customer": {
"address_suffix": "JUNIGO-001"
}
}'

Create a parcel customer (full details)

curl -X POST "https://api.trysend.com/v1/parcel-customers" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"parcel_customer": {
"address_suffix": "JUNIGO-002",
"first_name": "John",
"last_name": "Doe",
"email": "john@junigo.com",
"mobile": "+2348012345678",
"origin_address": "12 Broad Street",
"origin_city": "Lagos",
"origin_state": "Lagos",
"origin_zip_code": "100001",
"origin_country": "Nigeria"
}
}'

List parcel customers

curl -X GET "https://api.trysend.com/v1/parcel-customers" \
-H "X-Api-Key: YOUR_API_KEY"

Get one parcel customer

curl -X GET "https://api.trysend.com/v1/parcel-customers/pc_abc123def456" \
-H "X-Api-Key: YOUR_API_KEY"

Packages

Retrieve a package

curl -X GET "https://api.trysend.com/v1/packages/ABC123XYZ" \
-H "X-Api-Key: YOUR_API_KEY"

List packages (filter by status)

curl -X GET "https://api.trysend.com/v1/packages?status=warehouse" \
-H "X-Api-Key: YOUR_API_KEY"

Track a package

curl -X GET "https://api.trysend.com/v1/packages/ABC123XYZ/track" \
-H "X-Api-Key: YOUR_API_KEY"

Parcel quotes

Get a lane code from GET /v1/parcel_lanes and a commodity code from GET /v1/parcel_commodities first. One operation prices all modes — no sender/recipient, no package arrays, no dimensions.

Air

curl -X POST "https://api.trysend.com/v1/parcel_quotes" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lane_code": "010",
"transport_mode": "air",
"commodity_code": "010",
"weight": 25
}'

Ocean FCL

container_size is 20ft or 40ft (20'/40' mean the same).

curl -X POST "https://api.trysend.com/v1/parcel_quotes" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lane_code": "010",
"transport_mode": "ocean_fcl",
"commodity_code": "030",
"container_size": "40ft",
"quantity": 2
}'

Ocean LCL

volume is the total CBM.

curl -X POST "https://api.trysend.com/v1/parcel_quotes" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lane_code": "010",
"transport_mode": "ocean_lcl",
"commodity_code": "040",
"volume": 3.5
}'

Response is pending with lane, commodity, rate, charges, and total. Save the quote id and rate.id. Quotes store lane_code and commodity_code; country names and commodity labels are expanded from those codes.

List parcel quotes

curl -X GET "https://api.trysend.com/v1/parcel_quotes?status=pending" \
-H "X-Api-Key: YOUR_API_KEY"

Get one parcel quote

Pending quotes with expired rates are refreshed automatically when retrieved (new rate ID).

curl -X GET "https://api.trysend.com/v1/parcel_quotes/pq_abc123xyz" \
-H "X-Api-Key: YOUR_API_KEY"

Bookings

recipient is required when customer_as_recipient is omitted or false. Set customer_as_recipient: true with sender.customer_id only when that same customer is receiving the shipment. In that case, omit recipient because the backend loads the customer’s saved name, phone, email, and address and stores them in the booking’s recipient snapshot. The response still includes recipient. A complete customer profile in your account and API mode is required; no recipient details are guessed. Do not send non-empty recipient details together with the flag; this returns 422 INVALID_PARTY to avoid conflicting instructions.

Confirm a pending quote. The sender is an existing customer; the recipient reuses the sender or is entered manually. The booking stays a parcel quote (parcel_id: null) — warehouse receipt creates the parcel.

curl -X POST "https://api.trysend.com/v1/parcel_bookings" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"quote_id": "pq_abc123xyz",
"rate_id": "pqrate_abc123",
"sender": { "customer_id": "YSDX-UGTE-1234" },
"recipient": {
"name": "Ada Example",
"phone": "+2348000000000",
"address": {
"street": "10 Example Street",
"city": "Lagos",
"state": "Lagos",
"country": "NG"
}
}
}'