Create customs document
curl --request POST \
--url https://api.insightchain.ai/v1/customs_documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipper": {
"name": "Northwind Textiles Ltd",
"address_line1": "14 Canal Road",
"city": "Hai Phong",
"country": "VN"
},
"consignee": {
"name": "Harbor Outfitters Inc",
"address_line1": "200 Dock Street",
"city": "Portland",
"state": "OR",
"postal_code": "97201",
"country": "US"
},
"line_items": [
{
"description": "Cotton T-shirt, knitted",
"hs_code": "6109.10",
"quantity": 1000,
"unit_value": 12.5,
"weight_kg": 0.2,
"country_of_origin": "VN"
}
]
}
'import requests
url = "https://api.insightchain.ai/v1/customs_documents"
payload = {
"shipper": {
"name": "Northwind Textiles Ltd",
"address_line1": "14 Canal Road",
"city": "Hai Phong",
"country": "VN"
},
"consignee": {
"name": "Harbor Outfitters Inc",
"address_line1": "200 Dock Street",
"city": "Portland",
"state": "OR",
"postal_code": "97201",
"country": "US"
},
"line_items": [
{
"description": "Cotton T-shirt, knitted",
"hs_code": "6109.10",
"quantity": 1000,
"unit_value": 12.5,
"weight_kg": 0.2,
"country_of_origin": "VN"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
shipper: {
name: 'Northwind Textiles Ltd',
address_line1: '14 Canal Road',
city: 'Hai Phong',
country: 'VN'
},
consignee: {
name: 'Harbor Outfitters Inc',
address_line1: '200 Dock Street',
city: 'Portland',
state: 'OR',
postal_code: '97201',
country: 'US'
},
line_items: [
{
description: 'Cotton T-shirt, knitted',
hs_code: '6109.10',
quantity: 1000,
unit_value: 12.5,
weight_kg: 0.2,
country_of_origin: 'VN'
}
]
})
};
fetch('https://api.insightchain.ai/v1/customs_documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"request_id": "694b271b-4206-4cf1-81d5-f27d2c325344",
"document": {
"document_type": "combined",
"generated_at": "2026-11-21T10:55:53.576Z",
"invoice_number": "INV-20261121-694B27",
"invoice_date": "2026-11-21",
"po_number": "PO-CONTRACT-1",
"currency": "USD",
"incoterm": "FOB",
"shipper": {
"name": "Lakeside Exports Ltd",
"address_line1": "1 Harbour Road",
"address_line2": null,
"city": "Ho Chi Minh City",
"state": null,
"postal_code": null,
"country": "VN",
"phone": null,
"email": null,
"tax_id": null
},
"consignee": {
"name": "Harborview Imports Inc",
"address_line1": null,
"address_line2": null,
"city": "Newark",
"state": "NJ",
"postal_code": "07102",
"country": "US",
"phone": null,
"email": null,
"tax_id": "12-3456789"
},
"transport": {
"mode": "sea",
"vessel_flight": null,
"port_of_loading": "Cat Lai",
"port_of_discharge": "Newark"
},
"line_items": [
{
"item_number": 1,
"description": "Cotton T-shirts",
"hs_code": "6109.10",
"quantity": 500,
"unit_value": 4.2,
"total_value": 2100,
"weight_kg": 0.18,
"country_of_origin": "VN"
}
],
"summary": {
"total_items": 2,
"total_quantity": 1000,
"subtotal": 2125,
"freight_cost": 350,
"insurance_cost": 25,
"total_invoice_value": 2500
},
"declarations": [
"I, the undersigned, hereby declare that the information contained in this invoice is true and correct and that the contents of this shipm..."
],
"packing_details": [
{
"item_number": 1,
"description": "Cotton T-shirts",
"hs_code": "6109.10",
"quantity": 500,
"weight_kg": 0.18,
"package_number": "PKG-001"
}
],
"packing_summary": {
"total_packages": 2,
"total_quantity": 1000,
"total_weight_kg": 90
},
"notes": null
},
"duration_ms": 2,
"disclaimer": "This document is auto-generated for informational purposes. It may not meet all regulatory requirements for every jurisdiction. Verify wi..."
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}Customs documents
Create customs document
A commercial invoice, packing list or both, computed from the shipment you send. Logs the document.
Key scope: read (or execute). Module: customs_docs.
POST
/
v1
/
customs_documents
Create customs document
curl --request POST \
--url https://api.insightchain.ai/v1/customs_documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipper": {
"name": "Northwind Textiles Ltd",
"address_line1": "14 Canal Road",
"city": "Hai Phong",
"country": "VN"
},
"consignee": {
"name": "Harbor Outfitters Inc",
"address_line1": "200 Dock Street",
"city": "Portland",
"state": "OR",
"postal_code": "97201",
"country": "US"
},
"line_items": [
{
"description": "Cotton T-shirt, knitted",
"hs_code": "6109.10",
"quantity": 1000,
"unit_value": 12.5,
"weight_kg": 0.2,
"country_of_origin": "VN"
}
]
}
'import requests
url = "https://api.insightchain.ai/v1/customs_documents"
payload = {
"shipper": {
"name": "Northwind Textiles Ltd",
"address_line1": "14 Canal Road",
"city": "Hai Phong",
"country": "VN"
},
"consignee": {
"name": "Harbor Outfitters Inc",
"address_line1": "200 Dock Street",
"city": "Portland",
"state": "OR",
"postal_code": "97201",
"country": "US"
},
"line_items": [
{
"description": "Cotton T-shirt, knitted",
"hs_code": "6109.10",
"quantity": 1000,
"unit_value": 12.5,
"weight_kg": 0.2,
"country_of_origin": "VN"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
shipper: {
name: 'Northwind Textiles Ltd',
address_line1: '14 Canal Road',
city: 'Hai Phong',
country: 'VN'
},
consignee: {
name: 'Harbor Outfitters Inc',
address_line1: '200 Dock Street',
city: 'Portland',
state: 'OR',
postal_code: '97201',
country: 'US'
},
line_items: [
{
description: 'Cotton T-shirt, knitted',
hs_code: '6109.10',
quantity: 1000,
unit_value: 12.5,
weight_kg: 0.2,
country_of_origin: 'VN'
}
]
})
};
fetch('https://api.insightchain.ai/v1/customs_documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"request_id": "694b271b-4206-4cf1-81d5-f27d2c325344",
"document": {
"document_type": "combined",
"generated_at": "2026-11-21T10:55:53.576Z",
"invoice_number": "INV-20261121-694B27",
"invoice_date": "2026-11-21",
"po_number": "PO-CONTRACT-1",
"currency": "USD",
"incoterm": "FOB",
"shipper": {
"name": "Lakeside Exports Ltd",
"address_line1": "1 Harbour Road",
"address_line2": null,
"city": "Ho Chi Minh City",
"state": null,
"postal_code": null,
"country": "VN",
"phone": null,
"email": null,
"tax_id": null
},
"consignee": {
"name": "Harborview Imports Inc",
"address_line1": null,
"address_line2": null,
"city": "Newark",
"state": "NJ",
"postal_code": "07102",
"country": "US",
"phone": null,
"email": null,
"tax_id": "12-3456789"
},
"transport": {
"mode": "sea",
"vessel_flight": null,
"port_of_loading": "Cat Lai",
"port_of_discharge": "Newark"
},
"line_items": [
{
"item_number": 1,
"description": "Cotton T-shirts",
"hs_code": "6109.10",
"quantity": 500,
"unit_value": 4.2,
"total_value": 2100,
"weight_kg": 0.18,
"country_of_origin": "VN"
}
],
"summary": {
"total_items": 2,
"total_quantity": 1000,
"subtotal": 2125,
"freight_cost": 350,
"insurance_cost": 25,
"total_invoice_value": 2500
},
"declarations": [
"I, the undersigned, hereby declare that the information contained in this invoice is true and correct and that the contents of this shipm..."
],
"packing_details": [
{
"item_number": 1,
"description": "Cotton T-shirts",
"hs_code": "6109.10",
"quantity": 500,
"weight_kg": 0.18,
"package_number": "PKG-001"
}
],
"packing_summary": {
"total_packages": 2,
"total_quantity": 1000,
"total_weight_kg": 90
},
"notes": null
},
"duration_ms": 2,
"disclaimer": "This document is auto-generated for informational purposes. It may not meet all regulatory requirements for every jurisdiction. Verify wi..."
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"request_id": "<string>",
"details": [
"<unknown>"
],
"limit": 123,
"code": "<string>",
"field": "<string>"
}Authorizations
Body
application/json