pixiGetReminders
Returns unpaid invoices of a payment type that are due for the given reminder (dunning) level, including address and shop data.
Lists open invoices that are candidates for the next payment reminder. The call delegates to the internal procedure pixi_GetReminders.
An invoice is returned when all of the following apply:
Invoices.Payedis NULL (not paid).Invoices.Paymentequals@PaymentType.Invoices.totalis greater than 0.- More than the threshold number of days have passed between
Invoices.ScanOutDateand the current server date. - The invoice's current reminder level matches the level that precedes
@ReminderLevel:- level
1:ReminderLevelis NULL or 0, - level
2:ReminderLevel= 1, - level
3:ReminderLevel= 2, - level greater than 3:
ReminderLevel=@ReminderLevel- 1.
- level
- The address referenced by
Invoices.AddrRefbelongs to shop@ShopID, or@ShopIDis NULL (all shops).
The day threshold is determined as follows:
- Levels 1 to 3:
@ReminderDaysif given, otherwise the settingReminderLevel1_Days(if not 0), otherwise 15 (level 1), 30 (level 2) or 45 (level 3). - Levels above 3:
@ReminderDaysif given, otherwise 45. The setting is not used.
Each row contains invoice data, the invoice address and the shop name and customer e-mail of the shop. No sort order is defined.
Notes
- Read-only: the call does not raise the reminder level of the returned invoices. The caller has to update the reminder level by other means, otherwise the same invoices are returned again.
- Pitfall: levels 2 and 3 also read the setting
ReminderLevel1_Days(not a level-specific setting). If that setting is set, it replaces the defaults 30 and 45 for these levels, so all three levels use the same threshold unless@ReminderDaysis passed. - The setting is read via the function
fpixi_GetSetting, whose definition is not attached. - If
@ReminderLevelis NULL or less than 1, no result set is returned at all. - The age is measured from
ScanOutDate(scan-out/shipping date), not fromInvDate. Invoices withoutScanOutDateare never returned. - Invoices without a matching address or shop are excluded because of inner joins.
@ShopIDhas no default and must be sent; pass NULL to include all shops.- All tables are read with
NOLOCK, so uncommitted data may appear.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
ReminderLevel
Required
|
int | – |
Reminder level to prepare. Selects invoices whose current reminder level is one below this value. Allowed values
Example: |
PaymentType
Required
|
char(1) string |
– |
Payment type code; only invoices with Example: |
ShopID
Required
|
char(3) string |
– |
Shop ID of the invoice address. NULL returns invoices of all shops. Example: |
ReminderDays
|
int | NULL |
Minimum number of days since Example: |
Result set 1 · If @ReminderLevel >= 1 (may contain zero rows).
Unpaid invoices due for the requested reminder level, with invoice address and shop data.
| Column | Type | Description |
|---|---|---|
InvoiceNr
|
int |
Invoice number. |
InvDate
Nullable |
dateTime |
Invoice date. |
total
Nullable |
decimal |
Invoice total (always greater than 0). |
Payment
Nullable |
string |
Payment type code of the invoice. |
ShipmentTrackingID
Nullable |
string |
Shipment tracking ID of the invoice. |
Name
Nullable |
string |
Name of the invoice address. |
Name2
Nullable |
string |
Second name line. |
CareOf
Nullable |
string |
Care-of line. |
Street
Nullable |
string |
Street. |
HouseNr
Nullable |
string |
House number. |
City
Nullable |
string |
City. |
State
Nullable |
string |
State or region. |
ZIP
Nullable |
string |
Postal code. |
Country
Nullable |
string |
Country. |
Phone
Nullable |
string |
Phone number. |
eMail
Nullable |
string |
Customer e-mail address of the invoice address. |
ShopName
Nullable |
string |
Name of the shop the address belongs to. |
CusEmail
Nullable |
string |
Customer service e-mail address of the shop. |
Response example
<SqlRowSet1>
<row>
<InvoiceNr>100234</InvoiceNr>
<InvDate>2024-03-01T10:15:00</InvDate>
<total>89.90</total>
<Payment>R</Payment>
<ShipmentTrackingID>00340434161094042557</ShipmentTrackingID>
<Name>Max Mustermann</Name>
<Name2/>
<CareOf/>
<Street>Hauptstraße</Street>
<HouseNr>12</HouseNr>
<City>München</City>
<State>BY</State>
<ZIP>80331</ZIP>
<Country>DE</Country>
<Phone>+49 89 123456</Phone>
<eMail>max@example.com</eMail>
<ShopName>Example Shop</ShopName>
<CusEmail>service@example-shop.de</CusEmail>
</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:pixiGetReminders>
<ReminderLevel>1</ReminderLevel>
<PaymentType>R</PaymentType>
<ShopID>SHP</ShopID>
<!-- <ReminderDays>14</ReminderDays> -->
</ns1:pixiGetReminders>
</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:pixiGetReminders>
<ReminderLevel>1</ReminderLevel>
<PaymentType>R</PaymentType>
<ShopID>SHP</ShopID>
<!-- <ReminderDays>14</ReminderDays> -->
</ns1:pixiGetReminders>
</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 = [
'ReminderLevel' => '1',
'PaymentType' => 'R',
'ShopID' => 'SHP',
// 'ReminderDays' => '14',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetReminders', $soapArguments);
- SQL object:
- dbo.pipiGetReminders