ecomone developers
Open Ecomone
Docs / API reference / Accounting export

Accounting export

Accounting export: all invoices and credit notes of a period as one CSV file for your bookkeeping software.

Export invoices for accounting#

GET/api/public/v1/invoices/accountingorders:read

Returns every invoice and credit note issued in the period as one CSV file (text/csv, not JSON). Values come from the documents as they were issued; later changes to the order do not alter them. The export only reads and never issues or changes a document. Besides the orders:read scope, the user who created the API key (or authorized the OAuth token) needs billing permission in the shop. CSV format: UTF-8 with byte order mark, semicolon-separated, every value in double quotes, CRLF line endings, one header row, then one row per document sorted by issue time. Values a spreadsheet would read as a formula get a leading apostrophe.

Query parameters

fromstring (YYYY-MM-DD)required

First issue date, inclusive. Days are calendar days in Swiss time (Europe/Zurich).

tostring (YYYY-MM-DD)required

Last issue date, inclusive. Must not be before from.

shop_iduuid

Only for OAuth tokens that cover several shops: the shop to query. Must be one of the token's shops (else 403 forbidden). Required when the token covers more than one shop (else 400 shop_required). Optional for API keys (a key belongs to exactly one shop; any other value returns 403).

Response fields

Content-Type (header)string

text/csv; charset=utf-8.

Content-Disposition (header)string

attachment; filename="buchhaltung-<shop handle>-<from>-<to>.csv".

Cache-Control (header)string

private, no-store.

X-Missing-Snapshots (header)integer

Number of documents in the period that were not frozen when issued. Their rows are included, but the amounts and most other columns are empty.

Column 1: Rechnungsnummerstring

Invoice number; for credit notes the credit note number.

Column 2: Rechnungsdatumstring

Issue date, YYYY-MM-DD in Swiss time.

Column 3: Belegartstring

Rechnung (invoice) or Gutschrift (credit note).

Column 4: Ursprungsrechnungstring

Credit notes: number of the invoice they correct, also when that invoice lies outside the period. Empty for invoices.

Column 5: Bestellnummerstring

Order number.

Column 6: Order-IDstring

Order id (UUID).

Column 7: Rechnungs-Gesamtbetragstring

Gross total with two decimals and a dot, e.g. 85.90. Negative for credit notes.

Column 8: Nettostring

Net amount. Negative for credit notes.

Column 9: Steuerbetragstring

Tax amount. Negative for credit notes.

Column 10: Steuersatzstring

Tax rate in percent, e.g. 8.1; 0 for documents without tax.

Column 11: Währungstring

Document currency, e.g. CHF.

Column 12: Wechselkursstring

Exchange rate into the book currency (column Buchwährung) when the document currency differs. Stored with the document; for older documents taken from the payment provider's conversion of the payment. Empty when the currencies match or no rate is known.

Column 13: USt-IdNr. Kundestring

Customer VAT ID, if given.

Column 14: Lieferland ISOstring

Delivery country, two-letter code.

Column 15: Steuerland ISOstring

Country whose tax applies, two-letter code. For documents without tax one of: RC (reverse charge), IG (intra-community supply), EXPORT (export out of the EU), NICHT_STEUERBAR (not taxable).

Column 16: Versandland ISOstring

Country the goods were shipped from, when known.

Column 17: Zahlartstring

Payment method.

Column 18: Externe Transaktionsnummerstring

Payment transaction reference stored with the document; for older documents the payment provider's payment id (e.g. pi_...).

Column 19: Statusstring

ausgestellt (issued), Entwurf (draft), storniert (voided) or ersetzt (replaced by a corrected invoice).

Column 20: Buchwährungstring

Book currency of the selling entity: CHF for Switzerland, EUR for Germany and Austria, empty otherwise.

Errors

400

from or to is missing or not a valid YYYY-MM-DD date, or from is after to. The body has only message, no error field.

403

The acting user is unknown or has no billing permission in the shop. The body has only message, no error field.

503

The export could not be built (e.g. a database error). The body has only message, no error field.

401unauthorized

Any endpoint. Response carries header WWW-Authenticate: Bearer resource_metadata="<origin>/.well-known/oauth-protected-resource".

403forbidden

Scope check per endpoint (and per body field on PATCH /orders/:id).

403forbidden

shop_id query parameter names a shop outside the credential's reach.

400shop_required

Multi-shop OAuth token without shop_id.

404not_found

Any endpoint when the resolved shop has active=false.

429rate_limited

Any endpoint. Header Retry-After (seconds until the next minute bucket).

500server_error

Any unexpected error while processing the request.

Try itNot authorized
Request
curl "https://api.ecomone.shop/api/public/v1/invoices/accounting" \
  -H "X-Api-Key: $ECOMONE_API_KEY" \
  -H "X-Api-Secret: $ECOMONE_API_SECRET" \
  -o accounting.csv
200Response · text/csv
"Rechnungsnummer";"Rechnungsdatum";"Belegart";"Ursprungsrechnung";"Bestellnummer";"Order-ID";"Rechnungs-Gesamtbetrag";"Netto";"Steuerbetrag";"Steuersatz";"Währung";"Wechselkurs";"USt-IdNr. Kunde";"Lieferland ISO";"Steuerland ISO";"Versandland ISO";"Zahlart";"Externe Transaktionsnummer";"Status";"Buchwährung"
"RE-2026-0412";"2026-10-03";"Rechnung";"";"1042";"9f1c2b7e-4a55-4d1f-9b62-1c0a3f6d8e21";"85.90";"79.46";"6.44";"8.1";"CHF";"";"";"CH";"CH";"CH";"card";"pi_3PqExample0001";"ausgestellt";"CHF"
"GS-2026-0031";"2026-10-09";"Gutschrift";"RE-2026-0412";"1042";"9f1c2b7e-4a55-4d1f-9b62-1c0a3f6d8e21";"-85.90";"-79.46";"-6.44";"8.1";"CHF";"";"";"CH";"CH";"CH";"card";"pi_3PqExample0001";"ausgestellt";"CHF"

Authorize requests

Requests go straight from your browser to https://api.ecomone.shop. Your credentials stay in this browser tab and are never sent to this documentation site.