pixiSetShippingLock
Sets or removes the shipping lock (`SLocked`) of a customer, identified by `CustKey` or by external customer number and shop.
Sets the shipping lock flag of one customer record in Customers.
UserNameis trimmed. If it is empty or missing,APIis used. The value is written toCustomers.UpdateEmp.Lockedis converted to the stored value:1becomesY. Any other value, including0andNULL, becomesN.- If
CustomerNrExternalis not empty, the procedure looks up theCustKeyof the customer whoseCustomerNrExternalmatches and whoseCustomerOfequalsShopID. If several customers match, only one of them (TOP 1, no defined order) is used. - The customer with the resulting
CustKeygetsSLockedandUpdateEmpupdated. - A single row with the column
Resultis returned:0if exactly one customer was updated,1otherwise.
Notes
- If
CustomerNrExternalis given but no customer matches, the variable keeps the passedCustKey. In that case the customer with thatCustKeyis updated, or nothing is updated ifCustKeyisNULL. ShopIDis compared with=. IfShopIDisNULLwhileCustomerNrExternalis set, the lookup never finds a match.- If neither
CustKeynor a matching external number is given, no row is updated andResult=1is returned. - The lookup uses
UPDLOCK. There is no explicit transaction, so the lock is held only for the duration of that statement. - No error messages are produced. Only the
Resultvalue indicates success or failure.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
CustKey
|
int | NULL |
Internal key of the customer. Used if Example: |
Locked
|
bit boolean |
1 |
Allowed values
Example: |
CustomerNrExternal
|
varchar(250) string |
NULL |
External customer number, for example from the shop. If set, the customer is looked up by this number together with Example: |
ShopID
|
varchar(3) string |
NULL |
Shop code compared with Example: |
UserName
|
varchar(50) string |
NULL |
User name written to Example: |
Result set 1 · Always
Single row with the outcome of the update.
| Column | Type | Description |
|---|---|---|
Result
|
int |
|
Response example
<SqlRowSet1>
<row>
<Result>0</Result>
</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:pixiSetShippingLock>
<!-- <CustKey>10452</CustKey> -->
<!-- <Locked>1</Locked> -->
<!-- <CustomerNrExternal>SHOP-000123</CustomerNrExternal> -->
<!-- <ShopID>WEB</ShopID> -->
<!-- <UserName>shopsync</UserName> -->
</ns1:pixiSetShippingLock>
</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:pixiSetShippingLock>
<!-- <CustKey>10452</CustKey> -->
<!-- <Locked>1</Locked> -->
<!-- <CustomerNrExternal>SHOP-000123</CustomerNrExternal> -->
<!-- <ShopID>WEB</ShopID> -->
<!-- <UserName>shopsync</UserName> -->
</ns1:pixiSetShippingLock>
</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 = [
// 'CustKey' => '10452',
// 'Locked' => '1',
// 'CustomerNrExternal' => 'SHOP-000123',
// 'ShopID' => 'WEB',
// 'UserName' => 'shopsync',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiSetShippingLock', $soapArguments);
- SQL object:
- dbo.pipiSetShippingLock