> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Edifact outbound invoic

> Wire-ready UN/EDIFACT INVOIC interchange

### Path parameters

**partner\_id** `string` *required*

Partner ID

### Headers

**Idempotency-Key** `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`

**allowances** `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.

**EdifactInvoiceAllowance**

**amount** `string` *required*

**code** `string,null`

ALC 7161 special service code (e.g. `DI` discount, `FC` freight).

**indicator** `string` *required*

ALC 5463: `A` allowance or `C` charge.

**buyer** `string,null`

**currency** `string,null`

CUX+2 — invoice currency (ISO 4217, e.g. `EUR`).

**document\_code** `string,null`

BGM C002 document name code (380 commercial invoice, 381 credit note).

**invoice\_date** `string,null`

**invoice\_number** `string` *required*

**lines** `EdifactInvoiceLine[]` *required*

**EdifactInvoiceLine**

**allowances** `EdifactInvoiceAllowance[]`

Line-level allowances and charges (SG38 ALC under this LIN + MOA).

**EdifactInvoiceAllowance**

**amount** `string` *required*

**code** `string,null`

ALC 7161 special service code (e.g. `DI` discount, `FC` freight).

**indicator** `string` *required*

ALC 5463: `A` allowance or `C` charge.

**amount** `string,null`

MOA+203 line item amount, when present.

**item** `string` *required*

Item identifier (EAN/GTIN or supplier code) from the LIN segment.

**line\_number** `string` *required*

**price** `string,null`

PRI+AAA unit price, when present.

**price\_basis** `string,null`

PRI C509 5284 unit price basis (`price` is per this many units, e.g. 10); `None` means per 1.

**quantity** `string` *required*

QTY+47 invoiced quantity.

**tax\_rate** `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).

**order\_number** `string,null`

SG1 RFF+ON at header level — the buyer's purchase order number.

**supplier** `string,null`

**tax\_amount** `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.

**tax\_rate** `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.

**taxes** `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`.

**EdifactInvoiceTax**

**amount** `string,null`

MOA+124 tax amount (or MOA+150 value added tax amount).

**category** `string,null`

TAX 5305 duty/tax/fee category (`S` standard, `AA` lower, `E` exempt…).

**rate** `string,null`

TAX C243 5278 — the rate in percent.

**taxable\_amount** `string,null`

MOA+125 taxable amount — the base the rate applies to.

**total\_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](https://docs.stateset.com/spec/edi.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
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"
}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.