Jeebly
POST Scheduled Delivery API • Version 1.0.9

Shipment Label Generation
API Guide

Print a shipping label for your Jeebly order. Once you have created an order and received an AWB number, use this API to generate and download the printable shipping label in PDF format. Print the label and attach it to your package before the courier rider arrives for pickup.

Try in API Console
Version: 1.0.9 Method: POST Output: PDF / Image File AWB Barcode Ready
POST v1.0.9
Generate Shipment Label

Scheduled Label Printing Endpoint

DEMO / SANDBOX:
https://demo.jeebly.com/customer/generate_shipment_label
PRODUCTION LIVE:
https://myjeebly.jeebly.com/customer/generate_shipment_label
Auth Headers:X-API-KEY, client_key
Request Body:reference_number
Output Format:application/pdf
Jump to Request Body
1

What Is This API?

Once you have created an order in the Jeebly system and received an AWB number (Air Waybill tracking number), use this API to generate and download the official shipping label for that order.

The returned shipping label contains high-resolution scannable barcodes (1D Code 128 / 2D QR), consignor origin details, consignee destination address, payment status (Prepaid or COD with collect amount), package weight, and operational dispatch routing notes. Print the label and attach it securely to your package before the rider arrives for pickup.

API Details & Environments

Property Value Action
Request URL (Demo) https://demo.jeebly.com/customer/generate_shipment_label
Request URL (Production) https://myjeebly.jeebly.com/customer/generate_shipment_label
HTTP Method POST —
Content-Type application/json —
Prerequisite: Order Creation Required First

You must create an order first through the Order Creation API and receive a valid AWB number before calling this API. You cannot generate a label without a valid AWB reference number.

2

Authentication Headers

Every request submitted to the Label Generation API must include your merchant authentication headers. Requests lacking these headers or providing invalid tokens will return an immediate 400 Bad Request with an explanatory message.

Header Name Description Required
X-API-KEY Your API security key assigned to your merchant account. Yes
client_key Your Jeebly customer account key. Yes
Content-Type Must always be set to application/json. Yes
Need to view or generate your sandbox/production API keys?
Get Your Keys
3

Request Body

The request body is straightforward and requires exactly one field containing the shipment reference identifier:

Field Name Type Description Example Required
reference_number String The unique AWB / tracking number received in the API response when you created the shipment order. "JB301234" Yes
Validation Requirements for reference_number

The reference number must belong to an active, valid consignment in your merchant account. Passing an unassigned number, empty spaces, or blank string will result in "Invalid Shipment Number" or "Invalid JSON format".

4

Sample Request

Below is a complete example request demonstrating how to invoke the Label Generation endpoint across various programming languages:

curl --location 'https://demo.jeebly.com/customer/generate_shipment_label' \
--header 'X-API-KEY: YOUR_API_KEY' \
--header 'client_key: YOUR_CLIENT_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "reference_number": "JB301234"
}'
{
  "reference_number": "JB301234"
}
const myHeaders = new Headers();
myHeaders.append("X-API-KEY", "YOUR_API_KEY");
myHeaders.append("client_key", "YOUR_CLIENT_KEY");
myHeaders.append("Content-Type", "application/json");

const raw = JSON.stringify({
  "reference_number": "JB301234"
});

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

// Fetch as binary blob to trigger PDF download or display in iframe
fetch("https://demo.jeebly.com/customer/generate_shipment_label", requestOptions)
  .then((response) => {
    if (!response.ok) return response.json().then(err => { throw err; });
    return response.blob();
  })
  .then((blob) => {
    const url = window.URL.createObjectURL(blob);
    const a = document.createElement("a");
    a.href = url;
    a.download = "JB301234_shipping_label.pdf";
    document.body.appendChild(a);
    a.click();
    a.remove();
  })
  .catch((error) => console.error("Error generating label:", error));
import requests
import json

url = "https://demo.jeebly.com/customer/generate_shipment_label"

