Create Waybill

Overview

Service Unique Name CreateWaybill
Request Method POST
Content Type application/x-www-form-urlencoded; charset=utf-8

Description

Create Waybill API is for creating a new waybill record in the LogixERP. The API will be creating a waybill record in the ERP with status as "Data Received". The API return the label print of the Waybill, Package Sticker & a unique tracking URL.

Request Header

AccessKey : logixerp

Request Body

VALID JSON STRING

Example 1

{
"waybillRequestData":
{
"FromOU": "JEDDAH",
"WaybillNumber": "123456",
"DeliveryDate": "02-02-2020",
"CustomerCode": "C0000000",
"ConsigneeCode": "00000",
"ConsigneeAddress": "Showroom bld#2, cargo village",
"ConsigneeCountry": "SA",
"ConsigneeState": "CENTRAL",
"ConsigneeCity": "Riyadh",
"ConsigneePincode": "8523",
"ConsigneeName": "Worldwide Express",
"ConsigneePhone": "9999999999",
"ClientCode": "C100000",
"NumberOfPackages": 3,
"ActualWeight": 0.0,
"ChargedWeight": 112.8,
"CargoValue": 68.537,
"ReferenceNumber": "123456789",
"InvoiceNumber": "987654321",
"PaymentMode": "TBB",
"ServiceCode": "LASTMILEDELIVERY",
"reverseLogisticActivity": "",
"reverseLogisticRefundAmount": "",
"WeightUnitType": "KILOGRAM",
"Description": "VZXC",
"COD": 104.155,
"CODPaymentMode": "CASH",
"DutyPaidBy": "Receiver",
"packageDetails":
{
"packageJsonString":
[
{
"barCode": "1111111111",
"packageCount": 1,
"length": 20.0,
"width": 50.0,
"height": 60.0,
"weight": 10.0,
"chargedWeight": 12.0,
"selectedPackageTypeCode": "NON DOCUMENT"
},
{
"barCode": "1111111112",
"packageCount": 2,
"length": 20.0,
"width": 50.0,
"height": 60.0,
"weight": 10.0,
"chargedWeight": 12.0,
"selectedPackageTypeCode": "NON DOCUMENT"
}
]
}
}
}
When customer code is of 00000:

Example 2

{
"waybillRequestData":
{
"consigneeGeoLocation":"25.89,78.5",
"FromOU":"Delhi",
"DeliveryDate":"2019-06-03",
"WaybillNumber":"",
"CustomerCode":"00000",
"CustomerName":"CDCD TEST",
"CustomerAddress":"XC CSS",
"CustomerCity":"Gurgaon",
"CustomerCountry":"IN",
"CustomerPhone":"",
"CustomerState":"HR",
"CustomerPincode":""
"ConsigneeCode":"00000",
"ConsigneeName":"xyzsc",
"ConsigneePhone":"7888",
"ConsigneeAddress":"test address",
"ConsigneeCountry":"IN",
"ConsigneeState":"HR",
"ConsigneeCity":"Faridabad",
"ConsigneePincode":"440012",
"ConsigneeWhat3Words":"word.exact.replace",
"StartLocation":"Agra",
"EndLocation":"Manesar",
"ClientCode":"HERO",
"NumberOfPackages":"1",
"ActualWeight":"78",
"ChargedWeight":"78",
"CargoValue":"",
"ReferenceNumber":"",
"InvoiceNumber":"",
"PaymentMode":"PAID",
"ServiceCode":"PARTLOAD",
"WeightUnitType":"KILOGRAM",
"Description":"",
"COD":"",
"CODPaymentMode":"",
"PackageDetails":"",
"CreateWaybillWithoutStock":"false"
}
}

Example 3

{
"waybillRequestData":
{
"consigneeGeoLocation": "",
"FromOU": "",
"DeliveryDate": "",
"WaybillNumber": "",
"CustomerCode": "",
"ConsigneeCode": "",
"ConsigneeName": "",
"ConsigneePhone": "",
"ConsigneeAddress": "",
"ConsigneeCountry": "",
"ConsigneeState": "",
"ConsigneeCity": "",
"ConsigneePincode": "",
"ConsigneeWhat3Words": "",
"CreateWaybillWithoutStock": "",
"StartLocation": "",
"EndLocation": "",
"ClientCode": "",
"NumberOfPackages": "1",
"ActualWeight": "12",
"ChargedWeight": "12",
"CargoValue": "",
"ReferenceNumber": "",
"InvoiceNumber": "",
"PaymentMode": "TBB",
"ServiceCode": "EXPRESS",
"WeightUnitType": "KILOGRAM",
"Description": "",
"COD": "",
"salesInvoiceNumber": "QUBE0002",
"CODPaymentMode": "",
"packageDetails":
{
"packageJsonString":
[
{
"barCode": "",
"packageCount": 1,
"length": 10,
"width": 10,
"height": 10,
"weight": 15,
"chargedWeight": 15,
"selectedPackageTypeCode": "BOX"
}
]
}
}
}

