Update customer metafield when webhook received
When a loyalty, CRM or points system calls your webhook with an email address and a number, store it on the customer in the metafield custom.loyalty_points. Show it in the customer account, in emails or in Flow.
One trigger from Workflow Webhooks and Shopify's built-in actions, no other app needed.

What it needs
A webhook in Workflow Webhooks with this payload mapping. See Payload mapping and Flow variables.
| Field | What to map to it |
|---|---|
fieldOne |
The customer's email address |
fieldTwo |
The points balance as a whole number, for example 250 |
A call to the webhook then looks like this:
bash
curl -X POST https://<your webhook URL> \
-H "Content-Type: application/json" \
-d '{"email": "jane.doe@example.com", "points": 250}'Get the workflow
- Download the
.flowfile attached at the bottom of this page. - In your Shopify admin open Flow, click Import and choose the file.
- Check the steps, then click Turn on workflow.
The file is an export from Shopify Flow itself. Do not edit it by hand; change the workflow in Flow after importing it.
How it works
- Webhook Trigger starts the workflow each time your webhook URL is called and hands it the mapped fields.
- Get customer data looks up the customer with the query
email:{{fieldOne}}and keeps at most one result. - For each runs once for the customer it found, and not at all when no customer matches.
- Update customer metafield writes
{{fieldTwo}}tocustom.loyalty_pointsas an integer.
Make it yours
- Change the namespace and key to a metafield you already use, for example
loyalty.tierwith type single line text. - Add Add customer tags after the metafield step to mark customers above a points threshold.
Next steps
- Create your first webhook - create the webhook this workflow listens to.
- Workflow templates - all templates.
- History and troubleshooting - check that the webhook reached Flow.

