Safe Logistic Customer Job API Documentation
Detailed API documentation for managing shipments. Includes request and response structures for seamless integration.
1. Getting Started
Follow these steps to start using the API:
- Contact Us: Obtain a Credit Customer Account by reaching out to our support team.
- Setup Credentials: Get your login credentials (email and password) from the company.
- Authentication: Use the login API to retrieve a Bearer token for secure access to all endpoints.
2. Environments
Test Environment
- Portal:
https://test.safeway-xp.com/ - API:
https://api.safeway-xp.com/
Production Environment
- Portal:
https://cs.safeway-xp.com/ - API:
https://flm.safeway-xp.com/
3. Authentication and Token Management
Authenticate to access API endpoints. Use the token from the login API as a Bearer token in headers.
Login API
Method: POST
Endpoint (Production): https://flm.safeway-xp.com/api/Authentications/customerLogin
Endpoint (Test): https://api.safeway-xp.com/api/Authentications/customerLogin
Request Body
{
"email": "your_email@example.com",
"password": "your_password"
}Response
{
"token": "your_authentication_token"
}Validate Token
Use this endpoint to verify if your token is still valid.
Method: POST
Endpoint (Production): https://flm.safeway-xp.com/api/Authentications/validate-token
Endpoint (Test): https://api.safeway-xp.com/api/Authentications/validate-token
Headers
Authorization: Bearer your_token_hereResponse Example
{
"valid": true,
"expiresAt": "2025-03-15T14:23:00Z"
}4. Create Job API
Method: POST
Endpoint (Production): https://flm.safeway-xp.com/api/CustomerJob/create
Endpoint (Test): https://api.safeway-xp.com/api/CustomerJob/create
Request Body Example
{
"countryName": "Bahrain",
"supplierName": "DHL",
"shipmentDetails": "Books and electronics",
"shipperAddress": {
"name": "Ali Express",
"countryId": 17,
"cityId": 204,
"addressLine": "Building 55, Road 12, Block 345",
"email": "ali@safeway.com",
"mobile": "+97339001122"
},
"consigneeAddress": {
"name": "Fatima Store",
"countryId": 24,
"cityId": 322,
"addressLine": "Street 7, Dammam",
"email": "store@fatima.com",
"mobile": "+96655005500"
},
"cargo": [
{
"description": "Laptop Boxes",
"quantity": 10,
"unitPrice": 350.000,
"weight": 100.000,
"length": 60,
"width": 50,
"height": 40,
"hsCodeId": 120,
"coo": "CN"
},
{
"description": "Cable Reels",
"quantity": 6,
"unitPrice": 60.000,
"weight": 80.000,
"length": 70,
"width": 40,
"height": 40,
"hsCodeId": 122,
"coo": "CN"
}
],
"paymentMethods": [
{ "method": "Cash", "amount": 150.000 },
{ "method": "Card", "amount": 50.000 }
],
"shipmentMethod": "Air",
"descriptionOfGoods": "Books and electronics",
"remark": "Handle with care"
}Response Example
{
"airwayBill": "1234567890",
"safeAirwaybillNumber": "SA123456",
"status": "Created"
}5.1 Get Job Details API
Method: GET
Endpoint (Production): https://flm.safeway-xp.com/api/CustomerJob/:airwayBill
Endpoint (Test): https://api.safeway-xp.com/api/CustomerJob/:airwayBill
Replace :airwayBill with the job’s unique Airway Bill number.
5.2 Download Job Document API
Download the shipment document as a PDF file.
Method: GET
Endpoint: /api/CustomerJob/:airwayBill/document
5.3 Download Safeway AWB Document API
Download the Safeway-formatted AWB document (SafeAWB).
Method: GET
Endpoint: /api/CustomerJob/:safeAirwayBill/safeway/document
5.4 Track Shipment API
Track shipment progress using Safe Airway Bill.
Method: GET
Endpoint: /api/Jobs/track-shipment?safeAirwaybill=SA123456
Response Example
{
"airwayBill": "SA123456",
"currentStatus": "Delivered",
"routeHistory": [
{ "status": "Picked up", "location": "Manama", "timestamp": "2025-03-12T08:10:00Z" },
{ "status": "In Transit", "location": "Riyadh", "timestamp": "2025-03-13T16:45:00Z" },
{ "status": "Delivered", "location": "Riyadh", "timestamp": "2025-03-14T10:22:00Z" }
]
}6. Calculate Price API
Special Customer Calculate Price
Method: POST
Endpoint: /api/CustomerJob/calculateprice
Public Calculate Price
Method: POST
Endpoint: /api/CustomerJob/calculateprice/public
7. Location APIs (Countries, States, Cities)
Countries
/api/express/Countries/pagination?page=1&pageSize=10&searchTerm=bah
States
/api/express/States/by-country-name?name=Bahrain&page=1&pageSize=10
Cities
/api/Cities/by-country-name?countryName=Bahrain&stateName=Bahrain&page=1&pageSize=1000