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.
<?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
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> | |||||||
<EntryDate> | datetime | M | Format should agree to EntryDate >2019-03-27 11:56:07</ EntryDate > | ||||
<CustomerID> | 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 | ||
<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. | Account | ||
<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) | ||
<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> | M | Customer 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 | |||||
<Fax> | varchar(30) | O | Fax | ||||
<AM> | 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 | |||||
<VatNumber> | varchar(10) | O | VATRegNo | ||||
<DeliveryInstructions> | nvarchar(120) | O | DeliveryInstructions | ||||
<PickInstructions> | nvarchar(120) | O | PickInstructions | ||||
<ExportOptionEmail> | varchar(50) | O | ExportOptionEmail | ||||
<WebSite> | varchar(50) | O | Customer website | WebSite | |||
<Contacts> | O | This section will generate a contact, | tblVisionCustomerContact | ||||
<CTitle> | varchar(10) | O | This 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) | O | From v2.7.0 (how to address the contact in a letter) | Contact 'Dear' | |||
<CEmail> | varchar(50) | O | Contact Email | ||||
<CPhone> | varchar(30) | O | From v2.7.0 | Contact telephone | |||
<CtHomePhone> | varchar(30) | O | From v2.7.0 | Contact home telephone | |||
<CMobilePhone> | 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 | ||||
<DName> | varchar(12) | O | This 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) | O | 2 character ISO Code | County | |||
<Address></DeliveryAddress> | |||||||
</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 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.