CreatePurchaseOrder
Create a new purchase order with details and returns the Synergetic assigned order number.
This web service calls underlying SQL stored procedure – SynergyOneFinance.dbo.spxiPurchaseOrder.
InputObject (XML)
Element |
SQL Data Type |
Mandatory |
Description |
VendorTokenGUID |
GUID |
Yes |
Specific GUID that Synergetic will give the third party app to validate them upon every web service request. |
VersionNumber |
Decimal(4,2) |
Yes |
To cater for extending the web service and return the version specific format. Default 2.5. |
ConfigFileName |
Varchar(max) |
No |
Optional - if missing or blank then the authentication details into DB are found in WebServiceSynergetic.XML in the website folder. |
BusinessUnitCode |
Varchar(30) |
No |
BusinessUnitCode to assign the order to. Must match code in Synergetic. If not supplied then default is the first business unit found where the vendor login is a user. |
CreditorID |
Integer |
Yes |
Supplier ID for the items on this purchase order. |
OrderDate |
Date |
Yes |
Date of the purchase order – dd/mm/yyyy. |
OrderHeader |
Varchar(max) |
No |
Extra note to place at the top of the order. |
OrderTrailer |
Varchar(max) |
No |
Extra note to place on the bottom of the order. |
OrderDetail |
xmlNode |
Yes |
Order details, separate multi-record capable node. |
OrderDetail sub-node
This node demines the ordered items to add as part of the purchase order.
Element |
SQL Data Type |
Mandatory |
Description |
Description |
Varchar(255) |
Yes |
Description of the purchased item. |
Quantity |
Integer |
Yes |
Quantity of item ordered. |
Amount |
Money |
Yes |
Cost per unit ordered. Multiplying Cost x Qty will provide total cost. |
TaxCode |
Varchar(15) |
No |
Defaults to Tax Code '10' |
TaxAmount |
Money |
Yes |
0 = Tax Free. |
GLCode |
Varchar(15) |
No |
GL Account to default this order line to. This can be overwritten when the invoice is entered. |
<InputXML>
<VendorTokenGUID>3FC2ABA9-8F37-4CC9-934C-6ABCCA9F44B7</VendorTokenGUID>
<VersionNumber>2.5</VersionNumber>
<ConfigFileName></ConfigFileName>
<BusinessUnitCode>MAIN</BusinessUnitCode>
<CreditorID>4722</CreditorID>
<OrderDate>15/02/2010</OrderDate>
<DeliveryAddress></DeliveryAddress>
<OrderHeader>Extra notes to add to top of order</OrderHeader>
<OrderTrailer>Extra notes to add to bottom of order</OrderTrailer>
<OrderDetails>
<OrderDetail Description="Blazer" Quantity="5" Amount="80" TaxAmount="8" />
<OrderDetail Description="Trousers" Quantity="10" Amount="40" TaxAmount="4" />
<OrderDetail Description="Socks" Quantity="1" Amount="6.3901" TaxAmount="0.30" />
</OrderDetails>
</InputXML>
OutputObject (XML)
Element |
SQL Data Type |
Description |
ReturnValue |
Integer |
0 = Success, Non Zero indicates an error. |
OrderNumber |
Integer |
Purchase order number assigned by Synergetic. Will be blank if there is an error. |
Message |
Varchar(max) |
Will contain 'Order created successfully' or an error message if there is a problem creating the order. For example if the Creditor ID is unknown to Synergetic. Default to blank. |
Sample Output
<PurchaseOrder OrderNumber="5" Message="Order created successfully." />
<PurchaseOrder OrderNumber="" Message="Error - Order detail Amount not supplied or not numeric." />
<PurchaseOrder OrderNumber="" Message="Error - Order detail Quantity not supplied or not numeric." />
<PurchaseOrder OrderNumber="" Message="Error - Incorrect OrderDate format." />