# Connect Shopify to SendBeam

How to connect Shopify to SendBeam: what you need, the setup steps, and the code.

Via automation

A Shopify store collects customers every day. Connecting it to SendBeam adds each new customer as a contact, so order follow-ups and store news go out from the same place as the rest of your email.

## Before you start

- An account with Shopify
- A SendBeam API key, or a form ID
- An n8n, Zapier or Make account — only for the routes that use one

## Set it up

There are two routes, and which one you want depends on what you are after.

### Orders and checkouts — straight from Shopify, no automation tool

Order Placed and Cart Abandoned are native SendBeam automation triggers, fed by
a webhook you create in your own store. Nothing to install, nothing in between.

1. **Point Shopify at SendBeam.** Shopify Admin → Settings → Notifications → Webhooks. Create one for `orders/create`, and `checkouts/create` if you want Cart Abandoned.
2. **Save the signing secret.** Shopify shows it once, when you create your first webhook on the store. Paste it into SendBeam so the `X-Shopify-Hmac-SHA256` header on every event can be verified — without it, Shopify-signed events are refused rather than trusted.
3. **Build the automation.** The triggers appear in Automations like any other.

The [e-commerce documentation](https://sendbeam.io/docs/ecommerce) has the endpoint URL, the full
topic-to-trigger table, and two caveats worth reading first: a Shopify checkout
is a started checkout rather than a confirmed abandonment, and Shopify emits no
event at all for a product page being viewed, so Product Viewed cannot be fed
from it.

### Everything else — through an automation tool

For customers, tags and anything the three e-commerce triggers do not cover.

1. **Pick your automation tool.** n8n with the official SendBeam node, Make or Zapier. Each connects to Shopify with its own trigger, shown below.
2. **Create an API key.** Settings → API keys in SendBeam, with contacts:write, and lists:write if the workflow adds people to a list. The full key is shown once. To send SendBeam events out instead, add an endpoint under Settings → Webhooks.
3. **Map the fields and test.** Map the fields between Shopify and SendBeam, run the workflow once with your own address, and check the result before switching it on.

## Code

### In n8n: Shopify to SendBeam

`n8n workflow`

```
1. Shopify Trigger, with a customer-created topic
2. SendBeam → Contact → Create or update
     Email       the customer's email from step 1
     First name  the first name, if there is one
     Source      shopify
3. SendBeam → Contact → Add to list
     Contact     By email, the same expression as step 2
     List        From list, then pick the list by name
```

Install the SendBeam node from Settings → Community nodes (n8n-nodes-sendbeam). Adding someone who is already a contact, or already on the list, succeeds, so the workflow is safe to re-run.

### In Make: Shopify to the REST API

`Make scenario`

```
Module 1: the Shopify module that watches for new customers
Module 2: HTTP → Make a request
URL:          https://sendbeam.io/api/v1/contacts
Method:       POST
Headers:      x-api-key = sb_live_XXXXXXXX_YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
Body type:    Raw
Content type: JSON (application/json)
Request content:
{
  "email": "{{1.email}}",
  "first_name": "{{1.first_name}}",
  "source": "shopify"
}
```

Replace {{1.email}} and {{1.first_name}} with the customer’s email and the name, mapped from module 1. A 409 answer means the contact already exists; route it to GET /api/v1/contacts?q= with the same address if you need the contact’s id.

### In Zapier: Shopify to the REST API

`Zap`

```
Trigger  Shopify → New Customer
Action   Webhooks by Zapier → POST
URL           https://sendbeam.io/api/v1/contacts
Payload type  json
Data
  email       the customer's email
  first_name  the first name
  source      shopify
Headers
  x-api-key   sb_live_XXXXXXXX_YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
```

Webhooks by Zapier is available on Zapier’s paid plans. The SendBeam app for Zapier will replace this step with a Create Contact action once it is listed in Zapier’s directory.

## Things to know

- Shopify records whether a customer accepted email marketing; only run the Add to list step when it says they did.
- Only add people to a marketing list if they agreed to hear from you. Someone who only bought or booked can still get receipts and reminders through Send transactional.

[← Shopify email marketing integration](https://sendbeam.io/integrations/shopify)

---
Source: https://sendbeam.io/docs/integrations/shopify
