Skip to content

Create Invoice

Required scope: invoice:create

The invoice lines, currency, totals, customer, and portfolio are derived from the immutable commercial order revision. integrationId identifies a connected accounting integration configured in HeyX.

Generated Reference
POST /public-api/publicapi.v1.Invoice/CreateInvoice

Creates or returns the provider draft for an immutable order revision. Reusing idempotency_key with different input is rejected.

Request CreateInvoiceRequest
Response CreateInvoiceResponse

CreateInvoiceRequest

Field Type
integration_id string
order_id string
expected_order_version int32
idempotency_key string

CreateInvoiceResponse

Field Type
invoice Invoice
{
"integrationId": "<accounting-integration-id>",
"orderId": "<commercial-order-id>",
"expectedOrderVersion": 2,
"idempotencyKey": "erp-invoice-order-123-v2"
}

Retry an ambiguous timeout with the same idempotency key and identical input. Reusing the key with different input is rejected. Creation does not send the invoice.