pixiEmillInvoicesList
Returns all invoices of a date range, optionally limited to one shop, with customer data and the related order, for the eMill integration.
Lists invoices for the eMill integration.
ShopID: if empty or omitted, invoices of all shops are returned; otherwise only invoices whoseInvShopIDequalsShopID.DateFrom: if omitted or earlier than 1990-01-01, the start of the current day (00:00:00) is used.DateTo: if omitted or earlier than 1990-01-01, the end of the current day (23:59:59.997) is used.- An invoice is returned if its
InvDatelies betweenDateFromandDateTo(both inclusive).
For each invoice the call adds:
- customer data (external customer number, salutation, names, e-mail) from the customer referenced by the invoice; these columns are empty if no customer is found;
- order data (
OrderNr,OrderNrExternal,OrdShopID,OrderDate) from the order line with the highest key among the invoice lines of the invoice.
The result has no defined sort order.
Notes
- All tables are read
WITH (NOLOCK); uncommitted data may appear. - Invoices without invoice lines, or whose highest referenced order line does not exist, are not returned (inner join on the order line).
- If only one date is passed, the other defaults to today: passing only a
DateToin the past results inDateFrom= today and therefore an empty result. DateTowithout time part means midnight, so invoices later on that day are excluded; pass the end of the day explicitly.- Only one order is reported per invoice, even if the invoice covers lines of several orders.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
ShopID
|
varchar(3) string |
NULL |
Shop ID to filter invoices by ( Example: |
DateFrom
|
datetime dateTime |
NULL |
Start of the invoice date range (inclusive). Omitted or before 1990-01-01: start of the current day. Example: |
DateTo
|
datetime dateTime |
NULL |
End of the invoice date range (inclusive). Omitted or before 1990-01-01: end of the current day (23:59:59.997). Example: |
Result set 1 · Always (may be empty)
One row per invoice in the date range (and shop, if given) that has at least one existing order line.
| Column | Type | Description |
|---|---|---|
InvoiceNr
|
string |
Invoice number. |
InvoiceKey
|
int |
Internal key of the invoice. |
CustomerNrExternal
Nullable |
string |
External customer number; empty if no customer is linked. |
SAnrede
Nullable |
string |
Salutation of the customer. |
SName
Nullable |
string |
Customer name. |
SName2
Nullable |
string |
Second name line of the customer. |
Email
Nullable |
string |
E-mail address of the customer ( |
InvDate
|
dateTime |
Invoice date. |
OrderNr
Nullable |
int |
Pixi order number of the order line with the highest key on the invoice. |
OrderNrExternal
Nullable |
string |
External (shop) order number. |
OrdShopID
Nullable |
string |
Shop ID of the order. |
OrderDate
Nullable |
dateTime |
Order date. |
Response example
<SqlRowSet1>
<row>
<InvoiceNr>RE240512</InvoiceNr>
<InvoiceKey>48213</InvoiceKey>
<CustomerNrExternal>K10023</CustomerNrExternal>
<SAnrede>Frau</SAnrede>
<SName>Anna Müller</SName>
<SName2/>
<Email>anna.mueller@example.com</Email>
<InvDate>2024-05-14T10:22:31</InvDate>
<OrderNr>153344</OrderNr>
<OrderNrExternal>100004711</OrderNrExternal>
<OrdShopID>SH1</OrdShopID>
<OrderDate>2024-05-12T18:05:00</OrderDate>
</row>
</SqlRowSet1>
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:pixiEmillInvoicesList>
<!-- <ShopID>SH1</ShopID> -->
<!-- <DateFrom>2024-05-01T00:00:00</DateFrom> -->
<!-- <DateTo>2024-05-31T23:59:59</DateTo> -->
</ns1:pixiEmillInvoicesList>
</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:pixiEmillInvoicesList>
<!-- <ShopID>SH1</ShopID> -->
<!-- <DateFrom>2024-05-01T00:00:00</DateFrom> -->
<!-- <DateTo>2024-05-31T23:59:59</DateTo> -->
</ns1:pixiEmillInvoicesList>
</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 = [
// 'ShopID' => 'SH1',
// 'DateFrom' => '2024-05-01T00:00:00',
// 'DateTo' => '2024-05-31T23:59:59',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiEmillInvoicesList', $soapArguments);
- SQL object:
- dbo.pipiEmillInvoicesList