pixiCADeleteEventMatches
Deletes all customer account matches of a customer account entry (CAref), including the bank matches derived from them.
Removes every match in which the given customer account entry takes part.
- The common API envelope runs first. It checks the call-frequency limit and records the call time. If the limit is exceeded, the call returns a
ResultCode/ResultTextrow with code502and does nothing else. - If
CArefisNULL, a row withReturnCode=ERRORis returned and nothing is deleted. - Otherwise the procedure collects all records in
CustomerAccountMatchwhereCAref1orCAref2equalsCAref. For each match key it then does the following:- It sets
UpdateDateto the current time andUpdateEmptoAPIon the match. - It deletes all
BankMatchrows whoseSourceCustomerAccountMatchKeypoints to the match. - It deletes the match itself.
- It sets
On success the call returns no result set. The output parameters ResultCode/ResultText hold 200/OK.
Notes
- Each match is deleted in its own transaction inside
Pixi_CA_DeleteMatch. There is no overall transaction. If deleting one match fails, only that match is rolled back and its error is re-raised withRAISERROR(severity 16). Matches deleted before it stay deleted. The loop continues with the remaining matches. - The list of matches is read with
NOLOCK. The deletes useROWLOCK. - The update of
UpdateDate/UpdateEmpright before the delete is probably meant for audit or trigger logic. The code does not show this. - The match is found if
CArefappears on either side (CAref1orCAref2). - If no match exists for
CAref, the call succeeds silently without any result. ResultCodestays200even when theCAref cannot be NULLrow is returned. Evaluate the returned row as well.- The frequency limit comes from
API_CONTROL.MIN_BREATHING_MSECfor this function name.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
CAref
Required
|
int | – |
Key of the customer account entry. All matches in which it appears as Example: |
ResultCode
OUTPUT
|
char(3) string |
NULL |
Result code set by the API envelope: Allowed values
|
ResultText
OUTPUT
|
varchar(1024) string |
NULL |
Result text of the API envelope: |
Result set 1 · Only if the call frequency limit is exceeded
Status row of the API envelope. No further processing takes place.
| Column | Type | Description |
|---|---|---|
ResultCode
|
char(3) string |
Always |
ResultText
|
varchar(1024) string |
Message containing the wait time in milliseconds. |
Result set 2 · If CAref is NULL
Error row. Nothing is deleted.
| Column | Type | Description |
|---|---|---|
ReturnCode
|
varchar(5) string |
Always |
ErrorMessage
|
varchar(20) string |
Error text. |
Response example
<SqlRowSet1>
<row>
<ResultCode>502</ResultCode>
<ResultText>(850) Frequency quote exceeded. Next call to this function can be made in ca. 850 milliseconds</ResultText>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| ERROR | CAref cannot be NULL | `CAref` was sent as NULL. Pass a valid customer account key. |
| 502 | ({WaitMsec}) Frequency quote exceeded. Next call to this function can be made in ca. {WaitMsec} milliseconds | The call was repeated faster than the minimum interval configured in `API_CONTROL`. Wait the given time and retry. |
| RAISERROR | {original SQL error message} | Deleting a single match or its bank matches failed, for example because of a constraint or deadlock. That match is rolled back and the original error text is re-raised. The other matches are still processed. |
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:pixiCADeleteEventMatches>
<CAref>104523</CAref>
<!-- <ResultCode>?</ResultCode> -->
<!-- <ResultText>?</ResultText> -->
</ns1:pixiCADeleteEventMatches>
</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:pixiCADeleteEventMatches>
<CAref>104523</CAref>
<!-- <ResultCode>?</ResultCode> -->
<!-- <ResultText>?</ResultText> -->
</ns1:pixiCADeleteEventMatches>
</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 = [
'CAref' => '104523',
// 'ResultCode' => '?',
// 'ResultText' => '?',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiCADeleteEventMatches', $soapArguments);
- SQL object:
- dbo.pipiCADeleteEventMatches