Labels

Labels are a critical part of the shipping process — they contain the carrier, service, barcode, and address information required for successful delivery. Evership provides two endpoints for retrieving shipping labels: one for individual shipments, and one for batches.

On this page, we’ll explore how to retrieve shipping labels programmatically, either in single or batch format. Labels can be generated in multiple sizes, and downloaded as ready-to-print PDF files.

Introduction

The label model defines the format, URL, and relationship to the shipment(s). Labels are only available once a shipment has been successfully purchased.

The Retrieve label (single) endpoint lets you download labels in multiple formats for a single shipment, while the Retrieve label (batch) endpoint returns a single PDF file containing labels for multiple shipments in one consistent format.


GETapi.evership.app/v1/labels/single

Retrieve a label (single)

Using the "Retrieve label (single)" API you can pass the shipment_id of a purchased shipment and define the label formats that you want to be returned. The response will contain a URL to the shipment labels in each of the formats requested.

Optional attributes

  • Name
    shipment_id
    Type
    string
    Description

    Unique identifier for the shipment for which the label is being requested.

  • Name
    label_formats
    Type
    string
    Description

    Comma-separated list of label formats to be retrieved.
    Possible formats include:

    • 10_10 = 10 cm × 10 cm label
    • 10_15 = 10 cm × 15 cm label
    • a4_page = label printed on an A4 page, 2 labels per page

Request

GET https://www.api.evership.app/v1/labels/single?shipment_id=12345&label_formats=10_10,10_15,a4_page

Response

200
Success
{
  "shipment_id": "12345",
  "labels": [
    {
      "format": "10_10",
      "url": "https://www.api.evership.app/v1/shipments/12345/label/10_10"
    },
    {
      "format": "10_15",
      "url": "https://www.api.evership.app/v1/shipments/12345/label/10_15"
    },
    {
      "format": "a4_page",
      "url": "https://www.api.evership.app/v1/shipments/12345/label/a4_page"
    }
  ]
}

GETapi.evership.app/v1/labels/batch

Retrieve a label (batch)

Using this “Retrieve label (batch)” API you can pass multiple shipment_id's of a batch of purchased shipments and define the single label format that you want to be returned.

The response will contain a URL to single PDF file that contains the shipment labels of all of the shipment_id's requested in the format requested.

This is different from the Retrieve label (single) API in 2 ways:

  1. You can pass multiple shipment_id's and we will return a single PDF file that contains all of the labels of the requested shipment records
  2. You can only request for a single label format, not all three label formats.

Optional attributes

Request Fields

  • Name
    shipment_ids
    Type
    array
    Description

    Array of unique identifiers for the shipments.

  • Name
    label_format
    Type
    string
    Description

    The format of the label to be used for the shipments:

    • 10_10 = 10 cm × 10 cm label
    • 10_15 = 10 cm × 15 cm label
    • a4_page = labels printed on an A4 page, 2 labels per page

Request

GET https://www.api.evership.app/v1/labels/batch?shipment_ids=12345,12346,12347&label_format=10_15

Response

200
Success
{
  "label_batch_id": "batch_qAAAAABlYF30BJk5Xv1J30ZF5x9Z1Q2F5x",
  "label_format": "10_15_label",
  "label_url": "https://www.api.evership.app/v1/shipments/label/batch_qAAAAABlYF30BJk5Xv1J30ZF5x9Z1Q2F5x.pdf"
}

Was this page helpful?