pixiReadPOSHeader
Returns POS document headers (cash register receipts) from POSheader2, either a single header by key or a list filtered by create/update dates with key-based paging.
Reads header records of POS documents from table POSheader2. All branches return the same column set. If POSHeaderKey is not passed, it is treated as 0.
If RowCount is set to a value other than 0, the number of returned rows is limited via SET ROWCOUNT.
The parameters are evaluated in this order; only the first matching branch runs:
- Create or update date – if
CreateAndUpdateDateFromorCreateAndUpdateDateTois set: returns headers withPOSheaderKey > POSHeaderKeywherePHcreateDateorPHupdateDateis>= CreateAndUpdateDateFromandPHcreateDateorPHupdateDateis< CreateAndUpdateDateTo. - Create date – if
CreateDateFromorCreateDateTois set: headers withPOSheaderKey > POSHeaderKeyandPHcreateDatein the range[CreateDateFrom, CreateDateTo). - Update date – if
UpdateDateFromorUpdateDateTois set: headers withPOSheaderKey > POSHeaderKeyandPHupdateDatein the range[UpdateDateFrom, UpdateDateTo). - Key range – if
RowCountis passed (not NULL): headers withPOSheaderKey > POSHeaderKey. - Single header – otherwise: the header with
POSheaderKey = POSHeaderKey.
Branches 1–4 are sorted by POSheaderKey ascending. For paging, pass the last POSheaderKey received as POSHeaderKey in the next call together with RowCount.
Lower date bounds are inclusive, upper bounds exclusive. Omitting one bound leaves that side open.
Notes
- The table is read
WITH (NOLOCK); uncommitted data can be returned. - In the date branches
POSHeaderKeyis a lower bound (>), not an exact match. Passing a specific key together with a date filter does not return that header itself. - In the combined create/update filter the two bounds are checked independently: a row matches if any of the two dates is
>=the lower bound and any of the two dates is<the upper bound, which is not necessarily the same date. - Calling without any parameter returns no rows (it searches for
POSheaderKey = 0). - Passing
RowCount = 0explicitly selects the key-range branch without a row limit, i.e. all headers with a key greater thanPOSHeaderKeyare returned. - Column data types are not visible in the code; they come from table
POSheader2.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
POSHeaderKey
|
int | NULL |
Key of the POS header. Exact match in single-record mode; exclusive lower bound ( Example: |
CreateDateFrom
|
datetime dateTime |
NULL |
Inclusive lower bound for Example: |
CreateDateTo
|
datetime dateTime |
NULL |
Exclusive upper bound for Example: |
UpdateDateFrom
|
datetime dateTime |
NULL |
Inclusive lower bound for Example: |
UpdateDateTo
|
datetime dateTime |
NULL |
Exclusive upper bound for Example: |
CreateAndUpdateDateFrom
|
datetime dateTime |
NULL |
Inclusive lower bound checked against Example: |
CreateAndUpdateDateTo
|
datetime dateTime |
NULL |
Exclusive upper bound checked against Example: |
RowCount
|
int | NULL |
Maximum number of rows (via Example: |
Result set 1 · Always (may be empty); columns are identical in all branches.
POS document headers from POSheader2, sorted by POSheaderKey ascending except in single-record mode.
| Column | Type | Description |
|---|---|---|
POSheaderKey
|
int |
Key of the POS header. |
PHcreateEmp
Nullable |
string |
Employee who created the record. |
PHcreateDate
Nullable |
dateTime |
Creation timestamp. |
PHupdateEmp
Nullable |
string |
Employee who last changed the record. |
PHupdateDate
Nullable |
dateTime |
Timestamp of the last change. |
PHdate
Nullable |
dateTime |
Document date. |
PHdocNr
Nullable |
string |
Document number. |
PHdocType
Nullable |
string |
Document type. |
PHpaymentType
Nullable |
string |
Payment type. |
PHrefDocNr
Nullable |
string |
Referenced document number. |
PHdownPayment
Nullable |
decimal |
Down payment. |
PHrepairDone
Nullable |
string |
Repair-done indicator. |
PHtimesPrinted
Nullable |
int |
Number of times the document was printed. |
PHstatus
Nullable |
string |
Document status. |
PHcusName
Nullable |
string |
Customer name. |
PHcusAddress
Nullable |
string |
Customer street address. |
PHcusZIP
Nullable |
string |
Customer postal code. |
PHcusCity
Nullable |
string |
Customer city. |
PHcusCNTcode
Nullable |
string |
Customer country code. |
PHcusCountry
Nullable |
string |
Customer country. |
PHcusVATID
Nullable |
string |
Customer VAT ID. |
PHcusPhone
Nullable |
string |
Customer phone number. |
PHcusEmail
Nullable |
string |
Customer e-mail address. |
PHcusFirstHeaderRef
Nullable |
string |
Reference to the customer's first POS header. |
PHtotalPaid
Nullable |
decimal |
Amount paid. |
PHtotal
Nullable |
decimal |
Document total. |
PHlocID
Nullable |
string |
Location ID. |
PHclosingTag
Nullable |
string |
Closing tag (e.g. end-of-day closing reference). |
PHvatSum
Nullable |
decimal |
Total VAT amount. |
PHRegisterID
Nullable |
string |
Cash register ID. |
POSSessionID
Nullable |
string |
POS session ID. |
PHCusAddrKey
Nullable |
int |
Key of the customer address. |
TotalNetto
Nullable |
decimal |
Net total. |
Mwst7
Nullable |
decimal |
VAT amount at 7 %. |
Mwst16
Nullable |
decimal |
VAT amount at 16 %. |
PHDiscountPercent
Nullable |
decimal |
Discount in percent. |
PHDiscountAmount
Nullable |
decimal |
Discount amount. |
InvoiceComment
Nullable |
string |
Comment for the invoice. |
NoTax
Nullable |
string |
Tax-free indicator. |
OrderNr
Nullable |
string |
Related order number. |
PHVatLow
Nullable |
decimal |
VAT at the reduced rate. |
PHVatHigh
Nullable |
decimal |
VAT at the standard rate. |
Response example
<SqlRowSet1>
<row>
<POSheaderKey>10453</POSheaderKey>
<PHcreateEmp>MK</PHcreateEmp>
<PHcreateDate>2024-03-15T10:24:11</PHcreateDate>
<PHupdateEmp>MK</PHupdateEmp>
<PHupdateDate>2024-03-15T10:25:02</PHupdateDate>
<PHdate>2024-03-15T10:24:11</PHdate>
<PHdocNr>K-2024-001873</PHdocNr>
<PHdocType>R</PHdocType>
<PHpaymentType>BAR</PHpaymentType>
<PHtimesPrinted>1</PHtimesPrinted>
<PHstatus>C</PHstatus>
<PHcusName>Max Mustermann</PHcusName>
<PHcusZIP>80331</PHcusZIP>
<PHcusCity>München</PHcusCity>
<PHcusCNTcode>DE</PHcusCNTcode>
<PHtotalPaid>59.90</PHtotalPaid>
<PHtotal>59.90</PHtotal>
<PHlocID>001</PHlocID>
<PHvatSum>9.56</PHvatSum>
<PHRegisterID>KASSE1</PHRegisterID>
<TotalNetto>50.34</TotalNetto>
<PHDiscountPercent>0</PHDiscountPercent>
<PHDiscountAmount>0.00</PHDiscountAmount>
<PHVatLow>0.00</PHVatLow>
<PHVatHigh>9.56</PHVatHigh>
</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:pixiReadPOSHeader>
<!-- <POSHeaderKey>10452</POSHeaderKey> -->
<!-- <CreateDateFrom>2024-03-01T00:00:00</CreateDateFrom> -->
<!-- <CreateDateTo>2024-04-01T00:00:00</CreateDateTo> -->
<!-- <UpdateDateFrom>2024-03-01T00:00:00</UpdateDateFrom> -->
<!-- <UpdateDateTo>2024-04-01T00:00:00</UpdateDateTo> -->
<!-- <CreateAndUpdateDateFrom>2024-03-15T00:00:00</CreateAndUpdateDateFrom> -->
<!-- <CreateAndUpdateDateTo>2024-03-16T00:00:00</CreateAndUpdateDateTo> -->
<!-- <RowCount>500</RowCount> -->
</ns1:pixiReadPOSHeader>
</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:pixiReadPOSHeader>
<!-- <POSHeaderKey>10452</POSHeaderKey> -->
<!-- <CreateDateFrom>2024-03-01T00:00:00</CreateDateFrom> -->
<!-- <CreateDateTo>2024-04-01T00:00:00</CreateDateTo> -->
<!-- <UpdateDateFrom>2024-03-01T00:00:00</UpdateDateFrom> -->
<!-- <UpdateDateTo>2024-04-01T00:00:00</UpdateDateTo> -->
<!-- <CreateAndUpdateDateFrom>2024-03-15T00:00:00</CreateAndUpdateDateFrom> -->
<!-- <CreateAndUpdateDateTo>2024-03-16T00:00:00</CreateAndUpdateDateTo> -->
<!-- <RowCount>500</RowCount> -->
</ns1:pixiReadPOSHeader>
</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 = [
// 'POSHeaderKey' => '10452',
// 'CreateDateFrom' => '2024-03-01T00:00:00',
// 'CreateDateTo' => '2024-04-01T00:00:00',
// 'UpdateDateFrom' => '2024-03-01T00:00:00',
// 'UpdateDateTo' => '2024-04-01T00:00:00',
// 'CreateAndUpdateDateFrom' => '2024-03-15T00:00:00',
// 'CreateAndUpdateDateTo' => '2024-03-16T00:00:00',
// 'RowCount' => '500',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiReadPOSHeader', $soapArguments);
- SQL object:
- dbo.pipiReadPOSHeader