ParcelLabel API

Download
(2 reviews)

Label Creation process

There are two processes which can be followed to generate a label, you can either:

  1. Poll our API
  2. Utilize our webhook functionality

Flow 1: Polling our API

With this process, there are three key steps you need to follow to generate a label:

  1. Send a label creation request to the Create Label(s) endpoint - either domestic or international. This endpoint will return back a consignment id.
  2. Using the consignment id retrieved from step 1, repeatedly call the "Get Status of Label(s)" endpoint until the status of the consignment is complete. The recommended polling time is once every second, you should stop polling if the consignment status isn't complete within 30 seconds OR if an error is encountered.
  3. Send a request to download the label(s) in the consignment.

Figure 1: The ParcelLabel V3 polling process

resources/Untitled%20Diagram%20(3)-3274d8fe-97e4-4b96-b048-c3376b0ef3d5.png

Flow 2: Utilizing our Webhooks

Alternatively, merchants are able to choose to receive consignment notifications via a webhook so that they do not have to continually call the "Get Status of Label(s)" endpoint. This requires merchants to build a web service which can receive and process webhooks.

If all labels of the consignment have been successfully generated, the status of the labels are sent to the URL specified in notification_endpoint field.

If any of the labels in the consignment has failed to be generated, an error message is sent to the URL specified in notification_endpoint field.

Please refer to Get Status of Label(s) to see the response message and samples.


Reviews