Skip to content

Drayage API (1.0.0)

Drayage API documentation

Languages
Servers
Production server
https://api.drayeasy.com/api/v2/

User Profile

Request

Method: GET

Security
bearerAuth
curl -i -X GET \
  https://api.drayeasy.com/api/v2/users/profile \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful response

Bodyapplication/json
namestring

The full name of the user as registered in the system.

Example: "John Doe"
available_balancenumber

The available balance of the user.

Example: 90937.58
rate_search_limitinteger

The maximum number of search queries allowed within a defined time frame.

Example: 100
remaining_rate_search_limitinteger

The number of search queries a user can still perform before hitting the limit.

Example: 100
rate_search_limit_refresh_in_secondsinteger

Time in seconds until the search rate limit is reset to its maximum value.

Example: 100
requested_rate_create_limitinteger

The maximum number of create rate requests a user can make within a set period.

Example: 100
remaining_requested_rate_create_limitinteger

The available quota of create rate requests before reaching the allocated limit.

Example: 100
requested_rate_create_limit_refresh_in_secondsinteger

Time in seconds until the create rate limit is replenished to its full capacity.

Example: 100
Response
application/json
{ "name": "John Doe", "available_balance": 90937.58, "rate_search_limit": 100, "remaining_rate_search_limit": 100, "rate_search_limit_refresh_in_seconds": 100, "requested_rate_create_limit": 100, "remaining_requested_rate_create_limit": 100, "requested_rate_create_limit_refresh_in_seconds": 100 }

City Search

Request

This API endpoint offers a flexible way to retrieve information about cities by supporting search queries based on city names or UN/LOCODEs. It's designed to help users find detailed city data, including geographic coordinates and zip codes.

Note: Either the 'query' or 'unlocode' parameter must be present. However, 'unlocode' should be the only active option when both 'query' and 'unlocode' parameters are present.

Security
bearerAuth
Query
querystring

Search query for city name. Format: [CityName],[StateCode]

Example: query=Ontario,CA
unlocodestring

UN/LOCODE search parameter. This takes precedence over 'query' when both are present.

Example: unlocode=USONT
curl -i -X GET \
  'https://api.drayeasy.com/api/v2/cities?query=Ontario%2CCA&unlocode=USONT' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Cities found successfully

Bodyapplication/json
dataArray of objects
Response
application/json
{ "data": [ {} ] }

Rate Search

Request

This API endpoint is designed to facilitate detailed searches for freight rates across various intermodal regions. It allows users to specify criteria such as intermodal region ID, destination city ID, container size, cargo types, and whether the area has limited access.

Security
bearerAuth
Query
intermodal_region_idintegerrequired

The id of Intermodal Region

to_city_idintegerrequired

The id of City

cntr_sizeinteger

The container size (20, 40, 45). It is strongly recommended to send request with cntr_size parameter, if not, 40 will be used by default

Default 40
Enum204045
cargo_typesArray of integers

2: HAZMAT, 3: REEFER. For example, [2, 3] refers to the hazmat and reefer container. empty array or null refers to general cargo

Items Enum23
weightnumber(float)

Container weight value

weight_unitstring

Container weight unit, accept lb or kg only

Enum"lb""kg"
cargo_valuenumber(float)

Cargo value, if not provided, premium will be 0, minimum is 0, maximum is 1000000

Example: cargo_value=100000
is_limited_area_accessboolean

Limited area access

curl -i -X GET \
  'https://api.drayeasy.com/api/v2/rates/advanceSearch?intermodal_region_id=0&to_city_id=0&cntr_size=20&cargo_types=2&weight=0.1&weight_unit=lb&cargo_value=100000&is_limited_area_access=true' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful rate search response

Bodyapplication/json
dataobject
Response
application/json
{ "data": { "intermodal_region": {}, "to_city": {}, "currency": "USD", "remaining_limit": 18, "rates": [], "premium": 56, "quote_id": "string" } }

Rate Request

Operations

Intermodal Region

Operations

Order

Operations

Create Order

Request

This endpoint is used to create new orders with detailed information about the shipment, including container details, delivery information, contact emails, and more.

Security
bearerAuth
Bodyapplication/jsonrequired
mbl_numberstringrequired

The MBL#

Example: "MBL123456789"
rate_idstringrequired

The id of Rate

Example: "RATE123"
quote_idstringrequired

The unique identifier for a quote. Retrieve this ID from the rate search API.

Example: "fb8ed1ce-203f-4ffa-b70e-f91662a7eeb9"
destination_typeinteger

The Destination Type. 1: Ocean Port, 2: Ramp Port, Default: 1

Example: 1
live_or_dropinteger

Live or Drop. 0: Unknown, 1: Live, 2: Drop, Default: 0