Request Details

Parameter Data Type Required/Optional Description
SecureKey Required It is a Unique key for accessing the API. For secure key email to support team.
fromOU Optional Source Operating Unit. Refer to the Annexure Operating Unit.
waybillNumber Optional Unique waybill number is available in ERP for customer account if it is blank, system will generate an auto waybill number.
deliveryDate Optional Estimated delivery date, if blank current date will be save as default.
customerCode Required Consignor code is same as available in ERP. Consignor code can be 00000 for unregistered consignor.
customerName Optional Customer Name
customerCity Optional Customer City should match with the code as available in the ERP. Refer to the annexure City List for the correct values if Consignor code is 00000 which is unregistered.
customerAddress Optional Customer Address is from where the shipment is getting pick.
customerState Optional Customer State code should match with the code as available in ERP. Refer to the annexure State List for the correct values if Consignor code is 00000 which is unregistered.
CustomerPhone Optional Customer's Phone Number
CustomerCountry Optional It should be two digits country code. Reference is given here. https://goo.gl/wgg9s
CustomerPincode Optional Customer's area Zip Code from where the shipment will get pick.
ConsigneeAddress Required Consignee Address is where the shipment will be delivered.
ConsigneeCountry Required Consignee Country code. It should be two digits country code (IN, EG, etc.). Reference is given here. https://goo.gl/wgg9s
ConsigneeState Required Consignee State code should be same as available in the ERP. Refer to the annexure State List for the correct values.
ConsigneeCity Required Consignee City code should be same as available in the ERP. Refer to the annexure City List for the correct values.
ConsigneeCode Required Consignee code should be same as available in the ERP. Consignee code can be 00000 for unregistered consignee.
ConsigneeName Required Name of the receiver
ConsigneePhone Required Consignee's Phone Number
StartLocation Optional Start location, incase pickup location is not the same as consignor city.
EndLocation Optional End location, incase delivery location is not the same as consignee city.
ClientCode Required Client Code is same as available in ERP.
NumberOfPackages Required Number of Packages
ActualWeight Required Actual Weight of the package
ChargedWeight Double Optional It is always same or greater than Actual weight as per contract of client.
CargoValue Double Optional Shipment Invoice Amount.
ReferenceNumber Optional Reference Number is alos used to track waybill.
InvoiceNumber Optional Consignor's Invoice Number
PaymentMode Required Payment Mode (FOD / TBB / To Be Billed / Cash On Delivery / Free Of Cost). To Be Billed is set as default.
ServiceCode Required Service Code should be same as available in ERP. Refer to Annexure Services List for the values.
ReverseLogisticActivity Optional Reverse logistics type (Package Pickup / Both / Cash Refund). It is mandatory to provide this value when service code type is of Reverse Logistics.
ReverseLogisticRefundAmount Double Optional If reverse logistic activity is Both or Cash Refund then it is mandatory to give this value.
WeightUnitType Required Weight Unit Type (Gram / Kilogram / Tonne / Pound). Kilogram is set as default.
Description Optional In this column, user mention shipment details.
COD Optional COD Amount collects at the time of pickup.
CODPaymentMode Required if COD amount is there COD Payment Mode (Cash / Cheque / Demand Draft / Account Transfer / PayMob / MPesa / Others).
Currency Optional Enter 3 digit currency code (USD, GBP, etc) as specified at https://www.iso.org/iso-4217-currency-codes.html
DutyPaidBy Optional Duty Paid by means that who is going to pay duty charges (sender / receiver).
CreateWaybillWithoutStock Optional If the provided waybill number in the json is from document stock or not. If the waybill number exists in the document stock then it takes false, if waybill number is given to user any random number then it takes true.
SendEmail Optional This parameter takes boolean value, i.e. True or False. If user wants to send email keep its value as True, else False.
SendSMS Optional This parameter takes boolean value, i.e. True or False. If user wants to send email keep its value as True, else False.
PrintWaybill Optional It gives the waybill print in the response when its value is set as true.When its value is set as false then it does not give the waybill print in the response.
PrintSticker Optional It gives the waybill sticker print in the response when its value is set as true. When its value is set as false then it does not give the waybill sticker print in the response.
PackageDetails Optional Details of packages. To be provided in JSON format, e.g.

