> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.brevo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.brevo.com/_mcp/server.

# Enroll members

## Overview

A **subscription** links a Brevo contact to a loyalty program. It is the member record. Before enrolling, the contact must already exist in Brevo — use the [Contacts API](/docs/synchronise-contact-lists) to create or sync contacts first.

On enrollment, all balances are initialized at `0` and the member is placed on the default entry tier.

---

## Enroll a contact

**Endpoint:** `POST https://api.brevo.com/v3/loyalty/config/programs/{pid}/subscriptions`

```bash
curl --request POST \
  --url https://api.brevo.com/v3/loyalty/config/programs/27xxdd7a-.../subscriptions \
  --header 'api-key: YOUR_API_KEY' \
  --header 'content-type: application/json' \
  --data '{
    "contactId": 12345,
    "loyaltySubscriptionId": "cust_abc123",
    "creationDate": "2025-03-01T10:00:00.000Z"
  }'
```

**Request parameters**

| Parameter               | Type    | Required | Description                                                                                      |
| ----------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------ |
| `contactId`             | integer | Yes      | Brevo internal contact ID (must be > 0)                                                          |
| `loyaltySubscriptionId` | string  | No       | Your external customer ID, max 64 chars. Useful for cross-referencing with your commerce system. |
| `creationDate`          | string  | No       | Custom enrollment date (ISO 8601). Use for historical data imports.                              |

**Response (200)**

```json
{
  "contactId": 12345,
  "loyaltyProgramId": "27xxdd7a-af67-0020-ba65-19d60000a26e",
  "loyaltySubscriptionId": "cust_abc123",
  "organizationId": 1,
  "createdAt": "2025-03-01T10:00:00.000Z",
  "updatedAt": "2025-03-01T10:00:00.000Z",
  "versionId": 1
}
```

Set `loyaltySubscriptionId` to your own customer ID at enrollment time. This lets you reference the member by your internal ID throughout the integration and pass it in eCommerce order identifiers — without maintaining a separate ID mapping table.

---

## Linking subscriptions to eCommerce orders

When pushing an order to the Brevo eCommerce API, include `loyalty_subscription_id` in the `identifiers` object. This ensures the order is attributed to the correct loyalty member even if the contact's email address has changed.

```json
{
  "id": "order_789",
  "identifiers": {
    "email_id": "customer@example.com",
    "loyalty_subscription_id": "cust_abc123"
  },
  "amount": 89.99,
  "status": "completed"
}
```

See [Manage orders](/docs/import-your-orders) for the full eCommerce order schema.

---

## Error handling

| HTTP code | Meaning                                     | What to do                                                                           |
| --------- | ------------------------------------------- | ------------------------------------------------------------------------------------ |
| `400`     | Bad request — missing or invalid parameters | Check `contactId` is a positive integer; check `loyaltySubscriptionId` is ≤ 64 chars |
| `401`     | Unauthorized — invalid or missing API key   | Verify your `api-key` header                                                         |
| `403`     | Forbidden — Loyalty module not enabled      | Ensure Loyalty is activated on your Brevo account                                    |
| `404`     | Program not found                           | Check the `{pid}` in your URL path                                                   |
| `422`     | Unprocessable entity                        | Contact may not exist in Brevo, or the program may not be published yet              |