VC Order v6
This versions has been superceded by v7
License Module
This is a licensed module and there is a small monthly charge for this feature in order that we support and maintain it for the future.
Introduction
Allows new order to be posted into Vision Commerce.
Request
Action : POST
URL : http://<path_to_api>/SalesOrder?Version=v6
This API needs to be authenticated ( pass header parameter Authorization : "Bearer "+AccessToken )
Order Total & Tax Total sent through to the API will override any Commerce calculation. When posting the invoice to the finance system, the values posted to the API will always be used.
Body XML sample
<?xml version="1.0" encoding="UTF-8"?>
<Order>
<OType>SO</OType>
<Customer>R2</Customer>
<Warehouse>MAIN</Warehouse>
<UnderBondType>DP</UnderBondType>
<OrderDate>2021-08-03</OrderDate>
<ReleaseDate></ReleaseDate>
<Address1>Royal House (demo)</Address1>
<Address2>28 Sovereign St</Address2>
<Address3></Address3>
<Town>Leeds</Town>
<Postcode>LS1 4BJ</Postcode>
<Country>GB</Country>
<Contact>Mrs Jones</Contact>
<DelContactNo>0113 396 9002</DelContactNo>
<Instructions>Use the rear door for the delivery </Instructions>
<CustomerRef>Ref 20 </CustomerRef>
<AccountManager>GEN</AccountManager>
<Type>RTL</Type>
<OrderLines>
<Item>
<ProductCode>IT9020I19</ProductCode>
<RotationNo />
<Units>2</Units>
<Singles></Singles>
<UnitPrice>156.50</UnitPrice>
<SinglePrice>13.04</SinglePrice>
<LineTotal>156.50</LineTotal>
<LineTax>0</LineTax>
</Item>
</OrderLines>
<SMsgDocNo>20</SMsgDocNo>
<SMsgDocument>Happy Birthday</SMsgDocument>
<SMsgQuantity>2</SMsgQuantity>
<SMsgHeader>Happy Birthday</SMsgHeader>
<SMsgTo>John Smith</SMsgTo>
<SMsg1>Happy Birthday</SMsg1>
<SMsg2>Hope you have a great day</SMsg2>
<SMsgFrom>Sue Jones</SMsgFrom>
<SMsgFooter>Happy Birthday</SMsgFooter>
<SMsgEmail>Happy Birthday</SMsgEmail>
<CartDiscount>0</CartDiscount>
<LineTotal>156.50</LineTotal>
<LineTaxTotal>2</LineTaxTotal>
<Fee>0</Fee>
<FeeTax>0</FeeTax>
<Shipping>5.00</Shipping>
<ShippingTax>2</ShippingTax>
<TaxTotal>2</TaxTotal>
<OrderTotal>166.50</OrderTotal>
<Payments>
<Payment>
<PaymentMethodID>200</PaymentMethodID>
<PaymentMethod>Cash</PaymentMethod>
<Value>166.50</Value>
<Name></Name>
<Company>Ontech</Company>
<Address1>Brentwood</Address1>
<Address2>East England</Address2>
<City>Brentwood</City>
<State>Essex</State>
<Postcode>CM131BN</Postcode>
<Country>England</Country>
<Phone>9946938619</Phone>
<Email>testers@ontech.uk</Email>
<TID>BL002</TID>
</Payment>
</Payments>
<ShippingMethodID>ONTECH</ShippingMethodID>
<PaymentMethodID>200</PaymentMethodID>
<WebOrderID>150</WebOrderID>
</Order>Tag | Element | Recurring Element | Data type | (M)andatory | Notes or limitations | Vision Commerce field |
|---|---|---|---|---|---|---|
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||||
<Order> | ||||||
<OType> | varchar(2) | M | Options SO - Standard Order (defaut) EP - EP Order | FKSalesOrderType | ||
<Warehouse> | varchar(6) | M | the warehouse code of the warehouse to be used for the order options | WareHouseCode | ||
<UnderBondType> | varchar(2) | M | Options DP : Duty Paid Other options - U : UK Under Bond | Under Bond Type | ||
| <Customer> |
| varchar(8) | O | Either field can be provided, if you provide nothing here then the system will use the default customer account code held in the API defaults setting | Customer |
| <CustID> |
| bigint | O | ||
<OrderDate> | date | M | format YYYY-MM-dd | Order Date | ||
<ReleaseDate> | datetime | O | YYYY-MM-dd HH:mm:ss format Web site completed date/time | Release Date | ||
<Address1> | nvarchar(50) | M | Delivery Address1 | |||
<Address2> | nvarchar(50) | O | Delivery Address2 | |||
<Address3> | nvarchar(50) | O | Delivery Address3 | |||
<Town> | nvarchar(50) | M | Delivery Town | |||
<Postcode> | varchar(15) | M | Postcode | |||
<Country> | varchar(2) | M | Country code | |||
|
|
| nvarchar(30) | O |
|
|
<DelContactNo> | varchar(50) | O | Delivery Contact No (Telephone) | |||
<Instructions> | varchar(120) | O | Will use customers default instructions unless this has something different when this will over write. | Delivery Instructions | ||
| <CustomerRef> |
| varchar(30) | O | The customer’s reference for the order | Customer Ref |
<AccountManager> | varchar(8) | O | Sales Order Analysis 1 Used to override the default option for the primary customer analysis code on a sales order | Account Manager | ||
<Type> | varchar(8) | O | Sales Order Analysis2 Used to override the default option for the secondary customer analysis code on a sales order | Type | ||
<OrderLines> | ||||||
<Item> | M | Section can be repeated with the <Item>, repeat for each individual order line |
| |||
<ProductCode> | varchar(30) | M | Product Code | |||
<RotationNo> | varchar(15) | O | RotationNumber | |||
<Units> | int | M | No of Cases | |||
<Singles> | int | C | Number of Singles | |||
<UnitPrice> | decimal(9,2) | C | After discounts and excluding VAT | PricePerUnit | ||
<SinglePrice> | decimal(9,2) | C | After discounts and excluding VAT | PricePerSingle | ||
<LineTotal> | decimal(9,4) | O | After discounts and excluding VAT | Total Price for the line, EX VAT | ||
<LineTax> | decimal(9,4) | O | VAT for this line | VAT total for the line | ||
| </Item> |
|
|
|
|
|
</OrderLines> | ||||||
| <SMsgDocNo> |
| int | O | Special message document | SM Document ID |
| <SMsgDocument> |
| varchar(80) | O | Special message document type | SM Document Type |
| <SMsgQuantity> |
| int | O | Special message quantity | SM Quantity |
| <SMsgHeader> |
| varchar(120) | O | Special message Header | Special Message Text 3 |
| <SMsgTo> |
| varchar(80) | O | Special message recipient (to) | Special Message Text 5 |
<SMsg1> | varchar(4096) | O | Saved in the order "warehouse options" – please check availability with the warehouse. Used by customers who wish to put a card inside the delivery for the receiver. Can be used for “Happy Birthday” “Merry Christmas” messages or similar. Can be HTML formatted or plain text. | SpecialMessageText1 | ||
<SMsg2> | varchar(4096) | O | This is line 2 of the message text and is predominantly used as a marketing message for the receiver of the goods. Can be HTML formatted or plain text. | SpecialMessageText2 | ||
| <SMsgFrom> |
| varchar(80) | O | Special message sender (from) | Special Message Text 6 |
| <SMsgFooter> |
| varchar(120) | O | Special message footer | Special Message Text 4 |
| <SMsgEmail> |
| O | Special Message Email address | Not currently in use | |
<CartDiscount> | decimal(9,4) | O | Total Discount Amount | |||
<LineTotal> | decimal(9,4) | O | Not including VAT | Line total | ||
<LineTaxTotal> | decimal(9,4) | O | This should be <OrderLinesTotal> less <OrderCartDiscount> and the vat of the net amount | Line tax Totals | ||
<Fee> | decimal(9,4) | O | Surcharge for Credit Card Payment | Surcharges > Price / Unit (SurchargePrice), | ||
<FeeTax> | decimal(9,4) | O | Surcharge tax | tblVisionSalesOrderHeaderAPI.FeeTaxTotal | ||
<Shipping> | decimal(9,4) | O | Not including VAT | Sundry Shipping Amount | ||
<ShippingTax> | decimal(9,4) | O | VAT on Shipping Total | |||
<TaxTotal> | decimal(9,4) | O | If declared this is the VAT element of the sale If not declared we will assume VAT at prevailing rate against OrderTotal | tblVisionSalesOrderHeaderAPI.TaxTotal | ||
<OrderTotal> | This should be Order Lines Total - Order Discount + Shipping Total + SurchargeTotal | tblVisionSalesOrderHeaderAPI.OrderTotal | ||||
<Payments> | ||||||
<Payment> | O | Segment can be repeated - allows multiple payments to be posted per order, if empty then payment on account is assumed | API Payment Details | |||
<PaymentMethodID> | varchar(30) | C | Checks if valid and sets code Mandatory if <Payments> segment submitted |
| ||
<PaymentMethod> | varchar(30) | O | Description of Payment Method | Not currently in use | ||
<Value> | decimal(9,2) | C | Mandatory if <Payments> segment submitted | Value | ||
|
| <Name> | nvarchar(30) | C
|
Conditional depending on payment method ID
Payment Transaction ID returned from vision live payment gateway
| BillingName |
| <Company> | varchar(50) | C
| BillingCompany | ||
| <Address1> | nvarchar(50) | C
| BillingAddress1 | ||
| <Address2> | nvarchar(50) | C
| BillingAddress2 | ||
| <City> | nvarchar(50) | C
| BillingCity | ||
| <State> | nvarchar(50) | C
| BillingState | ||
| <Postcode> | varchar(15) | C
| BillingPostcode | ||
| <Country> | varchar(2) | C
| Billingcountry | ||
| <Email> | varchar(50) | C
| BillingEmail | ||
| <Phone> | varchar(20) | C
| BillingPhone | ||
| <TID> | varchar(50)
| C | BillingTID | ||
| <FirstName> | nvarchar(30)
| C | Not currently in use | ||
| <LastName> | varchar(30)
| C | |||
| </Payment> |
|
|
|
|
|
</Payments> | ||||||
| <ShippingMethodID> |
| varchar(30) | O | Checks if valid | Sets Carrier based on ShippingMethodID |
<FKPaymentMethod> | int | O | Checks if valid | Sets Credit Card Order flag, tblVisionsalesOrderheader.FKPaymentMethod | ||
<WebOrderID> | bigint | M | This should be the website's unique reference for the order | Stored in OtherInfo=> Notes field | ||
<DName> | nvarchar(60) | M | Not currently in use | |||
</Order> | ||||||
Response / error codes
HTTP Status code | Description |
|---|---|
200 | Order saved |
201 | Order saved, however auto submission was failed |
400 | Something wrong with input or processing, |
Response (status code 200)
Order savedResponse (status code 400)
Node WebOrderID is not supplied