• Docs
  • Guides
  • API Status

Docs

API Endpoint

Base API URL: https://packagehub-api.visiblescm.com/v3.1/


Authentication

Description

Before sending your first packages using the PackageHub API, you will need to register for a free PackageHub account to receive an API token used for authentication.

Authentication and identification to the PackageHub API is done by providing a JWT token received in response of Account /Token with every request. Requests made without a proper JWT token will fail.

The PackageHub API provides two types of API Key: Test and Production. You can test all PackageHub API functionality using the Test token generated from your Test key in the Sandbox environment for free immediately after signing up. Test labels created in the Sandbox environment will not be billed to your account. If a label is mistakenly created in the Production environment, a cancel shipment request can be made to avoid accidental charges.


Account

POST /Account/Token

Description

Use this POST method to retrieve your account token, for use in the header as request authorization.

Request Parameters

param in Type Comments
apiKey* Body string 90a56104388c4b15b5773d
apiSecret* Body string iLNvrse+HOAjp3NM1cmJbOdfRi7X4fxxxxxxxxxxx
userName* Body string example@domain.com
password* Body string Password123
  • Request
  • Response
{
  "apiKey": "90a56104388c4b15b5773d",
  "apiSecret": "iLNvrse+HOAjp3NM1cmJbOdfRi7X4fxxxxxxxxxxx",
  "userName": "example@domain.com",
  "password": "Password123"
}
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6Ixxxxxxx.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiJCMEE4QUFBOEI4NzhFODM3OTQ4MEFBIiwiQXBwSWQiOiJBRDg3OTM5MC0zNjI0LTQ0N0MtQjY1OS1DMjY0NzVDRUNGOEYiLCJqdGkiOiI1N2Q5NDAyYi02OWIzLTQyZjQtYWE0Ni1lNDhlMzcyMTZiNjQiLCJzaWQiOiJmNTcwZTkzYi04ZjI3LTQxYmQtYjg1YS1lYTQyYjA0Njk1YTYiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJDb21wYW55QWRtaW4iLCJBY2NvdW50VHlwZSI6IjEiLCJWaXNpYmxlQWNjb3VudE51bWJlciI6IjA3ZGYxM2NiLTc3NjAtNGYzNi05MzdmLTlmNmViZGQ4MjVhZCIsIlRva2VuQWNjZXNzVHlwZSI6IjEiLCJJc1Rlc3QiOiJUcnVlIiwiU3ViUGxhbiI6IlBybyIsImV4cCI6MTU5OTc0MjkwMSwiaXNzIjoiaHR0cHM6Ly92aXNpYmxlLXNoaXBwaW5nLXFhLWFwaS5henVyZXdlYnNpdGVzLm5ldC8iLCJhdWQiOiJodHRwczovL3BvcnRhbC1xYS5wYWNrYWdlaHViLxxxxxxx.sc5kGisxEpZMSpuWAmEnCrH78RMue2ZCBqs7xxxxxxx"
}

Code Samples

  • cURL
  • Node.js
curl -X POST \
  https://packagehub-api.visiblescm.com/v3.1/Account/Token \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
  "apiKey": "90a56104388c4b15b5773d",
  "apiSecret": "iLNvrse+HOAjp3NM1cmJbOdfRi7X4fxxxxxxxxxxx",
  "userName": "example@domain.com",
  "password": "Password123"
}'
var http = require("https");

var options = {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Account/Token",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.write(
  JSON.stringify({
    apiKey: "90a56104388c4b15b5773d",
    apiSecret: "iLNvrse+HOAjp3NM1cmJbOdfRi7X4fxxxxxxxxxxx",
    userName: "example@domain.com",
    password: "Password123",
  })
);
req.end();

GET /Account/Postage/Balance

Description

To access information about your account and payment information, use this GET method. The response returns additional account settings such as AutoBuy settings, rate set, and account balance.

Note

Request object is empty because all required input parameters are provided in the authorization token in Header.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
  • Request
  • Response
{}
{
  "level": "Customer",
  "status": "Active",
  "name": "PackageHub Customer",
  "isAutoBuy": true,
  "autoBuyAmount": 100,
  "autoBuyThreshold": 50,
  "balance": 100,
  "currency": "USD",
  "creditCardPaymentAccountResponse": {
    "cardHolderName": "John Ships",
    "lastFour": "1111",
    "expirationMonth": "08",
    "expirationYear": "2026",
    "active": true,
    "default": true
  },
  "achPaymentAccountResponse": {
    "accountHolderName": "John Ships",
    "routingNumber": "123456789",
    "lastFour": "6789",
    "active": true,
    "default": false
  },
  "firstName": "John",
  "lastName": "Ships",
  "emailAddress": "example@domain.com",
  "subscriptionPlan": "Pro",
  "subscriptionPlanChangeDate": "2020-10-21T08:43:14.137",
  "createdDate": "2019-10-21T08:43:14.631"
}

Code Samples

  • cURL
  • Node.js
curl -X GET \
  https://packagehub-api.visiblescm.com/v3.1/Account/Postage/Balance \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <TOKEN>",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Account/Postage/Balance",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();

PUT /Account/Postage/Balance

Description

Use this PUT method to add funds to your shipping account. When this method is called, funds will be added to the account, using the payment method on file.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
transactionId* Header string 123456789
balance* Body number 100
  • Request
  • Response
{
  "balance": 100
}
{
  "parentAccountId": "674a65db-4318-430f-980c-0f408409b91c",
  "level": "Customer",
  "status": "Active",
  "name": "PackageHub Customer",
  "isAutoBuy": true,
  "autoBuyAmount": 100,
  "autoBuyThreshold": 50,
  "balance": 100,
  "currency": "USD",
  "users": [
    {
      "role": "AccountAdmin",
      "isEmailVerified": true,
      "firstName": "John",
      "lastName": "Ships",
      "userName": "f1f29503-639e-4c13-a40b-111110142f07",
      "email": "example@domain.com",
      "lastLoginDate": "2021-10-20T10:08:36.099Z",
      "passwordChangeDate": "2021-09-01TT00:00:00",
      "isActivated": true,
      "passwordChangeDueDate": "2022-01-01T00:00:00",
      "id": "31371645-256f-43dc-b295-e58dc1e80789",
      "createdDate": "2019-12-20T10:08:36.099Z"
    }
  ],
  "visibleAccountNumber": "8fedd4f3-f5d8-4a9d-b0c8-81bab9123456",
  "subscriptionPlan": "Pro",
  "subscriptionPlanChangeDate": "2020-08-07T17:01:43.137",
  "id": "4f9b2a7f-3b3e-4ad5-a76b-33c9c123456",
  "createdDate": "2019-12-20T10:08:36.099Z"
}

Code Samples

  • cURL
  • Node.js
curl -X PUT \
  https://packagehub-api.visiblescm.com/v3.1/Account/Postage/Balance \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'TransactionId: 721' \
  -H 'cache-control: no-cache' \
  -d '{
  "balance": 100
}'
var http = require("https");

var options = {
  method: "PUT",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <TOKEN>",
    TransactionId: "721",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Account/Postage/Balance",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.write(JSON.stringify({ balance: 100 }));
req.end();

PUT /Account/Postage/AutoBuy

Description

For accounts using a credit card to prepay for postage, use this PUT method to turn AutoBuy functionality on and off and to set recharge limits.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
isAutoBuy* Body boolean true/false
autoBuyAmount* Body number 100
autoBuyThreshold* Body number 50
  • Request
  • Response
{
  "isAutoBuy": true,
  "autoBuyAmount": 100,
  "autoBuyThreshold": 50
}
{
  "parentAccountId": "674a65db-4318-430f-980c-0f408409b91c",
  "level": "Customer",
  "status": "Active",
  "name": "PackageHub Customer",
  "isAutoBuy": true,
  "autoBuyAmount": 100,
  "autoBuyThreshold": 50,
  "balance": 100,
  "currency": "USD",
  "users": [
    {
      "role": "AccountAdmin",
      "isEmailVerified": true,
      "firstName": "John",
      "lastName": "Ships",
      "userName": "f1f29503-639e-4c13-a40b-111110142f07",
      "email": "example@domain.com",
      "lastLoginDate": "2021-10-20T10:08:36.099Z",
      "passwordChangeDate": "2021-09-01TT00:00:00",
      "isActivated": true,
      "passwordChangeDueDate": "2022-01-01T00:00:00",
      "id": "31371645-256f-43dc-b295-e58dc1e80789",
      "createdDate": "2019-12-20T10:08:36.099Z"
    }
  ],
  "visibleAccountNumber": "8fedd4f3-f5d8-4a9d-b0c8-81bab9123456",
  "subscriptionPlan": "Pro",
  "subscriptionPlanChangeDate": "2020-08-07T17:01:43.137",
  "id": "4f9b2a7f-3b3e-4ad5-a76b-33c9c123456",
  "createdDate": "2019-12-20T10:08:36.099Z"
}

Code Samples

  • cURL
  • Node.js
curl -X PUT \
  https://packagehub-api.visiblescm.com/v3.1/Account/Postage/AutoBuy \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
  "isAutoBuy": true,
  "autoBuyAmount": 100,
  "autoBuyThreshold": 50
}'
var http = require("https");

