pixiReadInvlines
Returns invoice lines, either one line by key or a list filtered by creation and/or update date, with key-based paging.
Reads invoice lines from Invlines. Each line is joined to its invoice (Invoices) and to the invoice currency (pixi.Currency). Only one filter mode is used. The procedure checks the modes in this order:
- Create or update date:
CreateAndUpdateDateFromorCreateAndUpdateDateTois set. A line matches ifCreateDateorUpdateDateis>=the from value, andCreateDateorUpdateDateis<the to value. - Create date:
CreateDateFromorCreateDateTois set. Filters onCreateDate(from inclusive, to exclusive). - Update date:
UpdateDateFromorUpdateDateTois set. Filters onUpdateDate(from inclusive, to exclusive). - Key range:
RowCountis passed (any non-NULL value). Returns all lines withInvLineKeygreater thanInvlineKey. - Single key: none of the above applies. Returns the line whose
InvLineKeyequalsInvlineKey.
In modes 1–4 only lines with InvLineKey > InvlineKey are returned, sorted by InvLineKey ascending. InvlineKey defaults to 0, so all keys qualify by default.
A non-zero RowCount limits the number of rows (SET ROWCOUNT). This enables paging: pass the last InvLineKey received as InvlineKey in the next call.
Notes
- All reads use
NOLOCK. Uncommitted data can be returned. - Lines are returned only if their invoice exists and the invoice's
CurrencyIdresolves to a currency (inner joins). - Calling without any parameters returns no rows:
InvlineKeybecomes0and the single-key mode looks for key0. - Passing
RowCount=0switches to key-range mode without a row limit. This returns all invoice lines aboveInvlineKey. - Date filter modes exclude each other. For example, when
CreateAndUpdateDate*is set, theCreateDate*andUpdateDate*parameters are ignored. - In the combined date mode, from and to are checked independently against either date. A line can therefore match even if neither date lies within the range.
ItemPrice_OrderCurrandShipCost_OrderCurrare copies ofItemPriceandShipCost. Code comments mark them for removal, so new integrations should not rely on them.- The final fallback branch of the code (empty result) can never be reached, because
InvlineKeyis never NULL at that point.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
InvlineKey
|
int | NULL |
Invoice line key. NULL is treated as Example: |
CreateDateFrom
|
datetime dateTime |
NULL |
Lower bound (inclusive) for Example: |
CreateDateTo
|
datetime dateTime |
NULL |
Upper bound (exclusive) for Example: |
UpdateDateFrom
|
datetime dateTime |
NULL |
Lower bound (inclusive) for Example: |
UpdateDateTo
|
datetime dateTime |
NULL |
Upper bound (exclusive) for Example: |
CreateAndUpdateDateFrom
|
datetime dateTime |
NULL |
Lower bound (inclusive): matches if Example: |
CreateAndUpdateDateTo
|
datetime dateTime |
NULL |
Upper bound (exclusive): matches if Example: |
RowCount
|
int | NULL |
Maximum number of rows to return. Example: |
Result set 1 · Always (may be empty)
Invoice lines matching the selected filter mode. Sorted by InvLineKey ascending, except in single-key mode.
| Column | Type | Description |
|---|---|---|
InvLineKey
|
int |
Primary key of the invoice line. |
InvoiceRef
|
int |
Key of the invoice ( |
OrderLineRef
Nullable |
int |
Reference to the order line. |
CustRef
Nullable |
int |
Reference to the customer. |
AddrRef
Nullable |
int |
Reference to the address. |
ItemNr
Nullable |
string |
Item number. |
ItemQty
Nullable |
int |
Invoiced quantity. |
OrderQty
Nullable |
int |
Ordered quantity. |
ItemText
Nullable |
string |
Item text of the line. |
ItemPrice
Nullable |
decimal |
Item price. |
ItemDiscount
Nullable |
decimal |
Item discount. |
ItemVAT
Nullable |
decimal |
VAT rate of the item. |
CreateDate
Nullable |
dateTime |
Creation date of the line. |
CreateEmp
Nullable |
string |
Employee who created the line. |
UpdateDate
Nullable |
dateTime |
Date of the last change. |
UpdateEmp
Nullable |
string |
Employee who last changed the line. |
ItemPrice_OrderCurr
Nullable |
decimal |
Copy of |
ShipCost
Nullable |
decimal |
Shipping cost of the line. |
ShipCostPerItem
Nullable |
decimal |
Shipping cost per item. |
OrderCurrency
Nullable |
string |
Currency code ( |
ShipCost_OrderCurr
Nullable |
decimal |
Copy of |
ItemRef
Nullable |
int |
Reference to the item. |
CCPChargedYN
Nullable |
string |
Flag from column |
SerialNr
Nullable |
string |
Serial number. |
FullPrice
Nullable |
decimal |
Full price before discount. |
DiscountValue
Nullable |
decimal |
Discount amount. |
DiscountPerc
Nullable |
decimal |
Discount in percent. |
Response example
<SqlRowSet1>
<row>
<InvLineKey>10234</InvLineKey>
<InvoiceRef>5120</InvoiceRef>
<OrderLineRef>88412</OrderLineRef>
<CustRef>3307</CustRef>
<AddrRef>4410</AddrRef>
<ItemNr>ART-1001</ItemNr>
<ItemQty>2</ItemQty>
<OrderQty>2</OrderQty>
<ItemText>T-Shirt blau, Gr. M</ItemText>
<ItemPrice>19.99</ItemPrice>
<ItemDiscount>0</ItemDiscount>
<ItemVAT>19</ItemVAT>
<CreateDate>2024-01-15T10:22:05</CreateDate>
<CreateEmp>API</CreateEmp>
<UpdateDate>2024-01-15T10:22:05</UpdateDate>
<UpdateEmp>API</UpdateEmp>
<ItemPrice_OrderCurr>19.99</ItemPrice_OrderCurr>
<ShipCost>4.90</ShipCost>
<ShipCostPerItem>0</ShipCostPerItem>
<OrderCurrency>EUR</OrderCurrency>
<ShipCost_OrderCurr>4.90</ShipCost_OrderCurr>
<ItemRef>1201</ItemRef>
<CCPChargedYN>N</CCPChargedYN>
<SerialNr/>
<FullPrice>19.99</FullPrice>
<DiscountValue>0</DiscountValue>
<DiscountPerc>0</DiscountPerc>
</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:pixiReadInvlines>
<!-- <InvlineKey>0</InvlineKey> -->
<!-- <CreateDateFrom>2024-01-01T00:00:00</CreateDateFrom> -->
<!-- <CreateDateTo>2024-02-01T00:00:00</CreateDateTo> -->
<!-- <UpdateDateFrom>2024-01-01T00:00:00</UpdateDateFrom> -->
<!-- <UpdateDateTo>2024-02-01T00:00:00</UpdateDateTo> -->
<!-- <CreateAndUpdateDateFrom>2024-01-15T00:00:00</CreateAndUpdateDateFrom> -->
<!-- <CreateAndUpdateDateTo>2024-01-16T00:00:00</CreateAndUpdateDateTo> -->
<!-- <RowCount>500</RowCount> -->
</ns1:pixiReadInvlines>
</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:pixiReadInvlines>
<!-- <InvlineKey>0</InvlineKey> -->
<!-- <CreateDateFrom>2024-01-01T00:00:00</CreateDateFrom> -->
<!-- <CreateDateTo>2024-02-01T00:00:00</CreateDateTo> -->
<!-- <UpdateDateFrom>2024-01-01T00:00:00</UpdateDateFrom> -->
<!-- <UpdateDateTo>2024-02-01T00:00:00</UpdateDateTo> -->
<!-- <CreateAndUpdateDateFrom>2024-01-15T00:00:00</CreateAndUpdateDateFrom> -->
<!-- <CreateAndUpdateDateTo>2024-01-16T00:00:00</CreateAndUpdateDateTo> -->
<!-- <RowCount>500</RowCount> -->
</ns1:pixiReadInvlines>
</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 = [
// 'InvlineKey' => '0',
// 'CreateDateFrom' => '2024-01-01T00:00:00',
// 'CreateDateTo' => '2024-02-01T00:00:00',
// 'UpdateDateFrom' => '2024-01-01T00:00:00',
// 'UpdateDateTo' => '2024-02-01T00:00:00',
// 'CreateAndUpdateDateFrom' => '2024-01-15T00:00:00',
// 'CreateAndUpdateDateTo' => '2024-01-16T00:00:00',
// 'RowCount' => '500',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiReadInvlines', $soapArguments);
- SQL object:
- dbo.pipiReadInvlines