Skip to main content
POST
/
labels
Create Label
curl --request POST \
  --url https://api.loopreturns.com/api/v1/labels \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "label_request_id": 67329889100573,
  "tracking_number": "9400136105440512280610",
  "carrier": "USPS",
  "label_url": "https://s3.amazonaws.com/example-bucket/label.pdf",
  "rate": [
    {
      "amount": 50000,
      "currency_code": "USD"
    },
    {
      "amount": 25000,
      "currency_code": "CAD"
    },
    {
      "amount": 1500,
      "currency_code": "EUR"
    }
  ],
  "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?strOrigTrackNum=9400136105440512280610",
  "qrcode_url": "https://s3.amazonaws.com/example-bucket/qrcode.pdf"
}
'
{
  "id": 67329889100573,
  "tracking_number": "9400136105440512280610",
  "carrier": "USPS",
  "rate": [
    {
      "amount": 50000,
      "currency_code": "USD"
    },
    {
      "amount": 25000,
      "currency_code": "CAD"
    },
    {
      "amount": 1500,
      "currency_code": "EUR"
    }
  ],
  "status": "new",
  "created_at": "2023-04-25T13:25:00-05:00",
  "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?strOrigTrackNum=9400136105440512280610",
  "label_url": "https://s3.amazonaws.com/example-bucket/label.pdf",
  "qrcode_url": "https://s3.amazonaws.com/example-bucket/qrcode.pdf"
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json
label_request_id
integer
required

The label request id this label applies to.

Example:

67329889100573

tracking_number
string
required

The tracking number associated with the label.

Maximum string length: 256
Example:

"9400136105440512280610"

carrier
string
required

The carrier associated with the label.

Maximum string length: 32
Example:

"USPS"

label_url
string | null
required

The URL containing the printable PDF of the labels. Required unless qrcode_url is provided.

Maximum string length: 2048
Example:

"https://s3.amazonaws.com/example-bucket/label.pdf"

rate
object
required
Example:
[
  { "amount": 50000, "currency_code": "USD" },
  { "amount": 25000, "currency_code": "CAD" },
  { "amount": 1500, "currency_code": "EUR" }
]
tracking_url
string | null

The tracking URL associated with the label.

Maximum string length: 2048
Example:

"https://tools.usps.com/go/TrackConfirmAction_input?strOrigTrackNum=9400136105440512280610"

qrcode_url
string | null

The QR Code URL containing the printable PDF of the labels.

Maximum string length: 512
Example:

"https://s3.amazonaws.com/example-bucket/qrcode.pdf"

Response

Created

id
integer<int64>
required

The id of the label you created.

Example:

67329889100573

tracking_number
string
required

The tracking number associated with the label.

Example:

"9400136105440512280610"

carrier
string
required

The carrier associated with the label.

Example:

"USPS"

rate
object
required
Example:
[
  { "amount": 50000, "currency_code": "USD" },
  { "amount": 25000, "currency_code": "CAD" },
  { "amount": 1500, "currency_code": "EUR" }
]
status
enum<string>
required

The current status of the label.

Available options:
queueable,
queued,
queued_for_purchase,
purchase_failed,
new,
pre_transit,
in_transit,
out_for_delivery,
delivered,
available_for_pickup,
cancelled,
unknown,
return_to_sender,
failure,
error,
refund_requested
Example:

"new"

created_at
string<date-time>
required

The date the label was created.

Example:

"2023-04-25T13:25:00-05:00"

tracking_url
string | null

The tracking URL associated with the label.

Example:

"https://tools.usps.com/go/TrackConfirmAction_input?strOrigTrackNum=9400136105440512280610"

label_url
string | null

The URL containing the printable PDF of the labels.

Example:

"https://s3.amazonaws.com/example-bucket/label.pdf"

qrcode_url
string | null

The QR Code URL containing the printable PDF of the labels.

Example:

"https://s3.amazonaws.com/example-bucket/qrcode.pdf"