var options = {
  method: "PUT",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <TOKEN>",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Account/Postage/AutoBuy",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.write(
  JSON.stringify({
    isAutoBuy: true,
    autoBuyAmount: 100,
    autoBuyThreshold: 50,
  })
);
req.end();

GET /Account/Postage/BalanceHistory

Description

Use this GET method to retrieve the account balance history. The response will return each payment event and adjustment. Use the available parameters to filter your search.

Note

Request object is empty because all required input parameters are provided in the Query Param.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
pageToken Query Param string NULL for first request, for further pages use pageToken as returned in response of current request
startDate Query Param Date(yyyy-mm-dd) 2019-10-18T07:28:56.864Z
endDate Query Param Date(yyyy-mm-dd) 2019-10-18T07:28:56.864Z
  • Request
  • Response
{}
{
  "results": [
    {
      "originalAmount": -16.02,
      "accountId": "4f9b2a7f-3b3e-4ad5-a76b-33c9cbd5b2ea",
      "transactionId": "5bf2f241-5f77-411b-9d70-6c03df123456",
      "eventType": "OnLabelGenerate",
      "transactionType": "Debit",
      "transactionDate": "2020-05-29T10:44:33.632Z",
      "amount": 16.02,
      "balance": 23.221,
      "currency": "USD",
      "comments": "Charge Label",
      "PaymentTypeId": "PHv2",
      "id": "987654",
      "createdDate": "2020-05-29T10:44:33.632Z"
    }
  ],
  "nextPage": "eyJDdXJyZW50IjowLCJOZXh0IjoxfQ==",
  "previousPage": "eyJDdXJyZW50IjowLCJOZXh0Ijo12345",
  "pageSize": 20,
  "totalResults": 11,
  "totalPages": 2
}

Code Samples

  • cURL
  • Node.js
curl -X GET \
  https://packagehub-api.visiblescm.com/v3.1/Account/Postage/BalanceHistory?startDate=2019-09-01T18:29:59.999Z,2019-09-23T18%3A30%3A00.000Z&endDate=2019-09-25T18:29:59.999Z&pageToken=ewoiY3VycmVudFBhZ2UiOiAiMSIsCiJuZXh0UGFnZSI6ICIyIgp9 \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <TOKEN>",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Account/Postage/BalanceHistory?startDate=2019-09-01T18:29:59.999Z,2019-09-23T18%3A30%3A00.000Z&endDate=2019-09-25T18:29:59.999Z&pageToken=ewoiY3VycmVudFBhZ2UiOiAiMSIsCiJuZXh0UGFnZSI6ICIyIgp9",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();


User

POST /User/SignUp/Customer

Description

Use this POST method to register as a customer.

Request Parameters

param in Type Comments
email* Body string user@example.com
password* Body string Password123
companyName* Body string ABC Company
firstName* Body string John
lastName* Body string Ships
signupKey Body string 674a65db-4318-430f-980c-0f408409b91c
  • Request
  • Response
{
  "email": "user@example.com",
  "password": "Password123",
  "companyName": "ABC Company",
  "firstName": "John",
  "lastName": "Ships",
  "signupKey": "674a65db-4318-430f-980c-0f408409b91c"
}
{
  "user": {
    "account": {
      "parentAccount": {
        "level": "Partner",
        "status": "Active",
        "logo": "https://visibleshippingqastorage.blob.core.windows.net/user-dev-container/674a65db-4318-430f-980c-0f408409b91c/Logo9/7/2020%204:38:48%20AM.jpg",
        "name": "TESTINGINTEGRATOR",
        "isAutoBuy": false,
        "autoBuyAmount": 0,
        "autoBuyThreshold": 0,
        "balance": 0,
        "currency": "USD",
        "visibleAccountNumber": "2F436775-5288-4D20-AE8F-957BB94BC345",
        "subscriptionPlan": "Basic",
        "subscriptionPlanChangeDate": "2020-08-26T06:00:07.203",
        "id": "674a65db-4318-430f-980c-0f408409b91c",
        "createdDate": "2020-08-26T06:00:07.25"
      },
      "parentAccountId": "674a65db-4318-430f-980c-0f408409b91c",
      "level": "Customer",
      "status": "TnCPending",
      "name": "ABCjjj Company",
      "isAutoBuy": false,
      "autoBuyAmount": 0,
      "autoBuyThreshold": 0,
      "balance": 0,
      "currency": "USD",
      "users": [],
      "visibleAccountNumber": "97e5c789-0d54-41dd-a8a2-e5d3b83cb732",
      "subscriptionPlan": "Basic",
      "subscriptionPlanChangeDate": "2021-10-28T05:02:51.7134076Z",
      "id": "2e1345a7-a159-4b0b-aa28-d554cb626f71",
      "createdDate": "2021-10-28T05:02:53.1984492Z"
    },
    "role": "AccountAdmin",
    "isEmailVerified": false,
    "firstName": "John",
    "lastName": "Ships",
    "userName": "0e66a7fd-5fca-4720-a884-d460e310e5d2",
    "email": "user@example.com",
    "lastLoginDate": "2021-10-28T05:02:51.7233709Z",
    "passwordChangeDate": "2021-10-28T05:02:51.7233722Z",
    "isActivated": true,
    "passwordChangeDueDate": "2021-11-27T00:00:00Z",
    "id": "83ae244d-af72-4aa2-94f7-b74f4db5340b",
    "createdDate": "2021-10-28T05:02:53.1984492Z"
  },
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBcHBJZCI6IiIsImp0aSI6IjgzYWUyNDRkLWFmNzItNGFhMi05NGY3LWI3NGY0ZGI1MzQwYiIsInNpZCI6IjJlMTM0NWE3LWExNTktNGIwYi1hYTI4LWQ1NTRjYjYyNmY3MSIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6IjAiLCJUb2tlbkFjY2Vzc1R5cGUiOiIwIiwiSXNUZXN0IjoiRmFsc2UiLCJTdWJQbGFuIjoiMCIsImV4cCI6MTY0NDAzNzM3MywiaXNzIjoiaHR0cHM6Ly92aXNpYmxlLXNoaXBwaW5nLXFhLWFwaS5henVyZXdlYnNpdGVzLm5ldC8iLCJhdWQiOiJodHRwczovL3BvcnRhbC1xYS5wYWNrYWdlaHViLmNvbSJ9.xHmXCaehjjxeEoYmd43KtsxpYRGvDYtjmGgu38q6Vk4",
  "refreshToken": "GUiOZLsVY9pmw2eHHF+klz41lC2mAPnVPzqsAkjGCDM=",
  "apiKey": "2F436775-5288-4D20-AE8F-957BB94BC345",
  "account": {
    "parentAccount": {
      "level": "Partner",
      "status": "Active",
      "logo": "https://visibleshippingqastorage.blob.core.windows.net/user-dev-container/674a65db-4318-430f-980c-0f408409b91c/Logo9/7/2020%204:38:48%20AM.jpg",
      "name": "TESTINGINTEGRATOR",
      "isAutoBuy": false,
      "autoBuyAmount": 0,
      "autoBuyThreshold": 0,
      "balance": 0,
      "currency": "USD",
      "visibleAccountNumber": "2F436775-5288-4D20-AE8F-957BB94BC345",
      "subscriptionPlan": "Basic",
      "subscriptionPlanChangeDate": "2020-08-26T06:00:07.203",
      "id": "674a65db-4318-430f-980c-0f408409b91c",
      "createdDate": "2020-08-26T06:00:07.25"
    },
    "parentAccountId": "674a65db-4318-430f-980c-0f408409b91c",
    "level": "Customer",
    "status": "TnCPending",
    "name": "ABCjjj Company",
    "isAutoBuy": false,
    "autoBuyAmount": 0,
    "autoBuyThreshold": 0,
    "balance": 0,
    "currency": "USD",
    "users": [
      {
        "role": "AccountAdmin",
        "isEmailVerified": false,
        "firstName": "John",
        "lastName": "Ships",
        "userName": "0e66a7fd-5fca-4720-a884-d460e310e5d2",
        "email": "user@example.com",
        "lastLoginDate": "2021-10-28T05:02:51.7233709Z",
        "passwordChangeDate": "2021-10-28T05:02:51.7233722Z",
        "isActivated": true,
        "passwordChangeDueDate": "2021-11-27T00:00:00Z",
        "id": "83ae244d-af72-4aa2-94f7-b74f4db5340b",
        "createdDate": "2021-10-28T05:02:53.1984492Z"
      }
    ],
    "visibleAccountNumber": "97e5c789-0d54-41dd-a8a2-e5d3b83cb732",
    "subscriptionPlan": "Basic",
    "subscriptionPlanChangeDate": "2021-10-28T05:02:51.7134076Z",
    "id": "2e1345a7-a159-4b0b-aa28-d554cb626f71",
    "createdDate": "2021-10-28T05:02:53.1984492Z"
  },
  "apps": [
    {
      "id": "fc72dcc7-56ac-4cef-90fc-caaaadbfa00b",
      "accountId": "2e1345a7-a159-4b0b-aa28-d554cb626f71",
      "appId": "236bee22-d666-40fd-b2d1-f1dd9d6ac236",
      "partnerAccountId": "2e1345a7-a159-4b0b-aa28-d554cb626f71",
      "partnerName": "ABCjjj Company",
      "appName": "Default App",
      "appDescription": "The Default app is added on Signup",
      "apiVersion": "v3",
      "helpUrl": "https://docs.sandbox.packagehub.mec.maersk.com/userguide/",
      "dateCreated": "2021-10-28T05:02:51.7234997Z",
      "apiKey": "216deb79a019459098b1a9",
      "apiSecret": "aJESq4XvzWSDmyyzBrZBDlib4/APQXa28HAVeaQJS4o=",
      "testApiKey": "7eb30b44e706458b83d772",
      "testApiSecret": "SNHyn6Mz8s/GGcck8+MYXHbXKkTOWqxf9Hxoz7zz/fE=",
      "status": "Enabled"
    }
  ],
  "status": "TnCPending"
}

Code Samples

  • cURL
  • Node.js
curl -X POST \
  https://packagehub-api.visiblescm.com/v3.1/User/SignUp/Customer \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
  -d '{
  "email": "user@example.com",
  "password": "Password123",
  "companyName": "ABC Company",
  "firstName": "John",
  "lastName": "Ships",
  "signupKey": "674a65db-4318-430f-980c-0f408409b91c"
}'
var http = require("https");

var options = {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/User/SignUp/Customer",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.write(
  JSON.stringify({
    email: "user@example.com",
    password: "Password123",
    companyName: "ABC Company",
    firstName: "John",
    lastName: "Ships",
    signupKey: "674a65db-4318-430f-980c-0f408409b91c",
  })
);
req.end();

POST /User/ApproveTermsAndConditions

Description

Use this POST method to approve terms and conditions for the newly created account.

Request Parameters

param in Type Comments
accountId* Body string 674a65db-4318-430f-980c-0f408409b91c
  • Request
  • Response
{
  "accountId": "674a65db-4318-430f-980c-0f408409b91c"
}
{
  "accountId": "674a65db-4318-430f-980c-0f408409b91c",
  "result": "Activated"
}

Code Samples

  • cURL
  • Node.js
curl -X POST \
  https://packagehub-api.visiblescm.com/v3.1/User/ApproveTermsAndConditions \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
  "accountId": "674a65db-4318-430f-980c-0f408409b91c"
}'
var http = require("https");

var options = {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/User/TermsAndConditions",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.write(
  JSON.stringify({ accountId: "674a65db-4318-430f-980c-0f408409b91c" })
);
req.end();

Address

Address

Description

Address object contains all necessary information for generating an address.

Parameters

param in Type Comments
name* Body string John Ships
company Body string Maersk
street1* Body string 5160 W WILEY POST WAY
street2 Body string
street3 Body string
city* Body string SALT LAKE CITY
state Body string UT (Required for fromAddress and toAddress in request body of POST /Shipment and POST /ShipmentRate)
zip* Body string 84116-2833
country Body string US
phone Body string 8888888888
email Body string support.packagehub@maersk.com
save Body boolean Set true to save this address and get an Id in response
verify Body boolean Set true for address validation and auto-fill
source Body string Shipment
verificationStatus Body string true
isResidential Body boolean false
referenceType Body string Possible values are: TaxCode, VATNumber, and ImportExportCode
referenceValue Body string 123456
  • Object
{
  "name": "John Ships",
  "company": "Maersk",
  "street1": "5160 W WILEY POST WAY",
  "street2": "",
  "street3": "",
  "city": "SALT LAKE CTY",
  "state": "UT",
  "zip": "84116-2833",
  "country": "US",
  "phone": "8888888888",
  "email": "support.packagehub@maersk.com",
  "save": true,
  "verify": true,
  "source": "Shipment",
  "verificationStatus": "Success",
  "isResidential": false,
  "referenceType": "TaxCode",
  "referenceValue": "H123"
}

GET /Address/:id

Description

Use this GET method to find an existing address.

Note

Request object is empty because all required input parameters are provided in the Route Param.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
id* Route Param string aa5b3c5f-ebe1-468f-a099-92792ea042e7
  • Request
  • Response
{}
{
  "errors": [],
  "name": "John Ships",
  "company": "Maersk",
  "street1": "5160 W WILEY POST WAY",
  "street2": "",
  "street3": "",
  "city": "SALT LAKE CTY",
  "state": "UT",
  "zip": "84116-2833",
  "country": "US",
  "phone": "8888888888",
  "email": "support.packagehub@maersk.com",
  "save": true,
  "verify": true,
  "source": "Shipment",
  "verificationStatus": "Success",
  "isResidential": false,
  "referenceType": "TaxCode",
  "referenceValue": "H123",
  "id": "0bc5b3b5-7828-4994-8928-a38e9ce388aa",
  "createdDate": "2020-04-02T15:57:44.3116569"
}

Code Samples

  • cURL
  • Node.js
curl -X GET \
  https://packagehub-api.visiblescm.com/v3.1/Address/aa5b3c5f-ebe1-468f-a099-92792ea042e7 \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Address/aa5b3c5f-ebe1-468f-a099-92792ea042e7",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();

POST /Address

Description

Use this POST method to create an address. The id generated in address response can be used in ShipmentRate, Shipment and Manifest request address object.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
address* Body <Address> Either save, verify or both should be set to true
  • Request
  • Response
{
  "name": "John Ships",
  "company": "Maersk",
  "street1": "5160 W WILEY POST WAY",
  "street2": "",
  "street3": "",
  "city": "SALT LAKE CTY",
  "state": "UT",
  "zip": "84116-2833",
  "country": "US",
  "phone": "8888888888",
  "email": "support.packagehub@maersk.com",
  "save": true,
  "verify": true,
  "source": "Shipment",
  "verificationStatus": "Success",
  "isResidential": false,
  "referenceType": "TaxCode",
  "referenceValue": "H123"
}
{
  "errors": [],
  "name": "John Ships",
  "company": "Maersk",
  "street1": "5160 W WILEY POST WAY",
  "street2": "",
  "street3": "",
  "city": "SALT LAKE CTY",
  "state": "UT",
  "zip": "84116-2833",
  "country": "US",
  "phone": "8888888888",
  "email": "support.packagehub@maersk.com",
  "save": true,
  "verify": true,
  "source": "Shipment",
  "verificationStatus": "Success",
  "isResidential": false,
  "referenceType": "TaxCode",
  "referenceValue": "H123",
  "id": "91234b72-78ed-4a94-8448-0fef1b761455",
  "createdDate": "2021-10-28T08:16:32.8064353Z"
}

Code Samples

  • cURL
  • Node.js
curl -X POST \
  https://packagehub-api.visiblescm.com/v3.1/Address \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
  -d '{
    "name": "John Ships",
    "company": "Maersk",
    "street1": "5160 W WILEY POST WAY",
    "street2": "",
    "street3": "",
    "city": "SALT LAKE CTY",
    "state": "UT",
    "zip": "84116-2833",
    "country": "US",
    "phone": "8888888888",
    "email": "support.packagehub@maersk.com",
    "save": true,
    "verify": true,
    "source": "Shipment",
    "verificationStatus": "Success",
    "isResidential": false,
    "referenceType": "TaxCode",
    "referenceValue": "H123"
}'
var http = require("https");

