VC Order v5



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

 

Body XML sample
<?xml version="1.0" encoding="UTF-8"?> <Order> <WhseID>OTSR</WhseID> <OType>SO</OType> <UBType>DP</UBType> <WebOrderID>150</WebOrderID> <ODate>2019-04-24</ODate> <DName>Test Name</DName> <DContact>Test contact</DContact> <DNumber>944772671</DNumber> <DAdd1>address1</DAdd1> <DAdd2>address2</DAdd2> <DAdd3>address3</DAdd3> <DTown>dTown</DTown> <DPostcode>DB10</DPostcode> <DCountry>GB</DCountry> <ShippingMethodID>ONTECH</ShippingMethodID> <PaymentMethodID>Amex</PaymentMethodID> <OrderLinesTotal>8.33333</OrderLinesTotal> <OrderLinesTotalTax>2</OrderLinesTotalTax> <OrderDiscountTotal>0</OrderDiscountTotal> <ShippingTotal>8.33333</ShippingTotal> <ShippingTaxTotal>2</ShippingTaxTotal> <SurchargeTotal>0</SurchargeTotal> <SurchargeTaxTotal>0</SurchargeTaxTotal> <OrderTotal>10.33333</OrderTotal> <OrderTaxTotal>2</OrderTaxTotal> <CustomerCode>EVENTS</CustomerCode> <DeliveryInstructions>Test delivery instruction</DeliveryInstructions> <SMT1>Special message 1 test</SMT1> <SMT2>special message test 2</SMT2> <OrderLines> <Item> <ProductCode>VD560NF70</ProductCode> <Rotation /> <Cases>0</Cases> <Singles>1</Singles> <CasePrice>50.00000</CasePrice> <SinglePrice>8.33333</SinglePrice> <LineTotal>8.33333</LineTotal> <LineTax>0</LineTax> </Item> </OrderLines> <Payments> <Payment> <PaymentMethodID>Amex</PaymentMethodID> <PaymentMethod>Amex</PaymentMethod> <Value>20</Value> </Payment> </Payments> </Order>





Tag

Element

Recurring Element

Data type

Mandatory /

Optional /

Conditional



Notes or limitations

Vision Commerce field

Tag

Element

Recurring Element

Data type

Mandatory /

Optional /

Conditional



Notes or limitations

Vision Commerce field

<?xml version="1.0" encoding="UTF-8" standalone="no"?>


<Order>















<WhseID>



varchar(6)

M

the warehouse code of the warehouse to be used for the order otherwise it will default to the warehouse set in the API admin options

WareHouseCode



<OType>



varchar(2)

M

Options 

SO  - Standard Order (defaut)

EP - EP Order

FKSalesOrderType



<UBType>



varchar(2)

M

Options

DP : Duty Paid (default)

Other options - Underbond (will place order on hold awaiting all UB details)

U : UK Under Bond
X : Export
E : Other EC Warehouse
D : Duty Free
V : Visiting Forces
O : Other Duty Free use
T  : Transfer of Stock within Warehouse
R  : Customer Paid Reserves

Under Bond Type



<WebOrderID>



bigint

M

We provide a VC Order number automatically, this should be the website's unique reference for the order

Stored in notes



<ODate>



date

M

format   YYYY-MM-dd

Order Date



<DName>



nvarchar(60)

M



Not currently in use

 


<DContact>

 

nvarchar(30)

O

 


Delivery Contact



<DNumber>



varchar(50)

O



Delivery Contact No (Telephone)



<DAdd1>



nvarchar(50)

M



Delivery Address1



<DAdd2>



nvarchar(50)

O



Delivery Address2



<DAdd3>



nvarchar(50)

O



Delivery Address3



<DTown>



nvarchar(50)

M



Delivery Town



<DPostcode>



varchar(15)

M



Postcode



<DCountry>



varchar(2)

M



Country code



<ShippingMethodID>



varchar(30)

O

Checks if valid and sets code if not will use API defaults.

Carrier



<PaymentMethodID>



varchar(30)

O

Checks if valid and sets code if not will use API defaults.

If payment has already been collected prior to posting the order to the API, be sure to populate the ‘Payments’ segment below.

Payment Method



<OrderLinesTotal>



decimal(9,4)

O

Not including VAT

Line total



<OrderLinesTotalTax>



decimal(9,4)

O

This should be <Orderlinestotal> less <orderdiscounttotal> and the vat of the net amount

