pixiSupplierOrderLineCreate
Create new purchase order line for one supplier
Since pixi version: 21.09 (21.9.0.60964) Additional notes: CAUTION: Only one item (per location) can be added per purchase order. You can sent order quantity for more location. In case of calculation of package unit, quantities for package unit will be adjusted per location and summarized together for total order quantity.
Using @ConsiderMinOrderQty = 1 and more location quantity for one item, min order quantity will be applied per location (not total item order quantity).
NOTE: Fields ItemId, SupplierPrice, LocationId, OrderedQty and SupplierOrderId or SupplierOrderNr are MANDATORY
NOTE: Purchase Order should have status NEW or BES (OPEN)
NOTE: Supplier of the Purchase order and Item should match
NOTE: DiscountType use 0 for % type and 1 for amount type. Discount Type and Discount are not mandatory. Default for Discount Type is PERCENT - Discount Type = 0.
**@PurchaseOrderXML** parameter sample XML:
<Items>
<Item>
<ItemId></ItemId>
<SupplierPrice></SupplierPrice>
<DiscountType></DiscountType>
<Discount></Discount>
<PackagingUnit></PackagingUnit>
<EstimatedDeliveryDate></EstimatedDeliveryDate>
<Comment></Comment>
<LocationList>
<Location>
<LocationId></LocationId>
<OrderedQty></OrderedQty>
</Location>
<Location>
<LocationId></LocationId>
<OrderedQty></OrderedQty>
</Location>
</LocationList>
</Item>
</Items>
Request
Request body
Name | Type | Required | Description |
---|---|---|---|
UserName | string | false | User name of user who execute API call Type: varchar(50) Default value: Example: API user Available from: 21.09 (21.9.0.60964) |
SupplierOrderId | integer | false | Purches order Id Type: int Default value: NULL Example: 12345 Available from: 21.09 (21.9.0.60964) |
SupplierOrderNr | integer | false | Purches order number Type: int Default value: NULL Example: 70012345 Available from: 21.09 (21.9.0.60964) |
PurchaseOrderXML | string | true | Item XML see additional information tab Type: xml Default value: Example: check additional information Available from: 21.09 (21.9.0.60964) |
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: 21.09 (21.9.0.60964) |
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: 21.09 (21.9.0.60964) |
Request Example
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body xmlns="">
<pixiSupplierOrderLineCreate>
<SupplierOrderId>0</SupplierOrderId>
<SupplierOrderNr>0</SupplierOrderNr>
<UserName>string</UserName>
<ConsiderPackageUnits>true</ConsiderPackageUnits>
<ConsiderMinOrderQty>true</ConsiderMinOrderQty>
<PurchaseOrderXML>string</PurchaseOrderXML>
</pixiSupplierOrderLineCreate>
</Body>
</Envelope>
Response
1. Detailed result set
Name | Type | Description |
---|---|---|
ItemId | integer | Item Id Type: int Available from: / (25.7.0.59144) |
Status | integer | Status = Error|Success Type: int Available from: / (25.7.0.59144) |
StatusDescription | integer | Detail descripton of status Type: int Available from: / (25.7.0.59144) |
Response Example
<PixiSupplierOrderLineCreatePost200TextXmlResponse>
<Status>0</Status>
<StatusDescription>0</StatusDescription>
<ItemId>0</ItemId>
</PixiSupplierOrderLineCreatePost200TextXmlResponse>
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:pixiSupplierOrderLineCreate>
<UserName xsi:type="xsd:string">API user</UserName>
<SupplierOrderId xsi:type="xsd:integer">12345</SupplierOrderId>
<SupplierOrderNr xsi:type="xsd:integer">70012345</SupplierOrderNr>
<PurchaseOrderXML xsi:type="xsd:string">check additional information</PurchaseOrderXML> <!-- required -->
<ConsiderMinOrderQty xsi:type="xsd:boolean">0 or 1</ConsiderMinOrderQty>
<ConsiderPackageUnits xsi:type="xsd:boolean">0 or 1</ConsiderPackageUnits>
</ns1:pixiSupplierOrderLineCreate>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PHP Example
<?php
getPixiSoapClientResponse('pixiSupplierOrderLineCreate', [
'UserName' => 'API user', // string
'SupplierOrderId' => '12345', // integer
'SupplierOrderNr' => '70012345', // integer
'PurchaseOrderXML' => 'check additional information', // string (required)
'ConsiderMinOrderQty' => '0 or 1', // boolean
'ConsiderPackageUnits' => '0 or 1', // boolean
]);
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);
}