var options = {
  method: "POST",
  headers: {
    Authorization: "Bearer <TOKEN>",
    "Content-Type": "application/json",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Address/",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);
req.write(
  JSON.stringify({
    name: "John Ships",
    company: "Maersk",
    street1: "5160 W WILEY POST WAY",
    street2: "",
    street3: "",
    city: "SALT LAKE CTY",
    state: "UT",
    zip: "84116-2833",
    country: "US",
    phone: "8888888888",
    email: "support.packagehub@maersk.com",
    save: true,
    verify: true,
    source: "Shipment",
    verificationStatus: "Success",
    isResidential: false,
    referenceType: "TaxCode",
    referenceValue: "H123",
  })
);

req.end();

POST /Address/:id/Validate

Description

Use this POST method to validate an existing address.

Note

Request object is empty because all required input parameters are provided in the Route Param.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
id* Route Param string aa5b3c5f-ebe1-468f-a099-92792ea042e7
  • Request
  • Response
{}
{
  "errors": [],
  "name": "John Ships",
  "company": "Maersk",
  "street1": "5160 W WILEY POST WAY",
  "street2": "",
  "street3": "",
  "city": "SALT LAKE CTY",
  "state": "UT",
  "zip": "84116-2833",
  "country": "US",
  "phone": "8888888888",
  "email": "support.packagehub@maersk.com",
  "save": true,
  "verify": true,
  "source": "Shipment",
  "verificationStatus": "Success",
  "isResidential": false,
  "referenceType": "TaxCode",
  "referenceValue": "H123",
  "id": "91234b72-78ed-4a94-8448-0fef1b761455",
  "createdDate": "2021-10-28T08:16:32.8064353"
}

Code Samples

  • cURL
  • Node.js
curl -X GET \
  https://packagehub-api.visiblescm.com/v3.1/Address/91234b72-78ed-4a94-8448-0fef1b761455/Validate \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "GET",
  headers: {
    Authorization: "Bearer <TOKEN>",
    "Content-Type": "application/json",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Address/91234b72-78ed-4a94-8448-0fef1b761455/Validate",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();

Carrier

GET /Carrier

Description

Use this GET method to retrieve a list of available carriers that can be configured on the account.

Note

Request object is empty because all required input parameters are provided in the authorization token in Header.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
  • Request
  • Response
{}
[
  {
    "id": "1967EA12-FF21-4EFF-BA32-047C36123456",
    "code": "USPS-ePostage",
    "name": "USPS ePostage",
    "description": "Postal solution for small and mid-sized shippers who drop off packages at retail, receive daily collection or schedule a package pickup, powered by Maersk.",
    "logo": "https://visibleshippingstorage.blob.core.windows.net/public-container/logo/USPS.svg",
    "createdDate": "2020-04-04T18:14:11.65"
  }
]

Code Samples

  • cURL
  • Node.js
curl -X GET \
  https://packagehub-api.visiblescm.com/v3.1/Carrier \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Carrier",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();

CarrierAccount

GET /CarrierAccount

Description

Use this GET method to retrieve a list of available carriers configured on the account.

Note

Request object is empty because all required input parameters are provided in the authorization token in Headers.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
  • Request
  • Response
{}
[
  {
    "id": "0fe85d6e-6aca-4dc6-930e-de970965f585",
    "carrierCode": "USPS-eVS",
    "name": "USPS eVS",
    "description": "Postal solution for large shippers that require a scheduled carrier pickup, powered by Maersk.",
    "configuration": {},
    "logo": "https://visibleshippingstorage.blob.core.windows.net/public-container/logo/USPS.svg",
    "status": "Enabled",
    "createdDate": "2020-06-01T10:06:18.4132765",
    "modifiedDate": "2020-06-01T10:06:18.4132765"
  }
]

Code Samples

  • cURL
  • Node.js
curl -X GET \
  https://packagehub-api.visiblescm.com/v3.1/CarrierAccount \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/CarrierAccount",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();

POST /CarrierAccount

Description

Use this POST method to configure a new carrier against the account.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
name* Body string USPS
carrierCode* Body string USPS-eVS
configuration* Body Object {}
description Body string Postal solution for large shippers that require a scheduled carrier pickup, powered by Maersk.
logo Body string https://visibleshippingstorage.blob.core.windows.net/public-container/logo/USPS.svg
status Body string Possible values are: Enabled and Disabled
  • Request
  • Response
{
  "name": "USPS",
  "description": "Postal solution for large shippers that require a scheduled carrier pickup, powered by Maersk.",
  "carrierCode": "USPS-eVS",
  "configuration": {
    "shipFromAddressId": "5a3d6676-6568-49a8-ab7f-b7e8b7dabc80"
  },
  "logo": "https://visibleshippingstorage.blob.core.windows.net/public-container/logo/USPS.svg",
  "status": "Enabled"
}
{
  "id": "b8cffe1f-2769-4607-a0a6-1b5200f185e1",
  "carrierCode": "USPS-eVS",
  "name": "USPS",
  "description": "Postal solution for large shippers that require a scheduled carrier pickup, powered by Maersk.",
  "configuration": {
    "ShipFromAddressId": "5a3d6676-6568-49a8-ab7f-b7e8b7dabc80"
  },
  "logo": "https://visibleshippingstorage.blob.core.windows.net/public-container/logo/USPS.svg",
  "status": "Enabled",
  "createdDate": "2021-10-28T08:53:23.3140162Z",
  "modifiedDate": "2021-10-28T08:53:23.3140162Z"
}

Code Samples

  • cURL
  • Node.js
curl -X POST \
  https://packagehub-api.visiblescm.com/v3.1/CarrierAccount \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'Authorization: Bearer <TOKEN>' \
  -d '{
    "name": "USPS",
    "description": "Postal solution for large shippers that require a scheduled carrier pickup, powered by Maersk.",
    "carrierCode": "USPS-eVS",
    "configuration": {
      "shipFromAddressId": "5a3d6676-6568-49a8-ab7f-b7e8b7dabc80"
    },
    "logo": "https://visibleshippingstorage.blob.core.windows.net/public-container/logo/USPS.svg",
    "status": "Enabled"
  }'
var http = require("https");

var options = {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "cache-control": "no-cache",
    Authorization: "Bearer <TOKEN>",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/CarrierAccount",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.write(
  JSON.stringify({
    name: "USPS",
    description:
      "Postal solution for large shippers that require a scheduled carrier pickup, powered by Maersk.",
    carrierCode: "USPS-eVS",
    configuration: {
      "shipFromAddressId": "5a3d6676-6568-49a8-ab7f-b7e8b7dabc80"
    },
    logo: "https://visibleshippingstorage.blob.core.windows.net/public-container/logo/USPS.svg",
    status: "Enabled",
  })
);

req.end();

PUT /CarrierAccount

Description

Use this PUT method to update an already configured carrier account.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
id* Body string b8cffe1f-2769-4607-a0a6-1b5200f185e1
name* Body string USPS
carrierCode* Body string USPS-eVS
configuration* Body Object {}
description Body string Postal solution for large shippers that require a scheduled carrier pickup, powered by Maersk.
logo Body string https://visibleshippingstorage.blob.core.windows.net/public-container/logo/USPS.svg
status Body string Possible values are: Enabled and Disabled
  • Request
  • Response
{
  "id": "b8cffe1f-2769-4607-a0a6-1b5200f185e1",
  "name": "USPS",
  "description": "Postal solution for large shippers that require a scheduled carrier pickup, powered by Maersk.",
  "carrierCode": "USPS-eVS",
  "configuration": {},
  "logo": "https://visibleshippingstorage.blob.core.windows.net/public-container/logo/USPS.svg",
  "status": "Enabled"
}
{
  "id": "b8cffe1f-2769-4607-a0a6-1b5200f185e1",
  "name": "USPS",
  "description": "Postal solution for large shippers that require a scheduled carrier pickup, powered by Maersk.",
  "carrierCode": "USPS-eVS",
  "configuration": {},
  "logo": "https://visibleshippingstorage.blob.core.windows.net/public-container/logo/USPS.svg",
  "status": "Enabled",
  "createdDate": "2021-10-28T08:53:23.3140162Z",
  "modifiedDate": "2021-10-28T08:53:23.3140162Z"
}

Code Samples

  • cURL
  • Node.js
curl -X PUT \
  https://packagehub-api.visiblescm.com/v3.1/CarrierAccount \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "id": "b8cffe1f-2769-4607-a0a6-1b5200f185e1",
    "name": "USPS",
    "description": "Postal solution for large shippers that require a scheduled carrier pickup, powered by Maersk.",
    "carrierCode": "USPS-eVS",
    "configuration": {},
    "logo": "https://visibleshippingstorage.blob.core.windows.net/public-container/logo/USPS.svg",
    "status": "Enabled"
  }'
var http = require("https");

var options = {
  method: "PUT",
  headers: {
    Authorization: "Bearer <TOKEN>",
    "Content-Type": "application/json",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/CarrierAccount",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.write(
  JSON.stringify({
    id: "b8cffe1f-2769-4607-a0a6-1b5200f185e1",
    name: "USPS",
    description:
      "Postal solution for large shippers that require a scheduled carrier pickup, powered by Maersk.",
    carrierCode: "USPS-eVS",
    configuration: {},
    logo: "https://visibleshippingstorage.blob.core.windows.net/public-container/logo/USPS.svg",
    status: "Enabled",
  })
);

req.end();

DELETE /CarrierAccount/:carrierAccountId

Description

Use this DELETE method to remove the configured carrier account.

Note

Request object is empty because all required input parameters are provided in the Route Param.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
carrierAccountId* Route Param string b8cffe1f-2769-4607-a0a6-1b5200f185e1
  • Request
  • Response
{}
true

Code Samples

  • cURL
  • Node.js
curl -X DELETE \
  https://packagehub-api.visiblescm.com/v3.1/CarrierAccount/b8cffe1f-2769-4607-a0a6-1b5200f185e1
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "DELETE",
  headers: {
    Authorization: "Bearer <TOKEN>",
    "Content-Type": "application/json",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/CarrierAccount/b8cffe1f-2769-4607-a0a6-1b5200f185e1",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();

GET /CarrierAccount/Service

Description

This GET method will provide a list of all available services for each carrier that are configured on the account.

Note

Request object is empty because all required input parameters are provided in the authorization token in Header.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
  • Request
  • Response
{}
{
  "USPS-eVS": [
    {
      "code": "PriorityMail",
      "name": "Priority Mail",
      "id": "BDBE3FA8-2D98-439B-B021-C70575FC44E3",
      "createdDate": "2019-03-18T10:40:24.4433333"
    }
  ]
}

Code Samples

  • cURL
  • Node.js
curl -X GET \
  https://packagehub-api.visiblescm.com/v3.1/CarrierAccount/Service \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <TOKEN>",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/CarrierAccount/Service",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();

GET /CarrierAccount/SpecialService

Description

Use this GET method to retrieve all the special services offered by the carrier that are configured on the account.

Note

Request object is empty because all required input parameters are provided in the authorization token in Header.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
  • Request
  • Response
{}
{
  "USPS-eVS": [
    {
      "code": "Insurance",
      "name": "Insurance",
      "id": "0904F324-E35E-47F6-B653-52EA81370B2D",
      "createdDate": "2019-05-18T11:46:26.2333333"
    }
  ]
}

Code Samples

  • cURL
  • Node.js
curl -X GET \
  https://packagehub-api.visiblescm.com/v3.1/CarrierAccount/SpecialService \
  -H 'Authorization: Bearer <TOKEN>'  \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "GET",
  headers: {
    Authorization: "Bearer <TOKEN>",
    "Content-Type": "application/json",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/CarrierAccount/SpecialService",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();

GET /CarrierAccount/PackageType

Description

Use this GET method to retrieve all the available package types for the carrier that are configured on the account.

Note

Request object is empty because all required input parameters are provided in the authorization token in Header.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
  • Request
  • Response
{}
{
  "USPS-eVS": [
    {
      "code": "SmallFlatRateBox",
      "name": "Small Flat Rate Box",
      "length": 5.375,
      "width": 8.625,
      "height": 1.625,
      "id": "5678D19F-EC07-4620-9EE1-D10565D0E793",
      "createdDate": "2019-04-22T15:17:42.6333333"
    }
  ]
}

Code Samples

  • cURL
  • Node.js
curl -X GET \
  https://packagehub-api.visiblescm.com/v3.1/CarrierAccount/PackageType \
  -H 'Authorization: Bearer <TOKEN>'  \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "GET",
  headers: {
    Authorization: "Bearer <TOKEN>",
    "Content-Type": "application/json",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/CarrierAccount/PackageType",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();

ShipmentRate

ShipmentRate is used to create the shipping rates with the provided shipment information. If no carrier or services are included in the request, rates for all carriers and services configured on the PackageHub shipping account will be included in the response.

POST /ShipmentRate

Description

Use this POST method to get shipping rates for the provided shipment information. If no carrier(s) or service type(s) are provided, rates for all carriers and/or service types configured for the PackageHub shipping account will be retrieved. It only returns error when not even a single rate is returned in rate[]. If any specific rate is not returned in rateshop then please rate with specific CarrierAccountId, Service and PackageType to find out error details.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
fromAddress* Body <Address> either address id or complete address detail can be passed in fromAddress object
toAddress* Body <Address> either address id or complete address detail can be passed in toAddress object
packages* Body <Package>
service Body string Possible values are: PriorityMail, PriorityMailExpress, ParcelSelect, ParcelSelectDE, GroundAdvantage, PriorityMailExpressIntl, PriorityMailIntl, GlobalExpressGuaranteed, FirstClassIntl, LibraryMail, MediaMail, BoundPrintedMatter, FirstClass, Ecommerce, Express12:00DOC, Express12:00, Express9:00DOC, Express9:00, ExpressWorldwide, GlobalMailBusiness, SecondDayAir, SecondDayAirAM, ThreeDaySelect, Ground, NextDayAir, NextDayAirSaver, StandardToCanada, StandardToMexico, WorldWideExpedited, WorldWideExpress, WorldWideExpressPlus, and WorldWideSaver
carrierAccountId Body string 000f4008-190b-419e-bd51-1048c3135a56
specialService Body string Possible values are: RestrictedDelivery, SundayDelivery, HolidayDelivery, CrematedRemains, LiveAnimals, HAZMAT, COD, RegisteredMail, Insurance, CertifiedMail, ElectronicReturnReceipt, AdultSignature, Tracking and SignatureConfirmation
customsInfo Body <CustomsInfo>
specialServiceParam Body <SpecialService>
  • Request
  • Response
{
  "fromAddress": {
    "id": "0bc5b3b5-7828-4994-8928-a38e9ce388aa"
  },
  "toAddress": {
    "name": "Jane Ships",
    "company": "Maersk",
    "street1": "5160 Wiley Post Way",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84116",
    "country": "US",
    "phone": "4151234567",
    "verify": false
  },
  "packages": [
    {
      "packageType": "Parcel",
      "isRectangle": true,
      "length": 35,
      "width": 10,
      "height": 10,
      "dimensionUnit": "in",
      "weight": 5,
      "weightUnit": "lb"
    }
  ],
  "carrierAccountId": "000f4008-190b-419e-bd51-1048c3135a56",
  "specialService": ["SundayDelivery"],
  "customsInfo": {
    "customsItem": [
      {
        "weightUnit": "oz",
        "description": "Custom Description is Here",
        "quantity": 1,
        "weight": 5,
        "value": 2.2,
        "hsTariffNumber": "123456",
        "originCountry": "US"
      }
    ],
    "contentType": "DOCUMENTS",
    "nonDeliveryOption": "RETURN"
  }
}
{
  "rates": [
    {
      "carrierAccountName": "USPS",
      "carrierCode": "USPS-eVS",
      "carrierAccountId": "000f4008-190b-419e-bd51-1048c3135a56",
      "finalService": "PriorityMailExpress",
      "totalFee": 104.5000,
      "fees": [
        {
          "packageNumber": 1,
          "type": "Base",
          "fee": 62.0000,
          "ratingType": "DimensionalWeightAndZone"
        },
        {
          "packageNumber": 1,
          "type": "SundayDelivery",
          "fee": 12.50
        },
        {
          "packageNumber": 1,
          "type": "NonStandardCubicFeet",
          "fee": 15.0
        },
        {
          "packageNumber": 1,
          "type": "NonStandardDimension",
          "fee": 15.0
        }
      ],
      "currency": "USD",
      "deliveryDays": 1,
      "deliveryDate": "2022-03-23T00:00:00Z",
      "deliveryDateGuaranteed": false,
      "zone": "1",
      "createdDate": "0001-01-01T00:00:00"
    }
  ]
}

Code Samples

  • cURL
  • Node.js
curl -X POST \
  https://packagehub-api.visiblescm.com/v3.1/ShipmentRate \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: 2428' \
  -H 'Content-Type: application/json' \
  -H 'Host: packagehub-api.visiblescm.com' \
  -H 'User-Agent: Mozilla/5.0' \
  -H 'cache-control: no-cache' \
  -d '{
  "fromAddress": {
    "id": "0bc5b3b5-7828-4994-8928-a38e9ce388aa"
  },
  "toAddress": {
    "name": "Jane Ships",
    "company": "Maersk",
    "street1": "5160 Wiley Post Way",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84116",
    "country": "US",
    "phone": "4151234567",
    "verify": false
  },
  "packages": [
    {
      "packageType": "Parcel",
      "isRectangle": true,
      "length": 5,
      "width": 3,
      "height": 2,
      "dimensionUnit": "cm",
      "weight": 5,
      "weightUnit": "lb"
    }
  ],
  "carrierAccountId": "000f4008-190b-419e-bd51-1048c3135a56",
  "specialService": ["RestrictedDelivery"],
  "customsInfo": {
    "customsItem": [
      {
        "weightUnit": "oz",
        "description": "Custom Description is Here",
        "quantity": 1,
        "weight": 5,
        "value": 2.2,
        "hsTariffNumber": "123456",
        "originCountry": "US"
      }
    ],
    "contentType": "DOCUMENTS",
    "nonDeliveryOption": "RETURN"
  }
}'
var http = require("https");

var options = {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <TOKEN>",
    "User-Agent": "Mozilla/5.0",
    Accept: "*/*",
    "Cache-Control": "no-cache",
    Host: "packagehub-api.visiblescm.com",
    "Accept-Encoding": "gzip, deflate",
    "Content-Length": "2428",
    Connection: "keep-alive",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/ShipmentRate",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.write(
  JSON.stringify({
    fromAddress: {
      id: "0bc5b3b5-7828-4994-8928-a38e9ce388aa",
    },
    toAddress: {
      name: "Jane Ships",
      company: "Maersk",
      street1: "5160 Wiley Post Way",
      street2: "",
      city: "Salt Lake City",
      state: "UT",
      zip: "84116",
      country: "US",
      phone: "4151234567",
      verify: false,
    },
    packages: [
      {
        packageType: "Parcel",
        isRectangle: true,
        length: 5,
        width: 3,
        height: 2,
        dimensionUnit: "cm",
        weight: 5,
        weightUnit: "lb",
      },
    ],
    carrierAccountId: "000f4008-190b-419e-bd51-1048c3135a56",
    specialService: ["RestrictedDelivery"],
    customsInfo: {
      customsItem: [
        {
          weightUnit: "oz",
          description: "Custom Description is Here",
          quantity: 1,
          weight: 5,
          value: 2.2,
          hsTariffNumber: "123456",
          originCountry: "US",
        },
      ],
      contentType: "DOCUMENTS",
      nonDeliveryOption: "RETURN",
    },
  })
);
req.end();

Shipment

The shipment is central to the PackageHub API. A shipment consists of a to and from address, at least a single package, a carrier, and service type. This information is used to generate a shipping label.

GET /Shipment

Description

Use this GET method to retrieve an individual shipment or a list of shipments that have been created. Use parameters to filter values to find the shipment(s) you need to view.

Note

Request object is empty because all required input parameters are provided in the Query Param.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
key Query Param string Possible values are: Id, ShipmentId, TransactionId and TrackingNumber
value Query Param string e77e7eb7-6062-4e6d-b1ab-fafb58a611cd
packageNumber Query Param number 1
pageToken Query Param string NULL for first request, for further pages use pageToken as returned in response of current request
startDate Query Param Date(yyyy-mm-dd) 2019-10-18
endDate Query Param Date(yyyy-mm-dd) 2019-10-18
client Query Param string Possible values are: Indicium
  • Request
  • Response
{}
{
  "id": "e77e7eb7-6062-4e6d-b1ab-fafb58a611cd",
  "accountId": "4f9b2a7f-3b3e-4ad5-a76b-33c9cbd5b2ea",
  "appId": "ecca4f2c-e00e-4465-b768-ae74748454a8",
  "fromAddress": {
    "name": "Jane Ships",
    "company": "Maersk",
    "street1": "5160 Wiley Post Way",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84116",
    "country": "US",
    "phone": "4151234567",
    "save": true,
    "verify": false,
    "source": "Shipment",
    "verificationStatus": "Success",
    "isResidential": false,
    "id": "1f4d7fd9-59ea-41fb-a8f5-7b792abae05e"
  },
  "toAddress": {
    "name": "John Ships",
    "company": "Maersk",
    "street1": "1545 s 4800 w",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84104",
    "country": "US",
    "phone": "5708208072",
    "save": true,
    "verify": false,
    "source": "Shipment",
    "verificationStatus": "Success",
    "isResidential": false,
    "id": "ecef95ac-56f6-4971-9a6e-701fc88261db"
  },
  "packages": [
    {
      "id": "1a715e0c-f75f-4073-b431-9b1eebf83e61",
      "packageNumber": 1,
      "packageType": "Parcel",
      "isRectangle": true,
      "length": 12.0,
      "width": 12.0,
      "height": 12.0,
      "dimensionUnit": "in",
      "weight": 1.0,
      "weightUnit": "lb",
      "finalPackageType": "Parcel",
      "finalWeightUnit": "lb",
      "finalDimensionUnit": "in",
      "finalWeight": 1.0,
      "finalVolume": 1728.0,
      "oversized": false
    }
  ],
  "rates": [
    {
      "carrierAccountName": "USPS eVS",
      "carrierCode": "USPS-eVS",
      "carrierAccountId": "0fe85d6e-6aca-4dc6-930e-de970965f585",
      "finalService": "PriorityMail",
      "totalFee": 7.16,
      "fees": [
        {
          "packageNumber": 1,
          "type": "Base",
          "fee": 7.16,
          "ratingType": "WeightAndZone"
        }
      ],
      "currency": "USD",
      "deliveryDays": 2,
      "deliveryDate": "2021-10-30T00:00:00",
      "deliveryDateGuaranteed": true,
      "zone": "2",
      "id": "4ac779f2-9a88-4f7d-b9f1-b2d2f0765f6d",
      "createdDate": "2021-10-28T11:32:09.1001743"
    }
  ],
  "postageLabel": {
    "labels": [
      "https://visibleshippingqastorage.blob.core.windows.net/label-dev-container/Label-20f73d5f-9cb9-4176-981f-01a8232c278e.png"
    ],
    "labelFileType": "PNG",
    "labelSize": "4x6",
    "labelOrientation": "Portrait",
    "labelType": "Url"
  },
  "forms": [],
  "tracking": {
    "trackingBarcodeNumber": "420063719205590242327000948078",
    "trackingNumber": "9205590242327000948078",
    "status": "PreTransit",
    "subStatus": "LabelGenerated",
    "trackingUrl": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9205590242327000948078"
  },
  "specialService": [],
  "carrierAccountName": "USPS eVS",
  "carrierCode": "USPS-eVS",
  "carrierAccountId": "0fe85d6e-6aca-4dc6-930e-de970965f585",
  "service": "PriorityMail",
  "shipDate": "2021-10-28T11:32:07.4447094",
  "createdDate": "2021-10-28T11:32:08.8176678",
  "transactionId": "3Y2erws85ekhXStXQ3Kyd53duP",
  "billTo": {
    "type": "Sender"
  }
}

Code Samples

  • cURL
  • Node.js
curl -X GET \
   https://packagehub-api.visiblescm.com/v3.1/Shipment?key=Id&value=e77e7eb7-6062-4e6d-b1ab-fafb58a611cd&packageNumber=1&pageToken=ewoiY3VycmVudFBhZ2UiOiAiMSIsCiJuZXh0UGFnZSI6ICIyIgp9&startDate=2019-10-18T07:28:56.864Z&endDate=2019-10-18T07:28:56.864Z \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <TOKEN>",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Shipment?key=Id&value=e77e7eb7-6062-4e6d-b1ab-fafb58a611cd&packageNumber=1&pageToken=ewoiY3VycmVudFBhZ2UiOiAiMSIsCiJuZXh0UGFnZSI6ICIyIgp9&startDate=2019-10-18T07:28:56.864Z&endDate=2019-10-18T07:28:56.864Z",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();

POST /Shipment

Description

Use this POST method to create a new shipment. A label will be generated in the response with the defined format requested.

In case of shipping to/from same address, its preferrable to use address id instead of complete address object, however its not mandatory.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
transactionId* Header string 123456789, unique for each transaction
fromAddress* Body <Address> either address id or complete address detail can be passed in fromAddress object
toAddress* Body <Address> either address id or complete address detail can be passed in toAddress object
packages* Body <Package>
service* Body string Possible values are: PriorityMail, PriorityMailExpress, ParcelSelect, ParcelSelectDE, GroundAdvantage, PriorityMailExpressIntl, PriorityMailIntl, GlobalExpressGuaranteed, FirstClassIntl, LibraryMail, MediaMail, BoundPrintedMatter, FirstClass, Ecommerce, Express12:00DOC, Express12:00, Express9:00DOC, Express9:00, ExpressWorldwide, GlobalMailBusiness, SecondDayAir, SecondDayAirAM, ThreeDaySelect, Ground, NextDayAir, NextDayAirSaver, StandardToCanada, StandardToMexico, WorldWideExpedited, WorldWideExpress, WorldWideExpressPlus, and WorldWideSaver
carrierAccountId* Body string 000f4008-190b-419e-bd51-1048c3135a56
customsInfo* Body <CustomsInfo> Required in case of International Shipment Request
altReturnAddress Body <Address> either address id or complete address detail can be passed in altReturnAddress object
postageLabel Body <PostageLabel>
shipDate Body Date(yyyy-mm-dd) 2021-10-18
specialService Body string Possible values are: RestrictedDelivery, SundayDelivery, HolidayDelivery, CrematedRemains, LiveAnimals, HAZMAT, COD, RegisteredMail, Insurance, CertifiedMail, ElectronicReturnReceipt, Returns, AdultSignature, Tracking and SignatureConfirmation
specialServiceParam Body <SpecialServiceParam>
option Body <Option>
  • Request
  • Response
{
  "toAddress": {
    "name": "John Ships",
    "company": "Maersk",
    "street1": "1545 s 4800 w",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84104",
    "country": "US",
    "phone": "5708208072",
    "verify": false
  },
  "fromAddress": {
    "name": "Jane Ships",
    "company": "Maersk",
    "street1": "5160 Wiley Post Way",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84116",
    "country": "US",
    "phone": "4151234567",
    "verify": false
  },
  "altReturnAddress": {
    "name": "Jane Ships",
    "company": "Maersk",
    "street1": "5160 Wiley Post Way",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84116",
    "country": "US",
    "phone": "4151234567",
    "verify": false
  },
  "packages": [
    {
      "packageType": "Parcel",
      "length": 35,
      "width": 10,
      "height": 10,
      "weight": 1
    }
  ],
  "service": "PriorityMail",
  "carrierAccountId": "0fe85d6e-6aca-4dc6-930e-de970965f585",
  "postageLabel": {
    "labelFileType": "PNG",
    "labelType": "Url"
  }
}
{
  "id": "28ffe2ea-968c-402a-9675-52ace710a602",
  "accountId": "4f9b2a7f-3b3e-4ad5-a76b-33c9cbd5b2ea",
  "appId": "ecca4f2c-e00e-4465-b768-ae74748454a8",
  "fromAddress": {
    "name": "John Ships",
    "company": "Maersk",
    "street1": "1545 s 4800 w",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84104",
    "country": "US",
    "phone": "5708208072",
    "save": true,
    "verify": false,
    "source": "Shipment",
    "verificationStatus": "Success",
    "isResidential": false,
    "id": "1f4d7fd9-59ea-41fb-a8f5-7b792abae05e",
    "createdDate": "2021-10-28T11:32:07.453127Z"
  },
  "toAddress": {
    "name": "John Ships",
    "company": "Maersk",
    "street1": "1545 s 4800 w",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84104",
    "country": "US",
    "phone": "5708208072",
    "save": true,
    "verify": false,
    "source": "Shipment",
    "verificationStatus": "Success",
    "isResidential": false,
    "id": "1f4d7fd9-59ea-41fb-a8f5-7b792abae05e",
    "createdDate": "2021-10-28T11:32:07.453127Z"
  },
  "altReturnAddress": {
    "name": "John Ships",
    "company": "Maersk",
    "street1": "1545 s 4800 w",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84104",
    "country": "US",
    "phone": "5708208072",
    "save": true,
    "verify": false,
    "source": "Shipment",
    "verificationStatus": "Success",
    "isResidential": false,
    "id": "a7e7a8fb-3d31-4ded-ad18-40468d88d1a3",
    "createdDate": "2021-10-28T11:32:07.4948065Z"
  },
  "packages": [
    {
      "id": "07e7adab-49c6-4728-818b-fd5ea98d4855",
      "packageNumber": 1,
      "packageType": "Parcel",
      "isRectangle": true,
      "length": 35.0,
      "width": 10.0,
      "height": 10.0,
      "dimensionUnit": "in",
      "weight": 1.0,
      "weightUnit": "lb",
      "finalPackageType": "Parcel",
      "finalWeightUnit": "lb",
      "finalDimensionUnit": "in",
      "finalWeight": 22.0,
      "finalVolume": 3500.0,
      "oversized": false
    }
  ],
  "rates": [
    {
      "carrierAccountName": "USPS eVS",
      "carrierCode": "USPS-eVS",
      "carrierAccountId": "0fe85d6e-6aca-4dc6-930e-de970965f585",
      "finalService": "PriorityMail",
      "totalFee": 47.3900,
      "fees": [
        {
          "packageNumber": 1,
          "type": "Base",
          "fee": 17.3900,
          "ratingType": "DimensionalWeightAndZone"
        },
        {
          "packageNumber": 1,
          "type": "NonStandardCubicFeet",
          "fee": 15.0
        },
        {
          "packageNumber": 1,
          "type": "NonStandardDimension",
          "fee": 15.0
        }
      ],
      "currency": "USD",
      "deliveryDays": 2,
      "deliveryDate": "2021-10-30T00:00:00",
      "deliveryDateGuaranteed": true,
      "zone": "2",
      "id": "41fffdf4-d0cd-4632-b2c8-db304ae16b95",
      "createdDate": "0001-01-01T00:00:00"
    }
  ],
  "postageLabel": {
    "labels": [
        "https://visibleshippingqastorage.blob.core.windows.net/label-dev-container/Label-2f87e5ab-65b7-4dd5-969c-c8c0ce8cbdd9.png"
    ],
    "labelFileType": "PNG",
    "labelSize": "4x6",
    "labelOrientation": "Portrait",
    "labelType": "Url"
  },
  "forms": [],
  "tracking": {
    "trackingBarcodeNumber": "420063719205590242327000948122",
    "trackingNumber": "9205590242327000948122",
    "status": "PreTransit",
    "subStatus": "LabelGenerated",
    "trackingUrl": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9205590242327000948122"
  },
  "specialService": [],
  "specialServiceParam": {},
  "carrierAccountName": "USPS eVS",
  "carrierCode": "USPS-eVS",
  "carrierAccountId": "0fe85d6e-6aca-4dc6-930e-de970965f585",
  "service": "PriorityMail",
  "shipDate": "2021-10-28T11:48:10.3618025Z",
  "createdDate": "2021-10-28T11:48:11.5143818Z",
  "transactionId": "3zcTRcnMjLxuPiUR7C6Gy1Bvi6rsj",
  "billTo": {
    "type": "Sender"
  },
  "errors": [],
  "warnings": []
}

Code Samples

  • cURL
  • Node.js
curl -X POST \
  https://packagehub-api.visiblescm.com/v3.1/shipment \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'TransactionId: 243' \
  -H 'cache-control: no-cache' \
  -d '{
  "toAddress": {
    "name": "John Ships",
    "company": "Maersk",
    "street1": "1545 s 4800 w",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84104",
    "country": "US",
    "phone": "5708208072",
    "verify": false
  },
  "fromAddress": {
    "name": "Jane Ships",
    "company": "Maersk",
    "street1": "5160 Wiley Post Way",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84116",
    "country": "US",
    "phone": "4151234567",
    "verify": false
  },
  "altReturnAddress": {
    "name": "Jane Ships",
    "company": "Maersk",
    "street1": "5160 Wiley Post Way",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84116",
    "country": "US",
    "phone": "4151234567",
    "verify": false
  },
    "packages": [
        {
            "packageType": "Parcel",
            "length": 12,
            "width": 12,
            "height": 12,
            "weight": 1
        }
    ],
    "service": "PriorityMail",
    "carrierAccountId": "0fe85d6e-6aca-4dc6-930e-de970965f585",
    "postageLabel": {
        "labelFileType": "PNG",
        "labelType": "Url"
    }
}'
var http = require("https");

var options = {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    TransactionId: "910",
    Authorization: "Bearer <TOKEN>",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/shipment",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.write(
  JSON.stringify({
    toAddress: {
      name: "John Ships",
      company: "Maersk",
      street1: "1545 s 4800 w",
      street2: "",
      city: "Salt Lake City",
      state: "UT",
      zip: "84104",
      country: "US",
      phone: "5708208072",
      verify: false,
    },
    fromAddress: {
      name: "Jane Ships",
      company: "Maersk",
      street1: "5160 Wiley Post Way",
      street2: "",
      city: "Salt Lake City",
      state: "UT",
      zip: "84116",
      country: "US",
      phone: "4151234567",
      verify: false,
    },
    altReturnAddress: {
      name: "Jane Ships",
      company: "Maersk",
      street1: "5160 Wiley Post Way",
      street2: "",
      city: "Salt Lake City",
      state: "UT",
      zip: "84116",
      country: "US",
      phone: "4151234567",
      verify: false,
    },
    packages: [
      {
        packageType: "Parcel",
        length: 12,
        width: 12,
        height: 12,
        weight: 1,
      },
    ],
    service: "PriorityMail",
    carrierAccountId: "0fe85d6e-6aca-4dc6-930e-de970965f585",
    postageLabel: {
      labelFileType: "PNG",
      labelType: "Url",
    },
  })
);
req.end();

POST /Shipment/Refund

Description

POST to this method to request a refund for a shipment. Processing time for label refunds are dependent on the carrier and may take up to 2-4 weeks to process.

Refund Status

Status Description
Initiated Refund initiated but request is not yet processed.
Approved Refund approved by carrier but refund amount has not been processed yet.
Rejected Refund rejected by carrier.
Refunded Refund approved and refund amount has been processed.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
transactionId* Header string 12345665, unique for each transaction
key* Body string Possible values are: Id, ShipmentId, and TrackingNumber
value* Body string fe09ea71-7329-4757-afe5-f7a7cf057e3e
  • Request
  • Response
{
  "key": "ShipmentId",
  "value": "fe09ea71-7329-4757-afe5-f7a7cf057e3e"
}
{
  "id": "fe09ea71-7329-4757-afe5-f7a7cf057e3e",
  "accountId": "4f9b2a7f-3b3e-4ad5-a76b-33c9cbd5b2ea",
  "appId": "ecca4f2c-e00e-4465-b768-ae74748454a8",
  "fromAddress": {
    "name": "John Ships",
    "company": "Maersk",
    "street1": "1545 s 4800 w",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84104",
    "country": "US",
    "phone": "5708208072",
    "save": true,
    "verify": false,
    "source": "Shipment",
    "verificationStatus": "Success",
    "isResidential": false,
    "id": "1f4d7fd9-59ea-41fb-a8f5-7b792abae05e",
    "createdDate": "2021-10-28T11:32:07.453127Z"
  },
  "toAddress": {
    "name": "Jane Ships",
    "company": "Maersk",
    "street1": "5160 Wiley Post Way",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84116",
    "country": "US",
    "phone": "4151234567",
    "save": true,
    "verify": false,
    "source": "Shipment",
    "verificationStatus": "Success",
    "isResidential": false,
    "id": "ecef95ac-56f6-4971-9a6e-701fc88261db",
    "createdDate": "2021-10-28T11:32:07.4766718Z"
  },
  "altReturnAddress": {
    "name": "John Ships",
    "company": "Maersk",
    "street1": "1545 s 4800 w",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84104",
    "country": "US",
    "phone": "5708208072",
    "save": true,
    "verify": false,
    "source": "Shipment",
    "verificationStatus": "Success",
    "isResidential": false,
    "id": "a7e7a8fb-3d31-4ded-ad18-40468d88d1a3",
    "createdDate": "2021-10-28T11:32:07.4948065Z"
  },
  "packages": [
    {
      "id": "907d0666-b8be-4905-80df-37bc3de15e2f",
      "packageNumber": 1,
      "packageType": "Parcel",
      "isRectangle": true,
      "length": 12.0,
      "width": 12.0,
      "height": 12.0,
      "dimensionUnit": "in",
      "weight": 1.0,
      "weightUnit": "lb",
      "finalPackageType": "Parcel",
      "finalWeightUnit": "lb",
      "finalDimensionUnit": "in",
      "finalWeight": 1.0,
      "finalVolume": 1728.0,
      "oversized": false
    }
  ],
  "rates": [
    {
      "carrierAccountName": "USPS eVS",
      "carrierCode": "USPS-eVS",
      "carrierAccountId": "0fe85d6e-6aca-4dc6-930e-de970965f585",
      "finalService": "PriorityMail",
      "totalFee": 7.16,
      "fees": [
        {
          "packageNumber": 1,
          "type": "Base",
          "fee": 7.16,
          "ratingType": "WeightAndZone"
        }
      ],
      "currency": "USD",
      "deliveryDays": 2,
      "deliveryDate": "2021-10-30T00:00:00",
      "deliveryDateGuaranteed": true,
      "zone": "2",
      "id": "627a5655-a43a-4a56-bd76-853c44b0d312",
      "createdDate": "2021-10-28T17:23:31.9991757"
    }
  ],
  "postageLabel": {
    "labels": [
      "https://visibleshippingqastorage.blob.core.windows.net/label-dev-container/Label-1266e580-9ca1-49f0-84e9-f906bfa1b34a.png"
    ],
    "labelFileType": "PNG",
    "labelSize": "4x6",
    "labelOrientation": "Portrait",
    "labelType": "Url"
  },
  "forms": [],
  "tracking": {
    "trackingBarcodeNumber": "420063719205590242327000948856",
    "trackingNumber": "9205590242327000948856",
    "status": "PreTransit",
    "subStatus": "LabelGenerated",
    "trackingUrl": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9205590242327000948856"
  },
  "specialService": [],
  "refundStatus": "Refunded",
  "carrierAccountName": "USPS eVS",
  "carrierCode": "USPS-eVS",
  "carrierAccountId": "0fe85d6e-6aca-4dc6-930e-de970965f585",
  "service": "PriorityMail",
  "shipDate": "2021-10-28T17:23:30.5676265",
  "createdDate": "2021-10-28T17:23:31.8572514",
  "transactionId": "1YTxYJyw8wnS5FoW6W4wRZqocuzdYRma",
  "billTo": {
    "type": "Sender"
  },
  "option": {
    "USPS_RefundDisputeId" : "106435"
  },
  "errors": [],
  "warnings": []
}

Code Samples

  • cURL
  • Node.js
curl -X POST \
  https://packagehub-api.visiblescm.com/v3.1/Shipment/Refund \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'TransactionId: 35345' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: 41' \
  -H 'Content-Type: application/json' \
  -H 'Host: packagehub-api.visiblescm.com' \
  -H 'User-Agent: Mozilla/5.0' \
  -H 'cache-control: no-cache' \
  -d '{
  "key": "ShipmentId",
  "value": "fe09ea71-7329-4757-afe5-f7a7cf057e3e"
}'
var http = require("https");

var options = {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <TOKEN>",
    TransactionId: "35345",
    "User-Agent": "Mozilla/5.0",
    Accept: "*/*",
    "Cache-Control": "no-cache",
    Host: "packagehub-api.visiblescm.com",
    "Accept-Encoding": "gzip, deflate",
    "Content-Length": "41",
    Connection: "keep-alive",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Shipment/Refund",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.write(
  JSON.stringify({
    key: "ShipmentId",
    value: "fe09ea71-7329-4757-afe5-f7a7cf057e3e",
  })
);
req.end();

GET /Shipment/:id/Label

Description

Use this GET method to print a label for an existing shipment. Warehouses are complicated spaces and oftentimes labels will get lost or damaged. Utilize this API call to print a label in such situations.

Note

Request object is empty because all required input parameters are provided in the Route and Query Param.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
id* Route Param string fe09ea71-7329-4757-afe5-f7a7cf057e3e
packageNumber Query Param number 1
  • Request
  • Response
{}
{
  "labelFileType": "PNG",
  "labelSize": "4x6",
  "labelOrientation": "Portrait",
  "labels": [
    "https://visibleshippingqastorage.blob.core.windows.net/label-dev-container/Label-1266e580-9ca1-49f0-84e9-f906bfa1b34a.png"
  ],
  "labelType": "Url"
}

Code Samples

  • cURL
  • Node.js
curl -X GET \
  https://packagehub-api.visiblescm.com/v3.1/Shipment/{id}/Label \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Host: packagehub-api.visiblescm.com' \
  -H 'User-Agent: Mozilla/5.0' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <TOKEN>",
    "User-Agent": "Mozilla/5.0",
    Accept: "*/*",
    "Cache-Control": "no-cache",
    Host: "packagehub-api.visiblescm.com",
    "Accept-Encoding": "gzip, deflate",
    Connection: "keep-alive",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Shipment/{id}/Label",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();

Manifest

The Manifest, also referred to as SCAN Form or end-of-day form, alerts the carrier(s) to shipments entering their network and provides couriers with a way to accept packages in bulk.

POST /Manifest

Description

Use this POST method to create a Manifest for shipments to notify carrier(s) of the packages that will be put in their network.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
fromAddress* Body <Address> either address id or complete address detail can be passed in fromAddress object
carrierAccountId* Body string 0fe85d6e-6aca-4dc6-930e-de970965f585
key* Body string Possible values are: ShipmentId, TrackingNumber, and TransactionId
value* Body string[] [Array of shipmentIds]
shipDate Body Date(yyyy-mm-dd) 2021-10-30
  • Request
  • Response
{
  "fromAddress": {
    "id": "6bc099e7-53b9-4051-bc14-354cd924018a"
  },
  "carrierAccountId": "0fe85d6e-6aca-4dc6-930e-de970965f585",
  "key": "ShipmentId",
  "value": ["ef01bffa-f0b7-47b2-9eed-56a01b786dfd"],
}
{
  "id": "f179a731-fd01-4997-986c-c494c71106e8",
  "appId": "ecca4f2c-e00e-4465-b768-ae74748454a8",
  "shipmentIds": ["ef01bffa-f0b7-47b2-9eed-56a01b786dfd"],
  "trackingNumbers": [],
  "transactionIds": [],
  "carrierAccountName": "USPS eVS",
  "carrierCode": "USPS-eVS",
  "carrierAccountId": "0fe85d6e-6aca-4dc6-930e-de970965f585",
  "fromAddress": {
    "name": "John Ships",
    "company": "Maersk",
    "street1": "1545 s 4800 w",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84104",
    "country": "US",
    "phone": "5708208072",
    "save": true,
    "verify": false,
    "source": "Manifest",
    "verificationStatus": "Success",
    "isResidential": false,
    "id": "6bc099e7-53b9-4051-bc14-354cd924018a"
  },
  "transactionDate": "2023-02-23T10:13:09.5553896Z",
  "shipDate": "2023-02-23T10:13:08.4895412Z",
  "messages": [
    {
      "code": "MANIFEST_QUEUED",
      "description": "Manifest is currently queued"
    }
  ]
}

Code Samples

  • cURL
  • Node.js
curl -X POST \
  https://packagehub-api.visiblescm.com/v3.1/Manifest \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "fromAddress": {
        "id": "6bc099e7-53b9-4051-bc14-354cd924018a"
    },
    "carrierAccountId": "0fe85d6e-6aca-4dc6-930e-de970965f585",
    "key": "ShipmentId",
    "value": [
        "ef01bffa-f0b7-47b2-9eed-56a01b786dfd"
    ]
}'
var http = require("https");
var options = {
 "method": "POST",
 "headers": {
  "Content-Type": "application/json",
  "Authorization": "Bearer <TOKEN>",
  "cache-control": "no-cache",
 }
};

