Invoices
Write
pixiSetReminderLevel
Sets the reminder (dunning) level of an invoice identified by its invoice number.
Looks up the invoice by InvoiceNR (Invoices.InvoiceNr) and passes its key to the internal procedure Pixi_CA_R_SetLevel, using API as user name.
That procedure works as follows:
- Level greater than 0: It searches the reminders (
Reminders) that contain a reminder line (ReminderLines) for this invoice and whoseHighestReminderLevelequalsReminderLevel.- If a matching reminder exists:
- The invoice gets the new
ReminderLevel. UpdateEmpis set toAPI.UpdateDateis set to the date of that reminder, not to the current time.- All reminder lines of the invoice are reassigned to that reminder (
ReminderRef).
- The invoice gets the new
- If no matching reminder exists: Only the invoice is updated, with
UpdateDateset to the current time.
- If a matching reminder exists:
- Level 0 or
NULL: The invoice'sReminderLevelis reset toNULL.UpdateEmp=APIandUpdateDate= now.
The call returns no result set.
Notes
- No feedback: There is no status row and no error handling. If the invoice number does not exist, nothing is updated and the call still succeeds silently.
- Ambiguous invoice numbers: The invoice key is read with a scalar subquery. If several invoices share the same
InvoiceNr, SQL Server raises error 512 ("Subquery returned more than 1 value"). - Locking: The lookups in
Invoices,RemindersandReminderLinesuseNOLOCK. - Transactions: The updates run without an explicit transaction.
- No validation:
ReminderLevelis not checked against a range; any integer is written. - Several matching reminders: The reminder is picked by variable assignment with
ORDER BY ReminderDate. In practice this usually yields the latest one, but SQL Server does not guarantee which row is used. - Reassignment of lines: When a matching reminder is found, all reminder lines of the invoice are moved to it, including lines that belonged to other reminders.
- Level 0: The check that is meant to treat 0 as "no level" never applies (
NULLIF(@ReminderLevel, 0) = 0is never true). With 0 the code therefore still searches for reminders withHighestReminderLevel = 0. The invoice level ends up asNULLeither way.
Tables used
Invoices · Write
Reminders · Read
ReminderLines · Write
| Parameter | Type | Default | Description |
|---|---|---|---|
ReminderLevel
Required
|
int | – |
New reminder level of the invoice. 0 or NULL resets the level to NULL. Example: |
InvoiceNR
Required
|
varchar(20) string |
– |
Invoice number ( Example: |
This call returns no result set.
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:pixiSetReminderLevel>
<ReminderLevel>2</ReminderLevel>
<InvoiceNR>RE2024001234</InvoiceNR>
</ns1:pixiSetReminderLevel>
</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:pixiSetReminderLevel>
<ReminderLevel>2</ReminderLevel>
<InvoiceNR>RE2024001234</InvoiceNR>
</ns1:pixiSetReminderLevel>
</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' => '2',
'InvoiceNR' => 'RE2024001234',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiSetReminderLevel', $soapArguments);
- SQL object:
- dbo.pipiSetReminderLevel
Updated at 2026-10-30