Line tax Totals



<OrderDiscountTotal>



decimal(9,4)

O



Total Discount Amount



<ShippingTotal>



decimal(9,4)

O

Not including VAT

Sundry Shipping Amount



<ShippingTaxTotal>



decimal(9,4)

O



VAT on Shipping Total



<SurchargeTotal>



decimal(9,4)

O

Surcharge for Credit Card Payment

Surcharges > Price / Unit (SurchargePrice),
tblVisionSalesOrderHeaderAPI.FeeTotal



<SurchargeTaxTotal>



decimal(9,4)

O

Surcharge tax

tblVisionSalesOrderHeaderAPI.FeeTaxTotal



<OrderTotal>







This should be

Order Lines Total - Order Discount + Shipping Total + SurchargeTotal

tblVisionSalesOrderHeaderAPI.OrderTotal



<OrderTaxTotal>



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

 

<CustomerCode>

 

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

 

<CustRef>

 

varchar(30)

O

The customer’s reference for the order

Customer Ref



<CompletedDate>



datetime

O

YYYY-MM-dd HH:mm:ss format

Web site completed date/time 

Adds to the notes field



<A1OR>



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



<A2OR>



varchar(8)

O

Sales Order Analysis2

Used to override the default option for the secondary customer analysis code on a sales order

Type



<DeliveryInstructions>



varchar(120)

O

Will use customers default instructions unless this has something different when this will over write.

Delivery Instructions



<SMT1>



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



<SMT2>



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

 

<SMT3>

 

varchar(120)

O

Special message Header

Special Message Text 3

 

<SMT4>

 

varchar(120)

O

Special message footer

Special Message Text 4

 

<SMT5>

 

varchar(80)

O

Special message recipient (to)

Special Message Text 5

 

<SMT6>

 

varchar(80)

O

Special message sender (from)

Special Message Text 6

 

<SMD>

 

int

O

Special message document

SM Document ID

 

<SMDT>

 

varchar(80)

O

Special message document type

SM Document Type

 

<SMQ>

 

int

O

Special message quantity

SM Quantity

 

<SME>

 

email

O

Special Message Email address

Not currently in use









Optional Section -

only needed if linking to credit card payment gateway in Vision

<BillingTID>



varchar(50)

C

Payment Transaction ID returned from vision live payment gateway 











Conditional depending on payment method ID













tblVisionSalesOrderVLPayment.*












<BillingFirstName>



nvarchar(30)

C

<BillingLastName>



nvarchar(30)

C

<BillingFullName>




nvarchar(60)

C

<BillingCompany>



varchar(50)

C

<BillingAddress1>



nvarchar(50)

C

<BillingAddress2>



nvarchar(50)

C

<BillingCity>



nvarchar(50)

C

<BillingState>



nvarchar(50)

C

<BillingPostcode>



varchar(15)

C

<BillingCountry>



varchar(2)

C

<BillingPhone>



varchar(20)

C

<BillingEmail>



varchar(50)

C



<OrderLines>
    <Item>





M

Section can be repeated with the <Item>, repeat for each individual order line


tblVisionSalesOrderDetail





<ProductCode>

varchar(30)

M



Product Code





<Rotation>

varchar(15)

O



RotationNumber





<Cases>

int

M



No of Cases





<Singles>

int

C



Number of Singles





<CasePrice>

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>













<Payments>
     <Payment>





O

Available from VC v2.10.0+, allows multiple payments to be posted per order, if empty then payment on account is assumed

API Payment Details
tblVisionSalesOrderPayment





<PaymentMethodID>

varchar(30)

C

Checks if valid and sets code

Mandatory if <Payments> segment submitted


FKPaymentMethod





<PaymentMethod>

varchar(30)

O

Description of Payment Method

Not currently in use





<Value>

decimal(9,2)

C

Mandatory if <Payments> segment submitted

Value



    </Payment>
</Payments>











</Order>















Response / error codes

HTTP Status code

Description

HTTP Status code

Description

200

Order saved

201

Order saved, however auto submission was failed

202

Order saved, on hold

400

Something wrong with input or processing, 
Check the error response and re-post after correcting



Response (status code 200)
Order saved



Response (status code 400)
Node WebOrderID is not supplied



Copyright Ontech Solutions 2017-2024. All rights reserved, no part may be replicated or distributed without the express permission of the owner.