pixiGetDatevExportInvoices
Returns the DATEV export data for invoices in a date range, optionally filtered by shop, country, invoice number, external order number, account and cost center.
Provides the DATEV export file "Invoices" through the API.
- The call reads the setting
BookExportDatevActive(shown in Pixi as "DATEV API Calls"). - If the setting is
1, it passes all parameters unchanged to the internal procedurePixi_DatevExportInvoicesand returns that procedure's result. It also passes@SetStartAndEndOfDay = 0. - If the setting is not
1, the call does not run an export. It returns one status row withStatus=ERRORand a message saying that the setting is not enabled.
Parameters:
DateFromandDateToare required and define the period of the export.- All other parameters are optional filters. If a filter is left out (
NULL), no restriction is applied on that criterion. This assumes that the internal procedure treatsNULLthis way. ShowOnlySumsasks for a summed output instead of individual lines.
Notes
- The actual export logic, the filter semantics and the columns of the export result set are in
Pixi_DatevExportInvoices. Its definition is not attached, so the columns and any side effects of the export cannot be documented here. - Because
@SetStartAndEndOfDay = 0is passed,DateFromandDateToare presumably used exactly as sent and are not extended to 00:00 / 23:59:59. To cover whole days, send explicit times, e.g.2024-01-31T23:59:59. - The setting is read through
fpixi_GetSetting. If the setting does not exist, this function returns0, so the call returns the error row. A setting value that cannot be converted toBITcauses a conversion error. - The setting is read from
SettingswithNOLOCK.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
DateFrom
Required
|
datetime dateTime |
– |
Start of the export period. Example: |
DateTo
Required
|
datetime dateTime |
– |
End of the export period. The value is presumably used exactly as sent, so include the time of day. Example: |
ShopId
|
varchar(3) string |
NULL |
Optional filter by shop ID. Example: |
ShowOnlySums
|
bit boolean |
0 |
If Example: |
Country
|
varchar(3) string |
NULL |
Optional filter by country code. Example: |
InvoiceNr
|
varchar(20) string |
NULL |
Optional filter by invoice number. Example: |
OrderNrExternal
|
varchar(50) string |
NULL |
Optional filter by external (shop) order number. Example: |
BookKeepingAccount
|
varchar(255) string |
NULL |
Optional filter by bookkeeping account number. Example: |
CostCenter
|
varchar(8) string |
NULL |
Optional filter by cost center. Example: |
Result set 1 · If the setting BookExportDatevActive = 1
The DATEV invoice export rows, as returned by Pixi_DatevExportInvoices. Its definition is not attached, so the columns cannot be listed.
Result set 2 · If the setting BookExportDatevActive is not 1
A single status row saying that the DATEV API calls are not enabled.
| Column | Type | Description |
|---|---|---|
Status
|
varchar(5) string |
Always |
StatusMessage
|
varchar(65) string |
Error text. |
Response example
<SqlRowSet1>
<row>
<Status>ERROR</Status>
<StatusMessage>Setting "DATEV API Calls" (BookExportDatevActive) is not enabled.</StatusMessage>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| ERROR | Setting "DATEV API Calls" (BookExportDatevActive) is not enabled. | The setting `BookExportDatevActive` is missing or not set to `1`. Enable "DATEV API Calls" in the Pixi settings. |
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
Authorization: Basic BASE64(USERNAME:PASSWORD)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiGetDatevExportInvoices>
<DateFrom>2024-01-01T00:00:00</DateFrom>
<DateTo>2024-01-31T23:59:59</DateTo>
<!-- <ShopId>SHP</ShopId> -->
<!-- <ShowOnlySums>0</ShowOnlySums> -->
<!-- <Country>DE</Country> -->
<!-- <InvoiceNr>RE2024000123</InvoiceNr> -->
<!-- <OrderNrExternal>100045678</OrderNrExternal> -->
<!-- <BookKeepingAccount>8400</BookKeepingAccount> -->
<!-- <CostCenter>1000</CostCenter> -->
</ns1:pixiGetDatevExportInvoices>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
curl -X POST 'https://apigateway.descartes.com/tms/pixi/' \
--user 'USERNAME:PASSWORD' \
--header 'Content-Type: text/xml; charset=utf-8' \
--data-binary @- <<'XML'
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiGetDatevExportInvoices>
<DateFrom>2024-01-01T00:00:00</DateFrom>
<DateTo>2024-01-31T23:59:59</DateTo>
<!-- <ShopId>SHP</ShopId> -->
<!-- <ShowOnlySums>0</ShowOnlySums> -->
<!-- <Country>DE</Country> -->
<!-- <InvoiceNr>RE2024000123</InvoiceNr> -->
<!-- <OrderNrExternal>100045678</OrderNrExternal> -->
<!-- <BookKeepingAccount>8400</BookKeepingAccount> -->
<!-- <CostCenter>1000</CostCenter> -->
</ns1:pixiGetDatevExportInvoices>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML
<?php
$soapClient = new SoapClient(null, [
'login' => 'USERNAME',
'password' => 'PASSWORD',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
]);
$arguments = [
'DateFrom' => '2024-01-01T00:00:00',
'DateTo' => '2024-01-31T23:59:59',
// 'ShopId' => 'SHP',
// 'ShowOnlySums' => '0',
// 'Country' => 'DE',
// 'InvoiceNr' => 'RE2024000123',
// 'OrderNrExternal' => '100045678',
// 'BookKeepingAccount' => '8400',
// 'CostCenter' => '1000',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetDatevExportInvoices', $soapArguments);
- SQL object:
- dbo.pipiGetDatevExportInvoices