Obtain Authentication Token (API Login)
Creating a load (shipment API)
Description of method / shipment
Introduction
The system has a specific web service to automatically generate loads in our system for a specific client, which facilitates integration with other systems and process automation.
The process is divided into two phases:
- Testing in the test environment: The IT team will provide credentials for the test environment.
- Production deployment: Once testing is successfully completed, the final credentials for the production environment will be provided.
Each phase is divided into two steps:
- Obtaining the authentication token (lasts 24 hours).
- Creating the load.
Obtain Authentication Token (API Login)
To interact with the APIs, you must obtain an authentication token through the login API.
Authentication is performed by verifying the email and password, which will be provided by the IT department. Through authentication, the user will receive a token that will be valid for 24 hours. This token must be stored, and a new one must be generated only when a token expired error is returned.
Method description / login
Request
- Request type: POST.
- Parameter content type: application/json.
- Body attributes.
{
"email": "string", //Obligatorio
"force": true, //Obligatorio, valor constante por defecto a true
"password": "string", //Obligatorio
"role": "API_SHIPMENT" //Obligatorio, deberá tomar el valor "API_SHIPMENT"
}Response
{
"expire": 0,
"token": "string",
"user": {
"active": true,
"first_name": "string",
"id": 0,
"image_profile_url": "string",
"last_name": "string",
"mobile_number": "string",
"nick_name": "string",
"player_id": "string",
"roles": [
{
"description": "string",
"name": "string"
}
]
}
}Example
REQUEST
POST: https://qa.fr8.app/v1/login
Body Payload (JSON):
{
"email": "peter@fr8app.com",
"force": true,
"password": " Password789#",
"role": "API_SHIPMENT"
}RESPONSE
{
"exp": 1729727977,
"token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJmcjhodWJfd2ViIiwiZXhwIjoxNzI5NzI3OTc3LCJpYXQiOjE3MTUyMTI3NzcsImlzcyI6ImZyOGh1Yl93ZWIiLCJqdGkiOiI5NzYxZDc3Yy01NGIyLTRiNTUtOTFhNS1iMjlkFGFhY2YwY2QiLCJuYmYiOjE3MTUyMTI3NzYsInN1YiI6IjEwNCIsInR5cCI6ImFjY2VzcyJ9.m73ADrBaxu_b-1GsZLYhbSu_X3p_7ekHMZVarhmTLygVn7yIRsMGUGMQmFFRrq3Z22dZ35kJZ9P5CnFM_xVn0g",
"user": {
"active": true,
"email": "peter@fr8app.com",
"first_name": "peter",
"id": 110,
"image_profile_url": null,
"last_name": "test",
"mobile_number": "5200000000",
"nick_name": null,
"player_id": null,
"roles": [
{
"description": "API shipment role in Fr8hub",
"name": "API_SHIPMENT" } ] }
}
Webservice login QA
- API: https://qa.fr8.app/v1/login
- Credentials: Provided by the IT team.
Webservice login Prod
- API: https://my.fr8.app/v1/login
- Credentials: Will be provided after validation in the test environment.
Creating a load (shipment API)
Preliminary considerations
- To create a shipment in the Fr8App system, you will need to use a Bearer Token previously obtained by the login method and provide all the fields required by the method.
- To complete the information for both the pickup and dropoff addresses (shipment_lane), there are three possible options, which have an order of priority and are mutually exclusive. That is, if the information in the first option is correct, the others will not be taken into account:
- facility id: system facility identifier.
- Longitude and latitude.
- Address, country, city, state (address is optional).
Description of method / shipment
Request
- Request type: POST.
- Authorization type: Bearer Token.
- Parameter content type: application/json.
- Body attributes.
{
"after_hours_follow_up": boolean, //Not required
"bol_number": "string", //Not required
"copies": integer, //Required, default value '1'. Number of loads to create in the system
"currency_code": "string", //Required, default value 'mxn', could take 'usd'
"expected_segments": integer, //Not required
"hot": boolean, //Not required
"invoicing_entity": "string", //Not required, possible values: fr8hub_mex, fr8hub_usa. By default it is taken from the shipper
"invoicing_reference": "string", //Not mandatory
"max_price": numeric, //Not mandatory, by default it takes 0 if it is not filled in the payload
"pickup_number": "string", //Not mandatory
"post_to_marketplace": boolean, //Not mandatory if generated by a customer account (if ("shipment_type": "spot" or "primary") and “max_price” ‘0’, then true, otherwise false)
"purchase_order_number": "string", //Not mandatory
"seal_number": "string", //Not mandatory
"shipment_details": { "additional_equip_dry_van": boolean, //Not mandatory
"additional_equip_flatbed": boolean, //Not mandatory
"additional_equip_reefer": boolean, //Not mandatory
"additional_equip_rabon": boolean, //Not mandatory
"additional_equip_torton": boolean, //Not mandatory
"air_ride": boolean, //Not required
"category": "string", //Required, subcategory based on trailer_type: If trailer_type = dry_van = “ft48” or “ft53” If trailer_type = flatbed = “legal” or “step_deck” or “legal_double” or “lowboy” If trailer_type = reefer = “fresh” or “frozen” or “controlled”
"description": "string", //Not required
"door_type": "string", //Not required
"e_track": boolean, //Not required
"food_grade": boolean, //Not required
"hazmat_class": "string", //Not required
"heated": boolean, //Not required
"height": numeric, //Not required, if empty it will take the default value for the trailer category
"length": numeric, //Not required, if empty it will take the default value for the trailer category
"lift_gates": boolean, //Not required
"load_value": numeric, //Not required
"note": "string", //Not required
"other_requirements": "string", //Not required
"pallets": integer, //Not required
"panels_material": "string", //Not required
"plate_trailer": boolean, //Not required
"roof_type": "string", //Not required
"screw_in_wood_floors": boolean, //Not required
"trailer_type": "string", //Required, possible values are "dry_van", “flatbed” or “refeer”
"tandem": boolean, //Not required
"vented": boolean, //Not required
"weight": numeric, //Not required, if empty it will take the default value for the trailer category
"width": numeric //Not required, if empty it will take the default value for the trailer category
},
"shipment_lane": {
"border_id": integer, //Mandatory if MX-US, US-MX, CA-US or US-CA, as per catalog provided by IT
"border_id_2": integer, //Mandatory if MX-CA or CA-MX, according to the catalog provided by IT
"dropoff_address": "string", //Not mandatory, complete address at the destination
"dropoff_city": "string", //Not mandatory, city at destination
"dropoff_consignee": "string", //Not mandatory, please state at destination
"dropoff_country": "string", //Not required, country of destination, possible values: “MX” or “US” or “CA”
"dropoff_postal_code": "string", //Not required, postal code at destination
"dropoff_state": "string", //Not mandatory, state at destination
"dropoff_instructions": "string", //Not mandatory
"dropoff_lat": numeric, //Not mandatory, latitude at destination
"dropoff_long": numeric, //Not mandatory, longitude at destination
"dropoff_schedule": "string", //Not mandatory
"dropoff_time_from_naive": "string", //Not mandatory, date and time of delivery in destination time zone (appointment start date must be greater than the collection appointment end date)
"dropoff_time_to_naive": "string", //Not mandatory, date and time of delivery in destination time zone (end of appointment, must be greater than or equal to start of appointment)
"dropoff_facility_id": integer, //Not mandatory
"pickup_facility_id": integer, //Not mandatory
"pickup_address": "string", //Not mandatory, complete address at origin
"pickup_city": "string", //Not mandatory, city of origin
"pickup_consignor": "string", //Not mandatory
"pickup_country": "string", //Not mandatory, country of origin, possible values: “MX” or “US” or “CA”
"pickup_postal_code": "string", //Not mandatory, postal code at origin
"pickup_state": "string", //Not mandatory, state of origin
"pickup_instructions": "string", //Not mandatory
"pickup_lat": numeric, //Not mandatory, latitude at origin
"pickup_long": numeric, //Not mandatory, longitude at origin
"pickup_schedule": "string", //Not mandatory
"pickup_time_from_naive": "string", //Mandatory, collection date and time in the origin time zone (appointment start date must be greater than the current process execution date)
"pickup_time_to_naive": "string", //Mandatory, collection date and time in the origin time zone (end of appointment, must be greater than or equal to the start of the appointment)
},
"shipment_type": "string", //Mandatory
"shipper_id": numeric, //Not mandatory if generated by a customer account
"code_xml": "string",//Not mandatory, Amazon customers only. See possible values.
"visible_to_shipper": boolean, //Not required by default true
"marketplace_commission": numeric //Not mandatory, it will take the percentage value
}
- In the case of an Amazon client properly configured in the system, the code_xml parameter is included, which can only take the following values:
OutboundAirShuttle
TransfersEmptyBags
OutboundReturns
TransfersReturns
TransfersMissorts
WELLDEX/NAFN (TransfersReactive)
OutboundAMZLMM
OutboundExternalFulfillment
OutboundVendorFlex
OutboundAMZL
TransfersInventoryCorrection
TransfersReactive
TransfersToteInjection
Inbound/Milkrun/WePay
LTL Vendors
V Returns
Example
REQUEST
Auth: Bearer Token - eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJmcjhodWJfd2ViIiwiZXhwIjoxNzU2NDI0MzM5LCJpYXQiOjE3NDE5MDkxMzksImlzcyI6ImZyOGh1Yl93ZWIiLiOiIxOGRkNzhmNC1mMzY4LTQ3MGQtOWNhMS0xYmYyYmE0MDM0YzUiLCJuYmYiOjE3NDE5MDkxMzgsInN1YiI6IjMzNzIiLCJ0eXAiOiJhY2Nlc3MifQ.1k9IZ5s-T0OCYH2Q974st_3GRA-HlwSiKqoDOPc1-d7qYKzwImp3eTkFLoP18h4gKOV_nHVhxyRy45AHr2DDeg
POST: https://qa.fr8.app/v1/shipment
Payload del Body (JSON)
{
"after_hours_follow_up": true,
"bol_number": "789789",
"copies": 3,
"currency_code": "usd",
"expected_segments": 1,
"hot": true,
"invoicing_entity": "fr8hub_mex",
"invoicing_reference": "789789",
"max_price": 1500,
"pickup_number": "3333",
"post_to_marketplace": true,
"purchase_order_number": "44444",
"seal_number": "5555",
"shipment_details": {
"additional_equip_dry_van": true,
"additional_equip_flatbed": true,
"additional_equip_reefer": true,
"additional_equip_rabon": true,
"additional_equip_torton": true,
"air_ride": true,
"category": "ft48",
"description": "testing",
"door_type": "any",
"e_track": true,
"food_grade": true,
"hazmat_class": "true",
"heated": true,
"height": 12.50,
"length": 47.00,
"lift_gates": true,
"load_value": 100001,
"note": "NA",
"other_requirements": "NA",
"pallets": 15,
"panels_material": "metal",
"plate_trailer": true,
"roof_type": "metal",
"screw_in_wood_floors": true,
"trailer_type": "dry_van",
"tandem": true,
"vented": true,
"weight": 99.00,
"width": 16.80
},
"shipment_lane": {
"dropoff_address": "Emperador 8-4, Villa Satelite, 83200",
"dropoff_city": "hermosillo",
"dropoff_consignee": "Inc",
"dropoff_country": "MX",
"dropoff_postal_code": "",
"dropoff_lat": 29.088072368216896,
"dropoff_long": -110.98103746469556,
"dropoff_state": "sonora",
"dropoff_instructions": "Center AXL",
"dropoff_time_from_naive": "2025-03-28 01:44:00",
"dropoff_time_to_naive": "2025-03-28 01:44:00",
"pickup_facility_id": 1661,
"pickup_consignor": "Tech",
"pickup_instructions": "Distribution",
"pickup_time_from_naive": "2025-03-15 01:44:00",
"pickup_time_to_naive": "2025-03-15 07:44:00"
},
"shipment_type": "spot",
"shipper_id": 234,
"visible_to_shipper": true,
"marketplace_commission": 0
}
RESPONSE
{
"ids": [
58219,
58220,
58221
]
}
Webservice shipment QA
- API: https://qa.fr8.app/v1/shipment
- Token: The token obtained must be included in the login.
Webservice shipment PROD
- API: https://my.fr8.app/v1/shipment
- Token: The token obtained must be included in the login.