Integrations · E-commerce

Validate your BigCommerce customers and orders

Check your BigCommerce store's customers and orders, and save each address's status on the customer (customer attributes) and on the order (order metafields), so your marketing exports and order reviews can leave out the addresses you should not mail. Two pieces, use either or both: a command you run on your own computer checks everything you already have as one bulk list, tells you what it will cost and asks before it spends anything; a small relay you deploy to your own Cloudflare account checks new customers and orders as they arrive. Neither one deletes a customer or an order or changes their details; they only add the fields below. Download them: email-validation-bigcommerce.zip holds bigcommerce.mjs (the command), relay.mjs (the relay) and the MIT licence.

What you need

  • A computer with Node 22.18 or later, for the command and for the relay's one-time setup: they have no browser-only option. Nothing to install: it has no dependencies.
  • An API key of ours from the API keys page: with the permission Bulk lists for the command (off by default: turn it on when you create the key), with Validate addresses for the relay (on by default). One key can have both. With Read balance and usage too, the command shows your balance before it asks.
  • A BigCommerce store-level API account: in your control panel, Settings → Store-level API accounts → Create API account, type "V2/V3 API token", with Customers: modify and Orders: modify (read-only for both is enough for a dry run). Copy the access token, the client secret and the API path (https://api.bigcommerce.com/stores/<store hash>/v3/): BigCommerce shows them once. The store hash is the part after /stores/.
  • For the relay only: a Cloudflare account to run it in, and Cloudflare's wrangler command (npx wrangler).

Check every customer and order

cd email-validation-bigcommerce                 # the unzipped folder
export EV_API_KEY=… BIGCOMMERCE_STORE_HASH=<store hash> BIGCOMMERCE_ACCESS_TOKEN=…
node bigcommerce.mjs --dry-run                  # counts only: nothing created, uploaded, spent or written
node bigcommerce.mjs                            # shows the credits and your balance, and asks

The command reads every customer and every order (deleted orders and unfinished checkouts are left out) and checks those without a status for their current address. A customer and their orders with the same address are one row of the list, so they cost one credit; duplicates, malformed addresses and unknown results are free. Before it asks, it shows how many customers, orders and distinct addresses it will check, the most credits it can use and your balance; nothing is spent on a no. Without a terminal (cron, a script) pass --yes.

  • --only customers or --only orders checks one kind.
  • --revalidate checks everything again, not only those without a status (or with unknown).
  • --region eu checks and keeps the list in the EU, with the same key.

The command creates its four customer attributes when they are missing, before anything is spent, and makes sure the API account may write customers first: a token without Customers: modify stops with nothing spent. BigCommerce has no order write that changes nothing, so a token without Orders: modify is refused at the first order write, after the list is paid; the list is kept, and the same command with an API account that has it (make a new one: BigCommerce does not change an account's permissions) writes the rest without paying again.

What it saves

WhereNameValue
Customer attributeEmail validation statusvalid, invalid, catch_all, unknown or disposable (statuses)
Customer attributeEmail validation reasonwhy, for example accepted or no_mailbox
Customer attributeEmail validation checked atwhen the check ran, in UTC
Customer attributeEmail validation checked emailthe address that was checked
Order metafieldemail_validation.status, email_validation.reason, email_validation.checked_at, email_validation.checked_emailthe same, for the order's billing address

A customer or an order whose checked email is its address today counts as checked; when the address changes, the next run (or the relay) checks the new one. The order metafields are readable by the other apps and API accounts of your store, written only by this API account, and never shown on the storefront.

Check new customers and orders

The relay is a Cloudflare Worker in your own account. Deploy it from the unzipped folder:

npx wrangler deploy relay.mjs --name ev-bigcommerce-relay --compatibility-date 2026-10-01
npx wrangler secret put EV_API_KEY --name ev-bigcommerce-relay                 # our API key
npx wrangler secret put BIGCOMMERCE_STORE_HASH --name ev-bigcommerce-relay
npx wrangler secret put BIGCOMMERCE_ACCESS_TOKEN --name ev-bigcommerce-relay
npx wrangler secret put BIGCOMMERCE_CLIENT_SECRET --name ev-bigcommerce-relay  # the same API account's client secret
openssl rand -hex 32                                                           # optional: a relay token
npx wrangler secret put BIGCOMMERCE_RELAY_TOKEN --name ev-bigcommerce-relay    # paste that token

Add --var EV_REGION:eu to the deploy command to have addresses validated in the EU and their results stored there. Then subscribe the relay to BigCommerce's customer and order webhooks, once:

export BIGCOMMERCE_STORE_HASH=<store hash> BIGCOMMERCE_ACCESS_TOKEN=…
BIGCOMMERCE_RELAY_TOKEN=… node bigcommerce.mjs --setup --relay-url https://ev-bigcommerce-relay.<your subdomain>.workers.dev/

--setup creates the customer attributes and the webhooks for new customers, changed customers, new orders and an order's status change (--only customers or --only orders for one kind). Run it again at any time: it keeps the webhooks that are there and turns back on one that BigCommerce deactivated. With a relay token set, BigCommerce sends it with every delivery and the relay requires it.

The relay accepts only deliveries signed with your API account's client secret, as BigCommerce documents its webhook signatures, and answers anything else with 401. A delivery holds only the customer's or order's id, so the relay reads it from your store with your token, skips it when it already holds a status for its address, checks it and writes the status, all after it has answered BigCommerce. An order of a customer already checked with the same address takes the customer's status without a check. A check the relay could not make (no credits left, a refused key, BigCommerce unavailable) is not tried again: the next run of the command catches it up.

Try it once with a test customer at no_mailbox@sandbox.email-validation.org (test addresses cost nothing; the sandbox domain receives no mail), added in the control panel, never by signing up or ordering on the storefront (BigCommerce mails those): within seconds its Email validation status should be invalid. Then delete the test customer. If it stays empty and BigCommerce's webhook log shows 401 answers, the relay did not accept your store's signatures: remove the webhooks and use the command on a schedule instead.

Run it again

Run the same command again after any stop (no credits, a closed laptop, the bulk list still running): it resumes the same bulk list and never pays twice (within the 30 days a list is kept). Run it from the same folder each time (or pass the same --state FILE): the file it keeps there holds the bulk list it is working on, never an address or a key. When every status is written the file is removed, and the next run checks only customers and orders without a status for their address (or with unknown), such as new ones, so you can run it on a schedule.

Before writing, the command reads the store again: a customer or order deleted since is skipped, one whose address changed since is skipped (the next run checks the new address), and one that already holds the status is left as it is. It shares the store's API limit with your other apps: when little of it is left, it waits for the limit to refresh.

Exit codes: 0 done (or you answered no), 1 a write failed or the run stopped (run it again), 2 wrong arguments, 75 the bulk list was still running when the command stopped waiting (run it again later; --wait-minutes N sets how long it waits).

The command prints record ids, job ids and counts, never an address or a key; the relay logs nothing.

What it cannot do

BigCommerce has no supported way for an app on the standard checkout to hold a checkout or a sign-up for an outside check: webhooks arrive after the order or the account exists. The status is saved right after, and what to do with the order or the customer is yours. A large import can outrun the relay; the next run of the command checks whatever it missed.

Neither the command nor the relay has run against a real BigCommerce store yet: they are built from BigCommerce's public documentation and tested against a store in memory. Try them on a test customer first, as above.

More on BigCommerce

Updated · Maintained by: Email Validation LLC

Need help? Contact support, or ask the help chat. Something wrong or missing on this page? Tell us