Generate Carrier Waybill

Overview

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

Description

Generate Carrier Waybill API is used to generate and print carrier waybill.

Request Header

AccessKey : logixerp

Request Body

These are form parameters:

  • waybillNumber: EGN10242
  • carrierCode: EASYPOST
  • aggregator: USPS
  • carrierProduct:DOCUMENT

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 shpould be same as available in ERP which status should not be Delivered / RTO / Un-Delivered / RTO-Delivered.
carrierCode String Required Carrier Code should be same as available in ERP.
aggregator String Optional Aggregator code which is available for particular carrier code.
carrierProduct String Required Carrier product code is available in ERP.

Response Format

ON SUCCESS
{
"carrierWaybill": "9400100897846034140343",
"labelDetailList":
[
{
"artifactType": "LABEL",
"artifactUrl": "https://s3.amazonaws.com/rachna-prod/DB7FACCA8A3640648D918B4A4818178A/DocketLabel/EGNL_INTERNAL_2020_353/fa4cd86c4e6a4b60a11fe057090aa6ad.png",
"description": null,
"fileExtension": "Label",
"fileName": "fa4cd86c4e6a4b60a11fe057090aa6ad.png",
"number": "EGNL/INTERNAL/2020/353"
}
],
"message": "_carrier_docket_created_successfully",
"messageType": "Success",
"waybillNumber": "EGN10242"
}

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

Error Message String

Error Messages Description

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

private static final String ACCESS_KEY = "logixerp";
private static final String API_URL = "https://webservice.logixerp.com/Rachna/webservice/v2/GenerateCarrierWaybill?secureKey=";
private static final int SECURE_KEY = -1280192700;
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", "DELHI13449");
params.put("carrierCode", "EASYPOST");
params.put("aggregator", "USPS");
params.put("carrierProduct", "DOCUMENT");
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/GenerateCarrierWaybill"

params = {'SecureKey':'secure_key'}
headers={'AccessKey':'logixerp'}
payload = {
'waybillNumber':'EGN10242',
'carrierCode':'US',
'aggregator':None,
'carrierProduct':'DOCUMENT'

}

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