Accounting export
Accounting export: all invoices and credit notes of a period as one CSV file for your bookkeeping software.
Export invoices for accounting#
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
First issue date, inclusive. Days are calendar days in Swiss time (Europe/Zurich).
Last issue date, inclusive. Must not be before from.
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
text/csv; charset=utf-8.
attachment; filename="buchhaltung-<shop handle>-<from>-<to>.csv".
private, no-store.
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.
Invoice number; for credit notes the credit note number.
Issue date, YYYY-MM-DD in Swiss time.
Rechnung (invoice) or Gutschrift (credit note).
Credit notes: number of the invoice they correct, also when that invoice lies outside the period. Empty for invoices.
Order number.
Order id (UUID).
Gross total with two decimals and a dot, e.g. 85.90. Negative for credit notes.
Net amount. Negative for credit notes.
Tax amount. Negative for credit notes.
Tax rate in percent, e.g. 8.1; 0 for documents without tax.
Document currency, e.g. CHF.
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.
Customer VAT ID, if given.
Delivery country, two-letter code.
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).
Country the goods were shipped from, when known.
Payment method.
Payment transaction reference stored with the document; for older documents the payment provider's payment id (e.g. pi_...).
ausgestellt (issued), Entwurf (draft), storniert (voided) or ersetzt (replaced by a corrected invoice).
Book currency of the selling entity: CHF for Switzerland, EUR for Germany and Austria, empty otherwise.
Errors
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.
The acting user is unknown or has no billing permission in the shop. The body has only message, no error field.
The export could not be built (e.g. a database error). The body has only message, no error field.
Any endpoint. Response carries header WWW-Authenticate: Bearer resource_metadata="<origin>/.well-known/oauth-protected-resource".
Scope check per endpoint (and per body field on PATCH /orders/:id).
shop_id query parameter names a shop outside the credential's reach.
Multi-shop OAuth token without shop_id.
Any endpoint when the resolved shop has active=false.
Any endpoint. Header Retry-After (seconds until the next minute bucket).
Any unexpected error while processing the 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.csvconst res = await fetch("https://api.ecomone.shop/api/public/v1/invoices/accounting", {
headers: {
"X-Api-Key": process.env.ECOMONE_API_KEY,
"X-Api-Secret": process.env.ECOMONE_API_SECRET,
},
});
if (!res.ok) throw new Error((await res.json()).message);
const csv = await res.text(); // semicolon-separated, UTF-8import os, requests
res = requests.get(
"https://api.ecomone.shop/api/public/v1/invoices/accounting",
headers={
"X-Api-Key": os.environ["ECOMONE_API_KEY"],
"X-Api-Secret": os.environ["ECOMONE_API_SECRET"],
},
timeout=120,
)
res.raise_for_status()
open("accounting.csv", "wb").write(res.content)"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"