Invoices
Endpoints under /api2/invoice to list, look up, create (full or partial capture) and resend the email of invoices linked to orders. Supports capture in online, offline or no_capture modes and identification by order_id or order_increment_id.
Overview
The invoices resource documents the financial side of the order: capture, gateway interaction and customer email. For shared family rules (pagination, dates, HTTP statuses, items handling), see the main Orders page.
online, offline and no_capture.order_id or order_increment_id.order_item_id or sku + qty./api2/invoice and /api2/invoices.List invoices.
1 open, 2 paid, 3 canceled.entity_id, created_at, updated_at, increment_id, grand_total.Examples
GET /api2/invoice?page=1&limit=50&include_pagination=1
Authorization: Bearer {{token}}
GET /api2/invoice?order_increment_id=100000123
Authorization: Bearer {{token}}
{
"page": 1,
"limit": 50,
"include_pagination": 1,
"order_increment_id": "100000123",
"created_from": "2026-01-01",
"created_to": "2026-12-31"
}
invoices key. Lookup by ID or single increment_id uses the invoice key. A plural alias /api2/invoices exists.Get a single invoice.
GET /api2/invoice?id=456
Authorization: Bearer {{token}}
GET /api2/invoice?increment_id=100000045
Authorization: Bearer {{token}}
Capture an order invoice fully or partially.
order_item_id or sku + qty. If omitted, captures all available quantities.online, offline or no_capture. Default offline.true, sends the invoice email after saving.Full capture
POST /api2/invoice/create
Authorization: Bearer {{token}}
Content-Type: application/json
{
"order_increment_id": "100000123",
"capture": "offline",
"send_email": true,
"comment": "Invoice created by integration."
}
Partial capture
POST /api2/invoice/create
Authorization: Bearer {{token}}
Content-Type: application/json
{
"order_id": 123,
"items": [
{"order_item_id": 10, "qty": 1},
{"sku": "PRODUCT-001", "qty": 2}
],
"capture": "no_capture"
}
Resend the invoice email. Identify the invoice with invoice_id, id or increment_id.
POST /api2/invoice/email
Authorization: Bearer {{token}}
Content-Type: application/json
{
"invoice_id": 456,
"comment": "Resend requested by integration."
}
Supported usage patterns
Tested and certified combinations for the Invoices resource.
GET /api2/invoice?state=1&include_pagination=1GET /api2/invoice?order_increment_id=100000123GET /api2/invoice?increment_id=100000045POST /api2/invoice/create + capture=offlinePOST /api2/invoice/create + items[] + capture=no_capturePOST /api2/invoice/emailIntegration recommendations
Recommended
- Keep
capture=offlinefor administrative flows that must not trigger gateway capture. - Use
capture=onlineonly when the payment method supports it and the goal is to confirm the charge immediately. - For partial invoices, validate item availability via the order lookup before sending.
Avoid
- Trusting
send_email=truealone instead of an explicit resend via/api2/invoice/emailafter SMTP failures. - Mixing
order_idandorder_increment_idin the same payload. - Using
capture=onlinewithout confirming gateway support — the error will surface from the payment integration.
Financial audit
For accounting reconciliation, prefer capture=offline + comment identifying the source system (e.g. "Invoiced via ERP-XYZ"). This keeps traceability in the order history without touching the gateway.
Common errors
| Status | Sample body | When it happens |
|---|---|---|
400 | {"error": "Invalid item"} | An items entry without order_item_id/sku or with non-positive qty. |
400 | {"error": "Cannot create invoice"} | The order no longer accepts further invoicing (e.g. fully invoiced or canceled). |
401 | {"error": "Unauthorized"} | Missing Authorization or expired token. |
404 | {"error": "Order not found"} | Unknown order_id or order_increment_id. |
404 | {"error": "Invoice not found"} | Unknown invoice_id or increment_id. |
409 | {"error": "Conflict on save"} | Duplicate or deadlock on concurrent writes. |
500 | {"error": "Payment gateway error"} | Failure relayed by the payment method when capture=online. |