Getting Started Tutorial for Developers
If you are a developer who is new to integration with Freight Tiger, we recommend that you should go thru this small tutorial which will help you get started.
Getting Started Tutorial: Intro to Freight Tiger Integrations
This is a short tutorial written to help developers who are new to Freight Tiger Platform and are trying to integrate their applications with Fright Tiger Platform for the first time.
This tutorial doesn’t assume any existing Freight Tiger knowledge.
This tutorial is designed for people who prefer to LEARN BY DOING.
If you prefer learning concepts from the ground up, check out other pages in this documentation. You might find this tutorial and the rest of the documentation complementary to each other.
Tip
This is Demo Script for Trip Integration that shows what data can be passed and how. We are giving some example payloads but developers are encouraged to modify this in any way they want.
Kindly note that this does not consist of ALL the APIs. Please refer here for complete API & Webhooks document.
Before We Start the Tutorial
We will build a small integration to FT Trips during this tutorial. You might be tempted to skip it because you’re not integrating trips — but give it a chance. The techniques you’ll learn in the tutorial are fundamental to building any Freight Tiger Integration, and mastering it will give you a deep understanding of Freight Tiger.
This is a demo script to demonstrate how the any external application can automate the process of trip maintenance using Freight Tiger Trip APIs.
Overview
Following are the steps to demonstrate the calls that are made for an end to end trip integration:
Create a new trip
Update the same trip with reference of Trip - lrid (FT Trip ID which was returned in Add Trip API response or feedUniqueId which is a unique identifier added in Add Trip API payload)
Push User-defined Trip Milestone Events into the trip.
Validate the data created in above steps on FT screens.
Validate the data created in above steps on Analytics dashboards.
Prerequisites
To execute this script, you need following:
JSON Web Token: read more. If you don't have it already, kindly raise a ticket here.
Username & Password Credentials to your account on <URL> for checking the data on FT UI.
Ensure our IPs are whitelisted for both environments:
Sandbox - 13.126.98.143
Production - 13.234.139.9
Two-Tier Environments
Integration/Sandbox Environment (IP: 13.126.98.143)
URL: https://integration.freighttiger.com
Production Environment (IP: 13.234.139.9)
URL: https://www.freighttiger.com
Code for Integration Steps
Postman Collection
Add Trip
<URL>/saas/trip/add?token=
Payload body (JSON
{
"lrnumber": "LR123",
"loading": {
"uniqueId": "CA123",
"lat": 19.0759837,
"lng": 72.87765590000004,
"address": "Mumbai, Maharashtra, India",
"area": "Mumbai, Maharashtra, India"
},
"unloading": {
"uniqueId": "AB123",
"lat": 17.9307285,
"lng": 73.64773420000006,
"address": "Mahabaleshwar, Maharashtra 412806, India",
"area": "Mahabaleshwar, Maharashtra, India"
},
"waypoints": [
{
"uniqueId": "123456",
"address": "Pune Maharashtra",
"number": "AP071H07",
"area": "500001",
"lat": 18.5204,
"lng": 73.8567
}
],
"vehicleNumber": "MH05AS1212",
"feedUniqueId": "F1212121-dd-24244",
"plantCode": "ABC123",
"locationSource": "sim",
"driverName": "Raju",
"driverNumbers": [
"1234567890"
],
"transporter":{
"uniqueId":"0001004407-I1O1",
"name":"SOUTHERN CARGO CARRIERS (INDIA) "
},
"consignee": {
"uniqueId": "CODE1",
"name": "Consignee 1",
"number": [
"1111111111",
"1111111111"
]
},
"share_trip": 1,
"customValues": {
"ewayBillNo": "EWB1234",
"invoiceNumber": "INV123"
},
"vehicle_details": {
"tare_weight": 100,
"net_weight": 100,
"gross_weight": 100,
"type": "8 wheels"
},
"shipment_number": "1234",
"lr_reference_number": "INV-4453",
"primary_attributes": {
"gate_in": "2021-02-02 12:34",
"gate_out": "2021-02-02 12:34",
"feed_unique_id": "F1212121-dd-24244",
"shipment_numbers": [
"SHP1",
"SHP2"
],
"container_number": "CN1",
"tare_weight": 100,
"net_weight": 100,
"gross_weight": 100,
"movement_subtype": "M",
"movement_channel": "In",
"billing_type": "To Pay",
"yard_entry_number": "Y12",
"expected_transit_time": 200,
"erp_transit_distance": 80,
"vehicle_type_ref_code": "4Wheeler"
},
"invoice": {
"total_invoice_value": 1000000,
"currency": "INR",
"invoice_details": [
{
"from": {
"name": "XYX Pvt Ltd",
"gstin": "SADSDFG132435DV",
"shipping_address": "HSR",
"billing_address": "HSR",
"contact_phone": [
"9123404017",
"98121231234"
],
"contact_email": [
"abc@gmail.com"
]
},
"to": {
"name": "ABC Pvt Ltd",
"gstin": "ASDSFD1234FDS",
"shipping_address": "Agra",
"billing_address": "Agra",
"contact_phone": [
"9123404017",
"98121231234"
],
"contact_email": [
"def@gmail.com"
]
},
"so_number": "343424",
"so_quantity": 12,
"so_date": "2020-01-01 13:40:00",
"so_release_date": "2020-01-01 13:40:00",
"po_number": "45642",
"do_number": "9675752",
"do_quantity": 12,
"do_date": "2020-01-01 13:40:00",
"do_publish_date": "2020-01-01 13:40:00",
"invoice_number": "INV2345",
"invoice_date": "2020-01-01 13:40:00",
"eway_bill_no": "1516859638",
"eway_bill_expiry_date": "2020-12-11 12:00:00",
"description": "Invoice For Cement Bags",
"total_invoice_value": 2222,
"price": {
"net_price": 10000,
"total_price": 12000,
"total_tax": 2000
},
"tax": {
"cgst_rate": 10,
"cgst": 1000,
"sgst": 10,
"sgst_rate": 100,
"igst": 10,
"igst_rate": 100,
"other_tax": 0,
"other_tax_rate": 0
},
"custom_fields": {
"doStoNo": "DO-232",
"gstvalue": "477531.32"
},
"item_details": [
{
"sku_code": "DA-123",
"material_code": "21324",
"hsn_code": "8803",
"quantity": 11,
"quantity_unit": "BAG",
"gross_weight": 22.34,
"net_weight": 21.34,
"weight_unit": "TON",
"product_name": "Concrete Cement Bag",
"description": "Concrete Cement Bag",
"custom_fields": {
"cement_type": "Concrete cement",
"cement_grade": "A Grade"
},
"price": {
"net_price": 10000,
"total_price": 12000,
"total_tax": 2000
},
"tax": {
"cgst_rate": 10,
"cgst": 10,
"sgst": 10,
"sgst_rate": 100,
"igst": 10,
"igst_rate": 100,
"other_tax": 0,
"other_tax_rate": 0
}
}
]
}
]
}
}
Add Trip Response:
{
"status": true,
"result": {
"id": 5946173,
"shareUrl": "https://www.freighttiger.com/v5/shareTrip?shareKey=TRP-d8c393f4-ca5c-41db-96fb-38abe933f0cd",
"lr_number": null,
"feed_unique_id": "5946173-1622210187-111162"
},
"message": "Trip Created Successfully"
}
Update Trip
<URL>/saas/trip/update?token=
Payload body (JSON):
m
{
"lrnumber": "LR124",
"driverNumbers": [
"1023456789"
],
"customValues": {
"ewayBillNo": "EWB1234"
},
"lrid": 5946173,
"feedUniqueId": "F1212121-dd-24244",
"consignee": {
"uniqueId": "CODE1",
"name": "Consignee 1",
"number": [
"1111111111",
"1111111111"
]
},
"vehicle_details": {
"tare_weight": 100,
"net_weight": 100,
"gross_weight": 100,
"type": "8 wheels"
},
"shipment_number": "1234",
"primary_attributes": {
"gate_in": "2021-02-02 12:34",
"gate_out": "2021-02-02 12:34",
"feed_unique_id": "F1212121-dd-24244",
"shipment_numbers": [
"SHP1",
"SHP2"
],
"container_number": "CN1",
"tare_weight": 100,
"net_weight": 100,
"gross_weight": 100,
"movement_subtype": "M",
"movement_channel": "In",
"billing_type": "To Pay",
"yard_entry_number": "Y12",
"expected_transit_time": 200,
"erp_transit_distance": 80,
"vehicle_type_ref_code": "4Wheeler"
},
"invoice": {
"total_invoice_value": 1000000,
"currency": "INR",
"invoice_details": [
{
"from": {
"name": "XYX Pvt Ltd",
"gstin": "SADSDFG132435DV",
"shipping_address": "HSR",
"billing_address": "HSR",
"contact_phone": [
"9123404017",
"98121231234"
],
"contact_email": [
"abc@gmail.com"
]
},
"to": {
"name": "ABC Pvt Ltd",
"gstin": "ASDSFD1234FDS",
"shipping_address": "HSR",
"billing_address": "HSR",
"contact_phone": [
"9123404017",
"98121231234"
],
"contact_email": [
"abc@gmail.com"
]
},
"so_number": "1232",
"po_number": "1232",
"do_number": "1232",
"invoice_number": "INV2345",
"invoice_date": "1234565342",
"eway_bill_no": "1516859638",
"eway_bill_expiry_date": "2020-12-11 12:00:00",
"description": "Invoice For Cement Bags",
"price": {
"net_price": 10000,
"total_price": 12000,
"total_tax": 2000
},
"tax": {
"cgst_rate": 10,
"cgst": 1000,
"sgst": 10,
"sgst_rate": 100,
"igst": 10,
"igst_rate": 100,
"other_tax": 0,
"other_tax_rate": 0
},
"custom_fields": {
"doStoNo": "123asz12",
"gstvalue": "477531.32"
},
"item_details": [
{
"sku_code": "xyz123",
"hsn_code": "8803",
"quantity": 11,
"units": "BAG",
"gross_weight": 22.34,
"net_weight": 21.34,
"weight_unit": "TON",
"product_name": "Item description",
"description": "Some description",
"custom_fields": {
"cement_type": "Concrete cement",
"cement_grade": "A Grade"
},
"price": {
"net_price": 10000,
"total_price": 12000,
"total_tax": 2000
},
"tax": {
"cgst_rate": 10,
"cgst": 10,
"sgst": 10,
"sgst_rate": 100,
"igst": 10,
"igst_rate": 100,
"other_tax": 0,
"other_tax_rate": 0
}
}
]
}
]
}
}
Push User-defined Trip Events
<URL>/saas/trip/events/user_defined?token=
Payload body (JSON):
Close Trip
<URL>/saas/trip/close?token=
Payload body (JSON):
Validations
Check trip screens
Check Trip Analytics
Check Data In Trip Analytics Report
Goto https://www.freighttiger.com, login
Go to report → Trip analysis
Select All Trips
Select period which consists of the date of trip that you created in this demo
Select all trips
Enter your mail ID
Click on EMAIL
Check your mail and download the sheet.
All the data you have sent should be in the sheet you received on mail.
Check Data In Trip Analytics Dashboard
Go to https://www.freighttiger.com, login
Go to Dashboards → Trip analytics
Enter a date range that includes the trip created in this demo script
Click on Number of Trips. This will open a pop-up.
Export as Excel or CSV
All the data Analytics data should be in the sheet.
Post your questions in the comment box to get answers from the experts who watch this page.
For engineering support: visit FT Support