Commercial Invoice
A commercial invoice is a customs document required for international shipments. It describes the goods being shipped, their value, and the parties involved. Customs authorities use it to assess duties and taxes at the destination country.
Envia generates commercial invoices automatically through the POST /ship/commercial-invoice endpoint after you create an international shipping label.
When you need a commercial invoice
A commercial invoice is required for any shipment that crosses an international border. Carriers will not process international shipments without one. The invoice must include:
- Description of each item being shipped
- HS code (tariff classification) for each item
- Quantity and unit price of each item
- Country of manufacture
- Export reason (sale, gift, sample, return, or personal effects)
- Who pays duties: sender or recipient
Request structure
The commercial invoice endpoint requires five main objects:
| Object | Required | Description |
|---|---|---|
| origin | Yes | Sender address with name, phone, street, city, state, country, postalCode |
| destination | Yes | Recipient address with the same fields |
| shipment | Yes | Carrier name and tracking number from the label you already created |
| packages | Yes | Array of packages, each containing an items array |
| customsSettings | Yes | Duties payment entity and export reason |
Creating a commercial invoice
After creating an international shipping label, use the tracking number and carrier to generate the invoice.
curl --request POST \
--url https://api-test.envia.com/ship/commercial-invoice \
--header "Authorization: Bearer $ENVIA_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"origin": {
"name": "Pedro Garcia",
"company": "Envia Corp",
"email": "[email protected]",
"phone": "8113219177",
"street": "Belisario Dominguez 2470",
"city": "Monterrey",
"state": "NL",
"country": "MX",
"postalCode": "64060",
"identificationNumber": "XAXX010101000"
},
"destination": {
"name": "Maria Schmidt",
"company": "Import GmbH",
"email": "[email protected]",
"phone": "679223722",
"street": "C. del Moscatelar 18",
"city": "Madrid",
"state": "M",
"country": "ES",
"postalCode": "28043",
"identificationNumber": "ES12345678A"
},
"shipment": {
"carrier": "dhl",
"trackingNumber": "794929929630"
},
"packages": [
{
"items": [
{
"description": "Blue jeans for kids made of cotton",
"productCode": "6204.62.3190",
"quantity": 1,
"countryOfManufacture": "MX",
"price": 20
},
{
"description": "Cotton shirt L size",
"productCode": "6206.30.0090",
"quantity": 2,
"countryOfManufacture": "MX",
"price": 3
}
]
}
],
"customsSettings": {
"dutiesPaymentEntity": "recipient",
"exportReason": "sale"
}
}'Response
A successful response returns the generated commercial invoice document URL:
{
"meta": "billoflading",
"data": {
"carrier": "CARRIER_CODE",
"trackingNumber": "TRACKING_NUMBER",
"billOfLading": "https://example.com/bill-of-lading.pdf"
}
}Item fields reference
Each item in the packages[].items array requires:
| Field | Type | Required | Description |
|---|---|---|---|
| description | string | Yes | Clear description of the product |
| productCode | string | Yes | HS code for tariff classification |
| quantity | integer | Yes | Number of units (minimum 1) |
| price | number | Yes | Unit price in the shipment currency |
| countryOfManufacture | string | No | ISO alpha-2 country code where the item was manufactured |
Customs settings
| Field | Type | Required | Values |
|---|---|---|---|
| dutiesPaymentEntity | string | Yes | "sender" (DDP) or "recipient" (DAP) |
| exportReason | string | No | "sale", "gift", "sample", "return", "personal_effects" |
Choosing "sender" means you pay duties upfront (Delivered Duty Paid). Choosing "recipient" means the buyer pays duties at delivery (Delivered at Place).
Uploading customs documents
Some carriers require you to upload the commercial invoice as a digital document. Use POST /ship/uploadDocuments with the tracking number and a base64-encoded PDF.
The document type code varies by carrier:
| Carrier | Type Code |
|---|---|
| FedEx | COMMERCIAL_INVOICE |
| DHL | INV |
| UPS | 002 |
Best practices
- Always classify your products with an HS code before creating the invoice. Use the HS Code Classification endpoint if you need help finding the correct code.
- Include the tax identification number (
identificationNumber) for both origin and destination when available. This helps customs process the shipment faster. - Set the
countryOfManufacturefor each item. Some countries require it and omitting it can cause customs delays. - For the export reason, use "sale" for commercial transactions. Using "gift" or "sample" for commercial shipments may cause customs issues.
Important: The commercial invoice must be generated after creating the shipping label, because it requires the tracking number from the label creation response.
Related pages
- Duties & Taxes — DDP vs DDU and Envia Guaranteed options
- International Shipping Workflow — End-to-end guide for cross-border shipments
Updated about 2 months ago
