Overview
The Label Broker™ allows shipping labels to be printed at participating USPS Post Office locations by presenting a QR code instead of a printed shipping label.
After purchasing a USPS or USPS Returns shipment, create a Label QR Code form to upload the shipping label to the USPS Label Broker service. The request returns a QR code that can be presented at a participating USPS location to print the shipping label.
For guidance on presenting the QR code, see the USPS Label Broker article.
Prerequisites
EasyPost users will first need a USPS and/or USPS Returns carrier account, which will be used for rating and purchasing shipments.
USPS Accounts
EasyPost automatically provides a USPS carrier account.
To use negotiated USPS rates, work with an EasyPost account representative to configure a custom USPS carrier account.
USPS Returns Accounts
USPS Returns accounts are not provided by default.
Work with an EasyPost account representative to enable USPS Returns before generating USPS Returns shipments.
Generate a Label QR Code
After purchasing a shipment, create a Label QR Code form by sening a POST request to the Forms endpoint.
Endpoint
POST /shipments/:shipment_id/formsRequest
{
"form":{
"type":"label_qr_code"
}
}cURL
curl -X POST https://api.easypost.com/v2/shipments/shp.../forms \
-u <YOUR_TEST/PRODUCTION_API_KEY>: \
-d "form[type]=label_qr_code"Request Parameters
| Parameter | Required | Description |
form.type |
Yes | Specifies the form to generate. Set to label_qr_code. |
Response
The endpoint returns the updated Shipment object with the generated Form appended to the forms array.
| Field | Description |
id |
Specifies the form to generate. Set to label_qr_code. |
form_type |
Type of generated form. Returns label_qr_code. |
form_url |
URL of the generated QR code image. |
submitted_electronically |
Always null for Label QR Code forms. |
{
"shipment":{
...
"forms": [
{
"object": "Form",
"id": "form_6fc6bddb972f41eb8b5eebcbd83158a3",
"created_at": "2020-06-29T22:02:43Z",
"updated_at": "2020-06-29T22:02:43Z",
"mode": "test",
"form_type": "label_qr_code",
"form_url": "https://easypost-files/…./abc123.png",
"submitted_electronically": null
}
],
}
}Common Errors
A Label QR Code cannot be generated under the following conditions:
- The shipment date is in the past.
- The shipment requires customs forms.
- The shipment has been refunded.
Example Error
{
"error":{
"code":"UNPROCESSABLE_ENTITY",
"message":"ship date must be in the future",
"errors":[]
}
}