Example: 0
port_of_discharge_idintegerrequired

Port of Discharge (Intermodal Region)

Example: 123
port_of_discharge_etastring(date)required

POD ETA

Example: "2023-10-01"
final_port_idinteger

Final Port (Intermodal Region), Required if destination_type is ramp port

Example: 456
final_port_etastring(date)

Final Port ETA, Required if destination_type is ramp port

Example: "2023-10-05"
warehouse_idinteger

The ID of Warehouse. Required when delivery_address is null.

Example: 789
delivery_addressstring

Delivery address. Required when warehouse_id is null.

Example: "1234 Main St, Anytown, USA"
pu_number_agent_idinteger

The ID of Pickup Number Agent

Example: 101
customer_reference_numberstringrequired

Customer Reference Number

Example: "CUST12345"
customer_memostring

Customer Memo

Example: "Handle with care"
terminal_firms_codestring

Terminal Firms Code

Example: "TFC123"
urgentboolean

Urgent, Default False

Example: false
contact_emailsArray of strings

Array of Contact Emails

Example: ["contact@example.com"]
containersArray of objectsrequired

Array of Container

containers[].​numberstringrequired

Container Number, Four Letters + Seven Numbers

Example: "ABCD1234567"
containers[].​typestring(ContainerSizeType)required

Container size and type specification.

Available container types:

  • 20GP: 20' x 8'6" - DRY CONTAINER
  • 20RF: 20' x 8'6" - REEFER CONTAINER
  • 20TK: 20' x 8'6" - TANK CONTAINER
  • 20OT: 20' x 8'6" - OPENTOP CONTAINER
  • 40GP: 40' x 8'6" - DRY CONTAINER
  • 40OT: 40' x 8'6" - OPENTOP CONTAINER
  • 40RF: 40' x 8'6" - REEFER CONTAINER
  • 40TK: 40' x 8'6" - TANK CONTAINER
  • 40HC: 40' x 9'6" - HIGH CUBIC, DRY CONTAINER
  • 40HQ: 40' x 9'6" - HIGH CUBIC, DRY CONTAINER
  • 40HR: 40' x 9'6" - HIGH CUBIC, REEFER CONTAINER
  • 40RH: 40' x 9'6" - HIGH CUBIC, REEFER CONTAINER
  • 45HC: 45' x 9'6" - HIGH CUBIC, DRY CONTAINER
  • 45HQ: 45' x 9'6" - HIGH CUBIC, DRY CONTAINER
  • 45RH: 45' x 9'6" - HIGH CUBIC, REEFER CONTAINER
Enum"20GP""20RF""20TK""20OT""40GP""40OT""40RF""40TK""40HC""40HQ"
Example: "40HC"
containers[].​seal_numberstring

Seal Number

Example: "SEAL123"
containers[].​packagestringrequired

Package: 20 Cartons, 100 Boxes...

Example: "20 Cartons"
containers[].​weightnumberrequired

Weight KG

Example: 1000
containers[].​delivery_referencestring

Delivery Reference

Example: "DELREF123"
containers[].​urgentboolean

Urgent, Default False

Example: false
containers[].​is_dgboolean

Danger Goods, Default False

Example: false
containers[].​is_socboolean

SOC Container, Default False

Example: false
containers[].​is_overweightboolean

Overweight Container, Default False

Example: false
containers[].​is_reeferboolean

Reefer Container, Default False

Example: false
containers[].​commodityArray of strings

Array of commodity

containers[].​loading_typeinteger(ContainerLoadingType)

Available types:

  • 0: TBD
  • 1: Pallet Load
  • 2: Floor Load
  • 3: Other
Example: 1
containers[].​cargo_valuenumber

Cargo Value, if not provided, premium will be 0, minimum is 0, maximum is 1000000

Example: 100000
file_listArray of objects

Array of upload files list

curl -i -X POST \
  https://api.drayeasy.com/api/v2/createOrder \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "mbl_number": "MBL123456789",
    "rate_id": "RATE123",
    "quote_id": "fb8ed1ce-203f-4ffa-b70e-f91662a7eeb9",
    "destination_type": 1,
    "live_or_drop": 0,
    "port_of_discharge_id": 123,
    "port_of_discharge_eta": "2023-10-01",
    "final_port_id": 456,
    "final_port_eta": "2023-10-05",
    "warehouse_id": 789,
    "delivery_address": "1234 Main St, Anytown, USA",
    "pu_number_agent_id": 101,
    "customer_reference_number": "CUST12345",
    "customer_memo": "Handle with care",
    "terminal_firms_code": "TFC123",
    "urgent": false,
    "contact_emails": [
      "contact@example.com"
    ],
    "containers": [
      {
        "number": "ABCD1234567",
        "type": "40HC",
        "seal_number": "SEAL123",
        "package": "20 Cartons",
        "weight": 1000,
        "delivery_reference": "DELREF123",
        "urgent": false,
        "is_dg": false,
        "is_soc": false,
        "is_overweight": false,
        "is_reefer": false,
        "commodity": [
          "string"
        ],
        "loading_type": 1,
        "cargo_value": 100000
      }
    ],
    "file_list": [
      {
        "file": "string",
        "type": "DO"
      }
    ]
  }'

