---
title: "Generate a Shipping Label"
method: POST
path: "/ship/generate/"
tags: ["Labels"]
---

# Generate a Shipping Label

`POST /ship/generate/`

Generate a shipping label with a tracking number for a specific carrier and service. This is the core endpoint for creating shipments — it returns a printable label and registers the shipment with the carrier.

**When to use:** Call this endpoint after you have selected a rate from the `/ship/rate/` response and are ready to create an actual shipment.

**Prerequisites:**
- Valid JWT authentication token (Bearer)
- A selected carrier and service (typically from a prior rate quote)
- Complete origin and destination addresses
- Package dimensions and weight
- For international shipments: customs items information and content description

**Key behaviors:**
- Returns a label URL (PDF), tracking number, and shipment metadata
- Once generated, the label is registered with the carrier and may incur charges
- Cancel unused labels via `/ship/cancel/` to request a refund
- Supports additional services (insurance, signature, etc.) through the `settings` object
- For international DDP shipments, include duty/tax payment details in the request

## Request body

- object
  - `origin` object, required — Origin address information
    - `name` string, required — Name of the person
    - `company` string — Name of the company or business
    - `email` string — Email address
    - `phone_code` string — Country phone code
    - `phone` string, required — Phone number
    - `street` string, required — Street address
    - `number` string — Street number
    - `district` string — District or neighborhood
    - `city` string, required — City name
    - `state` string, required — State or province code (e.g., NL, TX, QC)
    - `country` string, required — ISO 3166-1 alpha-2 country code (e.g., MX, US, CO)
    - `postalCode` string, required — Zipcode value
    - `reference` string — Reference information for delivery
    - `identificationNumber` string — Tax identification number
    - `branchCode` string — Origin branch code identification when you select a drop off service.
  - `destination` object, required — Destination address information
    - `name` string, required — Name of the person
    - `company` string — Name of the company or business
    - `email` string — Email address
    - `phone_code` string — Country phone code
    - `phone` string, required — Phone number
    - `street` string, required — Street address
    - `number` string — Street number
    - `district` string — District or neighborhood
    - `city` string, required — City name
    - `state` string, required — State or province code (e.g., NL, TX, QC). Retrieve valid codes from the Queries API (Get States by Country).
    - `country` string, required — ISO 3166-1 alpha-2 country code (e.g., MX, US, CO)
    - `postalCode` string, required — Zipcode value
    - `reference` string — Reference information for delivery
    - `identificationNumber` string — Tax identification number
    - `branchCode` string — Destination branch code identification when you select a drop off service.
  - `packages` object[], required — List of packages
    - `type` 'envelope' | 'box' | 'pallet', required — Package type
    - `content` string, required — Package content description
    - `amount` integer, required — Number of packages
    - `name` string — Package name
    - `declaredValue` number, required — Approximate value of the merchandise (Not the value to be insured)
    - `lengthUnit` 'CM' | 'IN', required — Unit of measure for dimensions
    - `weightUnit` 'KG' | 'LB', required — Unit of weight
    - `weight` number, required — Package weight
    - `dimensions` object, required — Package dimensions
      - `length` number, required — Length dimension
      - `width` number, required — Width dimension
      - `height` number, required — Height dimension
    - `additionalServices` object[] — Additional services for the package
      - `data` object — Required only for some additional services
        - `amount` string — Required if the additional service is envia_insurance, insurance or cash on delivery
      - `service` 'envia_insurance' | 'cash_on_delivery' | 'electronic_signature' — Additional service name
    - `items` object[] — Items in the package (**mandatory** for international shipments or domestic shipments generated within Brazil, for the fiscal declaration).
      - `description` string — Item description
      - `productCode` string — Product code (HS code)
      - `quantity` integer — Quantity of items
      - `countryOfManufacture` string — Country where item was manufactured (ISO 3166-1 alpha-2 country code)
      - `price` number — Unit price of the product
      - `currency` string — Currency of the price
    - `xmlData` object[] — Fiscal document data for Brazil domestic shipments. Required when shipping with carriers that need a fiscal declaration. Supports two document types: - **`dce`** (Declaração de Conteúdo Eletrônica): For non-commercial shipments. Obtain values from `POST /dce/autorizar` (Generate DC-e). Required fields: `dceNumber`, `dceSerie`, `dceDate`, `dceKey`, `dceValue`. - **`nfe`** (Nota Fiscal Eletrônica): For commercial shipments with an existing NF-e. Required fields: `nfeKey`, `nfeNumber`, `nfeSerie`, `nfeDate`. If `documentType` is not provided, it defaults to `dce`.
      - `documentType` 'dce' | 'nfe' — Fiscal document type. Defaults to 'dce' if not provided
      - `dceNumber` string — DC-e number from the Generate DC-e response. Required when documentType is 'dce'
      - `dceSerie` string — DC-e series number from the Generate DC-e response. Required when documentType is 'dce'
      - `dceDate` string, date-time — DC-e emission date from the Generate DC-e response. Required when documentType is 'dce'
      - `dceKey` string — 44-digit DC-e access key from the Generate DC-e response. Required when documentType is 'dce'
      - `dceValue` string — Total DC-e value from the Generate DC-e response. Required when documentType is 'dce'
      - `nfeKey` string — 44-digit NF-e access key. Required when documentType is 'nfe'
      - `nfeNumber` string — NF-e number. Required when documentType is 'nfe'
      - `nfeSerie` string — NF-e series number. Required when documentType is 'nfe'
      - `nfeDate` string, date-time — NF-e emission date. Required when documentType is 'nfe'
    - `bolComplement` object[] — Bill of Lading complement for freight shipments (only for México)
      - `productCode` string — Product code
      - `productDescription` string — Product description
      - `weightUnit` string — Weight unit
      - `quantity` integer — Quantity
      - `unitPrice` number — Unit price
      - `currency` string — Currency code
  - `settings` object, required — Shipping settings. printFormat and printSize are required for label generation.
    - `currency` 'USD' | 'MXN' | 'CLP' | 'COP' | 'INR' | 'BRL' | 'CAD' | 'ARS' | 'GTQ' | 'EUR' — Currency ISO code
    - `printFormat` 'PDF' | 'PNG' | 'ZPL' | 'ZPLII' | 'EPL', required — Print format for the label (required)
    - `printSize` 'PAPER_4X6' | 'PAPER_7X4.75' | 'STOCK_4X6' | 'PAPER_LETTER', required — Print size for the label (required). Use PAPER_4X6 or STOCK_4X6 for standard labels.
    - `comments` string — Comments for the shipment
  - `shipment` object, required — Carrier and service from the Quote response. type: 1=parcel, 2=LTL, 3=FTL.
    - `type` 1 | 2 | 3, required — | Type | Service type name | | :-----| :--------:| | 1 | Parcel | | 2 | LTL (Consolidates charge) | | 3 | FTL (Full TruckLoad) |
    - `reverse_pickup` 0 | 1 — Indicate whether this is a return shipment
    - `import` 0 | 1 — Indicates whether it is an import shipment
    - `carrier` string, required — Carrier name
    - `service` string, required — Service name
    - `declaredValue` number — Declared value for the shipment
    - `additionalServices` object[] — Additional services for the shipment (only used for LTL services)
      - `service` string — Service name
    - `pickup` object — Pickup information
      - `date` string, date — Pickup date
      - `totalPackages` integer — Total number of packages
      - `totalWeight` number — Total weight
    - `orderReference` string — Order number or reference (if from an ecommerce site)
  - `customsSettings` object — Customs settings for international shipments
    - `dutiesPaymentEntity` 'envia_guaranteed' | 'sender' | 'recipient' — Who pays the duties and taxes. Options: envia_guaranteed (prepaid with guaranteed amount - recommended), sender (DDP - billed after delivery), recipient (DAP - paid at delivery)
    - `exportReason` 'sale' | 'gift' | 'sample' | 'return' | 'other' — Reason for export

## Response `200`

Label created successfully

- object
  - `meta` string — Action name
  - `data` object[] — Generated labels
    - `carrier` string — Carrier name
    - `service` string — Service name
    - `shipmentId` integer — Shipment identification number
    - `trackingNumber` string — Tracking number
    - `trackUrl` string — Tracking URL
    - `label` string — Label URL
    - `additionalFiles` string[] — Additional files
    - `totalPrice` number, double — Total price
    - `currentBalance` number, double — Current account balance
    - `currency` string — Currency code
    - `packages` object[] — Packages linked to the shipment
      - `trackingNumber` string — Tracking number of the package
      - `trackUrl` string — Tracking URL
      - `content` string — Content name of the package
      - `weight` number, double — Weight of the package
      - `weightUnit` string — Weight unit of the package

---

[API](https://skmtc.net/envia/apis/envia-shipping-api-complete-documentation.md) · [All operations](https://skmtc.net/envia/apis/envia-shipping-api-complete-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/envia/envia-shipping-api-complete-documentation/versions/39f9208959d6/schema)
