Update Waybill

Overview

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

Description

Update Waybill API is used to update the waybill status and Cancel the waybill. Delivered Waybills can not be cancelled or updated.

Request Header

AccessKey : logixerp

Request Body

These are form parameters:

  • waybillNumber: DELHI12565
  • consigneeName: John
  • consigneeAddress: Delhi
  • consigneeCity: Delhi
  • consigneeState: Delhi
  • consigneeCountry: IN
  • consigneePhone: 9876543210
  • actualWeight: 1
  • chargedWeight: 1
  • numberOfPackages: 2
  • WaybillStatus: Cancelled
  • cancelledRemarks: Do not want

Request Details

Parameter Data Type Required/Optional Description
SecureKey int Required It is a Unique key for accessing the API. For secure key email to support team.
waybillNumber String Required Unique waybill number should be same as available in ERP. Waybill status should not be Delivered.
consigneeName String Optional Receiver's Name.
consigneeAddress String Optional receiver's Address.
consigneeCity String Optional Receiver's City.
consigneeState String Optional Receiver's State.
consigneeCountry String Optional Consignee Country code. It should be two digits’ country code. Reference is given here. https://goo.gl/wgg9s
consigneePhone String Optional Consignee Phone Number which you want to update
numberOfPackages String Optional Enter number of packages which you want to update.
actualWeight String Optional Weight of the package
chargedWeight String Optional Charged weight is that which you charge as per contract. It should be same or greater then Actual weight.
waybillStatus String Optional Waybill status you can update it as Cancelled.
cancelledRemarks String Optional/Required If you are cancelling any waybill then you have to give remarks that why are you cancelling waybill.

Response Format

ON SUCCESS
{
"message":"Waybill updated successfully",
"messageType":"Success",
“waybillNumber”: “DELHI12565”
}

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

Error Message String

Error Messages Description
Waybill not found Waybill details not available in the system
Cancelled waybill can not be updated Waybill status is already cancelled and it can’t be further updated
Waybill status can not be updated Waybill status is other than Data.

Sample Code

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.LinkedHashMap;

import java.util.Map;

public class UpdateWaybill {

private static final String ACCESS_KEY = "logixerp";
private static final String API_URL = "https://webservice.logixerp.com/Rachna/webservice/v2/UpdateWaybill?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 url = new URL(ACCESS_URL);
Map params = new LinkedHashMap<>();
params.put("waybillNumber", "206344");
params.put("consigneeName", "John123");
params.put("consigneeAddress", "Delhi123");
params.put("consigneeCity", "Delhi123");
params.put("consigneeState", "Delhi123");

params.put("consigneeCountry", "EG");

StringBuilder postData = new StringBuilder();
for (Map.Entry param : params.entrySet()) {
if (postData.length() != 0) postData.append('&');
postData.append(URLEncoder.encode(param.getKey(), "UTF-8"));
postData.append('=');
postData.append(URLEncoder.encode(String.valueOf(param.getValue()), "UTF-8"));

}

byte[] postDataBytes = postData.toString().getBytes("UTF-8");
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("AccessKey", ACCESS_KEY);
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setRequestProperty("Content-Length", String.valueOf(postDataBytes.length));
conn.setDoOutput(true);
conn.getOutputStream().write(postDataBytes);
Reader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
StringBuilder data = new StringBuilder();
for (int c; (c = in.read()) >= 0;) {
data.append((char)c);
}
String intentData = data.toString();
System.out.println(intentData);
}

}

import requests

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

params = {'SecureKey':'secure_key'}
headers={'AccessKey':'logixerp'}
payload = {
'waybillNumber': 'DELHI12565',
'consigneeName': 'John',
'consigneeAddress': 'Delhi',
'consigneeCity': 'Delhi',
'consigneeState': 'Delhi',
'consigneeCountry': 'IN',
'consigneePhone': 9876543210,
'actualWeight': 1,
'chargedWeight': 1,
'numberOfPackages': 2,
'WaybillStatus': None,
'cancelledRemarks': None

}

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