Your Guide to V5 Integration!
The ‘Address’ import endpoint can be used to add addresses to suppliers and customers, which can then be used for shipping and receiving. Addresses can also be added as ‘site addresses’ that are used for Transfers.
Linked Integration Guides:
This guide will focus on how to use this ‘Address’ endpoint, both via CSV import and using JSON via the V5 API.
In terms of how we can relate the address endpoint to what we see in the V5 Control Center, we will look at the ‘Customer’ table here. The ‘Supplier’ table would work in the exact same way since both suppliers and clients share the same ‘Client’ endpoint.
To find out more about the definitions for this ‘Address’ database class, please see the following link:
For importing via the ‘Address’ endpoint, the primary key is:
Name – The unique name for this address
Other fields that are required to create a valid entry in V5:
Type – the address type, this should be 0 for use with Clients, and 1 for use as a site address for Transfers (modlink).
Client_Code – If adding a client address, this is required to tie to the customer/supplier.
Line1 – The first line of the address.
Line2 – The second line of the address.
Line3 – The third line of the address.
City – The city the address is located in.
State – The state the address is located in.
Country – The country the address is located in.
Zip – The address’s zip/postal code.
Contact – A contact name for the address.
Tel – Telephone number associated with the address.
Email – Email address associated with the address.
Shipping addresses (if different from the address entered using the details above) and emergency recall contacts/details can also be added here, but we will just use the above data points in our example.
For this piece we will look to add an address to the customer shown in the CC panel above. This customer was added to the system previously using the ‘Client’ endpoint.
‘Address’ import Endpoint/URI –
http://host:port/V5-API/api/integrate/import/address
Samples:
Using the ‘Address’ endpoint, we can structure an import file for the above additions like so:
This sample JSON file can be downloaded here.
Once we have posted this to the system, we can see this address has been added to the ‘CUS01’ customer:
Since customers/suppliers can have multiple addresses assigned to them, let’s simply add another address to the ‘CUS01’ customer that we added to in the JSON example above.
For CSV imports we first need to construct a header file for our imports.
Header/column definition filename: “address.csvh”
Completed header files should be placed in: “<installdir>\SG Control Center\gateway\import\column_defs”
Import CSV filename: “address-datetime.csv”
CSVs for import should be placed in: “<installdir>\SG Control Center\gateway\import”
Samples:
Header File:
An example header file can be seen below. We will use the same fields as we did for the JSON import.
For further information on how we structure these files, please see the main integration page. This sample header file can be downloaded here.
CSV Import File:
We can then use the defined order of data points in the header to structure our import file. Note that this first row can be ignored by Control Center and so can be kept in the file when submitting for import. An example import based on our requirements above would look like this:
This sample import file can be downloaded here.
We can then drop this file into our import folder as defined above, and once the import is complete we can see that this address has been added against the same customer.