pixiUpdateSupplier
Updates the master data, main contact, lock and disabled flags of an existing supplier identified by its supplier number.
Performs a partial update of one supplier in Suppliers, identified by SupplNr.
- Empty strings in most parameters are converted to
NULL.SupplCtryis trimmed first. A parameter that isNULLor empty leaves the stored value unchanged (ISNULL(new, old)). - The supplier is looked up by
SupplNr. If it does not exist, an error row is returned. - If
IsLocked = 1orIsDisabled = 1,SupplierNoteis mandatory. If it is given, a note with the titleSupplier Locked by UserId: {id}orSupplier Disabled by UserId: {id}is inserted intoSupplierNote. The user is the Pixi userapi, orpixiAdministrationifapidoes not exist. If both flags are 1, two notes are created. - Within a transaction (or a savepoint if the caller already has an open transaction):
- If the supplier has no
ContactIdyet, an emptyContactrecord is created and linked. - The supplier fields are updated.
UpdateDateis set to the current time andUpdateEmptoAPI. - The linked contact is updated with the
MainContact_*values.
- If the supplier has no
- One status row is returned with
RowsAffected,ReturnCode,MessageandErrorMessage.
CanDoDirectFulfillment accepts Y/N. Other values leave the flag unchanged. IsLocked = 0 and IsDisabled = 0 unlock or enable the supplier without requiring a note.
Notes
- Notes outside the transaction: the
SupplierNoteinsert for locking or disabling runs before the transaction starts. It is not rolled back if the later update fails. It is also attempted when the supplier does not exist; in that caseSupplierIdisNULL. Database errors from this insert are not caught and come back asSqlMessage. - Missing
SupplNr: the message for an emptySupplNris overwritten by the "does not exist" message. That message is built by concatenatingNULL, so the result isNULL. The caller receivesReturnCode = Errorwith an empty orNULLErrorMessage. - Error precedence: a missing-note error for lock/disable overrides the "does not exist" message in
ErrorMessage. - Zero values:
DefaultDeliveryDaysandCurrencyIdare compared with'', which converts to 0. The value0is therefore treated as "not provided" and cannot be set. - Fields that cannot be cleared: an empty string never clears a field, because it is treated as "no change".
- Unused parameter:
SupplGroupis declared but not used. - Message text: the generic message contains the typo
conntact. - Locking: reads use
NOLOCK, updates useROWLOCK.XACT_ABORTis on. On a caught error, the transaction or savepoint is rolled back and an error row is returned. - Contact update: the contact's
RowVersionis always set to 1.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
SupplNr
|
varchar(4) string |
NULL |
Supplier number of the supplier to update. Mandatory in practice; without it an error row is returned. Example: |
SupplName
|
varchar(60) string |
NULL |
New supplier name ( Example: |
SupplNameExt
|
varchar(50) string |
NULL |
Name extension ( Example: |
SupplGroup
|
varchar(4) string |
NULL |
Supplier group. Declared but not used by the code. |
DefaultDeliveryDays
|
int | NULL |
Default delivery time in days ( Example: |
SupplFaxNR
|
varchar(100) string |
NULL |
Fax number ( Example: |
CustNR
|
varchar(20) string |
NULL |
Own customer number at the supplier ( Example: |
eMail
|
varchar(60) string |
NULL |
General e-mail address, stored in Example: |
SupAnrede
|
varchar(20) string |
NULL |
Salutation ( Example: |
SupName2
|
varchar(60) string |
NULL |
Second name line ( Example: |
SupAddress
|
varchar(50) string |
NULL |
Street address ( Example: |
SupZip
|
varchar(20) string |
NULL |
Postal code ( Example: |
SupPhone1
|
varchar(50) string |
NULL |
First phone number ( Example: |
CanDoDirectFulfillment
|
varchar(1) string |
NULL |
Whether the supplier can do direct fulfillment (drop shipping). Any other value leaves the flag unchanged. Allowed values
Example: |
SupCity
|
varchar(50) string |
NULL |
City ( Example: |
SupPhone2
|
varchar(50) string |
NULL |
Second phone number ( Example: |
SupplCtry
|
varchar(3) string |
NULL |
Country code ( Example: |
CurrencyId
|
smallint int |
NULL |
Currency ID of the supplier ( Example: |
eMailSupplOrder
|
varchar(255) string |
NULL |
E-mail address for supplier orders ( Example: |
HomePageUrl
|
nvarchar(2000) string |
NULL |
Website URL ( Example: |
MainContact_Title
|
nvarchar(100) string |
NULL |
Title of the main contact ( Example: |
MainContact_FirstName
|
nvarchar(20) string |
NULL |
First name of the main contact. Example: |
MainContact_LastName
|
nvarchar(200) string |
NULL |
Last name of the main contact. Example: |
MainContact_JobTitle
|
nvarchar(200) string |
NULL |
Job title of the main contact. Example: |
MainContact_JobFunction
|
nvarchar(200) string |
NULL |
Job function of the main contact. Example: |
MainContact_Phone
|
varchar(200) string |
NULL |
Phone number of the main contact. Example: |
MainContact_MobilePhone
|
varchar(200) string |
NULL |
Mobile phone number of the main contact. Example: |
MainContact_Fax
|
nvarchar(200) string |
NULL |
Fax number of the main contact. Example: |
MainContact_Email
|
nvarchar(200) string |
NULL |
E-mail address of the main contact. Example: |
SupplierComment
|
varchar(8000) string |
NULL |
Supplier comment, stored in Example: |
SupplierNote
|
varchar(8000) string |
NULL |
Body of the supplier note. Required when Example: |
IsDisabled
|
bit boolean |
NULL |
Sets the Allowed values
Example: |
IsLocked
|
bit boolean |
NULL |
Sets the Allowed values
Example: |
Result set 1 · Always (one status row, unless an uncaught error occurs while inserting a note before the transaction).
Status row of the update. On success ReturnCode is OK and ErrorMessage is empty. On error ReturnCode is Error, Message is a generic text and ErrorMessage contains the details.
| Column | Type | Description |
|---|---|---|
RowsAffected
|
int |
Number of supplier rows updated (1 on success, 0 on error). |
ReturnCode
|
varchar(100) string |
|
Message
Nullable |
varchar(4000) string |
Success message with the supplier number, or the generic error text. |
ErrorMessage
Nullable |
nvarchar(4000) string |
Empty on success; validation or SQL error message on error. Can be NULL if |
Response example
<SqlRowSet1>
<row>
<RowsAffected>1</RowsAffected>
<ReturnCode>OK</ReturnCode>
<Message>Supplier with SupplNr: "L001" successfully updated.</Message>
<ErrorMessage/>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| Error | Supplier with SupplNr: "{SupplNr}" does not exist. | No supplier with the given `SupplNr` exists. Returned in `ErrorMessage`. Check the supplier number. |
| Error | SupplierNote (comment) needs to be provided when locking the Supplier. | `IsLocked = 1` was sent without `SupplierNote`. Provide a note text. |
| Error | SupplierNote (comment) needs to be provided when disabling the Supplier. | `IsDisabled = 1` was sent without `SupplierNote`. Provide a note text. |
| Error | Something went wrong. Please conntact pixi* support. | Generic `Message` of every error row. If the error was caught during the update, `ErrorMessage` holds the SQL error text. If `SupplNr` was empty or missing, `ErrorMessage` is NULL. |
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:pixiUpdateSupplier>
<!-- <SupplNr>L001</SupplNr> -->
<!-- <SupplName>Muster Großhandel GmbH</SupplName> -->
<!-- <SupplNameExt>Abteilung Einkauf</SupplNameExt> -->
<!-- <SupplGroup>?</SupplGroup> -->
<!-- <DefaultDeliveryDays>5</DefaultDeliveryDays> -->
<!-- <SupplFaxNR>+49 30 1234567</SupplFaxNR> -->
<!-- <CustNR>K-98765</CustNR> -->
<!-- <eMail>info@muster-grosshandel.de</eMail> -->
<!-- <SupAnrede>Firma</SupAnrede> -->
<!-- <SupName2>Niederlassung Berlin</SupName2> -->
<!-- <SupAddress>Hauptstraße 12</SupAddress> -->
<!-- <SupZip>10115</SupZip> -->
<!-- <SupPhone1>+49 30 1234560</SupPhone1> -->
<!-- <CanDoDirectFulfillment>Y</CanDoDirectFulfillment> -->
<!-- <SupCity>Berlin</SupCity> -->
<!-- <SupPhone2>+49 30 1234561</SupPhone2> -->
<!-- <SupplCtry>DE</SupplCtry> -->
<!-- <CurrencyId>1</CurrencyId> -->
<!-- <eMailSupplOrder>bestellung@muster-grosshandel.de</eMailSupplOrder> -->
<!-- <HomePageUrl>https://www.muster-grosshandel.de</HomePageUrl> -->
<!-- <MainContact_Title>Dr.</MainContact_Title> -->
<!-- <MainContact_FirstName>Anna</MainContact_FirstName> -->
<!-- <MainContact_LastName>Schmidt</MainContact_LastName> -->
<!-- <MainContact_JobTitle>Key Account Manager</MainContact_JobTitle> -->
<!-- <MainContact_JobFunction>Vertrieb</MainContact_JobFunction> -->
<!-- <MainContact_Phone>+49 30 1234562</MainContact_Phone> -->
<!-- <MainContact_MobilePhone>+49 170 1234567</MainContact_MobilePhone> -->
<!-- <MainContact_Fax>+49 30 1234569</MainContact_Fax> -->
<!-- <MainContact_Email>a.schmidt@muster-grosshandel.de</MainContact_Email> -->
<!-- <SupplierComment>Mindestbestellwert 250 EUR</SupplierComment> -->
<!-- <SupplierNote>Gesperrt wegen offener Reklamationen.</SupplierNote> -->
<!-- <IsDisabled>0</IsDisabled> -->
<!-- <IsLocked>1</IsLocked> -->
</ns1:pixiUpdateSupplier>
</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:pixiUpdateSupplier>
<!-- <SupplNr>L001</SupplNr> -->
<!-- <SupplName>Muster Großhandel GmbH</SupplName> -->
<!-- <SupplNameExt>Abteilung Einkauf</SupplNameExt> -->
<!-- <SupplGroup>?</SupplGroup> -->
<!-- <DefaultDeliveryDays>5</DefaultDeliveryDays> -->
<!-- <SupplFaxNR>+49 30 1234567</SupplFaxNR> -->
<!-- <CustNR>K-98765</CustNR> -->
<!-- <eMail>info@muster-grosshandel.de</eMail> -->
<!-- <SupAnrede>Firma</SupAnrede> -->
<!-- <SupName2>Niederlassung Berlin</SupName2> -->
<!-- <SupAddress>Hauptstraße 12</SupAddress> -->
<!-- <SupZip>10115</SupZip> -->
<!-- <SupPhone1>+49 30 1234560</SupPhone1> -->
<!-- <CanDoDirectFulfillment>Y</CanDoDirectFulfillment> -->
<!-- <SupCity>Berlin</SupCity> -->
<!-- <SupPhone2>+49 30 1234561</SupPhone2> -->
<!-- <SupplCtry>DE</SupplCtry> -->
<!-- <CurrencyId>1</CurrencyId> -->
<!-- <eMailSupplOrder>bestellung@muster-grosshandel.de</eMailSupplOrder> -->
<!-- <HomePageUrl>https://www.muster-grosshandel.de</HomePageUrl> -->
<!-- <MainContact_Title>Dr.</MainContact_Title> -->
<!-- <MainContact_FirstName>Anna</MainContact_FirstName> -->
<!-- <MainContact_LastName>Schmidt</MainContact_LastName> -->
<!-- <MainContact_JobTitle>Key Account Manager</MainContact_JobTitle> -->
<!-- <MainContact_JobFunction>Vertrieb</MainContact_JobFunction> -->
<!-- <MainContact_Phone>+49 30 1234562</MainContact_Phone> -->
<!-- <MainContact_MobilePhone>+49 170 1234567</MainContact_MobilePhone> -->
<!-- <MainContact_Fax>+49 30 1234569</MainContact_Fax> -->
<!-- <MainContact_Email>a.schmidt@muster-grosshandel.de</MainContact_Email> -->
<!-- <SupplierComment>Mindestbestellwert 250 EUR</SupplierComment> -->
<!-- <SupplierNote>Gesperrt wegen offener Reklamationen.</SupplierNote> -->
<!-- <IsDisabled>0</IsDisabled> -->
<!-- <IsLocked>1</IsLocked> -->
</ns1:pixiUpdateSupplier>
</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 = [
// 'SupplNr' => 'L001',
// 'SupplName' => 'Muster Großhandel GmbH',
// 'SupplNameExt' => 'Abteilung Einkauf',
// 'SupplGroup' => '?',
// 'DefaultDeliveryDays' => '5',
// 'SupplFaxNR' => '+49 30 1234567',
// 'CustNR' => 'K-98765',
// 'eMail' => 'info@muster-grosshandel.de',
// 'SupAnrede' => 'Firma',
// 'SupName2' => 'Niederlassung Berlin',
// 'SupAddress' => 'Hauptstraße 12',
// 'SupZip' => '10115',
// 'SupPhone1' => '+49 30 1234560',
// 'CanDoDirectFulfillment' => 'Y',
// 'SupCity' => 'Berlin',
// 'SupPhone2' => '+49 30 1234561',
// 'SupplCtry' => 'DE',
// 'CurrencyId' => '1',
// 'eMailSupplOrder' => 'bestellung@muster-grosshandel.de',
// 'HomePageUrl' => 'https://www.muster-grosshandel.de',
// 'MainContact_Title' => 'Dr.',
// 'MainContact_FirstName' => 'Anna',
// 'MainContact_LastName' => 'Schmidt',
// 'MainContact_JobTitle' => 'Key Account Manager',
// 'MainContact_JobFunction' => 'Vertrieb',
// 'MainContact_Phone' => '+49 30 1234562',
// 'MainContact_MobilePhone' => '+49 170 1234567',
// 'MainContact_Fax' => '+49 30 1234569',
// 'MainContact_Email' => 'a.schmidt@muster-grosshandel.de',
// 'SupplierComment' => 'Mindestbestellwert 250 EUR',
// 'SupplierNote' => 'Gesperrt wegen offener Reklamationen.',
// 'IsDisabled' => '0',
// 'IsLocked' => '1',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiUpdateSupplier', $soapArguments);
- SQL object:
- dbo.pipiUpdateSupplier