Customs Documentation
What it does
Generate commercial invoices, packing lists, and certificates of origin in a single API call. Provide shipper, consignee, and item details, and POTAL generates all required customs documents with proper formatting and regulatory compliance.
Required Fields for 100% Accuracy
10 required / 12 total| Field | Type | Required |
|---|---|---|
doc_type | string | ! |
shipment.shipper.name | string | ! |
shipment.consignee.name | string | ! |
shipment.items[].hs_code | string | ! |
shipment.items[].description | string | ! |
shipment.items[].value | number | ! |
shipment.items[].quantity | number | ! |
shipment.items[].weight | number | ! |
shipment.items[].origin | string | ! |
shipment.destination | string | ! |
shipment.incoterms | string | opt |
shipment.currency | string | opt |
Tips for Best Accuracy
- ✓All item fields (hs_code, description, value, quantity, weight, origin) are required
- ✓HS codes should be at least 4 digits — warnings are generated for shorter codes
- ✓Values above $100,000 trigger validation warnings
Common Mistakes
- ✗Missing item-level origin field — each item needs its own origin country
- ✗Providing hs_code with fewer than 4 digits — use at least 4 digits for accuracy
- ✗Forgetting doc_type — it determines which document template is generated
How to use it
Prepare shipment data
Collect shipper info, consignee info, item details (HS code, description, value, quantity, weight).
Generate documents
POST /api/v1/customs-docs/generate with the complete shipment data.
Download documents
The response includes structured document data for commercial invoice, packing list, and certificates.
Export as PDF
Use the /documents/pdf endpoint to convert document data into printable PDF format.
API Reference
/api/v1/customs-docs/generate{
"shipper": {
"name": "Acme Corp",
"address": "123 Main St, Shanghai",
"country": "CN"
},
"consignee": {
"name": "US Buyer LLC",
"address": "456 Oak Ave, New York",
"country": "US"
},
"items": [
{
"hs_code": "6109.10",
"description": "Cotton t-shirts",
"value": 500,
"quantity": 100,
"weight": 25,
"origin": "CN"
}
],
"destination": "US",
"incoterms": "DDP",
"currency": "USD"
}{
"documents": {
"commercial_invoice": {
"invoice_number": "INV-2026-001",
"total_value": 500,
"items": [
"..."
]
},
"packing_list": {
"packages": 1,
"total_weight": 25,
"items": [
"..."
]
},
"certificate_of_origin": {
"origin": "CN",
"certifier": "Self-certified"
}
},
"timestamp": "2026-03-29T12:00:00Z"
}curl -X POST https://potal.app/api/v1/customs-docs/generate \
-H "X-API-Key: pk_live_your_key" \
-H "Content-Type: application/json" \
-d '{"shipper":{"name":"Acme Corp","country":"CN"},"consignee":{"name":"US Buyer","country":"US"},"items":[{"hs_code":"6109.10","description":"Cotton t-shirts","value":500,"quantity":100,"weight":25,"origin":"CN"}],"destination":"US"}'Related Features
Auto-generate CN22, CN23, and customs declaration forms
Generate PDF trade documents: invoices, packing lists, certificates
Generate compliance and origin certificates for customs clearance
Comprehensive screening before shipping: cost + compliance
EU ICS2 pre-arrival safety and security declaration support