curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.edi.stateset.com/v1/edifact/outbound/invoic/{partner_id}' \
--header "Authorization: Bearer $EDI_API_TOKEN" \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?Set a unique key for this operation; preserve it on retries}" \
--header 'Content-Type: application/json' \
--data '{
"allowances": [
{
"amount": "49.00",
"code": "string",
"indicator": "string"
}
],
"buyer": "string",
"currency": "USD",
"document_code": "string",
"invoice_date": "2026-08-31T14:22:05Z",
"invoice_number": "ORD-10042",
"lines": [
{
"allowances": [
{
"amount": "49.00",
"code": "string",
"indicator": "string"
}
],
"amount": "49.00",
"item": "string",
"line_number": "string",
"price": "49.00",
"price_basis": "string",
"quantity": "2",
"tax_rate": "string"
}
],
"order_number": "ORD-10042",
"supplier": "string",
"tax_amount": "4.12",
"tax_rate": "string",
"taxes": [
{
"amount": "49.00",
"category": "standard",
"rate": "string",
"taxable_amount": "49.00"
}
],
"total_amount": "102.12"
}'
Edifact outbound invoic
Wire-ready UN/EDIFACT INVOIC interchange
POST
/
v1
/
edifact
/
outbound
/
invoic
/
{partner_id}
curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.edi.stateset.com/v1/edifact/outbound/invoic/{partner_id}' \
--header "Authorization: Bearer $EDI_API_TOKEN" \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?Set a unique key for this operation; preserve it on retries}" \
--header 'Content-Type: application/json' \
--data '{
"allowances": [
{
"amount": "49.00",
"code": "string",
"indicator": "string"
}
],
"buyer": "string",
"currency": "USD",
"document_code": "string",
"invoice_date": "2026-08-31T14:22:05Z",
"invoice_number": "ORD-10042",
"lines": [
{
"allowances": [
{
"amount": "49.00",
"code": "string",
"indicator": "string"
}
],
"amount": "49.00",
"item": "string",
"line_number": "string",
"price": "49.00",
"price_basis": "string",
"quantity": "2",
"tax_rate": "string"
}
],
"order_number": "ORD-10042",
"supplier": "string",
"tax_amount": "4.12",
"tax_rate": "string",
"taxes": [
{
"amount": "49.00",
"category": "standard",
"rate": "string",
"taxable_amount": "49.00"
}
],
"total_amount": "102.12"
}'
Path parameters
string
required
Partner ID
Headers
string,null
Stable unique request key (1–128 ASCII letters/digits or -_.:). Requires Postgres. Retries return the original EDI bytes; changed JSON payload returns 409.
Request body
EdifactInvoice
EdifactInvoiceAllowance[]
Invoice-level allowances and charges (ALC + MOA): the header SG15 groups the summary does not total, then the summary SG51 totals (a summary group supersedes header groups with the same indicator and service code). The builder writes them in the summary.
string,null
string,null
CUX+2 — invoice currency (ISO 4217, e.g.
EUR).string,null
BGM C002 document name code (380 commercial invoice, 381 credit note).
string,null
string
required
EdifactInvoiceLine[]
required
Show EdifactInvoiceLine
Show EdifactInvoiceLine
EdifactInvoiceAllowance[]
string,null
MOA+203 line item amount, when present.
string
required
Item identifier (EAN/GTIN or supplier code) from the LIN segment.
string
required
string,null
PRI+AAA unit price, when present.
string,null
PRI C509 5284 unit price basis (
price is per this many units, e.g. 10); None means per 1.string
required
QTY+47 invoiced quantity.
string,null
SG33 TAX+7 under this LIN — the line’s VAT rate in percent, when the line states its own (TAX inside a line ALC group is not the line’s).
string,null
SG1 RFF+ON at header level — the buyer’s purchase order number.
string,null
string,null
MOA+124 — the tax amount. Kept for compatibility with [
Invoice::taxes]: the parser sets it to the sum of the summary tax groups’ amounts.string,null
TAX+7 — the VAT rate in percent. Kept for compatibility with [
Invoice::taxes]: the parser sets it to the first summary tax group’s rate (or, with no summary TAX, the header SG6 TAX+7). A line’s SG33 TAX goes to [InvoiceLine::tax_rate]; TAX inside an ALC group (SG21 / SG43) feeds neither.EdifactInvoiceTax[]
The summary tax breakdown (SG50 TAX-MOA), one entry per rate. When non-empty the builder emits these and ignores
tax_rate/tax_amount.string,null
MOA+86 / +9 message total amount payable, when present.
Response
No response body. Wire-ready UN/EDIFACT INVOIC interchange.Status codes
| Code | Meaning |
|---|---|
200 | Wire-ready UN/EDIFACT INVOIC interchange |
403 | Not this credential’s partner |
409 | Idempotency-Key reused with a different payload |
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/edifact/outbound/invoic/{partner_id}' \
--header "Authorization: Bearer $EDI_API_TOKEN" \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?Set a unique key for this operation; preserve it on retries}" \
--header 'Content-Type: application/json' \
--data '{
"allowances": [
{
"amount": "49.00",
"code": "string",
"indicator": "string"
}
],
"buyer": "string",
"currency": "USD",
"document_code": "string",
"invoice_date": "2026-08-31T14:22:05Z",
"invoice_number": "ORD-10042",
"lines": [
{
"allowances": [
{
"amount": "49.00",
"code": "string",
"indicator": "string"
}
],
"amount": "49.00",
"item": "string",
"line_number": "string",
"price": "49.00",
"price_basis": "string",
"quantity": "2",
"tax_rate": "string"
}
],
"order_number": "ORD-10042",
"supplier": "string",
"tax_amount": "4.12",
"tax_rate": "string",
"taxes": [
{
"amount": "49.00",
"category": "standard",
"rate": "string",
"taxable_amount": "49.00"
}
],
"total_amount": "102.12"
}'
Last modified on October 20, 2026