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-labelswhere
{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-labelsDetails
| 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.| Body Paramter | Details | Description |
|---|---|---|
customs |
|
Groups Customs fields that are derived from the labels. |
customs.address_importer |
|
Groups address information, if this is different to the recipient's address. |
customs.address_importer.city |
|
Specify the city. |
customs.address_importer.company |
|
Specify the name of the company to whom this address belongs. |
customs.address_importer.country |
|
Speciofy the country where this address is located. |
customs.address_importer.email |
|
Specify the email of the contact at the address. |
customs.address_importer.name |
|
Specify the name of the contact at the address. |
customs.address_importer.phone |
|
Specify the phone number of the contact at the address. |
customs.address_importer.state |
|
Specify the state or country subdivision where this address is located. |
customs.address_importer.street1 |
|
Specify the first line of the address. |
customs.address_importer.street2 |
|
Specify the second line of the address. |
customs.address_importer.zip |
|
Specify the Postal or ZIP code of the address. |
customs.aes_itn |
|
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 |
|
Specify the B13A number for Candian exports. This field is
required if the b13a_filing_optionis set to
true. |
customs.duties_payor |
|
Groups information about the party who paid the duties. This is only relevant for Federal Express users. |
customs.duties_payor.account |
|
Specify the Payor's account. This si the account of the party who pay the duty. |
customs.duties_payor.account.address |
|
Groups information about the Payor's address. |
customs.duties_payor.account.address.country |
|
Specify the Payor's country. |
customs.duties_payor.account.address.name |
|
Specify the Payor's name. |
customs.duties_payor.account.address.zip |
|
Specify the Payor's ZIP or Postal Code. |
customs.duties_payor.type |
|
Spocify the type of Payor. Thye can be a sender, recipient or third party. |
customs.exporter_reference |
|
Specify the importer's reference number. |
customs.incoterm |
|
|
customs.incoterm |
|
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 |
|
Specify the invoice or order number for this shipment. |
customs.invoiced_charges |
|
Groups information that details the breakdown of charges for the commercal invoice. |
customs.invoiced_charges.currency |
|
Specify the currency. |
customs.invoiced_charges.other_fees |
|
Specify any other fees. |
customs.invoiced_charges.total_duties |
|
Specify the total amount of Cusotms duty. |
customs.invoiced_charges.total_shipping |
|
Specify the total amount for shipping charges. |
customs.invoiced_charges.total_taxes |
|
Specify the total amount of taxes. |
customs.is_vat_collected |
|
Use this to indicated whether VAT has been collected or not during the checkout. |
documentTypes |
|
You can specify which type of document you want to generate. All are generated by default. |
rateId |
|
Specify the Shipping Rate ID that is used to generate the labels. |
sessionId |
|
Specify the Session ID of the ePAL transaction. |
shipmentId |
|
Specify The Shippo Shipment ID that is used for label generation. |
Response Parameters
| Response Parameter | Details | Description |
|---|---|---|
documents |
|
Groups information about the generated documents and labels. |
documents.commercialInvoice |
|
The URL that you can use to retrieve the commercial invoice. |
documents.customsDeclaration |
|
The URL that you can use to retrieve the custom's declaration. |
documents.label |
|
The URL that you can use to retrieve the shipping label. |
sessionId |
|
The ePAL Session ID that you can use to identify the ePAL transaction. |
tracking |
|
Groups information tracking information. |
tracking.number |
|
The tracking number for the shipment. |
tracking.url |
|
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"
}
}