pixiGetStandardReturnReasons
Returns the list of standard return reasons in German or English, combined from the standard reasons table, a setting and the return reason code table.
Builds one list of return reasons from three sources and returns it as a single result set.
Language selection. LanguageID = 1 selects German; any other value, including NULL, selects English. Internally the procedure switches to Pixi's table convention, where 1 = English and 2 = German, and uses that value to filter the tables.
Sources
RET_STANDARD_REASONSrows of the selected language. They returnRET_REASON_IDandREASON_TEXT.RET_REASON_CODEandLANGUAGEIDareNULL.- The setting
CSD_ReturnWizardReasons_Deutsch(German) orCSD_ReturnWizardReasons_English(other languages). Its value is a semicolon-separated list. Each entry becomes one row with trimmed text (max. 100 characters) andRET_REASON_ID=NULL. This part is combined with source 1 usingUNION, so identical rows from sources 1 and 2 appear only once. - Entries of
pixi.CodeTableValuewithCodeTableTypeId=2(return reasons), joined to theirTranslationentry (DBObjectName=CodeTableValue) in the selected language. These rows return the code table ID, the translated text and theCode.LANGUAGEIDis converted back to the caller's convention (1= German). These rows are appended withUNION ALL, so duplicates are not removed here.
Filter. With OnlyReturnReasonsFromPixiWeb = 1, only rows with a RET_REASON_ID are returned. This removes the setting-based reasons from source 2.
Sort order. Rows are sorted by RET_REASON_CODE. Rows without a code (NULL) come first, and their order among each other is not defined.
Notes
- The language convention of the parameter (
1= German) is the reverse of the convention used in the tables (1= English,2= German). Only theLANGUAGEIDcolumn of code table rows is reported in the caller's convention; all other rows returnNULL. - If the setting does not exist or is empty, source 2 returns no rows.
- A trailing or doubled semicolon in the setting value produces rows with an empty
REASON_TEXT. - Characters such as
&or<in the setting value can make the conversion of the list to XML fail, and the call then returns an SQL error. Settings,RET_STANDARD_REASONSandCodeTableValueare read withNOLOCK;Translationis read without a locking hint.- The setting name is matched with
LIKE, where_is a single-character wildcard. In practice the match is exact. - Read-only; only a temporary table is used.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
LanguageID
|
int | 1 |
Language of the reason texts: Allowed values
Example: |
OnlyReturnReasonsFromPixiWeb
|
bit boolean |
0 |
If Allowed values
Example: |
Result set 1 · Always
Return reasons in the selected language, sorted by RET_REASON_CODE.
| Column | Type | Description |
|---|---|---|
RET_REASON_ID
Nullable |
int |
ID from |
REASON_TEXT
Nullable |
varchar(max) string |
Text of the return reason. |
RET_REASON_CODE
Nullable |
varchar(100) string |
Code from |
LANGUAGEID
Nullable |
int |
Language of code table rows in the caller's convention ( |
Response example
<SqlRowSet1>
<row>
<RET_REASON_ID>3</RET_REASON_ID>
<REASON_TEXT>Artikel defekt</REASON_TEXT>
</row>
<row>
<RET_REASON_ID>17</RET_REASON_ID>
<REASON_TEXT>Falsche Größe</REASON_TEXT>
<RET_REASON_CODE>SIZE</RET_REASON_CODE>
<LANGUAGEID>1</LANGUAGEID>
</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:pixiGetStandardReturnReasons>
<!-- <LanguageID>1</LanguageID> -->
<!-- <OnlyReturnReasonsFromPixiWeb>0</OnlyReturnReasonsFromPixiWeb> -->
</ns1:pixiGetStandardReturnReasons>
</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:pixiGetStandardReturnReasons>
<!-- <LanguageID>1</LanguageID> -->
<!-- <OnlyReturnReasonsFromPixiWeb>0</OnlyReturnReasonsFromPixiWeb> -->
</ns1:pixiGetStandardReturnReasons>
</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 = [
// 'LanguageID' => '1',
// 'OnlyReturnReasonsFromPixiWeb' => '0',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetStandardReturnReasons', $soapArguments);
- SQL object:
- dbo.pipiGetStandardReturnReasons