var req = http.request('https://packagehub-api.visiblescm.com/v3.1/Manifest', options, function (res) {
 var chunks = [];

 res.on("data", funcion (chunk) {
  chunks.push(chunk);
 });

 res.on("end", function () {
  var body = Buffer.concat(chunks);
  console.log(body.toString());
 });
});

req.write(JSON.stringify({
    fromAddress: {
        id: "6bc099e7-53b9-4051-bc14-354cd924018a"
    },
    carrierAccountId: "0fe85d6e-6aca-4dc6-930e-de970965f585",
    key: "ShipmentId",
    value: [
        "ef01bffa-f0b7-47b2-9eed-56a01b786dfd"
    ]
}));
req.end();

GET /Manifest

Description

Use this GET method to retrieve a Manifest you have submitted. You may also request a list of some or all of the Manifests that have been submitted.

Note

Request object is empty because all required input parameters are provided in the Query Param.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
key* Query Param string Id
value* Query Param string 000f4008-190b-419e-bd51-1048c3135a56
pageToken Query Param string NULL for first request, for further pages use pageToken as returned in response of current request
startDate Query Param Date(yyyy-mm-dd) 2021-10-18
endDate Query Param Date(yyyy-mm-dd) 2021-10-18
  • Request
  • Response
{}
{
  "id": "f179a731-fd01-4997-986c-c494c71106e8",
  "appId": "ecca4f2c-e00e-4465-b768-ae74748454a8",
  "shipmentIds": ["ef01bffa-f0b7-47b2-9eed-56a01b786dfd"],
  "trackingNumbers": [],
  "transactionIds": [],
  "carrierAccountName": "USPS eVS",
  "carrierCode": "USPS-eVS",
  "carrierAccountId": "0fe85d6e-6aca-4dc6-930e-de970965f585",
  "fromAddress": {
    "errors": [],
    "name": "John Ships",
    "company": "Maersk",
    "street1": "1545 s 4800 w",
    "street2": "",
    "city": "Salt Lake City",
    "state": "UT",
    "zip": "84104",
    "country": "US",
    "phone": "5708208072",
    "save": true,
    "verify": false,
    "source": "Manifest",
    "verificationStatus": "Success",
    "isResidential": false,
    "id": "6bc099e7-53b9-4051-bc14-354cd924018a",
    "createdDate": "2023-02-16T08:00:31.6825002"
  },
  "transactionDate": "2023-02-23T10:13:09.5553896Z",
  "shipDate": "2023-02-23T10:13:08.4895412Z",
  "formNumber": "9275090242324301415203",
  "formUrl": "https://visibleshippingqastorage.blob.core.windows.net/manifest-dev-container/Manifest-b3f048f8-1fe8-4a4b-bad8-9d4ff5b20769.pdf",
  "messages": [
    {
      "code": "MANIFEST_GENERATED",
      "description": "Scanform generated for all 1 shipment(s)"
    }
  ]
}

