API Documentation

Overview

PB Global offers a REST API to clients who wish integrate their systems with its Courier Services. The public facing API only responds to POST and lives at /api/v1. The API requires an access token to be supplied with each JSON request.

Services

The API currently allows integration to the following endpoints;

Export Courier RatesThis endpoint can be used to get the lastest courier export rates. Valid for 24 hours.
Courier Pickup BookingThis endpoint can be used to book a Courier Pickup by PB Global.

Authentication

Endpoints can be accessed by using a unique access token key. Access tokens are found in your Account page.

Export Courier Rates - POST /api/v1/exportRates

Creates a new price request. The request will return the pricing data for the parameters provided in JSON format.
The endpoint expects the following input;

tokenAPI Access Token
zoneToThe Destination Zone ID.
lengthThe Length of the Package in CM.
widthThe Width of the Package in CM.
heightThe Height of the Package in CM.
weightThe Weight of the Package in KG.

Export Courier Rates - POST Sample - JQUERY

var form = new FormData();
form.append("zoneTo", "1");
form.append("length", "20");
form.append("width", "20");
form.append("height", "30");
form.append("weight", "4");
form.append("token", "YOUR TOKEN");

var settings = {
  "async": true,
  "crossDomain": true,
  "url": "http://www.pbglobal.eu/api/v1/exportRates.php",
  "method": "POST",
  "headers": {
    "cache-control": "no-cache"   
  },
  "processData": false,
  "contentType": false,
  "mimeType": "multipart/form-data",
  "data": form
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

Export Courier Rates - Status Codes

StatusDescription
0Error Found. Check Error Codes.
1Request OK
-1Price Not Available

Export Courier Rates - Error Codes

StatusDescription
1Missing Token
2Missing Zone Id
3Missing Length
4Missing Width
5Missing Height
6Missing Weight
7Calculated Weight > 30kg per package
8Other Error

Courier Pickup Booking - POST /api/v1/courierPickup

Creates a new Courier Pickup request. The request available to selected clients only. Please contact info@pbglobal.eu for more information.