Freight API / API v2 reference
ExFreight API v2 Reference
The ExFreight API v2 is an HTTP and JSON interface that lets a TMS, ERP or order system rate, book, track and retrieve documents for air, ocean and trucking shipments through ExFreight.
This page is the public reference for every endpoint, header, enum and error format. For what the API does and how access works, start at the ExFreight freight API page; for project planning, use the freight API integration checklist.
Authentication and environments
Every call sends two headers. Authorization: token YOUR_API_TOKEN identifies the customer account or location; the token is retrieved in the ExFreight portal settings and applies that account’s pricing. Exfresso-Partner-Id identifies your integration and is issued by email, with one value for the test environment and another for production. Requests and responses are JSON over HTTPS, except document and city downloads.
GET /api/v2/ping
Authorization: token YOUR_API_TOKEN
Exfresso-Partner-Id: YOUR_PARTNER_ID Endpoints
GET /api/v2/pingCheck connectivity and authenticationPOST /api/v2/ratingGet shipment rate quotesPOST /api/v2/bookingBook a shipmentPOST /api/v2/manual_bookingBook a shipment manuallyGET /api/v2/documents/[billing-code]/[document-type].pdfFetch a shipment document PDFGET /api/v2/tracking/[billing-code]Track a shipmentGET /api/v2/shipmentsList shipmentsGET /api/v2/cities.csv.gzList UN/LOCODE locodes
Check connectivity and authentication: GET /api/v2/ping
Confirms that the API token and Partner Id are valid. Call it first in the test environment.
Request
GET /api/v2/ping
Authorization: token YOUR_API_TOKEN
Exfresso-Partner-Id: YOUR_PARTNER_ID Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"pong": 42
} Get shipment rate quotes: POST /api/v2/rating
Returns priced routes for truck LTL, air, ocean LCL, FCL and European LTL in one call, with customer-specific pricing applied through the token. Locations are postal codes in North America, postal codes or geocoordinates in Europe and UN/LOCODE elsewhere; freight_class is required only within North America. Field-by-field context is in the freight quote API guide.
Request
POST /api/v2/rating
Authorization: token YOUR_API_TOKEN
Exfresso-Partner-Id: YOUR_PARTNER_ID
Content-Type: application/json
{
"pickup": {
"country": "US",
"postal": "90210"
},
"delivery": {
"country": "US",
"postal": "10023"
},
"ship_day": "2016-01-15",
"ltl": {
"accessorials": [
{
"category": "airline_delivery",
"scope": "general_service"
},
{
"category": "lift_gate",
"scope": "at_delivery"
},
{
"category": "school",
"scope": "at_pickup"
}
],
"freight_class": "300",
"items": [
{
"description": "Anvils",
"dimensioned_pieces": {
"height": {
"unit": "inch",
"value": 24
},
"length": {
"unit": "inch",
"value": 24
},
"quantity": 10,
"width": {
"unit": "inch",
"value": 24
}
},
"is_hazardous": true,
"total_weight": {
"unit": "pound",
"value": 2000
}
}
]
},
"product": "all",
"result_filtering": null
} Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"type": "ltl",
"pickup": {
"city_name": "Los Angeles",
"country": "US"
},
"delivery": {
"city_name": "New York",
"country": "US"
},
"reference_key": "0123456789abcdef",
"rated_items": [
{
"description": "Anvils",
"reference_key": "ab71f9c721e",
"dimensioned_pieces": {
"height": {
"unit": "inch",
"value": 24
},
"length": {
"unit": "inch",
"value": 24
},
"quantity": 10,
"width": {
"unit": "inch",
"value": 24
}
},
"nmfc_code": null,
"total_weight": {
"unit": "pound",
"value": 2000
}
},
{
"description": "Hammers",
"reference_key": "ff183aa03862",
"dimensioned_pieces": {
"height": {
"unit": "inch",
"value": 6
},
"length": {
"unit": "inch",
"value": 6
},
"quantity": 3,
"width": {
"unit": "inch",
"value": 6
}
},
"nmfc_code": null,
"total_weight": {
"unit": "pound",
... Book a shipment: POST /api/v2/booking
Books a route_number returned by the rating call. Ship day, freight item descriptions and container commodities can be changed at booking; commodities feed the customs paperwork. Field-by-field context is in the freight booking API guide.
Request
POST /api/v2/booking
Authorization: token YOUR_API_TOKEN
Exfresso-Partner-Id: YOUR_PARTNER_ID
Content-Type: application/json
{
"reference_key": "0123456789abcdef",
"route_number": "ku5kPa74EO0qp2PcGp8ZfzeCKReB/AJioI8HMWCXcjM+pDMx",
"billing_reference_number": "An optional reference number for your records",
"commodities": [
{
"description": "Anvils",
"country_of_origin": null,
"eccn": "",
"license_type": "",
"quantity": 3,
"schedule_b": "8205.90.1000",
"value": {
"unit": "US_cent",
"value": 120000
},
"weight": {
"unit": "pound",
"value": 2000
}
}
],
"consignee": {
"address": {
"city": "Tokyo",
"country": "JP",
"line_1": "4 Chome-2-8 Shibakoen",
"line_2": "Minato",
"name": "Tanaka LLC",
"postal": "105-0011",
"state": ""
},
"contact": {
"email": "takana-llc@example.com",
"fax": null,
"name": "Tanaka Keiko",
"phone": "+81 3-3433-5111"
},
"hours": {
"close_time": "19:00",
"open_time": "07:00"
}
},
"destination_agent": null,
"exporter_of_record": null,
"importer_of_record": null,
"pickup_confirmation_email": null,
"shipper": {
"address": {
"city": "Los Angeles",
"country": "US",
"line_1": "121 Greenwood Blvd",
"line_2": "Suite 42",
"name": "Acme Supplies",
"postal": "90201",
"state": "CA"
},
"contact": {
"email": "aaron.acme@example.com",
"fax": "555-999-9999",
"name": "Aaron Acme",
"phone": "555-111-1111"
},
"ein": "111222444",
"hours": {
"close_time": "17:00",
"open_time": "09:00"
},
"po_number": "acme_po_4242"
},
"special_instructions": "Please do not shake"
} Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"billing_code": "AAACME-1234567890",
"documents": [
"/api/v2/documents/AAACME-1234567890/ltl_bol.pdf",
"/api/v2/documents/AAACME-1234567890/ocean_bol.pdf",
"/api/v2/documents/AAACME-1234567890/air_waybill.pdf"
]
} Book a shipment manually: POST /api/v2/manual_booking
Creates a booked shipment outside the normal flow. It must be enabled on the account and is used only under a specific agreement with ExFreight.
Request
POST /api/v2/manual_booking
Authorization: token YOUR_API_TOKEN
Exfresso-Partner-Id: YOUR_PARTNER_ID
Content-Type: application/json
{
"username": "username",
"billing_reference_number": "REF123",
"consignee": {
"address": {
"city": "Othertown",
"country": "US",
"line_1": "456 Second St",
"line_2": "",
"name": "Consignee Address Name",
"postal": "67890",
"state": "CA"
},
"contact": {
"email": "example@example.com",
"fax": "+1-555-123-4568",
"name": "Jane Doe",
"phone": "+1-555-123-4568"
},
"hours": {
"close_time": "17:00",
"open_time": "08:00"
}
},
"door_service": "door_to_door",
"legs": [
{
"type": "truck",
"carrier_xcac": "X1234",
"destination": {
"city": "Gulfport",
"country": "US",
"line_1": "811 Winston St",
"line_2": "",
"name": "Jinky Jinks",
"postal": "39503",
"province": "MS"
},
"load_transfers": [
{
"description": "Load transfer description",
"action": "pickup",
"handling_units": 2,
"piece_count": 1,
"total_weight": {
"unit": "kilogram",
"value": 800
}
}
],
"origin": {
"city": "Atlanta",
"country": "US",
"line_1": "712 Jones Ave",
"line_2": "",
"name": "Tenacious Tents",
"postal": "30316",
"province": "GA"
},
"scheduled_delivery_date": "2024-12-17",
"scheduled_pickup_date": "2025-12-14"
}
],
"shipment_details": {
"type": "ftl",
"items": [
{
"description": "Widgets",
"handling_units": 1,
"piece_count": 10,
"total_weight": {
"unit": "kilogram",
"value": 0
}
}
]
},
"shipper": {
"address": {
"city": "Anytown",
"country": "US",
"line_1": "123 Main St",
"line_2": "",
"name": "Shipper Address Name",
"postal": "12345",
"state": "CA"
},
"contact": {
"email": "example@example.com",
"fax": "+1-555-123-4567",
"name": "John Doe",
"phone": "+1-555-123-4567"
},
"hours": {
"close_time": "17:00",
"open_time": "08:00"
}
},
"shipper_po_number": "LD-20260067"
} Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"billing_code": "AAACME-1234567890"
} Fetch a shipment document PDF: GET /api/v2/documents/[billing-code]/[document-type].pdf
Returns a shipment document as a PDF: ltl_bol, euro_truck_bol, ocean_bol, air_waybill, air_master_waybill, shipping_label, pod, ups_label or parcel_label. Field-by-field context is in the bill of lading API guide.
| Parameter | Example | Meaning |
|---|---|---|
billing-code | FLPSTN-1234567890 | The full billing code of the shipment (accounting code + bol number). |
document-type | ltl_bol | The type of document requested. One of air_master_waybill, air_waybill, euro_truck_bol, ltl_bol, ocean_bol, parcel_label, pod, shipping_label, ups_label. |
Request
GET /api/v2/documents/FLPSTN-1234567890/ltl_bol.pdf
Authorization: token YOUR_API_TOKEN
Exfresso-Partner-Id: YOUR_PARTNER_ID Response
HTTP/1.1 200 OK
Content-Type: application/pdf
%PDF.... Track a shipment: GET /api/v2/tracking/[billing-code]
Returns status per leg, actual pickup and delivery times, signed_by, original and current ETA and dated notes. Tracking is polled; there are no webhooks. Field-by-field context is in the freight tracking API guide.
| Parameter | Example | Meaning |
|---|---|---|
billing-code | FLPSTN-1234567890 | The full billing code of the shipment (accounting code + bol number). |
Request
GET /api/v2/tracking/FLPSTN-1234567890
Authorization: token YOUR_API_TOKEN
Exfresso-Partner-Id: YOUR_PARTNER_ID Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"billing_code": "AAACME-1234567890",
"documents": [
"/api/v2/documents/AAACME-1234567890/ltl_bol.pdf",
"/api/v2/documents/AAACME-1234567890/euro_truck_bol.pdf",
"/api/v2/documents/AAACME-1234567890/ocean_bol.pdf",
"/api/v2/documents/AAACME-1234567890/air_waybill.pdf",
"/api/v2/documents/AAACME-1234567890/shipping_label.pdf",
"/api/v2/documents/AAACME-1234567890/pod.pdf",
"/api/v2/documents/AAACME-1234567890/air_master_waybill.pdf",
"/api/v2/documents/AAACME-1234567890/ups_label.pdf",
"/api/v2/documents/AAACME-1234567890/parcel_label.pdf"
],
"legs": [
{
"pickup": "Eldorado",
"delivery": "La La Land",
"actual_delivery_datetime": null,
"actual_pickup_datetime": null,
"carrier": {
"name": "Carrier Name",
"scac": "SSSS",
"xcac": "XXXXX"
},
"delivery_location": null,
"pickup_location": null,
"signed_by": "Signed By: Libraham Aiken",
"status": "Enroute"
}
],
"notes": [
{
"created_at": "2016-01-15T00:20:34.000Z",
"note": "when in the course of human events"
},
{
"created_at": "2016-01-15T01:16:07.000Z",
"note": "it was the best of times"
}
],
"status": "open",
"timeline": {
"delivery": {
"notified_at": "2016-01-15T00:20:34.000Z",
"occurred_at": {
"date": "2016-01-15",
"time": "01:02:03"
}
},
"actual_pickup": "2016-01-15",
"current_eta": "2016-01-15",
"original_eta": "2016-01-15",
"scheduled_pickup": "2016-01-15"
}
} List shipments: GET /api/v2/shipments
Lists open and archived shipments for the location tied to the token, 100 per page, oldest first. Optional created_since filters by creation date.
Request
GET /api/v2/shipments
Authorization: token YOUR_API_TOKEN
Exfresso-Partner-Id: YOUR_PARTNER_ID Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"current_page": 1,
"current_results": 2,
"results": [
"AAACME-1234567890",
"AAACME-1234567811"
],
"total_pages": 1,
"total_results": 2
} List UN/LOCODE locodes: GET /api/v2/cities.csv.gz
Downloads the UN/LOCODE city list ExFreight recognizes, gzipped CSV. Only the Partner Id header is needed.
Request
GET /api/v2/cities.csv.gz
Exfresso-Partner-Id: YOUR_PARTNER_ID Response
HTTP/1.1 200 OK
Content-Type: application/x-gzip
<gzipped csv content> Enums
Values the API accepts and returns. Clients should tolerate new values being added.
| Enum | Values |
|---|---|
| Accessorial Category | airline_delivery, airline_pickup, alcohol_license_fee, amazon_fba_delivery, appointment, canadian_border_fee, construction_site, delivery_notification, dry_run, flatbed_tarps, fragile, hazardous_materials, hotel, in_bond_transport, inside, lift_gate, limited_access, military_base, ocean_cfs_delivery, ocean_cfs_pickup, protect_from_freeze, redelivery, residential, school, shipment_overlengthOver_28, shipment_overlength_12_20, shipment_overlength_20_28, shipment_overlength_7_8, shipment_overlength_8_12, sort_and_segment, trade_show, tsa_program_carrier, unpalletized_loose_boxes |
| Accessorial Scope | at_pickup, at_delivery, general_service |
| Container Size | 20'DV, 40'DV, 40'HC |
| Weight Unit | pound, kilogram, gram |
| Length Unit | inch, foot, mile, cm, e4m, m, km |
| Volume Unit | cubic_e4m, cubic_cm, cubic_m, cubic_inch, cubic_ft |
| Route Type | air_standard, air_express, air_express_direct, air_deferred, ocean_standard, fcl, truck, ftl, parcel_standard, parcel_express |
| Leg Type | air, air_parcel, transfer, ocean, parcel, port, truck |
| Leg Status | Booked, Scheduling, Scheduled, Enroute, Delivered, Exception (Customs), Exception (Incorrect Bill of Lading), Exception (Misrouted), Exception (Reconsignment), Exception (Refused), Exception (Weight & Inspection), Exception (Other), Terminated |
| Load Transfer Action | pickup, dropoff |
| Shipment Status | open, archived, cancelled |
| Door Service | door_to_door, port_to_door, door_to_port, port_to_port |
| Rating Type | ltl, ltl_nmfc, fcl |
| Freight Class | 50, 55, 60, 65, 70, 77.5, 85, 92.5, 100, 110, 125, 150, 175, 200, 250, 300, 400, 500 |
| Fee Type | freight, fuel, screening, security, transfer, generic, handling, terminal, customs, destination, warehouse, chassis, space_premium, insurance, verified_gross_mass |
| Currency Unit | Minor units per currency, for example US_cent, EU_cent, GB_pence, CA_cent, MX_cent, CN_fen, JP_yen (80+ currencies) |
Errors
Errors return an error object with a code and a readable message; validation errors add validation_errors that mirror the request structure field by field. Codes: access_grant_error, booking_error, quote_expired_error, database_error, duplicate_entry_error, email_too_large, invalid_state_error, invalid_authentication_strategy_error, leg_rule_error, log_read_error, no_such_document, payment_error, record_not_found, redis_read_error, restricted_operation, signable_document_error, stu_save_error, unauthorized_access, undeletable_entity, validation_error, customs_entry_polling_error, sso_saml_error, missing_required_header_error, user_agreement_acceptance_required, generic_error, unknown_error, location_group_error.
{
"error": {
"code": "unknown_error",
"message": "Something unexpected happened"
}
} What the API does not cover
Duties, taxes, customs bonds, MPF and HMF are not part of the rating response; the duty and tax calculator and carbon emission estimates run on the ExFreight platform, as the landed cost estimate guide explains. Status is polled rather than pushed by webhook, and EDI is not offered through the API (see API vs EDI in freight). To request a Partner Id, write to salesbox@exfreight.com with your company, systems and the modes you ship.