Deliver Waybill

Overview

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

Description

Deliver Waybill API is used to deliver the waybills or shipments by creating delivery run sheet and then delivering the waybills in it all at once. You can deliver maximum 10 waybills at a time.

Request Header

AccessKey : logixerp

Request Body

VALID JSON STRING
{
"waybillDeliveryRequestData":
[
{
"waybillNumber": "528555",
"remarks": "VERY SOON ",
"deliveredTo": "naveen",
"deliveryTime": "2020-02-25 16:00:00",
"deliveryStatus": "RTO-Delivered"
},
{
"waybillNumber": "DELHI11626",
"remarks": "VERY SOON ",
"deliveredTo": "amit",
"deliveryTime": "2020-02-25 17:00:00",
"deliveryStatus": "Delivered"
}
]
}

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 Waybill number which is supposed to be deliver.
remarks String Optional Remarks for the waybill if user wants to give any special instruction.
deliveredTo String Optional Name of the person to whom waybill is delivered.
deliveryTime String Optional The time of delivering the waybill which will take date from the waybill’s booking date till current date. Its format is yyyy-mm-dd hh:mm:ss
deliveryStatus String Required delivery status is updated in the given format only (Un-Delivered / Delivered / RTO-Delivered / Partial-Delivered).
customStatus String Optional If user wants to give any status.

Response Format

ON SUCCESS
{
"drsDetails":
{
"creationDate": "2020-02-25T15:00:00",
"number": "Delhi/2020/1315"
},
"message": "Delivery Run Sheet created successfully",
"messageType": "Success"
}

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

Error Message String

Error Messages Description
Duplicate waybill number is not allowed When any waybill is sent multiple times in the same request.
More than 10 waybills are not allowed. When number of waybills sent in the request is more than 10.
Date should not be after today's date When date and time is given after the current date and time.
Delivery Run Sheet creation failed Some internal error occurred.

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 DeliverWaybill {

private static final String ACCESS_KEY = "logixerp";
private static final String API_URL = "https://webservice.logixerp.com/Rachna/webservice/v2/DeliverWaybill?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("Content-Type", "application/json; charset=utf-8");
con.setRequestProperty("Accept", "application/json");

con.setDoOutput(true);

String jsonInputString = "{\"waybillDeliveryRequestData\":\r\n" +
"[\r\n" +
"{\r\n" +
"\"waybillNumber\": \"DELHI13627\",\r\n" +
"\"remarks\": \"VERY SOON \",\r\n" +
"\"deliveredTo\": \"raju\",\r\n" +
"\"deliveryTime\": \"2020-04-30 16:00:00\",\r\n" +
"\"deliveryStatus\": \"RTO-Delivered\"\r\n" +
"},\r\n" +
"{\r\n" +
"\"waybillNumber\": \"DELHI13626\",\r\n" +
"\"remarks\": \"VERY SOON \",\r\n" +
"\"deliveredTo\": \"amit\",\r\n" +
"\"deliveryTime\": \"2020-04-29 00:00:02\",\r\n" +
"\"deliveryStatus\": \"Delivered\"\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/DeliverWaybill"

params = {'SecureKey' : 'secure_key'}
data = {
"waybillDeliveryRequestData":
[
{
"waybillNumber": "DELHI13627",
"remarks": "VERY SOON ",
"deliveredTo": "raju",
"deliveryTime": "2020-04-30 16:00:00",
"deliveryStatus": "RTO-Delivered"
},
{
"waybillNumber": "DELHI13626",
"remarks": "VERY SOON ",
"deliveredTo": "amit",
"deliveryTime": "2020-04-29 00:00:02",
"deliveryStatus": "Delivered"
}
]

}

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...