pixiSupplierOrderCreate
Recommended
Create new purchase order for one supplier
Since pixi version: AVA Official - Update 7 (8.4.7.23158) Additional notes: CAUTION: Only one item (per location) can be added per purchase order. All separated rows will be combined together and summarized.
NOTE: It is best to use both tags (ItemNrSuppl,ItemNrInt) to ensure uniqueness of the added item.
**PurchaseOrderDocument** parameter sample XML:
<Items>
<Item>
<ItemNrInt></ItemNrInt>
<ItemNrSuppl></ItemNrSuppl>
<SupplierPrice></SupplierPrice>
<Qty></Qty>
</Item>
</Items>
Request
Request body
Name | Type | Required | Description |
---|---|---|---|
Type | integer | false | Purchase order type (1 = Purchase Order, 2 = Pre-Order) Type: int Default value: 1 Example: 1 or 2 Available from: 18.09 (8.4.45.35482) |
UserId | integer | false | Id of user who execute API call Type: int Default value: NULL Example: 123 Available from: AVA Official - Update 7 (8.4.7.23158) |
AppName | string | true | Name of application which execute API call Type: varchar(255) Default value: Example: Application name Available from: AVA Official - Update 7 (8.4.7.23158) |
UserName | string | true | User name of user who execute API call Type: varchar(50) Default value: Example: API user Available from: AVA Official - Update 7 (8.4.7.23158) |
SupplierId | integer | false | SupplierId or SupplierNr must be provided; Supplier ID Type: int Default value: NULL Example: 123 Available from: AVA Official - Update 7 (8.4.7.23158) |
SupplierNr | string | false | SupplierNr or SupplierId must be provided; Supplier number (code) Type: varchar(4) Default value: NULL Example: MGS Available from: AVA Official - Update 7 (8.4.7.23158) |
ExternalCode | string | false | External code Type: nvarchar Default value: NULL Example: abcd Available from: AVA Official - Update 7 (8.4.7.23158) |
OrderLocation | string | false | One of order location parameter must be provided; Id of order location Type: varchar(3) Default value: NULL Example: 001 Available from: AVA Official - Update 7 (8.4.7.23158) |
OrderLocationId | integer | false | One of order location parameter must be provided; Character code of order location Type: int Default value: NULL Example: 123 Available from: AVA Official - Update 7 (8.4.7.23158) |
DeliveryLocation | string | false | One of delivery location parameter must be provided; Id of shipping and billing location Type: varchar(3) Default value: NULL Example: 001 Available from: AVA Official - Update 7 (8.4.7.23158) |
DeliveryLocationId | integer | false | One of delivery location parameter must be provided; Character code of shipping and billing location Type: int Default value: NULL Example: 123 Available from: AVA Official - Update 7 (8.4.7.23158) |
ShowDetailedReturn | boolean | false | Switch: Return detailed result Type: bit Default value: 0 Example: 0 or 1 Available from: AVA 17.09 (8.4.33.31482) |
SupplOrderDocument | string | true | Item XML see additional information tab Type: xml Default value: Example: check additional information Available from: AVA Official - Update 7 (8.4.7.23158) |
ConsiderMinOrderQty | boolean | false | Same functionality as at purchase order suggestions, apply (0 no, 1 yes) minimum order quantity Type: bit Default value: 0 Example: 0 or 1 Available from: AVA Official - Update 7 (8.4.7.23158) |
ConsiderPackageUnits | boolean | false | Same functionality as at purchase order suggestions, apply (0 no, 1 yes) packing units Type: bit Default value: 0 Example: 0 or 1 Available from: AVA Official - Update 7 (8.4.7.23158) |
EstimatedDeliveryDate | string | false | Estimated delivery date Type: datetime Default value: NULL Example: date format: YYYYMMDD hh:mm:ss[.mmm] Available from: AVA Official - Update 7 (8.4.7.23158) |
OrderConsiderationStartDate | string | false | Only applicable for Pre-Orders; Exclude from upcoming purchase order suggestions until this date Type: datetime Default value: NULL Example: date format: YYYYMMDD hh:mm:ss[.mmm] Available from: 18.09 (8.4.45.35482) |
Request Example
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body xmlns="">
<pixiSupplierOrderCreate>
<AppName>string</AppName>
<UserId>0</UserId>
<UserName>string</UserName>
<SupplierId>0</SupplierId>
<SupplierNr>string</SupplierNr>
<DeliveryLocation>string</DeliveryLocation>
<DeliveryLocationId>0</DeliveryLocationId>
<OrderLocation>string</OrderLocation>
<OrderLocationId>0</OrderLocationId>
<SupplOrderDocument>string</SupplOrderDocument>
<ConsiderPackageUnits>true</ConsiderPackageUnits>
<ConsiderMinOrderQty>true</ConsiderMinOrderQty>
<ExternalCode>string</ExternalCode>
<EstimatedDeliveryDate>string</EstimatedDeliveryDate>
<ShowDetailedReturn>true</ShowDetailedReturn>
<Type>0</Type>
<OrderConsiderationStartDate>string</OrderConsiderationStartDate>
</pixiSupplierOrderCreate>
</Body>
</Envelope>
Response
1. When a new purchase order gets created
Name | Type | Description |
---|---|---|
InternalNumber | integer | Purchase order internal number Type: int Available from: 25.06 (25.6.0.58802) |
SupplierOrderId | integer | Purchase order ID Type: int Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiSupplierOrderCreatePost200TextXmlResponse>
<SupplierOrderId>0</SupplierOrderId>
<InternalNumber>0</InternalNumber>
</PixiSupplierOrderCreatePost200TextXmlResponse>
2. Detailed result set
Name | Type | Description |
---|---|---|
ItemId | integer | Item ID Type: int Available from: 25.06 (25.6.0.58802) |
ItemName | string | Item name Type: varchar (120) Available from: 25.06 (25.6.0.58802) |
ItemNrInt | string | Shop item number Type: varchar (50) Available from: 25.06 (25.6.0.58802) |
ItemNrSuppl | string | Supplier item number Type: varchar (50) Available from: 25.06 (25.6.0.58802) |
StatusMessage | string | (Item does not have the correct supplier assigned |ItemNrSuppl is missing for the item | Item not FOUND | OK) Type: varchar (100) Available from: 25.06 (25.6.0.58802) |
InternalNumber | integer | Purchase order Nr (Example: 70014599) Type: int Available from: 25.06 (25.6.0.58802) |
SupplierOrderId | integer | Purchase order ID (Example: 14599) Type: int Available from: 25.06 (25.6.0.58802) |
ItemCodeInternal | string | Internal item number Type: varchar (50) Available from: 25.06 (25.6.0.58802) |
SupplierOrderlineId | integer | Purchase orderline ID Type: int Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiSupplierOrderCreatePost200TextXmlResponse>
<SupplierOrderId>0</SupplierOrderId>
<InternalNumber>0</InternalNumber>
</PixiSupplierOrderCreatePost200TextXmlResponse>
3. When someting went wrong
Name | Type | Description |
---|---|---|
ReturnCode | string | Status = Error|Success Type: varchar (10) Available from: 25.06 (25.6.0.58802) |
ErrorMessage | string | Description of the error Type: varchar (300) Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiSupplierOrderCreatePost400TextXmlResponse>
<ReturnCode>string</ReturnCode>
<ErrorMessage>string</ErrorMessage>
</PixiSupplierOrderCreatePost400TextXmlResponse>
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:pixiSupplierOrderCreate>
<Type xsi:type="xsd:integer">1 or 2</Type>
<UserId xsi:type="xsd:integer">123</UserId>
<AppName xsi:type="xsd:string">Application name</AppName> <!-- required -->
<UserName xsi:type="xsd:string">API user</UserName> <!-- required -->
<SupplierId xsi:type="xsd:integer">123</SupplierId>
<SupplierNr xsi:type="xsd:string">MGS</SupplierNr>
<ExternalCode xsi:type="xsd:string">abcd</ExternalCode>
<OrderLocation xsi:type="xsd:string">001</OrderLocation>
<OrderLocationId xsi:type="xsd:integer">123</OrderLocationId>
<DeliveryLocation xsi:type="xsd:string">001</DeliveryLocation>
<DeliveryLocationId xsi:type="xsd:integer">123</DeliveryLocationId>
<ShowDetailedReturn xsi:type="xsd:boolean">0 or 1</ShowDetailedReturn>
<SupplOrderDocument xsi:type="xsd:string">check additional information</SupplOrderDocument> <!-- required -->
<ConsiderMinOrderQty xsi:type="xsd:boolean">0 or 1</ConsiderMinOrderQty>
<ConsiderPackageUnits xsi:type="xsd:boolean">0 or 1</ConsiderPackageUnits>
<EstimatedDeliveryDate xsi:type="xsd:string">date format: YYYYMMDD hh:mm:ss[.mmm]</EstimatedDeliveryDate>
<OrderConsiderationStartDate xsi:type="xsd:string">date format: YYYYMMDD hh:mm:ss[.mmm]</OrderConsiderationStartDate>
</ns1:pixiSupplierOrderCreate>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PHP Example
<?php
getPixiSoapClientResponse('pixiSupplierOrderCreate', [
'Type' => '1 or 2', // integer
'UserId' => '123', // integer
'AppName' => 'Application name', // string (required)
'UserName' => 'API user', // string (required)
'SupplierId' => '123', // integer
'SupplierNr' => 'MGS', // string
'ExternalCode' => 'abcd', // string
'OrderLocation' => '001', // string
'OrderLocationId' => '123', // integer
'DeliveryLocation' => '001', // string
'DeliveryLocationId' => '123', // integer
'ShowDetailedReturn' => '0 or 1', // boolean
'SupplOrderDocument' => 'check additional information', // string (required)
'ConsiderMinOrderQty' => '0 or 1', // boolean
'ConsiderPackageUnits' => '0 or 1', // boolean
'EstimatedDeliveryDate' => 'date format: YYYYMMDD hh:mm:ss[.mmm]', // string
'OrderConsiderationStartDate' => 'date format: YYYYMMDD hh:mm:ss[.mmm]', // string
]);
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);
}