# Connect Lemon Squeezy to SendBeam

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

Via automation

Lemon Squeezy sells software and digital products for a lot of indie makers. It can send an order_created webhook the moment someone buys, so connecting it to SendBeam adds each customer as a contact straight away.

## Before you start

- An account with Lemon Squeezy
- An n8n, Zapier or Make account
- A SendBeam API key, or a form ID

## Set it up

1. **Pick your automation tool.** n8n with the official SendBeam node, Make or Zapier. Each connects to Lemon Squeezy 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 Lemon Squeezy and SendBeam, run the workflow once with your own address, and check the result before switching it on.

## Code

### In n8n: Lemon Squeezy to SendBeam

`n8n workflow`

```
1. Webhook node, with its production URL added in Lemon Squeezy under Settings → Webhooks for the order_created event
2. SendBeam → Contact → Create or update
     Email       the customer's email from the order from step 1
     First name  the first name, if there is one
     Source      lemon-squeezy
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: Lemon Squeezy to the REST API

`Make scenario`

```
Module 1: a Webhooks → Custom webhook module, with its address added in Lemon Squeezy for the order_created event
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": "lemon-squeezy"
}
```

Replace {{1.email}} and {{1.first_name}} with the customer’s email from the order 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: Lemon Squeezy to the REST API

`Zap`

```
Trigger  Lemon Squeezy → Order Created
Action   Webhooks by Zapier → POST
URL           https://sendbeam.io/api/v1/contacts
Payload type  json
Data
  email       the customer's email from the order
  first_name  the first name
  source      lemon-squeezy
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

- Lemon Squeezy signs its webhooks; check the signature in n8n or Make before trusting the data.
- Subscription events (subscription_created and the rest) work the same way if you want to tag active subscribers.
- 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.

[← Lemon Squeezy email marketing integration](https://sendbeam.io/integrations/lemon-squeezy)

---
Source: https://sendbeam.io/docs/integrations/lemon-squeezy
