User Tools

Site Tools


api:integration:economic:invoice:draft

API : Economic Create Invoices

Introduction

Used to export invoices to e-conomic. The invoices will be created as orders in e-conomic, and not booked directly.

An e-mail will be send to the user (if they are registered with an e-mail address) and the customer's accounting system email, when the export is done. Exporting the invoices can take some time, which means that by the time this request responds, it will not be done exporting.

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.

Request

URL https://api.telecomx.dk/integration/economic/layout
Method POST
Access level RESELLER (if exporting invoices for themselves) or ADMIN.
Body reseller Id Id of the customer/reseller to export invoices for, defaults to users own customer
groupInvoiceLines Boolean [optional] Used to group invoice lines together, which have the same product and period. Defaults to false
layout Integer [optional] Number of a specific e-conomic layout to use for all invoices.
invoiceDate String [optional] Date to export invoices from, in YYYY-MM-DD format e.g (2022-12-01). Defaults to the first of the current month
invoicesToOmit Array<ID> [optional] Array of invoiceIds to not export
adminMode Boolean [optional] Can ONLY be used by admins, to export reseller invoices.
externalLicenses Boolean If true, returns the external license invoice lines instead.

Query examples

https://api.telecomx.dk/integration/economic/invoice/draft
https://api.telecomx.dk/integration/economic/invoice/draft?reseller=1234567890ABCD1234567890
https://api.telecomx.dk/integration/economic/invoice/draft?reseller=1234567890ABCD1234567890&layout=21

Body example

{
  "reseller": "1234567890ABCD1234567890",
  "groupInvoiceLines": true,
  "layout": 24,
  "invoiceDate": "2022-01-31",
  "invoicesToOmit": [ "6234567890ABCD1234567890", "1234567890ABDC1234567890"]
}

Response

Layout object
Property Type Description
success Boolean True if successfully exported
total Number How many invoices there are in total, including the invoicesOmitted
exported Number Amount of exported invoices

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": 31
}

Errors

Error code Message Description
403 access_denied Insufficient access level
403 economic The integration is not valid.
404 id Customer not found
404 reseller Reseller not found
422 multiple <multiple errors defined below>
500 internal_error <Unspecified>

Multiple errors

Error code Message Description
422 customer Customer was not found for invoice: <invoice ID>
422 finance.accountingSystemId Accounting system ID is not found for: <customer name>
422 economic.customer Customer not found in economic: <customer name>
422 economic.customerGroup.layout Customer did not have a layout available: <customer name>
422 economic.product Product not found in e-conomic with product code: <product code>
api/integration/economic/invoice/draft.txt · Last modified: 2023/03/21 10:54 by Joakim Andersen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki