This REST service allows your system to create a Fedex Express, SmartPost , Ground labels or UPS Ground Labels using standalone, web or script based program.
Your client must use POST, DELETE and PUT HTTP methods to successfully submit your label create, label delete and manifest close requests.
The service URL is:
https://api.pactrak.com/ibclabel/service
Attention: This is a secure service, you need to obtain a security token first and append
your token entry as a parameter to the URL above.
This is a sample URL with an authority token:
https://api.pactrak.com/ibclabel/service/...../?token=NmIzY2Y1OWV8SmFoMnclWl5Od1p2S1NzVw==
Your service requests will use some or all of the following values:
To create a new label you will need:
https://api.pactrak.com/ibclabel/service/STATION_CODE/SERVICE_CODE/ManifestID
The Fedex default label return type is a 4x6 ZPL label. You can modify the label type by appending the following parameters to your URL:
?image_type=IMAGE_TYPE&stock_type=STOCK_TYPEThe following tables define the accepted IMAGE_TYPE and STOCK_TYPE options.
image_type | stock_type |
---|---|
ZPLII | STOCK_4X6 |
EPL2 | STOCK_4X6.75_LEADING_DOC_TAB |
DPL | STOCK_4X6.75_TRAILING_DOC_TAB |
STOCK_4X8 | |
STOCK_4X9_LEADING_DOC_TAB | |
STOCK_4X9_TRAILING_DOC_TAB |
image_type | stock_type |
---|---|
PAPER_4X6 | |
PNG | PAPER_4X8 |
RTF | PAPER_4X9 |
TEXT | PAPER_7X4.75 |
PAPER_8.5X11_TOP_HALF_LABEL | |
PAPER_8.5X11_BOTTOM_HALF_LABEL | |
PAPER_LETTER |
To delete a label you will need:
https://api.pactrak.com/ibclabel/service/STATION_CODE/SERVICE_CODE/ServiceTrackNumber
To close your labels on the ship date: (NOT NEEDED For UPSG service)
https://api.pactrak.com/ibclabel/service/STATION_CODE/SERVICE_CODE/ManifestID
You will need to obtain a security token before submitting your test or production requests.
The easiest way to test your POST request is to use cURL from the system's command line. Use the station code TST for TEST entries.
We recommend saving your JSON structure into a text file ( input-file.txt ). To create a label under Manifest 1G161122 you will execute:
The following code is a sample input request for a Fedex / UPS Multilot shipment, except Fedex Smartpost requests.
Here is a sample curl delete request for Smartpost Fedex track number 76564231111: *To delete 2D shipments use code 'E'.
Here is a sample curl request to close ground manifest 1S161122:
After making a successful submission you should expect a return of one of the following JSON structures:
Response JSON structure
On error responses the Developer message object will contain a validity report with details of the issues found with the input provided. It is formatted with end of line chars "\n" so that it will be readable in your browser's web console.
Use these codes for UPS Labels
- UPSG: UPS Ground Service
- UPSN: UPS NextDay Service
- UPSNS: UPS NextDay Service Saver
- UPS2D: UPS 2 Day Service
- UPS3D: UPS 3 Day Service
- UPSM: UPS Sure Post Items less than 1 lbs, report weight in "OZ" ounces
- UPSM1: UPS Sure Post Items greater than 1 lbs
- For residential delivery add ?residential as a parameter to your request URL.
The service supports returning ZPL, GIF, SPL, EPL or PNG image of the label. Use the stock_type parameter in your URL request to change the type. If you don't use the parameter the ZPL code is returned.
Use these codes for DHL Labels
- DHM: SmartMail Parcel Expedited Max
- DHE: SmartMail Parcel Expedited
- DHG: SmartMail Parcel Ground
- DHP: SmartMail Parcel Plus Ground
- DHPE: DHL Plus Expedited
The service supports returning ZPL or a PNG image of the label. Use the stock_type parameter with the value: image for PNG, or zpl for ZPL response. If you don't use the parameter the ZPL code is returned.
Restful services are capable of receiving requests form web based or standalone applications. We have tested our services to comply with REST standards, returning appropriate HTTP codes to help developers using commonly used frameworks as JQuery or Prototype.
Additionally, there are many examples from many different programming languages such as C#, Java, PHP and C++.
If you desire to test or need Java sample code, the following project is an example of how to call an HTTP Rest service using HTTP Post protocol, IBCPost.
ZPL printing
- Zebra Windows help
- Linux printing
Base64- Encode / Decode and samples