Responses

created successfully

Bodyapplication/json
dataobject(Order)
Response
application/json
{ "data": { "id": 9079, "mbl_number": "MEDU12341232131", "status": "open", "urgent": false, "delivery_address": "delivery_address", "customer_reference_number": "customer_reference_number", "customer_memo": "TEST", "released_status": "Not Released", "destination_type": 2, "destination_type_name": "Ramp Port", "port_of_discharge_eta": "2023-09-13", "port_of_discharge": {}, "final_port_eta": "2023-10-06", "final_port": {}, "commodity": "commodity", "contact_emails": [], "terminal_firms_code": "S478", "amount_total": "606.00", "live_or_drop": 1, "created_at": "2023-09-19", "user": {}, "containers": [], "pickup_number_agent": {}, "warehouse": {}, "rate_id": "S200942", "rate": {}, "scenarios": [], "possible_charges": [] } }

Get Orders

Request

Method: GET URI: /orders

Security
bearerAuth
Query
idinteger

The id of the Order

mbl_numberstring

The MBL#

container_numberstring

The Container Number

customer_reference_numberstring

The Customer Reference Number

pageinteger

Current page of the list, default: 1

Default 1
per_pageinteger

Current per page of the list, default: 20

Default 20
curl -i -X GET \
  'https://api.drayeasy.com/api/v2/orders?id=0&mbl_number=string&container_number=string&customer_reference_number=string&page=1&per_page=20' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Get successfully

Bodyapplication/json
dataArray of objects(Order)
linksobject
metaobject
Response
application/json
{ "data": [ {} ], "links": { "first": "https://api.drayeasy.com/api/v2/orders?page=1", "last": "https://api.drayeasy.com/api/v2/orders?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "https://api.drayeasy.com/api/v2/orders", "per_page": 20, "to": 1, "total": 1 } }

Upload Files to Order

Request

This endpoint allows you to upload files or provide URLs associated with a specific order. The request should include either an array of files (file_list) or an array of URLs (urls).

Security
bearerAuth
Path
orderIdintegerrequired

ID of the order to upload files to

Bodyrequired
file_listArray of objects

File list is a two-dimensional array, each element contains file and type

urlsArray of objects

Urls is a two-dimensional array, each element contains url and type

curl -i -X POST \
  'https://api.drayeasy.com/api/v2/orders/{orderId}/files' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: multipart/form-data' \
  -F 'file_list[0][file]=string' \
  -F 'file_list[0][type]=DO' \
  -F 'urls[0][url]=http://example.com' \
  -F 'urls[0][type]=DO'

Responses

Files uploaded successfully

Bodyapplication/json
dataArray of objects(Document)
Response
application/json
{ "data": [ {} ] }

Get Order Files

Request

This endpoint allows you to retrieve files that are associated with a particular order identified by orderId. It's useful for fetching documents, images, or any other files related to the order for viewing or downloading purposes.

Security
bearerAuth
Path
orderIdintegerrequired

ID of the order to get files from

curl -i -X GET \
  'https://api.drayeasy.com/api/v2/orders/{orderId}/files' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

List of files associated with the order

Bodyapplication/json
dataArray of objects(Document)

Array of uploaded file information

Response
application/json
{ "data": [ {} ] }

Download Order File

Request

This endpoint is used to download a specific file associated with an order. By providing the orderId and fileId, you can retrieve and download the file. This functionality is useful for accessing documents, images, or any other files related to a particular order.

Security
bearerAuth
Path
orderIdintegerrequired

The ID of the order containing the file

fileIdintegerrequired

The ID of the file to download

curl -i -X GET \
  'https://api.drayeasy.com/api/v2/orders/{orderId}/files/{fileId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

File downloaded successfully

Body
string(binary)
Response
No content

Delete Order File

Request

This endpoint allows you to delete a specific file associated with an order. By providing the orderId and fileId, you can remove the file from the order's files collection. This action is irreversible, so use it with caution as it permanently deletes the specified file.

Security
bearerAuth
Path
orderIdintegerrequired

The ID of the order containing the file

fileIdintegerrequired

The ID of the file to delete

curl -i -X DELETE \
  'https://api.drayeasy.com/api/v2/orders/{orderId}/files/{fileId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

File deleted successfully

Response
No content

Warehouse

Operations

Pickup Number Agent

Operations