Code Samples

  • cURL
  • Node.js
curl -X GET \
   https://packagehub-api.visiblescm.com/v3.1/Manifest?Key=Id&Value=f179a731-fd01-4997-986c-c494c71106e8&pageToken=ewoiY3VycmVudFBhZ2UiOiAiMSIsCiJuZXh0UGFnZSI6ICIyIgp9&startDate=2019-10-18T07:28:56.864Z&endDate=2019-10-18T07:28:56.864Z \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <TOKEN>",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Manifest?Key=Id&Value=f179a731-fd01-4997-986c-c494c71106e8&pageToken=ewoiY3VycmVudFBhZ2UiOiAiMSIsCiJuZXh0UGFnZSI6ICIyIgp9&startDate=2019-10-18T07:28:56.864Z&endDate=2019-10-18T07:28:56.864Z",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();

Tracking

Tracking is used to retrieve shipment tracking information. The trackingNumber is generated after a successful shipment is created. The status is updated as the package moves from the origin to destination. The carrier provides the PackageHub API with updated tracking status data as package statuses and destinations change.

Different Tracking Status

Status Description Possible Sub Status
PreTransit Label has been printed but carrier has not yet picked up the package Label generated, Shipping info sent to carrier, Ready for pickup
InTransit Package is traveling to its destination Origin scan, Departure scan, Arrival, Destination scan, Damaged, Pickup scan, Received by local post office, Transferred to local post office, Import scan, Export scan, Carrier changed delivery, Arrived at carrier facility, Departed carrier facility
Delayed Package has been delayed but still in transit Pickup delayed, Weather delay, Bad delivery address
OutForDelivery Package has reached the delivery area and is in process of being delivered Delivery attempted
DeliveryFailed Delivery of the package has failed and it will either be discarded or start moving to original shipper Refused, Cannot deliver to POBox, Undeliverable, Returning, Returned
Delivered Package has been delivered Delivered, Delivered to agent
Cancelled Shipment has been cancelled by the shipper Sender stopped, Void info received
Other Less common or exception statuses Unknown, Pending, Failure, Lost package, Hold for future delivery, Pickup at carrier facility

