curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.edi.stateset.com/v1/commercial-invoice/{partner_id}' \
--header "Authorization: Bearer $EDI_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"buyer": {
"address_lines": [
"548 Market St"
],
"city": "San Francisco",
"country": "US",
"name": "Two-Person Tent",
"postal_code": "94107",
"state": "CA",
"tax_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"currency": "USD",
"freight": "string",
"incoterms": "string",
"incoterms_place": "string",
"insurance": "string",
"invoice_date": "2026-08-31T14:22:05Z",
"invoice_number": "ORD-10042",
"lines": [
{
"country_of_origin": "US",
"description": "Two-person tent, green — replacement for damaged pole set.",
"hs_code": "string",
"net_weight_kg": "string",
"quantity": "2",
"sku": "SKU-TENT-2P-GRN",
"unit_price": "49.00",
"uom": "string"
}
],
"po_number": "ORD-10042",
"reason_for_export": "string",
"seller": {
"address_lines": [
"548 Market St"
],
"city": "San Francisco",
"country": "US",
"name": "Two-Person Tent",
"postal_code": "94107",
"state": "CA",
"tax_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"ship_to": {
"address_lines": [
"548 Market St"
],
"city": "San Francisco",
"country": "US",
"name": "Two-Person Tent",
"postal_code": "94107",
"state": "CA",
"tax_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}'
Generates a commercial invoice / customs document from a canonical…
Commercial invoice (structured + HTML)
POST
/
v1
/
commercial-invoice
/
{partner_id}
curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.edi.stateset.com/v1/commercial-invoice/{partner_id}' \
--header "Authorization: Bearer $EDI_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"buyer": {
"address_lines": [
"548 Market St"
],
"city": "San Francisco",
"country": "US",
"name": "Two-Person Tent",
"postal_code": "94107",
"state": "CA",
"tax_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"currency": "USD",
"freight": "string",
"incoterms": "string",
"incoterms_place": "string",
"insurance": "string",
"invoice_date": "2026-08-31T14:22:05Z",
"invoice_number": "ORD-10042",
"lines": [
{
"country_of_origin": "US",
"description": "Two-person tent, green — replacement for damaged pole set.",
"hs_code": "string",
"net_weight_kg": "string",
"quantity": "2",
"sku": "SKU-TENT-2P-GRN",
"unit_price": "49.00",
"uom": "string"
}
],
"po_number": "ORD-10042",
"reason_for_export": "string",
"seller": {
"address_lines": [
"548 Market St"
],
"city": "San Francisco",
"country": "US",
"name": "Two-Person Tent",
"postal_code": "94107",
"state": "CA",
"tax_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"ship_to": {
"address_lines": [
"548 Market St"
],
"city": "San Francisco",
"country": "US",
"name": "Two-Person Tent",
"postal_code": "94107",
"state": "CA",
"tax_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}'
Path parameters
string
required
Partner ID
Request body
CommercialInvoice
CustomsParty
required
A party on the customs document (exporter, importer, or consignee).
string
ISO currency code the values are expressed in.
string,null
Freight charge added to the customs value (when DDP/CIF style terms).
string,null
Incoterms 2020 three-letter rule, e.g.
DAP, DDP, EXW.string,null
Named place for the incoterm, e.g.
Rotterdam.string,null
Insurance charge added to the customs value.
string
required
string
required
CustomsLine[]
required
Show CustomsLine
Show CustomsLine
string,null
ISO country of origin (where the goods were manufactured).
string
required
string,null
Harmonized System tariff code (6–10 digits). Customs assesses duty by this code, so it is required for a compliant declaration.
string,null
Net weight in kilograms for this line — required by postal customs declarations (CN22/CN23).
string
required
string,null
string
required
string
string,null
string,null
Why the goods are being exported (sale, sample, return, gift) — a CN22/23 and many national customs forms require it.
CustomsParty
required
A party on the customs document (exporter, importer, or consignee).
CustomsParty,null
A party on the customs document (exporter, importer, or consignee).
Response
No response body. Commercial invoice (structured + HTML).Status codes
| Code | Meaning |
|---|---|
200 | Commercial invoice (structured + HTML) |
403 | Not this credential’s partner |
422 | Invalid payload |
Using this contract
Read the source OpenAPI document for declared schemas and alternatives. This page also includes documented corrections from the spec overlays. Example IDs and values are illustrative; replace them with records from your workspace.curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.edi.stateset.com/v1/commercial-invoice/{partner_id}' \
--header "Authorization: Bearer $EDI_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
"buyer": {
"address_lines": [
"548 Market St"
],
"city": "San Francisco",
"country": "US",
"name": "Two-Person Tent",
"postal_code": "94107",
"state": "CA",
"tax_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"currency": "USD",
"freight": "string",
"incoterms": "string",
"incoterms_place": "string",
"insurance": "string",
"invoice_date": "2026-08-31T14:22:05Z",
"invoice_number": "ORD-10042",
"lines": [
{
"country_of_origin": "US",
"description": "Two-person tent, green — replacement for damaged pole set.",
"hs_code": "string",
"net_weight_kg": "string",
"quantity": "2",
"sku": "SKU-TENT-2P-GRN",
"unit_price": "49.00",
"uom": "string"
}
],
"po_number": "ORD-10042",
"reason_for_export": "string",
"seller": {
"address_lines": [
"548 Market St"
],
"city": "San Francisco",
"country": "US",
"name": "Two-Person Tent",
"postal_code": "94107",
"state": "CA",
"tax_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"ship_to": {
"address_lines": [
"548 Market St"
],
"city": "San Francisco",
"country": "US",
"name": "Two-Person Tent",
"postal_code": "94107",
"state": "CA",
"tax_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}'
Last modified on October 20, 2026