Table of Contents
API : Economic Create Invoices
Introduction
Used to export a month of customer invoices to e-conomic. The invoices are created as orders in e-conomic, or as invoice drafts when typeIntegration is invoice; nothing is booked.
Before the export is queued, every invoice's customer, the customer's contact reference and every invoice line's product code is checked against the reseller's e-conomic data, so the request fails up front when the export cannot succeed. The export itself runs afterwards, which means that by the time this request responds, it will not be done exporting.
An e-mail will be sent to the user (if they are registered with an e-mail address) and the customer's accounting system email when the export is done.
If the export of invoices should fail, then all the invoices that have been exported will also be deleted from e-conomic as a safety measure.
With adminMode the endpoint exports Telecom X' own reseller invoices to Telecom X' e-conomic agreement instead of the caller's customer invoices.
Request
| URL | https://api.telecomx.dk/integration/economic/invoice/draft | ||
|---|---|---|---|
| Method | POST | ||
| Access level | RESELLER for their own customer. ADMIN for any reseller. RESELLER_ADMIN or ADMIN for adminMode. |
||
| Query | externalLicenses | Boolean | [optional] Export the external license invoices instead of the regular invoices. Defaults to false |
| Body | reseller | Id | [optional] Id of the reseller to export invoices for. Only used for ADMIN, defaults to the user's own customer |
| invoiceDate | String | [optional] Invoice date to export, in YYYY-MM-DD format. Must be the first day of a month, e.g. 2026-09-01. Defaults to the first of the current month |
|
| invoicesToOmit | Array<Id> | [optional] Ids of invoices not to export |
|
| groupInvoiceLines | Boolean | [optional] Group invoice lines with the same product and period into one line. Defaults to false |
|
| layout | Integer | [optional] Number of a specific e-conomic layout to use for all invoices, 0 or above |
|
| note | String | [optional] Note added to every created order or invoice draft, max. 1000 characters |
|
| typeIntegration | String | [optional] order or invoice. Defaults to order |
|
| adminMode | Boolean | [optional] Export Telecom X' reseller invoices instead (RESELLER_ADMIN and ADMIN only). invoiceDate is then required, and reseller and externalLicenses are ignored. Defaults to false |
|
Query examples
POST https://api.telecomx.dk/integration/economic/invoice/draft POST https://api.telecomx.dk/integration/economic/invoice/draft?externalLicenses=true
Body example
{ "reseller": "650000000000000000000001", "groupInvoiceLines": true, "layout": 24, "invoiceDate": "2026-09-01", "invoicesToOmit": [ "650000000000000000000002", "650000000000000000000003" ], "note": "September 2026", "typeIntegration": "order" }
Response
| Json object | ||
|---|---|---|
| Property | Type | Description |
| success | Boolean | True when the export was queued, or when there was nothing to export |
| total | Number | How many invoices there are in total for the invoice date, including the omitted ones |
| exported | Number | How many invoices are exported. 0 when there is nothing to export, and then no export is queued |
Note that since this data is fetched from a third-party, the data returned can not be guaranteed.
Example - normal
{ "success": true, "total": 50, "exported": 48 }
Errors
A single failure found while checking the invoices is returned on its own, with its own error code; two or more are returned together as multiple, with the individual errors inside.
| Error code | Message | Description |
|---|---|---|
| 422 | <property> | Invalid input for the named property - the request body, query or URL parameter failed validation |
| 422 | invoiceDate | Invalid date |
| 403 | access_denied | Insufficient access level |
| 404 | economic.agreementGrantToken | Not found |
| 422 | customer | Customer was not found for invoice: <invoice id> |
| 404 | finance.accountingSystemId | Accounting system ID is not found for: <customer name> |
| 404 | economic.customer | Customer not found in economic: <customer name> |
| 404 | economic.customerContact | No customer contacts found in Economic for: <customer name> |
| 404 | economic.customerContact | Customer reference '<reference>' not found in Economic contacts for: <customer name> |
| 404 | economic.product | Product not found in e-conomic with product code: <product code> |
| 422 | multiple | Multiple errors - see inner |
| 401 | e-conomic rejected the stored agreement grant token. The body is e-conomic's own error, not the standard error object | |
| 500 | internal_error | <Unspecified> |