GET /Tracking

Description

Use this GET method to retrieve a specific shipment tracking detail via ShipmentId or TrackingNumber

Note

Request object is empty because all required input parameters are provided in the Query Param.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
key* Query Param string Possible values are: Id, ShipmentId, and TrackingNumber
value* Query Param string 9200190242327032670326
  • Request
  • Response
{}
{
  "trackingBarcodeNumber": "420026599200190242327032670326",
  "trackingNumber": "9200190242327032670326",
  "status": "PreTransit",
  "subStatus": "Pre- Shipment Info Sent to USPS, USPS Awaiting Item",
  "trackingUrl": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9200190242327032670326",
  "trackingDetails": [
    {
      "city": "Albertmouth",
      "state": "Vermont",
      "zip": "76773-2896",
      "dateTime": "2021-10-28T00:00:00",
      "status": "PreTransit",
      "subStatus": "Pre- Shipment Info Sent to USPS, USPS Awaiting Item",
      "country": "US"
    }
  ]

Code Samples

  • cURL
  • Node.js
curl -X GET \
  https://packagehub-api.visiblescm.com/v3.1/Tracking?Key={Id/ShipmentId/TrackingNumber/TransactionId}&Value={String} \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Host: packagehub-api.visiblescm.com' \
  -H 'User-Agent: Mozilla/5.0' \
  -H 'cache-control: no-cache'
var http = require("https");

var options = {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <TOKEN>",
    "User-Agent": "Mozilla/5.0",
    Accept: "*/*",
    Host: "packagehub-api.visiblescm.com",
    "Accept-Encoding": "gzip, deflate",
    Connection: "keep-alive",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Tracking?Key={Id/ShipmentId/TrackingNumber/TransactionId}&Value={String}",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.end();

Document

POST /Document/USPS/99M

Description

Use this endpoint to print labels with 99M barcode. Labels can be generated either from USPS or using our blazing fast Native solution. You can also use the tracking number of a shipment to get a 99M label for that shipment.

Request Parameters

param in Type Comments
authorization* Header string <Account /Token>
fromAddress* Body <Address> complete address detail need to be passed in fromAddress object
Required when source is Native
toAddress* Body <Address> complete address detail need to be passed in toAddress object
Full address Required when source is Native. Only Zip is required when source is USPS and not using trackingNumber
contentCode* Body string Required when source is Native
type* Body string Possible values are: ContainerLabel
service Body string Possible values are: ParcelSelectDE. Defaults to ParcelSelectDE
carrierAccountId* Body string Either tracking number or carrierAccountId must be used
entryFacilityType* Body string Possible values are: DNDC, DSCF, DDU, DHUB
Required when not using trackingNumber
source Body string Possible values are: USPS, Native. Defaults to USPS
containerSortType Body string Possible values are: Pallet, Sack, TruckBedload. Defaults to Pallet
processingCategory Body string Possible values are: Machinable, NonMachinable, Mixed.
Defaults to Machinable
trackingNumber* Body string Either tracking number or carrierAccountId must be used
containerTopology Body string Possible values are: Nested. Defaults to Nested
pages Body integer Number of container labels to print. All labels are returned in one PDF file. Defaults to 1.

USPS Request & Response Samples

  • Request
  • Response
{
    "toAddress": {
        "zip": "07097"
    },
    "Type": "ContainerLabel",
    "carrierAccountId": "{{USPS-Ship-CarrierAccountId}}",
    "Pages": "2",
    "Source": "USPS",
    "EntryFacilityType": "DSCF"
}
{
    "id": "1632a90d-73a2-4220-b2c7-30d5ac463e38",
    "carrierAccountId": "5e45a934-667b-415b-80f6-4775aae824c0",
    "fromAddress": {
        "name": "Jack Bauer",
        "company": "JB Tech",
        "street1": "186 Cannongate III Road",
        "street2": "",
        "street3": "",
        "city": "Nashua",
        "state": "NH",
        "zip": "03063",
        "country": "US",
        "phone": "8967364543",
        "email": "jbtech@mailinator.com",
        "save": false,
        "verify": false,
        "source": "Contact",
        "verificationStatus": "Success",
        "isResidential": false,
        "id": "0576d65a-cd16-404d-9940-93598cadd2ce"
    },
    "toAddress": {
        "street2": "",
        "street3": "",
        "zip": "07097",
        "country": "US",
        "phone": "",
        "save": false,
        "verify": false,
        "source": "Document",
        "verificationStatus": "Success",
        "isResidential": false,
        "id": "94ee400e-bf3d-4fa8-8feb-59670c121bf6"
    },
    "type": "ContainerLabel",
    "entryFacilityType": "DSCF",
    "source": "USPS",
    "containerSortType": "Pallet",
    "processingCategory": "Machinable",
    "containerTopology": "Nested",
    "service": "ParcelSelectDE",
    "pages": 2,
    "url": "http://127.0.0.1:10000/devstoreaccount1/document-dev-container/ContainerLabel-9013b706-234b-47ef-85dd-d7cb5398b789.pdf",
    "warnings": [],
}

Native Request & Response Samples

  • Request
  • Response
{
    "toAddress": {
        "name": "NDC",
        "city": "New Jersey",
        "state": "NJ",
        "zip": "07097"
    },
    "fromAddress": {
        "name": "Maersk",
        "city": "Inwood",
        "state": "NY",
        "zip":  "11096"
    },
    "contentCode": "PSVC MACH NDC",
    "type": "ContainerLabel",
    "carrierAccountId": "000f4008-190b-419e-bd51-1048c3135a56",
    "entryFacilityType": "DNDC",
    "source": "Native",
    "pages": 1
}
{
  {
    "id": "c6c29574-cbc6-4b4d-bb06-e8b2bdff516f",
    "carrierAccountId": "000f4008-190b-419e-bd51-1048c3135a56",
    "fromAddress": {
        "name": "Maersk",
        "street2": "",
        "street3": "",
        "city": "Inwood",
        "state": "NY",
        "zip": "11096",
        "country": "US",
        "phone": "",
        "save": false,
        "verify": false,
        "source": "Document",
        "verificationStatus": "Success",
        "isResidential": false,
        "id": "2d82a604-841f-4433-932e-d3d61fb88470"
    },
    "toAddress": {
        "name": "NDC",
        "street2": "",
        "street3": "",
        "city": "New Jersey",
        "state": "NJ",
        "zip": "07097",
        "country": "US",
        "phone": "",
        "save": false,
        "verify": false,
        "source": "Document",
        "verificationStatus": "Success",
        "isResidential": false,
        "id": "ae7c7451-5ba5-4836-94d0-57be69c09551"
    },
    "type": "ContainerLabel",
    "contentCode": "PSVC MACH NDC",
    "entryFacilityType": "DNDC",
    "source": "Native",
    "pages": 1,
    "url": "https://visibleshippingqastorage.blob.core.windows.net/document-dev-container/ContainerLabel-39b0d848-ddc8-4190-87b1-e6e114f42b21.pdf",
    "warnings": [],
}

Code Samples

  • cURL
  • Node.js
curl -X POST \
  https://packagehub-api.visiblescm.com/v3.1/Document/USPS/99M \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "toAddress": {
        "name": "NDC",
        "city": "New Jersey",
        "state": "NJ",
        "zip": "07097"
    },
    "fromAddress": {
        "name": "Maersk",
        "city": "Inwood",
        "state": "NY",
        "zip": "11096",
    },
    "contentCode": "PSVC MACH NDC",
    "type": "ContainerLabel",
    "entryFacilityType": "DNDC",
    "carrierAccountId": "000f4008-190b-419e-bd51-1048c3135a56",
    "pages": 1
}'
var http = require("https");

var options = {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <TOKEN>",
    "cache-control": "no-cache",
  },
};

