pixiAddOrderLine
API call adds an orderline to an existing pixi order
Since pixi version: LOU Official (6.3.0.4452) Additional notes: Handling of price and discount parameters
VoucherID and Discount: Only one VoucherId is allowed to be assigned to one order.
When Discount is provided, it is mandatory to provide also a VoucherId.
If VoucherId already exists for the order. It is possible to change the Discount(Voucher amount) for it.
For B2B orders the Price parameter is automatically treated as "Net price" and for B2C orders the Price parameter is treated as "Gross price".
Parameter DiscountPerc is calculated from FullPrice and FullPriceDiscountValue.
The parameter is ignored when also FullPriceDiscountValue is provided.
DiscountPerc can also be calculated from FullPrice and DiscountedPrice when FullPriceDiscountValue is not provided.
Request
Request body
Name | Type | Required | Description |
---|---|---|---|
Date | string | false | Create date Type: datetime Default value: NULL Example: YYYY-MM-DD hh:mm:ss Available from: LOU Official (6.3.0.4452) |
Extras | string | false | Shipping details - Extras Type: varchar(50) Default value: NULL Example: abcdefg Available from: LOU Official (6.3.0.4452) |
Status | string | false | Manually define orderline status. Allowed statuses are: NEW,ANG,HAL,BES,STO,NLB,MIN,RET,FUT (Default = NULL). When using parameter @UsePaymentStatus set to 1, then @Status has to be NULL or NEW. Type: varchar(3) Default value: NULL Example: STO Available from: AVA Official - Update 23 (8.4.23.27873) |
DF_Type | string | false | Direct fullfilement type Type: varchar(1) Default value: NULL Example: 1 Available from: 21.12 (21.12.0.63114) |
ItemKey | integer | false | Item Id Type: int Default value: NULL Example: 123 Available from: LOU Official (6.3.0.4452) |
Product | string | false | Shipping details - Product Type: varchar(50) Default value: NULL Example: abcdefg Available from: LOU Official (6.3.0.4452) |
Discount | number | false | Voucher amount Type: money Default value: NULL Example: 9.99 Available from: LOU Official (6.3.0.4452) |
Employee | string | false | Employee that created the orderline Type: varchar(50) Default value: NULL Example: abcdefg Available from: LOU Official (6.3.0.4452) |
ItemName | string | false | Item name Type: varchar(120) Default value: NULL Example: abcdefg Available from: 21.12 (21.12.0.63114) |
Quantity | integer | false | Orderline quantity Type: int Default value: 1 Example: 123 Available from: LOU Official (6.3.0.4452) |
ShipCost | number | false | The total shipping costs of the whole order Type: money Default value: 0.0 Example: 9.99 Available from: LOU Official (6.3.0.4452) |
FullPrice | number | false | Item selling price without any discount Type: money Default value: NULL Example: 9.99 Available from: 21.12 (21.12.0.63114) |
ItemNrInt | string | false | Shop item number Type: varchar(50) Default value: NULL Example: abcdefg Available from: LOU Official (6.3.0.4452) |
Verfahren | string | false | Shipping details - Verfahen Type: varchar(50) Default value: NULL Example: abcdefg Available from: LOU Official (6.3.0.4452) |
VoucherID | string | false | ID of the voucher Type: varchar(50) Default value: NULL Example: abcdefg Available from: LOU Official (6.3.0.4452) |
LocationID | string | false | Location code Type: varchar(3) Default value: 001 Example: 002 Available from: LOU Official (6.3.0.4452) |
GiftMessage | string | false | Gift Message Type: varchar(8000) Default value: Example: abcdefg Available from: LOU Official (6.3.0.4452) |
PixiOrderNr | integer | true | pixi Order number Type: int Default value: Example: 123 Available from: LOU Official (6.3.0.4452) |
SerialNumber | string | false | Item serial number Type: varchar(50) Default value: NULL Example: abcdefg Available from: 21.12 (21.12.0.63114) |
AddressRemarks | string | false | Address remarks Type: varchar(255) Default value: NULL Example: abcdefg Available from: LOU Official (6.3.0.4452) |
ItemNrExternal | string | false | Item number external (Imported from Shop) Type: varchar(50) Default value: N Example: abcdefg Available from: AVA 17.06 (8.4.30.30160) |
DiscountPercent | number | false | Discount on orderline in percent Type: numeric Default value: NULL Example: 9.99 Available from: LOU Official (6.3.0.4452) |
DiscountedPrice | number | false | Item selling price including discount Type: money Default value: NULL Example: 9.99 Available from: 21.12 (21.12.0.63114) |
ItemSpecialNote | string | false | Item special note Type: varchar(8000) Default value: NULL Example: abcdefg Available from: 21.12 (21.12.0.63114) |
OrderNrExternal | string | false | External order number Type: varchar(50) Default value: NULL Example: abcdefg Available from: 21.12 (21.12.0.63114) |
UsePaymentStatus | boolean | false | When 1, then orderline status is automatically set based on orders payment type, when 0 then you can manually define it by @Status parameter. Type: bit Default value: 0 Example: 0 or 1 Available from: AVA Official - Update 23 (8.4.23.27873) |
FullPriceDiscountValue | number | false | Discount per orderline as amount Type: money Default value: NULL Example: 9.99 Available from: 21.12 (21.12.0.63114) |
Request Example
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body xmlns="">
<pixiAddOrderLine>
<PixiOrderNr>0</PixiOrderNr>
<ItemKey>0</ItemKey>
<ItemNrInt>string</ItemNrInt>
<Quantity>0</Quantity>
<ShipCost>0</ShipCost>
<LocationID>string</LocationID>
<GiftMessage>string</GiftMessage>
<DiscountPercent>0</DiscountPercent>
<VoucherID>string</VoucherID>
<Discount>0</Discount>
<AddressRemarks>string</AddressRemarks>
<Verfahren>string</Verfahren>
<Product>string</Product>
<Extras>string</Extras>
<Employee>string</Employee>
<Date>string</Date>
<Status>string</Status>
<UsePaymentStatus>true</UsePaymentStatus>
<ItemNrExternal>string</ItemNrExternal>
<FullPrice>0</FullPrice>
<FullPriceDiscountValue>0</FullPriceDiscountValue>
<DiscountedPrice>0</DiscountedPrice>
<ItemName>string</ItemName>
<ItemSpecialNote>string</ItemSpecialNote>
<OrderNrExternal>string</OrderNrExternal>
<DF_Type>string</DF_Type>
<SerialNumber>string</SerialNumber>
</pixiAddOrderLine>
</Body>
</Envelope>
Response
1. Return status for adding new orderline
Name | Type | Description |
---|---|---|
CanAdd | boolean | Status if an orderline can be added or not Type: BIT Available from: 25.06 (25.6.0.58802) |
OrderNr | integer | Order number of the order where the orderline was added Type: INT Available from: 25.06 (25.6.0.58802) |
OrderlineId | integer | ID of the Orderline record Type: INT Available from: 25.06 (25.6.0.58802) |
ErrorMessage | string | Error message, when something unexpected happened Type: VARCHAR(8000) Available from: 25.06 (25.6.0.58802) |
OrderNrExternal | string | External order number Type: VARCHAR(50) Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiAddOrderLinePost200TextXmlResponse>
<CanAdd>true</CanAdd>
<OrderNr>0</OrderNr>
<ErrorMessage>string</ErrorMessage>
<OrderlineId>0</OrderlineId>
<OrderNrExternal>string</OrderNrExternal>
</PixiAddOrderLinePost200TextXmlResponse>
HTTP Example
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
# echo -n '{{username}}:{{password}}' | base64 | pbcopy
Authorization: Basic {{token}}
<?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/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:pixiAddOrderLine>
<Date xsi:type="xsd:string">YYYY-MM-DD hh:mm:ss</Date>
<Extras xsi:type="xsd:string">abcdefg</Extras>
<Status xsi:type="xsd:string">STO</Status>
<DF_Type xsi:type="xsd:string">1</DF_Type>
<ItemKey xsi:type="xsd:integer">123</ItemKey>
<Product xsi:type="xsd:string">abcdefg</Product>
<Discount xsi:type="xsd:number">9.99</Discount>
<Employee xsi:type="xsd:string">abcdefg</Employee>
<ItemName xsi:type="xsd:string">abcdefg</ItemName>
<Quantity xsi:type="xsd:integer">123</Quantity>
<ShipCost xsi:type="xsd:number">9.99</ShipCost>
<FullPrice xsi:type="xsd:number">9.99</FullPrice>
<ItemNrInt xsi:type="xsd:string">abcdefg</ItemNrInt>
<Verfahren xsi:type="xsd:string">abcdefg</Verfahren>
<VoucherID xsi:type="xsd:string">abcdefg</VoucherID>
<LocationID xsi:type="xsd:string">002</LocationID>
<GiftMessage xsi:type="xsd:string">abcdefg</GiftMessage>
<PixiOrderNr xsi:type="xsd:integer">123</PixiOrderNr> <!-- required -->
<SerialNumber xsi:type="xsd:string">abcdefg</SerialNumber>
<AddressRemarks xsi:type="xsd:string">abcdefg</AddressRemarks>
<ItemNrExternal xsi:type="xsd:string">abcdefg</ItemNrExternal>
<DiscountPercent xsi:type="xsd:number">9.99</DiscountPercent>
<DiscountedPrice xsi:type="xsd:number">9.99</DiscountedPrice>
<ItemSpecialNote xsi:type="xsd:string">abcdefg</ItemSpecialNote>
<OrderNrExternal xsi:type="xsd:string">abcdefg</OrderNrExternal>
<UsePaymentStatus xsi:type="xsd:boolean">0 or 1</UsePaymentStatus>
<FullPriceDiscountValue xsi:type="xsd:number">9.99</FullPriceDiscountValue>
</ns1:pixiAddOrderLine>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PHP Example
<?php
getPixiSoapClientResponse('pixiAddOrderLine', [
'Date' => 'YYYY-MM-DD hh:mm:ss', // string
'Extras' => 'abcdefg', // string
'Status' => 'STO', // string
'DF_Type' => '1', // string
'ItemKey' => '123', // integer
'Product' => 'abcdefg', // string
'Discount' => '9.99', // number
'Employee' => 'abcdefg', // string
'ItemName' => 'abcdefg', // string
'Quantity' => '123', // integer
'ShipCost' => '9.99', // number
'FullPrice' => '9.99', // number
'ItemNrInt' => 'abcdefg', // string
'Verfahren' => 'abcdefg', // string
'VoucherID' => 'abcdefg', // string
'LocationID' => '002', // string
'GiftMessage' => 'abcdefg', // string
'PixiOrderNr' => '123', // integer (required)
'SerialNumber' => 'abcdefg', // string
'AddressRemarks' => 'abcdefg', // string
'ItemNrExternal' => 'abcdefg', // string
'DiscountPercent' => '9.99', // number
'DiscountedPrice' => '9.99', // number
'ItemSpecialNote' => 'abcdefg', // string
'OrderNrExternal' => 'abcdefg', // string
'UsePaymentStatus' => '0 or 1', // boolean
'FullPriceDiscountValue' => '9.99', // number
]);
function getPixiSoapClientResponse(string $method, array $arguments = [])
{
$soapArguments = [];
foreach ($arguments as $key => $value) {
$soapArguments[] = new SoapVar($value, null, '', '', $key);
}
$soapClient = new SoapClient(null, [
'login' => '...',
'password' => '...',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
]);
return $soapClient->__call($method, $soapArguments);
}