# Use external IDs with Shopify and Talon.One

> Having the same customer and product IDs across your systems helps you deliver a seamless omnichannel experience, driving promotions and loyalty everywhere — web, app, and POS.

> For the complete documentation index, see [llms.txt](https://docs.talon.one/llms.txt).

In Shopify, you can use
[custom ID metafields](https://shopify.dev/docs/apps/build/custom-data/metafields/working-with-custom-ids)
to store external IDs on customers and product variants.

You can then sync these external IDs with Talon.One to use them in your campaigns and
loyalty programs. This tutorial walks you through the necessary steps to set up the sync.

## Talon.One requirements

- You are an [admin](/docs/product/account/account-settings/manage-roles.md#admin-role)
  user.
- You have set up an [Application](/docs/product/applications/create-and-manage-applications.md).
- You have created a
  [Third-party API key](/docs/product/applications/manage-third-party-api-keys.md#create-a-third-party-api-key)
  for use with Shopify.

:::important
When using external customer IDs, ensure your Application does not contain any customer
profiles with the same integration ID as the external IDs you are syncing. Otherwise, any
existing customer data will be overwritten.
:::

## Shopify requirements

- You are an
  [administrator](https://help.shopify.com/en/manual/your-account/staff-accounts/staff-roles/staff-roles-descriptions)
  user.
- You have completed the
  [basic setup](/docs/dev/technology-partners/shopify/set-up-shopify-app.md)
  of the Talon.One Shopify app.
- You have created
  [custom ID metafields](https://shopify.dev/docs/apps/build/custom-data/metafields/working-with-custom-ids)
  to store external IDs on customers, product variants, or both.

## Set up the integration

<StepsContainer>

### Configure the app

Let's assume you are using external IDs for both customers and product variants. Your
external IDs are stored in metafields named `custom.external_customer_id` and
`custom.external_product_variant_id`.

To sync these IDs with Talon.One:

1. In Shopify, open **Apps > Talon One** > **Custom ID**.
1. Select **Use customer custom ID**.
1. Set the customer metafield key and namespace. For this tutorial, set the key to `external_customer_id` and the namespace to `custom`.
1. Select **Use product variants custom ID**.
1. Set the product metafield key and namespace. For this tutorial, set the key to `external_product_variant_id` and the namespace to `custom`.
1. Click **Save**.

### Sync your inventory

This step is only necessary if you are using external product IDs.

- If you **have not** synced your inventory before, follow the steps in
  [Sync your Shopify inventory with Talon.One](/docs/dev/technology-partners/shopify/sync-inventory-shopify.md).
- If you **have** synced your inventory before, re-trigger the product sync:

  1. In the
     [app configuration](/docs/dev/technology-partners/shopify/set-up-shopify-app.md#configure-the-app),
     note the value in the **Catalog ID** field.
  1. Replace the value with `0` and click **Save**.
  1. Restore the previous value in the **Catalog ID** field and click **Save**.

After the sync is complete, your cart item catalog contains the products from your Shopify
catalog, with the `sku` field set to the external ID. The actual SKUs in Shopify are
stored in a separate `sku_shopify` field in Talon.One.

### Verify the customer sync

This step is only necessary if you are using external customer IDs.

To verify that the customer sync is working:

1. In Shopify, create or update a customer profile that includes an external customer ID.
1. In Talon.One, on the left-side menu of your Application, click <Customers
   className="icon"/> **Customers**.

You should see a new customer profile created with the external ID as the integration ID.

</StepsContainer>

## Considerations when using external customer IDs

- External customer IDs are also used in customer sessions. For example, when a customer
  adds an item to the cart, the session is opened with `profileId` set to the external ID.
- When a customer session is opened, and the external ID is not yet available, the
  creation of the customer profile in Talon.One is temporarily deferred, and the session
  is opened with `profileId` set to the internal Shopify customer ID. Once the external ID
  becomes available, Talon.One creates the customer profile and updates the session.
- When a customer session is closed, and the external ID is still not available, the
  session is closed with `profileId` set to the internal Shopify customer ID.