var req = http.request(
  "https://packagehub-api.visiblescm.com/v3.1/Document/USPS/99M",
  options,
  function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
      chunks.push(chunk);
    });

    res.on("end", function () {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
    });
  }
);

req.write(
  JSON.stringify({
    toAddress: {
        name: "NDC",
        city: "New Jersey",
        state: "NJ",
        zip: "07097"
    },
    fromAddress: {
        name: "Maersk",
        city: "Inwood",
        state: "NY",
        zip: "11096",
    },
    contentCode: "PSVC MACH NDC",
    type: "ContainerLabel",
    "entryFacilityType": "DNDC",
    carrierAccountId: "000f4008-190b-419e-bd51-1048c3135a56",
    pages: 1
  })
);
req.end();

Errors

Description

When a client or the server encounters an error, a subsequent response will be returned with information on why the call was not successful, which will enable you to identify fixes quickly and easily.

An easy-to-understand JSON message will be returned with a standard 4xx or 5xx code and with an accompanying body description explaining the issue.

Every response will contain a header X-Correlation-ID which correlates HTTP requests between your client and our server.

Response Body

attribute type specification
StatusCode HttpStatusCode Http status code denoting the cause of failure
TimeStamp String Date and time at the moment of failure
Source String Indicates the subsystem or external provider where actual error is generated
Method String Http method used to send request
Url String Request URL where failure occurred
Errors Array of Error objects Breakdown of the failure

Error Object

attribute type specification
Code String Machine readable description of the failure
Message String Human readable description of the failure
AdditionalInfo Object It contains error code and message as returned by external providers when name of provider is not PHv3

Error Codes

Error Codes mapping with HttpsStatusCodes
HttpStatusCode Package Hub Error Code
400 (Bad Request) [Module.[SubModule]].BAD_REQUEST
401 (Unauthorized) [Module.[SubModule]].AUTHENTICATION_FAILED
403 (Forbidden) [Module.[SubModule]].NOT_AUTHORIZED
404 (Not Found) [Module.[SubModule]].NOT_FOUND
422 (Unprocessable Entity) [Module.[SubModule]].VALIDATION_FAILED
[Module.[SubModule]].NOT_SUPPORTED
[Module.[SubModule]].NOT_ACTIVE
[Module.[SubModule]].PAYMENT_FAILED
500 (Internal Server Error) INTERNAL_SERVER_ERROR
503 (Service Unavailable) [Module].OPERATION_FAILED
Error Codes with some example description(s)
Package Hub Error Code Example description(s)
ACCOUNT.NOT_ACTIVE
  • You must approve the Terms and Conditions before using this account
  • This account has been closed
ACCOUNT.NOT_FOUND
  • Provided account id doesn't exist
ACCOUNT.PAYMENT_FAILED
  • Failed to {Debit/Credit} ${amount} from customer's CreditCard/ACH
ACCOUNT.VALIDATION_FAILED
  • Start date must be less than end date
  • Message is required
  • Account can only be closed when there are no active customer associated to your account
  • Account creation failed due to insufficient MID(s). Contact Support
  • Account Creation Failed. Contact Support
  • The Terms & Conditions have already been accepted for this account
  • Please add your support email in company profile section
  • AccountType is not supported
  • Provided email address already exist
  • Incorrect credentials
  • Account already exists either for the provided email or company name
ACCOUNT.APP.AUTHENTICATION_FAILED
  • Server failed to authenticate the request. Make sure the value of the Authorization header is formed correctly
  • Invalid Api key or Api Secret
  • Token is not valid
ACCOUNT.APP.VALIDATION_FAILED
  • Test token not supported for carrier {Carrier}. It is supported only for USPS-eVS and USPS-ePostage carriers
ACCOUNT.BALANCE.VALIDATION_FAILED
  • Insufficient Fund
  • {Amount} must be greater than or equals to $1
ACCOUNT.PARENT.NOT_FOUND
  • Either ParentAccountId or PartnerAppId is empty or invalid
  • PartnerAppId is either empty, invalid or is not associated with parent
ACCOUNT.PARENT.VALIDATION_FAILED
  • You can register more apps only via your current partner {Partner}. Please contact customer support for more info
ADDRESS.VALIDATION_FAILED
  • Either save, verify or both should be set to true
  • Country Code {CountryCode} is not valid
  • Requested address is invalid
CARRIER.AUTHENTICATION_FAILED
  • Incorrect {Property1} or {Property2}. Please contact customer support for more info.
CARRIER.NOT_ACTIVE
  • {Carrier} is temporarily disabled by admin for all users
CARRIER.NOT_SUPPORTED
  • Provided carrier {Carrier} is not supported
CARRIERACCOUNT.NOT_ACTIVE
  • Provided CarrierAccount {CarrierAccount} is in requested status and waiting for approval
  • Provided CarrierAccount {CarrierAccount} has been disabled by the admin. Please contact support
CARRIERACCOUNT.NOT_FOUND
  • No CarrierAccount exists for the provided CarrierAccountId
  • No carrier accounts are associated with your app
  • Requested resource doesn't exist
  • The value of {carrierCode} is not valid
CARRIERACCOUNT.VALIDATION_FAILED
  • Invalid AppID
  • Carrier account already exist for the provided name
CARRIERACCOUNT.STATUS.NOT_SUPPORTED
  • CarrierAccount status EnabledWithoutWatermark is supported only in QA environment with live token for native carriers (USPS-eVS-Native, USPS-ePostage-Native, FedEx-Native and UPS-Native).
CARRIERACCOUNT.CONFIG.NOT_AUTHORIZED
  • Only Admin can create or alter the following configuration - USPSeVSWebtoolId, USPSeVSWebtoolPassword, USPSeVSWebtoolMID, USPSMailOwnerMID, USPSeVSMID, USPSMailOwnerMailerID
DOCUMENT.CARRIER.NOT_ACTIVE
  • {Carrier} is temporarily disabled by admin for all users
DOCUMENT.CARRIER.NOT_SUPPORTED
  • Provided carrier {Carrier} is not supported
DOCUMENT.CARRIER.VALIDATION_FAILED
  • Only USPSeVS, USPSShip carrier(s) support(s) printing Document
DOCUMENT.CARRIERACCOUNT.NOT_ACTIVE
  • Provided CarrierAccount {CarrierAccount} is in requested status and waiting for approval
  • Provided CarrierAccount {CarrierAccount} has been disabled by the admin. Please contact support
DOCUMENT.CARRIERACCOUNT.NOT_FOUND
  • No CarrierAccount exists for the provided CarrierAccountId
  • No carrier accounts are associated with your app
  • Requested resource doesn't exist
  • The value of {carrierCode} is not valid
DOCUMENT.TRACKINGNUMBER.NOT_FOUND
  • Tracking number not found
MANIFEST.NOT_FOUND
  • Requested Id doesn't exist
MANIFEST.NOT_SUPPORTED
  • Manifest is not supported for carrier {Carrier}
MANIFEST.VALIDATION_FAILED
  • Start date must be less than end date
  • {Key} with {Value} is not supported
  • Shipment(s) with invalid ship date should be removed from manifest request: {transaction_id}
PACKAGETYPE.NOT_ACTIVE
  • {packageType} is temporarily disabled by admin for all users
  • {Carrier} is temporarily disabled by admin for all users
PACKAGETYPE.NOT_FOUND
  • Requested resource doesn't exist
PACKAGETYPE.NOT_SUPPORTED
  • Package not found for carrier
  • {Carrier} does not support packagetype {packageType}
PACKAGETYPE.VALIDATION_FAILED
  • Dimension is required
  • Maximum weight should be {MaxWeight} lbs for {service}
  • Maximum Length+Grith should be {lengthPlusGirth} Inch for {service}
SERVICE.NOT_ACTIVE
  • {Service} is temporarily disabled by admin for all users
SERVICE.NOT_SUPPORTED
  • {Service} not supported by {Carrier}
SHIPMENT.BAD_REQUEST
  • {Module}: The {Module} field is required
SHIPMENT.NOT_FOUND
  • Shipment not found
  • OrderNotFound
SHIPMENT.OPERATION_FAILED
  • {Carrier} API system error, please retry after some time
SHIPMENT.VALIDATION_FAILED
  • Transaction Id already exists
  • Return label is only supported for domestic shipment
  • Customs Info and Customs Item are required
  • ShipDate must be set to today or a future day time