"packageDetails": {
"packageJsonString": [
{
"barCode": "",
"packageCount": 1,
"length": 20.0,
"width": 50.0,
"height": 60.0,
"weight": 10.0,
"chargedWeight": 12.0,
"selectedPackageTypeCode": "NON DOCUMENT"
}
]
}
Each Array element in the package Json String will be for packages for the same dimensions. Incase you have multiple packages of the same dimension the package count will be having the count of packages.
  • Barcode: Keep it blank for system to auto generate the barcode.
  • Package Count: Package count have the same package dimensions. Sum of all package count should be equal to the number of packages.
  • Length: Package Length.
  • Width: Package Width.
  • Height: Package Height.
  • Weight: Package Weight.
  • Charged Weight: Charged Weight of the packages.
  • Select Package Type Code: Package Type Code is like Document / Non Document.

Package JSON

Parameter Data Type Required/Optional Description
BarCode Optional Package barcode. If it is blank, system will auto assign a unique barcode to the package.
PackageCount Required Numeric count of the packages. If you have multiple packages of the same dimensions you could mention the package count and dimensions. System will create unique barcode for every package.
Length Required Length of the package. It is always numeric values from 0 to 99999
Width Required Width of the package. It is always numeric values from 0 to 99999
Height Required Height of the package. It is always numeric values from 0 to 99999
Weight Required Weight of the package. It is always numeric values from 0 to 99999
ChargedWeight Required Charged Weight. It is always same or greater than Actual weight as per contract of client. It is always numeric values from 0 to 99999

Response Format

ON SUCCESS
{
"labelURL": "LABEL_DOWNLOAD_URLpdf",
"message" : "WayBill Created Successfully",
"messageType" : "Success",
"packageStickerURL": "STICKER_DOWNLOAD_URLpdf",
"status": "Data Received",
"waybillNumber": "3110032214"
}

ON ERROR
{
"message" : "ERROR_MESSAGE",
"messageType" : "Error"
}

Error Message String

Error Messages Description
Service Code not found Service code is wrong or not given.
Invalid Service code Service code is wrong.
Customer Code missing Customer code is not given.
Consignee Address missing Consignee address is not given.
Consignee Country missing Consignee country is not given.
Consignee State missing Consignee state is not given.
Consignee City missing Consignee city is notgiven.
Consignee Name missing Consignee name is not given.
Consignee Phone missing Consignee phone is not given.
Contract Expired Customer contract has already expired in ERP.
Contract Credit Limit Exceeded Customer credit limit has exceeded which was assigned in customer contract.
Contract Suspended Customer contract is in suspend state.
Waybill Creation Failed Waybill creation failed due to an internal error.

Sample Code

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;

import java.net.URL;

