pixiGetInvoice
API call returns invoices based on selected filters.
Since pixi version: LOU Official (6.3.0.4452) Additional notes:
### Iterating through results
---
- Iterating can be done with the help of parameters "StartKey" and "RowCount"
- The "StartKey" parameter is not included in the result set
- "TotalRows" column shows only the number of actually returned rows and is upward limited to the "RowCount" parameter
- The condition to stop iterating through results is to check if the "TotalRows" column is smaller than "RowCount" parameter. Or there are no more rows returned.
#### Sample call
---
Assuming there is a maximum of 130 records
EXEC pipiGetInvoice @InvDateFrom = '2000-12-09 10:28:05',
@InvDateTo = '2021-12-09 10:28:05',
@RowCount = 50
@StartKey = 0
/*Result from 1 till 50 are returned*/
/*"TotalRows" = 50*/
EXEC pipiGetInvoice @InvDateFrom = '2000-12-09 10:28:05',
@InvDateTo = '2021-12-09 10:28:05',
@RowCount = 50,
@StartKey = 50
/*Result from 51 till 100 are returned*/
/*"TotalRows" = 50*/
EXEC pipiGetInvoice @InvDateFrom = '2000-12-09 10:28:05',
@InvDateTo = '2021-12-09 10:28:05',
@RowCount = 50,
@StartKey = 100
/*Result from 101 till 130 are returned*/
/*"TotalRows" = 30*/
With the last call, the "TotalRows" value is 30. Since this is less than the "RowCount" (50). There are no more records to fetch.
Request
Request body
Name | Type | Required | Description |
---|---|---|---|
ShopID | string | false | pixi shop ID Type: varchar(3) Default value: NULL Example: ABC Available from: LOU Official - Update 46 (6.9.46.27927) |
OrderNR | integer | false | pixi order number Type: int Default value: NULL Example: 1234567890 Available from: LOU Official - Update 46 (6.9.46.27927) |
RowCount | integer | false | Number of records to be returned Type: int Default value: 1000 Example: 12345 Available from: LOU Official - Update 46 (6.9.46.27927) |
StartKey | integer | false | Return records that have "InvoiceKey" bigger than provided value Type: int Default value: 0 Example: 12345 Available from: LOU Official - Update 46 (6.9.46.27927) |
InvDateTo | string | false | End of date interval based on invoice create date Type: datetime Default value: NULL Example: YYYY-MM-DD hh:mm:ss Available from: LOU Official - Update 46 (6.9.46.27927) |
InvoiceNr | string | false | pixi invoice number Type: varchar(20) Default value: NULL Example: 123abc Available from: LOU Official (6.3.0.4452) |
ShipDateTo | string | false | End of date interval based on invoice ship date Type: datetime Default value: NULL Example: YYYY-MM-DD hh:mm:ss Available from: 19.02 (8.4.50.37001) |
AddCCPPayID | boolean | false | Populate also CCP Pay ID in the returned result set Type: bit Default value: 0 Example: 1 Available from: LOU Official - Update 46 (6.9.46.27927) |
InvDateFrom | string | false | Beginning of date interval based on invoice create date Type: datetime Default value: NULL Example: YYYY-MM-DD hh:mm:ss Available from: LOU Official - Update 46 (6.9.46.27927) |
PaymentType | string | false | Payment type code Type: char Default value: NULL Example: A Available from: LOU Official - Update 46 (6.9.46.27927) |
ShipDateFrom | string | false | Beginning of date interval based on invoice ship date Type: datetime Default value: NULL Example: YYYY-MM-DD hh:mm:ss Available from: 19.02 (8.4.50.37001) |
UpdateDateTo | string | false | End of date interval based on invoice last update date Type: datetime Default value: NULL Example: YYYY-MM-DD hh:mm:ss Available from: LOU Official - Update 46 (6.9.46.27927) |
UpdateDateFrom | string | false | Beginning of date interval based on invoice last update date Type: datetime Default value: NULL Example: YYYY-MM-DD hh:mm:ss Available from: LOU Official - Update 46 (6.9.46.27927) |
OrderNRExternal | string | false | Shop order number Type: varchar(50) Default value: NULL Example: 123abc Available from: LOU Official - Update 46 (6.9.46.27927) |
OnlyUnpaidInvoices | boolean | false | Switch: Only return unpaid invoices Type: bit Default value: 0 Example: 1 Available from: LOU Official - Update 46 (6.9.46.27927) |
Request Example
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body xmlns="">
<pixiGetInvoice>
<InvoiceNr>string</InvoiceNr>
<ShopID>string</ShopID>
<PaymentType>string</PaymentType>
<OrderNR>0</OrderNR>
<OrderNRExternal>string</OrderNRExternal>
<InvDateFrom>string</InvDateFrom>
<InvDateTo>string</InvDateTo>
<UpdateDateFrom>string</UpdateDateFrom>
<UpdateDateTo>string</UpdateDateTo>
<RowCount>0</RowCount>
<AddCCPPayID>true</AddCCPPayID>
<OnlyUnpaidInvoices>true</OnlyUnpaidInvoices>
<StartKey>0</StartKey>
<ShipDateFrom>string</ShipDateFrom>
<ShipDateTo>string</ShipDateTo>
</pixiGetInvoice>
</Body>
</Envelope>
Response
1. Invoice details
Name | Type | Description |
---|---|---|
Blz | string | BLZ Type: varchar Available from: 25.06 (25.6.0.58802) |
Note | string | Invoice note Type: varchar Available from: 25.06 (25.6.0.58802) |
Paid | boolean | Paid flag Type: bit Available from: 25.06 (25.6.0.58802) |
Total | number | Invoice total Type: money Available from: 25.06 (25.6.0.58802) |
ShopID | string | Shop ID Type: varchar Available from: 25.06 (25.6.0.58802) |
VATLow | number | Sum of low VAT Type: money Available from: 25.06 (25.6.0.58802) |
VATSum | number | Total VAT Type: money Available from: 25.06 (25.6.0.58802) |
Account | string | Account Type: varchar Available from: 25.06 (25.6.0.58802) |
CustKey | integer | Customer ID Type: int Available from: 25.06 (25.6.0.58802) |
OrderNr | integer | pixi order number Type: int Available from: 25.06 (25.6.0.58802) |
PaidSum | number | Paied sum Type: money Available from: 25.06 (25.6.0.58802) |
VATHigh | number | Sum of high VAT Type: money Available from: 25.06 (25.6.0.58802) |
BankName | string | Bank name Type: varchar Available from: 25.06 (25.6.0.58802) |
CcCardNr | string | Credit card number Type: varchar Available from: 25.06 (25.6.0.58802) |
CcpPayID | string | Credit card payment ID Type: varchar Available from: 25.06 (25.6.0.58802) |
Currency | string | Currency code (always EUR) Type: varchar Available from: 25.06 (25.6.0.58802) |
ShipCost | number | Shipping cost Type: money Available from: 25.06 (25.6.0.58802) |
ShipDate | string | Date of shipment Type: datetime Available from: 25.06 (25.6.0.58802) |
CcCardExp | string | Credit card Exp Type: varchar Available from: 25.06 (25.6.0.58802) |
CreateEmp | string | User who created the invoice Type: varchar Available from: 25.06 (25.6.0.58802) |
InvoiceNr | string | pixi Invoice number Type: varchar Available from: 25.06 (25.6.0.58802) |
TotalRows | integer | Total rows returned (including "RowCount" filter) Type: int Available from: 25.06 (25.6.0.58802) |
CcCardName | string | Credit card name Type: varchar Available from: 25.06 (25.6.0.58802) |
CcCardType | string | Credit card type Type: varchar Available from: 25.06 (25.6.0.58802) |
InvoiceKey | integer | Invoice ID Type: int Available from: 25.06 (25.6.0.58802) |
ShipVendor | string | Shipping vendor used Type: varchar Available from: 25.06 (25.6.0.58802) |
TotalNoVAT | number | Total without VAT Type: money Available from: 25.06 (25.6.0.58802) |
TotalToPay | number | Total to pay Type: money Available from: 25.06 (25.6.0.58802) |
TrackingID | string | Parcel tracking IDs Type: varchar Available from: 25.06 (25.6.0.58802) |
UpdateDate | string | Invoice last update date Type: datetime Available from: 25.06 (25.6.0.58802) |
AccountName | string | Account name Type: varchar Available from: 25.06 (25.6.0.58802) |
InvoiceDate | string | Invoice date Type: datetime Available from: 25.06 (25.6.0.58802) |
PaymentCode | string | Payment code Type: varchar Available from: 25.06 (25.6.0.58802) |
PaymentDate | string | Date of payment Type: smalldatetime Available from: 25.06 (25.6.0.58802) |
PaymentText | string | Payment description text Type: varchar Available from: 25.06 (25.6.0.58802) |
ExchangeRate | number | Exchange rate of the invoice Type: decimal Available from: 25.06 (25.6.0.58802) |
ReturnReason | string | Return reason text Type: varchar Available from: 25.06 (25.6.0.58802) |
OrderCurrency | string | Currency code Type: varchar Available from: 25.06 (25.6.0.58802) |
ReminderLevel | integer | Reminder level on the invoice Type: int Available from: 25.06 (25.6.0.58802) |
ShipCostNoVAT | number | Shipping costs without VAT Type: numeric Available from: 25.06 (25.6.0.58802) |
RefToInvoiceNr | string | Reference to original invoice number Type: varchar Available from: 25.06 (25.6.0.58802) |
OrderNrExternal | string | Shop order number Type: varchar Available from: 25.06 (25.6.0.58802) |
RefToInvoiceKey | integer | Reference to original invoice ID Type: int Available from: 25.06 (25.6.0.58802) |
Discount_Invoice | number | Discount on the invoice (Net value in case of B2B Invoice) Type: money Available from: 25.06 (25.6.0.58802) |
PaymentAddressId | integer | Billing address ID Type: int Available from: 25.06 (25.6.0.58802) |
ReturnTrackingId | string | Parcel last return tracking ID Type: varchar Available from: 25.06 (25.6.0.58802) |
Discount_InvLines | number | Sum of discount applied to separate invoice lines Type: money Available from: 25.06 (25.6.0.58802) |
ReturnCostsAmount | number | Amount of return costs Type: money Available from: 25.06 (25.6.0.58802) |
ShipmentAddressId | integer | Shipping address ID Type: int Available from: 25.06 (25.6.0.58802) |
TotalToPay_OrderCurr | number | Invoice total Type: money Available from: 25.06 (25.6.0.58802) |
ReturnTrackingIdHistory | string | All return tracking IDs (history) for parcel Type: varchar Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiGetInvoicePost200TextXmlResponse>
<TotalRows>0</TotalRows>
<InvoiceNr>string</InvoiceNr>
<InvoiceDate>string</InvoiceDate>
<ShopID>string</ShopID>
<PaymentAddressId>0</PaymentAddressId>
<ShipmentAddressId>0</ShipmentAddressId>
<CustKey>0</CustKey>
<Total>0</Total>
<VATSum>0</VATSum>
<VATHigh>0</VATHigh>
<VATLow>0</VATLow>
<TotalNoVAT>0</TotalNoVAT>
<ShipCost>0</ShipCost>
<ShipCostNoVAT>0</ShipCostNoVAT>
<Discount_Invoice>0</Discount_Invoice>
<Discount_InvLines>0</Discount_InvLines>
<PaymentCode>string</PaymentCode>
<PaymentText>string</PaymentText>
<PaymentDate>string</PaymentDate>
<Paid>true</Paid>
<TotalToPay>0</TotalToPay>
<PaidSum>0</PaidSum>
<CcCardType>string</CcCardType>
<CcCardNr>string</CcCardNr>
<CcCardName>string</CcCardName>
<CcCardExp>string</CcCardExp>
<Account>string</Account>
<Blz>string</Blz>
<BankName>string</BankName>
<AccountName>string</AccountName>
<TrackingID>string</TrackingID>
<ShipDate>string</ShipDate>
<UpdateDate>string</UpdateDate>
<ReminderLevel>0</ReminderLevel>
<OrderNr>0</OrderNr>
<OrderNrExternal>string</OrderNrExternal>
<Note>string</Note>
<ShipVendor>string</ShipVendor>
<CcpPayID>string</CcpPayID>
<Currency>string</Currency>
<OrderCurrency>string</OrderCurrency>
<TotalToPay_OrderCurr>0</TotalToPay_OrderCurr>
<ReturnReason>string</ReturnReason>
<InvoiceKey>0</InvoiceKey>
<RefToInvoiceNr>string</RefToInvoiceNr>
<RefToInvoiceKey>0</RefToInvoiceKey>
<ReturnCostsAmount>0</ReturnCostsAmount>
<CreateEmp>string</CreateEmp>
<ExchangeRate>0</ExchangeRate>
<ReturnTrackingId>string</ReturnTrackingId>
<ReturnTrackingIdHistory>string</ReturnTrackingIdHistory>
</PixiGetInvoicePost200TextXmlResponse>
HTTP Example
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
# echo -n '{{username}}:{{password}}' | base64 | pbcopy
Authorization: Basic {{token}}
<?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/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:pixiGetInvoice>
<ShopID xsi:type="xsd:string">ABC</ShopID>
<OrderNR xsi:type="xsd:integer">1234567890</OrderNR>
<RowCount xsi:type="xsd:integer">12345</RowCount>
<StartKey xsi:type="xsd:integer">12345</StartKey>
<InvDateTo xsi:type="xsd:string">YYYY-MM-DD hh:mm:ss</InvDateTo>
<InvoiceNr xsi:type="xsd:string">123abc</InvoiceNr>
<ShipDateTo xsi:type="xsd:string">YYYY-MM-DD hh:mm:ss</ShipDateTo>
<AddCCPPayID xsi:type="xsd:boolean">1</AddCCPPayID>
<InvDateFrom xsi:type="xsd:string">YYYY-MM-DD hh:mm:ss</InvDateFrom>
<PaymentType xsi:type="xsd:string">A</PaymentType>
<ShipDateFrom xsi:type="xsd:string">YYYY-MM-DD hh:mm:ss</ShipDateFrom>
<UpdateDateTo xsi:type="xsd:string">YYYY-MM-DD hh:mm:ss</UpdateDateTo>
<UpdateDateFrom xsi:type="xsd:string">YYYY-MM-DD hh:mm:ss</UpdateDateFrom>
<OrderNRExternal xsi:type="xsd:string">123abc</OrderNRExternal>
<OnlyUnpaidInvoices xsi:type="xsd:boolean">1</OnlyUnpaidInvoices>
</ns1:pixiGetInvoice>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PHP Example
<?php
getPixiSoapClientResponse('pixiGetInvoice', [
'ShopID' => 'ABC', // string
'OrderNR' => '1234567890', // integer
'RowCount' => '12345', // integer
'StartKey' => '12345', // integer
'InvDateTo' => 'YYYY-MM-DD hh:mm:ss', // string
'InvoiceNr' => '123abc', // string
'ShipDateTo' => 'YYYY-MM-DD hh:mm:ss', // string
'AddCCPPayID' => '1', // boolean
'InvDateFrom' => 'YYYY-MM-DD hh:mm:ss', // string
'PaymentType' => 'A', // string
'ShipDateFrom' => 'YYYY-MM-DD hh:mm:ss', // string
'UpdateDateTo' => 'YYYY-MM-DD hh:mm:ss', // string
'UpdateDateFrom' => 'YYYY-MM-DD hh:mm:ss', // string
'OrderNRExternal' => '123abc', // string
'OnlyUnpaidInvoices' => '1', // boolean
]);
function getPixiSoapClientResponse(string $method, array $arguments = [])
{
$soapArguments = [];
foreach ($arguments as $key => $value) {
$soapArguments[] = new SoapVar($value, null, '', '', $key);
}
$soapClient = new SoapClient(null, [
'login' => '...',
'password' => '...',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
]);
return $soapClient->__call($method, $soapArguments);
}