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:

  1. Contact Us: Obtain a Credit Customer Account by reaching out to our support team.
  2. Setup Credentials: Get your login credentials (email and password) from the company.
  3. 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/login

Endpoint (Test): https://api.safeway-xp.com/api/Authentications/login

Request Body

{
  "email": "your_email@example.com",
  "password": "your_password"
}

Response

{
  "token": "your_authentication_token"
}

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

{
  "countryName": "Bahrain",
  "supplierName": "HDL",
  "shipmentDetails": "p",
  "consigneeAddress": { ... },
  "shipperAddress": { ... },
  "cargo": [ { ... } ],
  "shipmentMethod": "Air",
  "descriptionOfGoods": "Books",
  "remark": "Handle with care"
}

Response

{
  "airwayBill": "1234567890",
  "safeAirwaybillNumber": "SA123456",
  "status": "Created"
}

5. Get Job Details and Download Document 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 related to a specific job as a PDF file.

Method: GET

Endpoint (Production):https://flm.safeway-xp.com/api/CustomerJob/:airwayBill/document

Endpoint (Test):https://api.safeway-xp.com/api/CustomerJob/:airwayBill/document

Replace :airwayBill with the specific job’s unique Airway Bill number.

Response

Returns a Blob representing the PDF file of the shipment document.

6. Calculate Price API

You can calculate the expected shipping price before creating a job. Two modes are supported:

Special Customer Calculate Price (Requires Login)

Authenticated users (Credit Customers) can calculate pricing based on their special rates and zones. Requires Bearer token from login.

Method: POST

Endpoint (Production): https://flm.safeway-xp.com/api/CustomerJob/calculateprice

Endpoint (Test): https://api.safeway-xp.com/api/CustomerJob/calculateprice

Request Body Example

{
  "supplierName": "DHL",
  "shipmentMethod": 1,
  "shipmentType": 0,
  "countryName": "SAUDI ARABIA",
  "cityName": "RIYADH",
  "totalKg": 0.8
}

Response Example

{
  "price": 24.000,
  "kg": 1.000,
  "extraChargeApplied": null,
  "extraChargeAmount": 0,
  "netAmount": 24.000
}

Public Calculate Price (Cash Customer)

Unauthenticated users (or website visitors) can use this endpoint to get a general price estimate. Uses the Cash Customer pricing configuration.

Method: POST

Endpoint (Production): https://flm.safeway-xp.com/api/CustomerJob/calculateprice/public

Endpoint (Test): https://api.safeway-xp.com/api/CustomerJob/calculateprice/public

Request Body Example

{
  "supplierName": "ARAMEX",
  "shipmentMethod": 0,
  "shipmentType": 1,
  "countryName": "UAE",
  "cityName": "DUBAI",
  "totalKg": 2.5
}

Response Example

{
  "price": 40.000,
  "kg": 3.000,
  "extraChargeApplied": null,
  "extraChargeAmount": 0,
  "netAmount": 40.000
}

7. Location APIs (Countries, States, Cities)

Use these APIs to fetch country, state, and city names correctly.

Get Countries

/api/express/Countries/pagination?page=1&pageSize=10&searchTerm=bah

Sample Response

{
  "currentPage": 1,
  "pageSize": 10,
  "totalItems": 2,
  "items": [
    {"id": 7, "countryName": "BAHRAIN", "countryCode": "BH", "states": null},
    {"id": 119, "countryName": "BAHAMAS", "countryCode": "BS", "states": null}
  ]
}

Get States by Country

/api/express/States/by-country-name?name=Bahrain&page=1&pageSize=10

Sample Response

{
  "currentPage": 1,
  "pageSize": 10,
  "totalItems": 1,
  "items": [
    {"id": 29, "name": "Bahrain", "countryId": 7, "cities": []}
  ]
}

Get Cities by Country and State

/api/Cities/by-country-name?countryName=Bahrain&stateName=Bahrain&page=1&pageSize=1000

Sample Response

{
  "currentPage": 1,
  "pageSize": 1000,
  "totalItems": 81,
  "items": [
    {"id": 73, "cityName": "Riffa", "stateID": 29, "postalCode": []},
    {"id": 72, "cityName": "Manama", "stateID": 29, "postalCode": []},
    {"id": 785179, "cityName": "ZAYED TOWN", "stateID": 29, "postalCode": []},
    ...
  ]
}