---
title: "Validate contact data in Shopify"
url: "https://lookvalid.com/integrations/shopify.md"
canonical_url: "https://lookvalid.com/integrations/shopify"
last_updated: "2026-10-22"
type: "how-to"
summary: "Check the phone number on each new order or customer and write a clean international format and number type back to the customer record."
related: ["https://lookvalid.com/integrations.md", "https://lookvalid.com/docs/api/phone.md", "https://lookvalid.com/docs/quickstart.md"]
---

# Validate contact data in Shopify

Check the phone number on each new order or customer and write a clean international format and number type back to the customer record.

Stores take phone numbers at checkout in any shape a customer types, and shipping carriers and text updates read that field. A number with a missing country code means a delivery notice that never arrives, and a returns team calling a number that cannot be dialed.

## What LookValid checks

- [Phone Numbering-Plan Validation](https://lookvalid.com/products/phone.md): Returns E.164 and the national and international formats with the country and number type, from numbering-plan data only. It cannot tell whether the line is active. (1 credit per valid number)
- [Country Calling Codes](https://lookvalid.com/products/country-code.md): Looks up the calling code and national number lengths for a shipping country. (1 credit per lookup (an unknown code, country or name is free))
- [IP Intelligence](https://lookvalid.com/products/ip.md): Returns location, network owner and risk flags for an address, which can add context to an unusual order. (1 credit per lookup)

## Connect it in four steps

1. Create a LookValid account and an API key from the dashboard, which a person does once.
2. Set the key as the LOOKVALID_API_KEY environment variable on the server that receives your store's webhooks, and keep it out of theme code, which shoppers can read. Verify the X-Shopify-Hmac-Sha256 header on each delivery before you trust it.
3. Take the phone from the orders/create payload and call the function; skip any delivery whose X-Shopify-Webhook-Id you have already handled, so a repeat does not cost a second lookup. On null flag the order for a human look, and on an error log the code and fix and let the order proceed.
4. Write the E.164 number, type and country into customer fields or tags in your store through your own admin tooling, keeping in mind that Shopify does not guarantee webhook ordering, so key the update on the order id.

A small server function at the https address your store sends orders/create webhooks to, which checks the phone number the order carries. The call is `POST https://YOUR_API_HOST/v1/phone`.

```js
const API_URL = "https://YOUR_API_HOST/v1/phone";

export async function validateShopifyPhone(value) {
  const response = await fetch(API_URL, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.LOOKVALID_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "phone": value,
    }),
  });
  const result = await response.json();
  if (!response.ok) throw new Error(`${result.error.code}: ${result.error.fix}`);
  if (!result.found) return null;
  return {
      "phone_e164": result.data?.e164 ?? null,
      "phone_type": result.data?.number_type ?? null,
      "phone_country": result.data?.country ?? null,
  };
}
```

| Response field | Goes into |
| --- | --- |
| `data.e164` | phone_e164 |
| `data.number_type` | phone_type |
| `data.country` | phone_country |

## Without code

You can do this with no server of your own by using an automation platform's generic HTTP request step, started by a new-order trigger. It sends the order phone to LookValid and writes the answer back to the customer, with no dedicated LookValid app involved.

## Questions

### What does it cost in credits?

The pricing page lists the credits for the phone product. One order is one lookup if you check once per order.

### What does the phone check not do?

It checks the number against numbering-plan rules. It cannot tell if the line is active, who carries it or whether a text will arrive.

### Where does the key go?

On the server that receives your webhooks, in an environment variable. Never place it in storefront theme code.

## Sources

- [About webhooks (Shopify developer docs)](https://shopify.dev/docs/apps/build/webhooks), read 2026-10-18

## Related

- [LookValid integrations](https://lookvalid.com/integrations.md)
- [Phone Numbering-Plan Validation reference](https://lookvalid.com/docs/api/phone.md)
- [Quickstart](https://lookvalid.com/docs/quickstart.md)
