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.
<?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
Tag | Segment | Element | Data type | Mandatory / Optional / Conditional | Notes or limitations | Conditions | Vision 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. | Account | ||
<Name> | <varchar50> | M | Customer name | AccountName | |||
<DateCreated> | datetime | M | Format should agree to >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 | |||||
<WebSite> | varchar(50) | O | Customer website | WebSite | |||
<VATCode> | varchar(1) | O | The customer can define this within the system, but in general the list is: 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) | O | Account 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> | O | This section will generate a contact, | tblVisionCustomerContact | ||||
<Title> | varchar(10) | O | This 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) | O | From v2.7.0 | Contact telephone | |||
<Email> | varchar(50) | O | Contact Email | ||||
<Dear> | varchar(50) | O | From v2.7.0 (how to address the contact in a letter) | Contact 'Dear' | |||
<HomeTel> | varchar(30) | O | From v2.7.0 | Contact home telephone | |||
<MobileTel> | varchar(30) | O | From v2.7.0 | Contact mobile telephone | |||
</Contact> | |||||||
</DeliveryAddress> | O | This section will create a delivery address separate to the main address | tblVisionCustomerDeliveryAddress | ||||
<AccountRef> | varchar(12) | O | This 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) | O | 2 character ISO Code | County | |||
<Address></DeliveryAddress> | |||||||
<APICustomerID> | bigint | C | 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 code | Description |
---|---|
200 | Customer created/updated |
400 | XML format is incorrect - Response body will contain error message |
Customer created/updated
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.