Generate shipping labels and documents

Use this request to generate shipping labels and other associated documents (such as customs declarations, commercial invoices and so on). You can choose which you want to generate.

Use a POST operation and the following URL to send this request:
{api_url}/generate-labels
where {api_url} is the API's URL.
For example, you would use the following URL for a request sent to production:
https://api.epalglobal.co/generate-labels

Details

Table 1. Request Details
Detail Value
Operation POST
Endpoint /generate-labels
Fields

Body Parameters

The following table list the fields that maybe available in the customs object:

Warning:
The exact fields that are in the customs object can vary. This is derived from your saved Shippo preferences.
Table 2. customs Object Fields
Body Paramter Details Description
customs
  • Type: Object
  • Status: Required
Groups Customs fields that are derived from the labels.
customs.address_importer
  • Type: Object
  • Status: Optional
Groups address information, if this is different to the recipient's address.
customs.address_importer.city
  • Type: String
  • Status: Optional
Specify the city.
customs.address_importer.company
  • Type: String
  • Status: Optional
Specify the name of the company to whom this address belongs.
customs.address_importer.country
  • Type: String
  • Status: Optional
Speciofy the country where this address is located.
customs.address_importer.email
  • Type: String
  • Status: Optional
Specify the email of the contact at the address.
customs.address_importer.name
  • Type: String
  • Status: Optional
Specify the name of the contact at the address.
customs.address_importer.phone
  • Type: String
  • Status: Optional
Specify the phone number of the contact at the address.
customs.address_importer.state
  • Type: String
  • Status: Optional
Specify the state or country subdivision where this address is located.
customs.address_importer.street1
  • Type: String
  • Status: Optional
Specify the first line of the address.
customs.address_importer.street2
  • Type: String
  • Status: Optional
Specify the second line of the address.
customs.address_importer.zip
  • Type: String
  • Status: Optional
Specify the Postal or ZIP code of the address.
customs.aes_itn
  • Type: String
  • Status: Mandatory when required
Specify the AES/ITN reference for US exports valued above 2500 USD. This is required if the eel_pfc field is AES_ITN.
customs.b13a_number
  • Type: String
  • Status: Mandatory when required
Specify the B13A number for Candian exports. This field is required if the b13a_filing_optionis set to true.
customs.duties_payor
  • Type: Object
  • Status: Used only for Federal Express.
Groups information about the party who paid the duties. This is only relevant for Federal Express users.
customs.duties_payor.account
  • Type: String
  • Status: Optional
Specify the Payor's account. This si the account of the party who pay the duty.
customs.duties_payor.account.address
  • Type: Object
  • Status: Optional
Groups information about the Payor's address.
customs.duties_payor.account.address.country
  • Type: String
  • Status: Optional
Specify the Payor's country.
customs.duties_payor.account.address.name
  • Type: String
  • Status: Optional
Specify the Payor's name.
customs.duties_payor.account.address.zip
  • Type: String
  • Status: Optional
Specify the Payor's ZIP or Postal Code.
customs.duties_payor.type
  • Type: String
  • Status: Optional
  • Possible Values: "SENDER", "RECIPIENT" or "THIRD_PARTY"
Spocify the type of Payor. Thye can be a sender, recipient or third party.
customs.exporter_reference
  • Type: String
  • Status: Optional
Specify the importer's reference number.
customs.incoterm
  • Type: String
  • Status: Mandatory when required
customs.incoterm
  • Type: String
  • Status: Optional
If you do not want to use the Shippo incoterm (for example DDU, DAP, or eDAP), you can specify it in this field.
CAUTION:
If you do specify a value this will overwrite the Shippo incoterm. You must specify a valid value for the carrier or route.
customs.invoice
  • Type: String
  • Status: Optional
Specify the invoice or order number for this shipment.
customs.invoiced_charges
  • Type: Object
  • Status: Optional
Groups information that details the breakdown of charges for the commercal invoice.
customs.invoiced_charges.currency
  • Type: String
  • Status: Optional
Specify the currency.
customs.invoiced_charges.other_fees
  • Type: String
  • Status: Optional
Specify any other fees.
customs.invoiced_charges.total_duties
  • Type: String
  • Status: Optional
Specify the total amount of Cusotms duty.
customs.invoiced_charges.total_shipping
  • Type: String
  • Status: Optional
Specify the total amount for shipping charges.
customs.invoiced_charges.total_taxes
  • Type: String
  • Status: Optional
Specify the total amount of taxes.
customs.is_vat_collected
  • Type: Boolean
  • Status: Optional
Use this to indicated whether VAT has been collected or not during the checkout.
documentTypes
  • Type: Array of strings
  • Status: Optional
  • Possible Values: "label", "commercial_invoice", "customs_declaration"
You can specify which type of document you want to generate. All are generated by default.
rateId
  • Type: String
  • Status: Mandatory
Specify the Shipping Rate ID that is used to generate the labels.
sessionId
  • Type: String
  • Status: Mandatory
Specify the Session ID of the ePAL transaction.
shipmentId
  • Type: String
  • Status: Optional
Specify The Shippo Shipment ID that is used for label generation.

Response Parameters

Table 3.
Response Parameter Details Description
documents
  • Type: Object
Groups information about the generated documents and labels.
documents.commercialInvoice
  • Type: String
The URL that you can use to retrieve the commercial invoice.
documents.customsDeclaration
  • Type: String
The URL that you can use to retrieve the custom's declaration.
documents.label
  • Type: String
The URL that you can use to retrieve the shipping label.
sessionId
  • Type: String
The ePAL Session ID that you can use to identify the ePAL transaction.
tracking
  • Type: Object
Groups information tracking information.
tracking.number
  • Type: String
The tracking number for the shipment.
tracking.url
  • Type: String
The URL for the shipment.

Request Example

The following example request shows the minimum number of required fields:
{
  "sessionId": "550e8400-e29b-41d4-a716-446655440000",
  "rateId": "97794930bf2b4372bb1a9df319654128"
}
The following example request shows all the possible fields:
{
  "sessionId": "550e8400-e29b-41d4-a716-446655440000",
  "rateId": "97794930bf2b4372bb1a9df319654128",
  "documentTypes": [
    "label",
    "commercial_invoice",
    "customs_declaration"
  ],
  "customs": {
    "incoterm": "DDU",
    "invoice": "INV-2026-001234",
    "exporter_reference": "ORDER-12345",
    "importer_reference": "IMP-REF-001",
    "is_vat_collected": true,
    "invoiced_charges": {
      "currency": "USD",
      "total_shipping": "25.00",
      "total_taxes": "15.50",
      "total_duties": "10.00",
      "other_fees": "5.00"
    }
  }
}

Response Example

The following is an example response for a successful request:
{
  "sessionId": "string",
  "documents": {
    "label": "string",
    "commercialInvoice": "string",
    "customsDeclaration": "string"
  },
  "tracking": {
    "number": "string",
    "url": "string"
  }
}