VC Customer 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 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

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>
   <CustomerID>121</CustomerID>
   <CustomerCode>TESTCUSTOMR</CustomerCode>
   <VATCode>S</VATCode>
   <Currency>GBP</Currency>
   <Name>99 Events Sales</Name>
   <Add1>All over the Country</Add1>
   <Add2>test</Add2>
   <Add3>test3</Add3>
   <City>test town</City>
   <Postcode>12345</Postcode>
   <Phone>987456213</Phone>
   <Fax>12345</Fax>
   <Email>bingin@bb.b</Email>
   <ExportOptionEmail>lee.gregant@ontech.uk</ExportOptionEmail>
   <WebSite>www.edsd.v</WebSite>
   <OVatNumber>123420</OVatNumber>
   <DeliveryInstructions>fsdfsdf</DeliveryInstructions>
   <PickInstructions>fsfkjl ks</PickInstructions>
   <EntryDate>2019-03-27 11:56:07</EntryDate>
   <Contacts>
      <Contact>
         <CTitle>TestTitle</CTitle>
         <CFirstN>Fname</CFirstN>
         <CLastN>Lname</CLastN>
         <CDear>hsgdhg</CDear>
         <CEmail>b.b@b</CEmail>
         <CPhone>2121</CPhone>
         <CtHomePhone>212</CtHomePhone>
         <CMobilePhone>212</CMobilePhone>
      </Contact>
   </Contacts>
   <DeliveryAddress>
      <Address>
         <DName>TestTitle</DName>
         <DAdd1>Fname</DAdd1>
         <DAdd2>Lname</DAdd2>
         <DAdd3>hsgdhg</DAdd3>
         <DCity>b.b@b</DCity>
         <DPostcode>2121</DPostcode>
         <DCountry>212</DCountry>
      </Address>
   </DeliveryAddress>
</Customer>

XML structure

TagSegmentElementData type

Mandatory /

Optional /

Conditional

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








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




<CustomerID>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


<CustomerCode>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


<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)


<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)


<Name><varchar50>MCustomer name
AccountName


<Add1><nvarchar50>M

Address1


<Add2><nvarchar50>O

Address2


<Add3><nvarchar50>O

Address3


<City><nvarchar50>M

Address4


<Postcode><varchar10>M

PostCode


<Country><varchar2>M

ISO Country Code 

Use GB for UK


FKCountry

(get using Country)



<Phone><varchar30>M

TelephoneNumber


<Email><varchar50>M

Email


<Fax>varchar(30)O

Fax


<AM>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




<VatNumber>varchar(10)O

VATRegNo


<DeliveryInstructions>nvarchar(120)O

DeliveryInstructions


<PickInstructions>nvarchar(120)O

PickInstructions


<ExportOptionEmail>varchar(50)O

ExportOptionEmail


<WebSite>varchar(50)OCustomer website
WebSite

<Contacts>
        <Contact>



O

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


tblVisionCustomerContact


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


<CFirstN>nvarchar(50)O

Contact First Name


<CLastN>nvarchar(50)O

Contact Surname


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


<CEmail>varchar(50)O

Contact Email


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


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


<CMobilePhone>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


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


<DAdd1>varchar(40)O

AddressLine1


<DAdd2>varchar(50)O

AddressLine2


<DAdd3>varchar(50)O

AddressLine3


<DCity>

varchar(50)O

Town


<DPostcode>varchar(10)O

Postcode


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

         <Address></DeliveryAddress>







</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 CustomerCode or CustomerID 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.