SHIPMENT.LABEL.VALIDATION_FAILED
  • The element 'eVSPriorityMailIntlRequest' has invalid child element 'Agreement'. List of possible elements expected: 'ContentType'
  • CustomText1 and CustomText2 are not allowed for International shipments
SHIPMENT.REFUND.NOT_SUPPORTED
  • Refund is not supported for carrier {Carrier}
SHIPMENT.REFUND.VALIDATION_FAILED
  • Refund not allowed as manifest has been already generated for this shipment
  • You have already initiated refund for this shipment
  • You cannot request a refund after 30 days of creating shipment
SHIPMENT.SPECIALSERVICEPARAM.VALIDATION_FAILED
  • To use {SpecialService} SpecialService, specialServiceParam.{Param} must be provided
SHIPMENT.TRACKING.NOT_SUPPORTED
  • Tracking is not supported for carrier {Carrier}
SHIPMENT.OPTION.ATTRIBUTE_IGNORED
  • {Attribute} was ignored, as it is not supported for {Selcted Service}
SHIPMENTRATE.NOT_FOUND
  • Cannot retrieve data
  • Could not find rates for requested shipment
SHIPMENTRATE.VALIDATION_FAILED
  • Customs Info and Customs Item are required
  • {package} and {service} is not supported for {country} by {carrierType}
  • The combination of Service and Package Type is not supported for the provided carrier
SHIPMENTRATE.SPECIALSERVICEPARAM.VALIDATION_FAILED
  • To use {SpecialService} SpecialService, specialServiceParam.{Param} must be provided
SPECIALSERVICE.NOT_SUPPORTED
  • Carrier {Carrier} does not support special service(s) {SpecialService1, SpecialService2, ...}
SPECIALSERVICE.VALIDATION_FAILED
  • Invalid selection of special services
USER.NOT_FOUND
  • Provided email address doesn't exist
USER.VALIDATION_FAILED
  • Provided email address already exist, try signing in
  • Incorrect credentials
  • Security code expired
  • Please provide your username instead of email

Warnings

Description

Warnings in the response contain information on which an action may be required.

An easy-to-understand JSON message is included for more details, for example, if a property is being deprecated or being ignored for a request

Warning Object

attribute type specification
Code String Machine readable description of the warning
Message String Human readable description of the warning
AdditionalInfo Object It contains warning code and message as returned by external providers when name of provider is not PHv3

Warning Codes

Warning Codes mapping with HttpsStatusCodes
HttpStatusCode Package Hub Error Code
200 (OK) [Module.[SubModule]].ATTRIBUTE_IGNORED
[Module.[SubModule]].MODIFIED
Warning Codes with some example description(s)
Package Hub Warning Code Example description(s)
SHIPMENT.ATTRIBUTE_IGNORED
  • {Attribute} was ignored, as it is not supported for carrier {Carrier}
SHIPMENT.TRACKING.ATTRIBUTE_IGNORED
  • Additional tracking number was ignored, as it is only supported for carrier USPS-eVS-Native with services PriorityMail and GroundAdvantage
SHIPMENT.OPTION.ATTRIBUTE_IGNORED
  • {Attribute} was ignored, as it is not supported for carrier {Carrier}
SHIPMENT.SPECIALSERVICEPARAM.ATTRIBUTE_IGNORED
  • {Attribute} was ignored, as it is not supported for special service {SpecialService}
ADDRESS.MODIFIED
  • FromAddress: Since company and last name both were missing, the first name is used as the company name as per USPS-Ship requirements.

Extras

BillTo

Description

Use BillTo object to bill the correct account for the shipment. This object is optional and it works for DHL, UPS and FedEx only.

Parameters

param in Type Comments
type Body string Supported values are: Sender, Recipient, ThirdParty. Defaults to Sender.
account Body string Setting account number. Required for Recipient and ThirdParty.
zip Body string Setting zip code that the account is based in. Only applicable to UPS. Required for Recipient and ThirdParty.
countryCode Body string Setting country code that the account is based in. Only applicable to UPS. Required for ThirdParty.
  • Object
{
  "type": "Recipient",
  "account": "168974560",
  "zip": "87226",
  "countryCode": "US"  
}

CustomsInfo

Description

CustomsInfo objects contain CustomsItem objects and all necessary information for the generation of customs form required for international shipments.

Parameters

param in Type Comments
customsItem Body <CustomsItem>
id Body string
contentType Body string Possible values are: Documents, Gift, Merchandise, Returned Goods, Sample, Other, Humanitarian, and Dangerous Goods
contentsExplanation Body string
customsCertify Body boolean
customsSigner Body string
currency Body string
nonDeliveryOption Body string Possible values are: Return and Abandon
restrictionType Body string Possible values are: Quarantine, Sanitary Inspection, Phytosanitary Inspection, and Other
restrictionComments Body string
eelpfc Body string Possible values are: NOEEI3037a, NOEEI3036, NOEEI3037h, NOEEI3037y, and AES_ITN
aesitn Body string
importersContact Body string
importersReference Body string
exportersContact Body string
exportersReference Body string
certificateNumber Body string
invoiceNumber Body string
licenseNumber Body string
  • Object
{
  "customsItem": [
    {
      "weightUnit": "oz",
      "customsInfoId": "string",
      "description": "string",
      "quantity": 0,
      "weight": 0,
      "value": 0,
      "hsTariffNumber": "string",
      "originCountry": "string",
      "itemCode": "string",
      "id": "string",
      "packageNumber": 0,
      "createdDate": "2020-10-08T19:32:18.764Z",
      "itemCategory": "string",
      "itemSubcategory": "string"
    }
  ],
  "id": "string",
  "contentType": "Documents",
  "contentsExplanation": "string",
  "customsCertify": true,
  "customsSigner": "string",
  "currency": "string",
  "nonDeliveryOption": "Return",
  "restrictionType": "Quarantine",
  "restrictionComments": "string",
  "eelpfc": "NOEEI3037a",
  "aesitn": "string",
  "importersContact": "string",
  "importersReference": "string",
  "exportersContact": "string",
  "exportersReference": "string",
  "certificateNumber": "string",
  "invoiceNumber": "string",
  "licenseNumber": "string"
}

CustomsItem

Description

CustomsItem object describes goods for international shipment and should be included in a CustomsInfo object.

Parameters

param in Type Comments
weightUnit Body string Possible values are: oz, lb, g, and kg
customsInfoId Body string
description Body string
quantity Body number
weight Body number
value Body number
hsTariffNumber Body string Required when shipping to EU, Norway and Switzerland
originCountry Body string
itemCode Body string
id Body string
packageNumber Body number
createdDate Body string
itemCategory Body string
itemSubcategory Body string
  • Object
{
  "weightUnit": "oz",
  "customsInfoId": "string",
  "description": "string",
  "quantity": 0,
  "weight": 0,
  "value": 0,
  "hsTariffNumber": "string",
  "originCountry": "string",
  "itemCode": "string",
  "id": "string",
  "packageNumber": 0,
  "createdDate": "2020-10-08T19:32:18.764Z",
  "itemCategory": "string",
  "itemSubcategory": "string"
}

Packages

Description

Packages object specifies the type of package being used for shipment and its corresponding properties.

Parameters

param in Type Comments
id Body string
packageType Body string Possible values are: Parcel, FlatRateEnvelope, SmallFlatRateBox, PaddedFlatRateEnvelope, LargeFlatRateBox, LegalFlatRateEnvelope, SoftPack, MediumFlatRateBox1, and MediumFlatRateBox2
isRectangle Body boolean Set this to false to inform carrier that your package is not of regular shape
length Body number
width Body number
height Body number
dimensionUnit Body string Possible values are: cm, mm, m, in, ft, and yd
weight Body number
weightUnit Body string Possible values are: oz, lb, g, and kg
  • Object
{
  "id": "string",
  "packageType": "Parcel",
  "isRectangle": true,
  "length": 0,
  "width": 0,
  "height": 0,
  "dimensionUnit": "cm",
  "weight": 0,
  "weightUnit": "oz"
}

PostageLabel

Description

Postage label object describes label type, label file type and custom text.

Parameters

param in Type Comments
labelType Body string Possible values are: Base64 and Url. Defaults to Url.
labelFileType Body string Possible values are: PDF, TIF, ZPL, PNG, ZPL2, and JPEG. Defaults to PDF.
labelSize Body string Possible values are: 4x6, 6x4, 4x8, 7x3, and Letter. Defaults to 4x6.
labelOrientation Body string Possible values are: Portrait and Landscape.
customText1 Body string
customText2 Body string
customText3 Body string
  • Object
{
  "labelType": "Base64",
  "labelFileType": "PDF",
  "labelSize": "4x6",
  "labelOrientation": "Portrait",
  "customText1": "Custom Text 1",
  "customText2": "Custom Text 2",
  "customText3": "Custom Text 3"
}

SpecialServiceParam

Description

Use these parameter when specifying any special services.

Parameters

param in Type Comments
hazmatDescription Body string
hazmatPhone Body string
hazmatType Body string Possible values are: AirEligibleEthanol, Class1, Class3, Class7_Radioactive, Class8_Corrosive, Class8_WetBattery, Class9_LithiumGroundOnly, Class9_LithiumReturns, Class9_LithiumMarked, Class9_DryIce, Class9_LithiumUnmarked, Class9_Magnetize, Div4.1, Div5.1, Div5.2, Div6.1, Div6.2, ExceptedQuantityProvision, GroundOnly, ConsumerCommodity, Lighters, LimitedQuantity, and SmallQuantityProvision
codAmount Body number
registeredMailAmount Body number
insuranceAmount Body number
liveAnimalsType Body string Possible values are: Bees, DayOldPoultry, AdultBirds, and Other
returnsImageType Body string Possible values are: LabelBroker
signatureType Body string Possible values are: Direct, Indirect and Adult
  • Object
{
  "hazmatDescription": "string",
  "hazmatPhone": "string",
  "hazmatType": "AirEligibleEthanol",
  "codAmount": 0,
  "registeredMailAmount": 0,
  "insuranceAmount": 0,
  "liveAnimalsType": "Bees",
  "returnsImageType": "LabelBroker",
  "signatureType": "Direct"
}

Option

Description

Use these parameter when specifying any shipment options.

Parameters

param in Type Comments
USPS_EntryFacilityType Body string Possible values are: DNDC, DDU, DSCF and DHUB
USPS_ContainerID1 Body string Any alphanumeric value
USPS_ContainerType1 Body string Possible values are: PALLET, SACK, RECEPTACLE, OPEN_DISTRIBUTE_FLAT_TUB_TRAY_BOX, OPEN_DISTRIBUTE_PALLET, OPEN_DISTRIBUTE_HALF_POSTAL_PAKS, OPEN_DISTRIBUTE_HALF_TRAY_BOX, OPEN_DISTRIBUTE_FULL_TRAY_BOX, OPEN_DISTRIBUTE_EMM_TRAY_BOX, OPEN_DISTRIBUTION_FULL_POSTAL_PAKS and TRUCK_BEDLOAD
USPS_ContainerID2 Body string Any alphanumeric value
USPS_ContainerType2 Body string Possible values are: PALLET, SACK, RECEPTACLE, OPEN_DISTRIBUTE_FLAT_TUB_TRAY_BOX, OPEN_DISTRIBUTE_PALLET, OPEN_DISTRIBUTE_HALF_POSTAL_PAKS, OPEN_DISTRIBUTE_HALF_TRAY_BOX, OPEN_DISTRIBUTE_FULL_TRAY_BOX, OPEN_DISTRIBUTE_EMM_TRAY_BOX, OPEN_DISTRIBUTION_FULL_POSTAL_PAKS and TRUCK_BEDLOAD
USPS_ContainerID3 Body string Any alphanumeric value
USPS_ContainerType3 Body string Possible values are: PALLET, SACK, RECEPTACLE, OPEN_DISTRIBUTE_FLAT_TUB_TRAY_BOX, OPEN_DISTRIBUTE_PALLET, OPEN_DISTRIBUTE_HALF_POSTAL_PAKS, OPEN_DISTRIBUTE_HALF_TRAY_BOX, OPEN_DISTRIBUTE_FULL_TRAY_BOX, OPEN_DISTRIBUTE_EMM_TRAY_BOX, OPEN_DISTRIBUTION_FULL_POSTAL_PAKS and TRUCK_BEDLOAD
USPS_EntryFacilityZip Body string Zip code of the destination entry facility
locationCode Body string Any alphanumeric value
subAccount Body string Any alphanumeric value
USPS_RefundDisputeId Body string Any alphanumeric value
  • Object
{
  "USPS_EntryFacilityType": "DNDC",
  "USPS_ContainerID1": "1234567",
  "USPS_ContainerType1": "PT",
  "USPS_ContainerID2": "a1b2c3",
  "USPS_ContainerType2": "SK",
  "USPS_EntryFacilityZip": "84116",
  "locationCode": "string",
  "subAccount": "string",
  "USPS_RefundDisputeId":"string"
}

Change logs

You can preview all of the changes logs and breaking changes here

You can find out what changed in the public API from the v3 to v3.1 here

Back to top © A.P. Moller - Maersk