payload = json.dumps({
  "reference_number": "JB301234"
})

headers = {
  'X-API-KEY': 'YOUR_API_KEY',
  'client_key': 'YOUR_CLIENT_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

if response.status_code == 200:
    # Save binary PDF stream directly to disk
    with open("JB301234_shipping_label.pdf", "wb") as f:
        f.write(response.content)
    print("Label downloaded successfully as JB301234_shipping_label.pdf")
else:
    print("Error generating label:", response.json())
<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://demo.jeebly.com/customer/generate_shipment_label',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => json_encode(['reference_number' => 'JB301234']),
  CURLOPT_HTTPHEADER => array(
    'X-API-KEY: YOUR_API_KEY',
    'client_key: YOUR_CLIENT_KEY',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);

if ($httpCode === 200) {
    header('Content-Type: application/pdf');
    header('Content-Disposition: inline; filename="JB301234.pdf"');
    echo $response;
} else {
    echo $response;
}
Test this request with live response preview in the interactive console:
Test in API Console
5

Success Response (200 OK)

When successful, the API returns a label file (usually a PDF or image stream). You can save this file directly to disk, stream it to a thermal printer, or display it in an iframe/browser tab for your fulfillment team.

200 OK HTTP Headers & Binary Stream
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: inline; filename=JB301234.pdf
Transfer-Encoding: chunked

(Binary PDF body stream)
Standard 4x6" Thermal Shipping Label

Formatted ready-to-print for standard label printers (Zebra, TSC, Citizen, Brother).

High-Resolution Barcode (Code 128)
Response Element Value Description
Content-Type application/pdf (or image) MIME type of the generated file payload.
Content-Disposition inline; filename=JB{AWB}.pdf Filename header carrying the corresponding AWB number for convenient saving.
Body Binary Byte Stream The printable document stream.
6

Error Responses (400 Bad Request)

A 400 Bad Request response means there was a problem with the request payload, missing authentication headers, or an unassigned shipment reference number. The message field will explain what went wrong:

400 1. If the format is wrong
Malformed JSON or syntax error
{
  "success": "false",
  "message": "Invalid JSON format"
}
400 2. If the API Key is not valid
X-API-KEY wrong, revoked, or missing
{
  "success": "false",
  "message": "Invalid API Token"
}
400 3. If the customer Key is not valid
client_key wrong or missing
{
  "success": "false",
  "message": "Invalid Customer Key"
}
400 4. If the consignment is invalid
reference_number does not exist
{
  "success": "false",
  "message": "Invalid Shipment Number"
}
7

Troubleshooting & Resolution Matrix

Use this quick-fix table to troubleshoot errors when invoking the Label Generation API:

Error Message What It Means How to Fix It
Invalid JSON format The request body is not valid JSON. Check the format of your request, closing brackets, and valid quotes around "reference_number".
Invalid API Token Your API key is wrong, revoked, or missing. Check your X-API-KEY header value and ensure no extra whitespace was added.
Invalid Customer Key Your client key is wrong or missing. Check your client_key header and confirm it matches your Jeebly account key.
Invalid Shipment Number The reference number you entered does not exist in the Jeebly database. Make sure you are using the correct AWB number returned from the order creation response.
Important Integration Rule

Note: Make sure you create the order first and get the AWB number before calling this API. You cannot generate a label without a valid AWB number.

8

Label Printing & Warehouse Best Practices

Follow these standard operating instructions to prevent barcode scanning failures and collection delays:

4x6" Thermal Format

Print directly on 100 x 150 mm (4 x 6 inch) direct thermal label rolls. Avoid scaling down or fitting to A4 sheets if possible.

Flat Surface Placement

Affix the printed sticker flat on the largest surface of the carton/polybag. Never fold the barcode around carton edges or seams.

Protect Barcodes

Do not cover thermal barcodes with clear packing tape, as adhesive chemicals can cause heat-activated thermal print to fade.