public class CreateWaybill {

private static final String ACCESS_KEY = "logixerp";
private static final String API_URL = "https://webservice.logixerp.com/Rachna/webservice/v2/CreateWaybill?secureKey=";
private static final int SECURE_KEY = SECURE KEY;
private static final String ACCESS_URL = API_URL+SECURE_KEY;

public static void main(String[] args) throws IOException {

URL obj = new URL(ACCESS_URL);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("AccessKey", ACCESS_KEY);
con.setRequestProperty("Content-Type", "application/json; charset=utf-8");
con.setRequestProperty("Accept", "application/json");

con.setDoOutput(true);

String jsonInputString = "{\"waybillRequestData\":\r\n" +
"{\r\n" +
"\"consigneeGeoLocation\": \"\",\r\n" +
"\"FromOU\": \"\",\r\n" +
"\"DeliveryDate\": \"21-04-2020\",\r\n" +
"\"WaybillNumber\": \"\",\r\n" +
"\"CustomerCode\": \"HERO\",\r\n" +
"\"ConsigneeCode\": \"SNAP\",\r\n" +
"\"ConsigneeName\": \"xxxx\",\r\n" +
"\"ConsigneePhone\": \"7017466939\",\r\n" +
"\"ConsigneeAddress\": \"xxx\",\r\n" +
"\"ConsigneeCountry\": \"IN\",\r\n" +
"\"ConsigneeState\": \"DELHI\",\r\n" +
"\"ConsigneeCity\": \"Lajpat Nagar\",\r\n" +
"\"ConsigneePincode\": \"110096\",\r\n" +
"\"ConsigneeWhat3Words\": \"\",\r\n" +
"\"CreateWaybillWithoutStock\": \"\",\r\n" +
"\"StartLocation\": \"\",\r\n" +
"\"EndLocation\": \"\",\r\n" +
"\"ClientCode\": \"HERO\",\r\n" +
"\"NumberOfPackages\": \"1\",\r\n" +
"\"ActualWeight\": \"12\",\r\n" +
"\"ChargedWeight\": \"12\",\r\n" +
"\"CargoValue\": \"10\",\r\n" +
"\"ReferenceNumber\": \"\",\r\n" +
"\"InvoiceNumber\": \"\",\r\n" +
"\"PaymentMode\": \"TBB\",\r\n" +
"\"ServiceCode\": \"EXPRESS\",\r\n" +
"\"WeightUnitType\": \"KILOGRAM\",\r\n" +
"\"Description\": \"\",\r\n" +
"\"COD\": \"\",\r\n" +
"\"salesInvoiceNumber\": \"\",\r\n" +
"\"CODPaymentMode\": \"\",\r\n" +
"\"packageDetails\":\r\n" +
"{\r\n" +
"\"packageJsonString\":\r\n" +
"[\r\n" +
"{\r\n" +
"\"barCode\": \"\",\r\n" +
"\"packageCount\": 1,\r\n" +
"\"length\": 10,\r\n" +
"\"width\": 10,\r\n" +
"\"height\": 10,\r\n" +
"\"weight\": 15,\r\n" +
"\"chargedWeight\": 15,\r\n" +
"\"selectedPackageTypeCode\": \"BOX\"\r\n" +
"}\r\n" +
"]\r\n" +
"}\r\n" +
"}\r\n" +

"}";

try(OutputStream os = con.getOutputStream()) {
byte[] input = jsonInputString.getBytes("utf-8");
os.write(input, 0, input.length);
}

try(BufferedReader br = new BufferedReader(
new InputStreamReader(con.getInputStream(), "utf-8"))) {
StringBuilder response = new StringBuilder();
String responseLine = null;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
System.out.println(response.toString());
}

}
}
import requests
import json

access_url = "https://webservice.logixerp.com/Rachna/webservice/v2/CreateWaybill"

params = {'SecureKey' : 'secure_key'}

data = {
"waybillRequestData":
{
"consigneeGeoLocation": "",
"FromOU": "",
"DeliveryDate": "",
"WaybillNumber": "",
"CustomerCode": "HERO",
"ConsigneeCode": "",
"ConsigneeName": "",
"ConsigneePhone": "",
"ConsigneeAddress": "",
"ConsigneeCountry": "",
"ConsigneeState": "",
"ConsigneeCity": "",
"ConsigneePincode": "",
"ConsigneeWhat3Words": "",
"CreateWaybillWithoutStock": "",
"StartLocation": "",
"EndLocation": "",
"ClientCode": "",
"NumberOfPackages": "1",
"ActualWeight": "12",
"ChargedWeight": "12",
"CargoValue": "",
"ReferenceNumber": "",
"InvoiceNumber": "",
"PaymentMode": "TBB",
"ServiceCode": "EXPRESS",
"WeightUnitType": "KILOGRAM",
"Description": "",
"COD": "",
"salesInvoiceNumber": "",
"CODPaymentMode": "",
"packageDetails":
{
"packageJsonString":
[
{
"barCode": "",
"packageCount": 1,
"length": 10,
"width": 10,
"height": 10,
"weight": 15,
"chargedWeight": 15,
"selectedPackageTypeCode": "BOX"
}
]
}
}

}

headers = {'Content-Type':'application/json', 'AccessKey' : 'logixerp'}

try:
r = requests.post(access_url, params=params, headers=headers, data=json.dumps(data))
print (r.text)
except requests.exceptions.RequestException as err:
print (err)
please wait...