VC Customer v6

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 customer records to be posted to Vision Commerce to be created, also supports updating existing customer records which are already available in Vision Commerce.

Request

Action : POST
URL: http://<path_to_api>/Customer?Version=v6

This API needs to be authenticated  ( pass header parameter  Authorization : "Bearer "+AccessToken )
We are using the CustomerID/CustomerCode to check the existence of customer in our database, if it exists in our database we will update the customer otherwise we create new customer.

Body XML sample
<?xml version="1.0" encoding="UTF-8"?>
<Customer>
	<Account>R2</Account>
	<Name>Vinceremos</Name>
	<DateCreated>2019-03-27 11:56:07</DateCreated>
	<Address1>Royal House (demo)</Address1>
	<Address2>28 Sovereign St</Address2>
	<Address3></Address3>
	<Town>Leeds</Town>
	<Postcode>LS1 4BJ</Postcode>
	<MainContactNo>0113 396 9002</MainContactNo>
	<EmailAddress>testers@ontech.uk</EmailAddress>
	<WebSite>www.vinceremos.com</WebSite>
	<VATCode>S</VATCode>
	<VATRegNo>GB142 4153 21</VATRegNo>
	<AccountTradingCurrency>GBP</AccountTradingCurrency>
	<DelPointTelNo>987456213</DelPointTelNo>
	<DeliveryInstructions>Use the rear door for the delivery </DeliveryInstructions>
	<PickInstructions>Ensure boxes are sealed and labelled before despatch.</PickInstructions>
	<AccountManager>GEN</AccountManager>
	<Type></Type>
	<Outlet></Outlet>
	<Area></Area>
	<Source></Source>
	<Division></Division>
	<Classification></Classification>
	<ExportOptionEmail>testers@ontech.uk</ExportOptionEmail>
	<Contacts>
		<Contact>
			<Title>Ms</Title>
			<FirstName>John</FirstName>
			<Surname>Smith</Surname>
			<Telephone>0113 396 9002</Telephone>
			<Email>testers@ontech.uk</Email>
			<Dear></Dear>
			<HomeTel>0113 396 9002</HomeTel>
			<MobileTel></MobileTel>
		</Contact>
	</Contacts>
	<DeliveryAddress>
		<Address>
			<AccountRef>BACD</AccountRef>
			<Address1>Royal House Warehouse (demo)</Address1>
			<Address2>32A Sovereign St</Address2>
			<Address3></Address3>
			<Town>leeds</Town>
			<Postcode>LS1 4BJ</Postcode>
			<Country>GB</Country>
		</Address>
	</DeliveryAddress>
	<APICustomerID>121</APICustomerID>
</Customer>

XML structure

TagSegmentElementData type

Mandatory /

Optional /

Conditional

Notes or limitationsConditionsVision Commerce field
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Customer>








<Account>varchar(8)C

The alphanumeric ID of the customer

We will use as the 'Customer Code' for vision

Needs to be unique

If the customer wishes to directly save then this is mandatory otherwise optional.

Direct save means that the customer has no need to update the customer record with a code to be able to save it.

Account


<Name><varchar50>MCustomer name
AccountName


<DateCreated>datetimeMFormat should agree to
<DateCreated
>2019-03-27 11:56:07</DateCreated>




<Address1><nvarchar50>M

Address1


<Address2><nvarchar50>O

Address2


<Address3><nvarchar50>O

Address3


<Town><nvarchar50>M

Address4


<Postcode><varchar10>M

PostCode


<Country><varchar2>M

ISO Country Code 

Use GB for UK


FKCountry

(get using Country)



<MainContactNo>varchar(30)O

Fax


<EmailAddress><varchar50>M

Email


<WebSite>varchar(50)OCustomer website
WebSite


<VATCode>varchar(1)O

The customer can define this within the system, but in general the list is:
S = Standard Rate

X = Exempt

Mandatory if using Direct Save

If not completed will use API Setting


FKVAT
(get using VATCode)


<VATRegNo>varchar(10)O

VATRegNo


<AccountTrading Currency>varchar(3)O

Should be the 3 character ISO code used for currency e.g. GBP.

Mandatory if using Direct Save

If not completed will use API Setting

FKCurrency,
(get using Currency)


<DelPointTelNo><varchar30>M

TelephoneNumber


<DeliveryInstructions>nvarchar(120)O

DeliveryInstructions


<PickInstructions>nvarchar(120)O

PickInstructions


<AccountManager>varchar(8)OAccount Manager



<Type>varchar(8)O




<Outlet>varchar(8)O




<Area>varchar(8)O




<Source>varchar(8)O




<Division>varchar(8)O




<Classification>varchar(8)O




<ExportOptionEmail>varchar(50)O

ExportOptionEmail

<Contacts>
        <Contact>



O

This section will generate a contact,
<Contact> can be replicated multiple times 


tblVisionCustomerContact


<Title>varchar(10)OThis node is used to insert/update Contact, this will be unique
Contact title


<FirstName>nvarchar(50)O

Contact First Name


<Surname>nvarchar(50)O

Contact Surname


<Telephone>varchar(30)OFrom v2.7.0
Contact telephone


<Email>varchar(50)O

Contact Email


<Dear>varchar(50)OFrom v2.7.0 (how to address the contact in a letter)
Contact 'Dear'


<HomeTel>varchar(30)OFrom v2.7.0
Contact home telephone


<MobileTel>varchar(30)OFrom v2.7.0
Contact mobile telephone

      </Contact>
<Contacts>








</DeliveryAddress>
         <Address>



O

This section will create a delivery address separate to the main address
<Address> can be repeated multiple times 


tblVisionCustomerDeliveryAddress


<AccountRef>varchar(12)OThis node is used to insert/update Address, this will be unique
DPAccount


<Address1>varchar(40)O

AddressLine1


<Address2>varchar(50)O

AddressLine2


<Address3>varchar(50)O

AddressLine3


<Town>

varchar(50)O

Town


<Postcode>varchar(10)O

Postcode


<Country>varchar(2)O2 character ISO Code
County

         <Address></DeliveryAddress>









<APICustomerID>bigintC

Your unique ID of the customer.

We can use to match to Vision customer record

Used to look up your customer code

Conditions:

- Can be supplied in addition to the CustomerCode.

APICustomerID
</Customer>







Response / error codes

See: Inbound Web API, further information below.

HTTP Status codeDescription
200Customer created/updated
400XML format is incorrect
 - Response body will contain error message   
Response (status code 200)
Customer created/updated
Response (status code 400)
Node Account or APICustomerID is not supplied for saving customer



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