> ## Documentation Index
> Fetch the complete documentation index at: https://docs.loqate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce Commerce Cloud Integration Guide

> Add Address Capture, Email and Phone Validation to Salesforce Commerce Cloud. Install the Loqate cartridge for improved data quality.

The Loqate Salesforce Commerce Cloud cartridge allows you to quickly and easily add Loqate address verification services to your instance of Salesforce Commerce Cloud,
providing type-ahead lookup functionality for address fields, and validation for both email addresses and phone numbers. With some or all of these services enabled,
you can reduce the amount of time spent inputting customer details, and improve the accuracy of your database.

## Available services

The Loqate cartridge gives you access to these Loqate services in your Salesforce Commerce Cloud instance:

* **Address Capture**, which provides a type-ahead solution for address input
* **Email Validation**, which ensures the accuracy of customer email addresses
* **Phone Validation**, which ensures the accuracy of customer phone numbers

You can use one or more of these services, depending on your business needs.

## Prerequisites

Before installing the Loqate cartridge you will need:

* A live Salesforce Commerce Cloud account
* A live Loqate account
* A Loqate API key\*

\* Note that your API key is designed to be an open access key to your account - there are security controls within your Loqate account to ensure this is not abused.
The key used in the app will be your primary mechanism of reporting for usage, so we recommend create a new key rather than reusing one you may already have on a website or other application.

## Process

The installation process is made up of the following steps:

* Download and install the cartridge
* Add the cartridge to your cartridge path
* Import required metadata
* Configure your settings
* Add the module to your site
* Map your fields

### Download and install the cartridge

First, download the [latest version of the Loqate cartridge](https://assets.loqate.com/sfccb2c-integration/latest/loqate_salesforce_commerce_cloud_b2c_latest.zip). Once that's downloaded:

* Inside the cartridge zip file you will find two directories - `cartridges` and `system-objects`
* Upload the `cartridges` directory and its contents (everything within the `plugin_loqate` folder) to the `Cartridges` directory of your SFCC instance

<img src="https://mintcdn.com/loqate/9_Nppb2BEMzsAUI3/images/integrations/salesforce-commerce-cloud/upload.png?fit=max&auto=format&n=9_Nppb2BEMzsAUI3&q=85&s=621455c417f34820988d5c78a4ef39da" alt="Upload to Cartridge directory" width="3648" height="2350" data-path="images/integrations/salesforce-commerce-cloud/upload.png" />

### Add the cartridge to your cartridge path

The next step is to update your site's cartridge path to include the new Loqate cartridge.

* You can do this in the Business Manager under **Administration > Sites > Manage Sites > \[Your Site] > Settings > Cartridge Path**

<img src="https://mintcdn.com/loqate/9_Nppb2BEMzsAUI3/images/integrations/salesforce-commerce-cloud/add.png?fit=max&auto=format&n=9_Nppb2BEMzsAUI3&q=85&s=bd61b6e084caf0c980a7d784b085e270" alt="Add to cartridge path" width="800" height="515" data-path="images/integrations/salesforce-commerce-cloud/add.png" />

* Add `plugin_loqate` to your cartridge path (Note: the cartridge path is colon separated)

### Import required metadata

Next, import the metadata file `LoqateMetadata.xml`, which is provided in the `system-objects` directory of the downloaded zip file.

* You can do this in the Business Manager under **Administration > Site Development > Import & Export**
* Upload the xml file via the **Import & Export Files** section

<img src="https://mintcdn.com/loqate/9_Nppb2BEMzsAUI3/images/integrations/salesforce-commerce-cloud/import.png?fit=max&auto=format&n=9_Nppb2BEMzsAUI3&q=85&s=6c1fc5c2a0a6e59245bea0860d807e59" alt="Import required metadata" width="800" height="515" data-path="images/integrations/salesforce-commerce-cloud/import.png" />

* Then import it via the **Meta data** section

### Configure your settings

With everything imported and installed, the next step is to start configuring the cartridge.

* Navigate to **Merchant Tools > Site Preferences > Custom Preferences > Loqate**
* Here you will be able to provide your Loqate account, and add any custom scripts your want to execute

Add the module to your site
Now add the following code to each page on which you want to include Loqate functionality:

```JSON theme={null}
<isinclude template="loqate/module" />
 
<isloqate />
```

This will include the module and add the scripts (including any custom scripts defined in your settings) to the page.

<Note>We recommend you add this to the Header section of each page.</Note>

### Map your fields

You can now start to set up your Loqate services and map them to your existing fields. You can choose whether to use one, two, or all three of the available services
(Address Capture, Email Validation, Phone Validation).

To do this, follow the process as detailed in our [Tag Setup Guide](/our-services/tag-setup-guide) - note that the code you've already added into your site in the previous step
supersedes the setup code that you'll be instructed to add in that guide. When you get to the step about copying and pasting a code snippet into you site,
you can go straight to launching the in-page setup.
