IBC. Inc.

IBC Web Airbill Service

Introduction

This service allows your system to create an IBC Web Airbill using standalone, web or script based program.

Your client must use POST HTTP method to successfully submit your IBC Web Airbill JSON data structure.

The service URL is:
 https://api.pactrak.com/ibcairbill/production 

To simply validate your structure or to test your JSON IBC Web Airbill structure, use this URL:
 https://api.pactrak.com/ibcairbill/production?_test 

You can also request a 4" x 6" ZPL label feed by adding "_zpl" parameter to your URL:
 https://api.pactrak.com/ibcairbill/production?_zpl 

IBC Web Airbill Structure

The REST service currently accepts the following JSON structure to correctly report your information.

/** Main Submission object called billdata */
billdata = {
/** The first object to define is the Shipper information. */
"shipper": {
"name":"Alberto Ochoa", /** REQUIRED */
"company_name":"IBC",
"phone":"305 597 5327", /** REQUIRED */
"address":"8401 NW 17th St", /** REQUIRED */
"city":"Miami", /** REQUIRED */
"state":"FL",
"zip":"33126",
"country":"US", /** REQUIRED - Use 2 char. ISO country code */
"account":"8040" /** REQUIRED */
},

/** The second object to define is the Consignee information */
"consignee":{
"name":"Test Recipient", /** REQUIRED */
"company_name":"Test Co.",
"phone":"718 526 5300", /** REQUIRED */
"address":"1465 Test Avenue", /** REQUIRED */
"city":"Test City", /** REQUIRED */
"state":"TS",
"zip":"11644",
"country":"US", /** REQUIRED - Use 2 char. ISO country code */
"email":"", /** A valid email address for the consignee */
"tax_id":"" /** Some countries require a Tax ID for the consignee, when shipping APX. [ 'BR' ] */
},

/** Finally, the last object to define is the Shipment information */
"shipment":{
"contents":"DOC", /** REQUIRED - Select between DOC or APX */
"description":"Test", /** REQUIRED */
"pieces":"1", /** REQUIRED */
"packaging":"P", /** REQUIRED - Select between "P", "L", "B" or "O" - Package, Letter, Box, Other */
"weight":"1", /** REQUIRED */
"weight_qualifier":"lbs",/** REQUIRED - Select between lbs or kgs */
"value":"10",/** REQUIRED - For Documents use 0 or 1. */
"service":"ST", /** REQUIRED -"P1", "ST", "DS", "GD", "MH" or "XF", Use ST for Standard service or GD for Ground */
"bill_to":"P", /** REQUIRED - Default option is P */
"platinum_service":"", /** OPTIONAL - */
"insurance_amount":"", /** OPTIONAL: If requesting insurance, should be less than $2500.00 */
"dimensions":"", /** OPTIONAL: use format Lenght x Width x Height - ie 10x10x15 */
"dimensions_qualifier":"inch" /** OPTIONAL - Select between "inch" or "cm" */
"tracking":"" /** OPTIONAL - leave blank if you want us to assign a tracking number or provide your numeric tracking number." */
}
}

How to submit your data

The easiest way to test your POST request is to use cURL from the system's command line.

We recommend saving your JSON structure into a text file ( input-file.txt ) and then execute this command:

curl -siL -X POST -k --data "@input-file.txt" https://api.pactrak.com/ibcairbill/production?_test

This is a sample JSON structure ready for testing.

billdata={ "shipper":{"name":"Test Shipper Name", "company_name":"IBC", "phone":"305 597 5327", "address":"8401 NW 17th St", "city":"Miami", "state":"FL", "zip":"33126", "country":"US", "account":"8040" }, "consignee":{ "name":"Test Recipient", "company_name":"Test Co.", "phone":"718 526 5300", "address":"1465 Test Avenue", "city":"Test City", "state": "TX", "zip":"11644","country":"US" }, "shipment":{ "contents":"APX", "description":"Test Shipment", "pieces":"1", "packaging":"P", "weight":"1", "weight_qualifier":"lbs", "value":"10", "service":"ST", "bill_to":"P", "platinum_service":"", "insurance_amount":"", "dimensions":"", "dimensions_qualifier":"inch", "tracking":"" }}

After making a successful submission you should expect a return of one of the following JSON structures:

Response JSON structure

{
/**
* The HTTP response code
* @type Integer.
*/
"code": 200,

/**
* Response message relevant to the action requested.
* @type String.
*/
"message":"",

/**
* Detailed Response message relevant to the action requested.
* @type String.
*/
"developerMessage":"",

/**
* A link to the resource.
* @type String.
*/
"href":"https://api.pactrak.com/ibcaribill/",

/**
* The Tracking number assigned to the Airwaybill. Note: this item is not returned on test submissions.
* @type String.
*/
"trackingNumber":"123456789",

/**
* If you requested a ZPL Label, the response will include this parameter Base64 Encoded.
* @type String.
*/
"labelData":""
}

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.

Developer Resources

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.