pixiCAGetInvoiceMatch
Returns the customer account entries that are matched against the customer account entry of a given invoice.
Looks up the customer account (CA) entry of an invoice and lists all CA entries that are matched with it, for example payments or credit notes that settle the invoice.
- At least one of
InvoiceKeyorInvoiceNrmust be set (a value of0or an empty string counts as not set). Otherwise an error is raised. - If
InvoiceKeyis not set, it is resolved fromInvoicesviaInvoiceNr. - The CA entry whose
InvoiceRefequals the invoice key is determined. - All match records in
CustomerAccountMatchwhere this CA entry is on either side (CAref1orCAref2) are read, and the counterpart CA entries are returned. A match record that references the invoice entry on both sides (self-match) returns the invoice entry itself. - The currency code is taken from
pixi.Currencyvia the entry's currency ID.
The result has no defined sort order.
Notes
- All reads use
NOLOCK, so uncommitted data may be returned. - The column
InvoiceNronly echoes the input parameter. If the call is made withInvoiceKeyonly,InvoiceNris empty (NULL) in the result. - If both parameters are passed,
InvoiceKeyis used andInvoiceNris not checked against it. - If no invoice or no CA entry is found for the invoice, an empty result set is returned without an error.
- If several CA entries reference the same invoice, only one of them (not deterministically chosen) is used.
- The header comment of the procedure ("show all CA Events and Statistics for a selected customer") does not match the actual behaviour.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
InvoiceKey
|
int | NULL |
Internal key of the invoice. Takes precedence over Example: |
InvoiceNr
|
varchar(20) string |
NULL |
Invoice number. Used to resolve the invoice key if Example: |
Result set 1 · If InvoiceKey or InvoiceNr is set; may be empty if no CA entry or match exists.
One row per customer account entry matched against the invoice's CA entry.
| Column | Type | Description |
|---|---|---|
InvoiceKey
Nullable |
int |
Invoice key (passed or resolved from the invoice number). |
InvoiceNr
Nullable |
varchar(20) string |
Invoice number as passed in the parameter; NULL if not passed. |
EventID
Nullable |
string |
Event type ID of the matched CA entry. |
EventDate
Nullable |
smalldatetime dateTime |
Date of the matched CA entry, rounded to minutes. |
Reference
Nullable |
string |
Reference text of the matched CA entry. |
Amount
Nullable |
decimal |
Amount of the matched CA entry. |
Matched
Nullable |
string |
Matched value/status of the CA entry as stored in |
OrderCurrency
|
string |
Currency code ( |
CreateDate
Nullable |
dateTime |
Creation date of the CA entry. |
Response example
<SqlRowSet1>
<row>
<InvoiceKey>104523</InvoiceKey>
<InvoiceNr>RE2024-001234</InvoiceNr>
<EventID>2</EventID>
<EventDate>2024-03-15T10:30:00</EventDate>
<Reference>Payment PayPal 7XK12345</Reference>
<Amount>-119.00</Amount>
<Matched>-119.00</Matched>
<OrderCurrency>EUR</OrderCurrency>
<CreateDate>2024-03-15T10:31:12</CreateDate>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| RAISERROR | Input data not OK | Neither `InvoiceKey` (non-zero) nor `InvoiceNr` (non-empty) was passed. Pass at least one of them. |
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:pixiCAGetInvoiceMatch>
<!-- <InvoiceKey>104523</InvoiceKey> -->
<!-- <InvoiceNr>RE2024-001234</InvoiceNr> -->
</ns1:pixiCAGetInvoiceMatch>
</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:pixiCAGetInvoiceMatch>
<!-- <InvoiceKey>104523</InvoiceKey> -->
<!-- <InvoiceNr>RE2024-001234</InvoiceNr> -->
</ns1:pixiCAGetInvoiceMatch>
</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 = [
// 'InvoiceKey' => '104523',
// 'InvoiceNr' => 'RE2024-001234',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiCAGetInvoiceMatch', $soapArguments);
- SQL object:
- dbo.pipiCAGetInvoiceMatch