For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Help CenterAPI KeysStatusSign In
GuidesAPI ReferenceChangelog
GuidesAPI ReferenceChangelog
  • Introduction
    • Getting started
  • Email API
  • Transactional SMS
  • Transactional WhatsApp
  • Marketing Campaigns
  • Contact Management
  • Events
    • GETGet events
    • POSTCreate an event
    • POSTCreate events in batch
  • Object Management
  • Accounts and Settings
  • Sales CRM
  • Conversations
  • Ecommerce
  • Loyalty
      • GETGet loyalty program list
      • POSTCreate loyalty program
      • GETGet loyalty program Info
      • PUTUpdate loyalty program
      • PATCHPartially update loyalty program
      • DELDelete Loyalty Program
      • POSTPublish loyalty program
      • POSTCreate subscription
      • POSTCreate subscription member
      • DELDelete subscription member
      • DELDelete subscription
      • GETGet Subscription Data
LogoLogo
Help CenterAPI KeysStatusSign In
LoyaltyProgram

Create subscription

POST
https://api.brevo.com/v3/loyalty/config/programs/:pid/subscriptions
POST
/v3/loyalty/config/programs/:pid/subscriptions
1import { BrevoClient } from "@getbrevo/brevo";
2
3async function main() {
4 const client = new BrevoClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.program.subscribeToLoyaltyProgram("pid", {
8 contactId: 1,
9 });
10}
11main();
1{
2 "organizationId": 1,
3 "loyaltyProgramId": "string",
4 "versionId": 1,
5 "contactId": 1,
6 "loyaltySubscriptionId": "string",
7 "meta": {},
8 "createdAt": "2024-01-15T09:30:00Z",
9 "updatedAt": "2024-01-15T09:30:00Z"
10}
Subscribes to a loyalty program
Was this page helpful?
Previous

Create subscription member

Next
Built with

Authentication

api-keystring

The API key should be passed in the request headers as api-key for authentication.

Path parameters

pidstringRequiredformat: "uuid"
Loyalty Program ID. A unique identifier for the loyalty program.

Request

Create Subscription Payload
contactIdlongRequired>=1

Required contact ID; must be greater than 0.

loyaltySubscriptionIdstringOptional<=64 characters

Optional subscription ID (max length 64).

creationDatedatetimeOptional

Optional creation date in ISO 8601 format (YYYY-MM-DDThh:mm:ss.ffffff+HH:MM). Must be in the past.

metamap from strings to anyOptional
Optional metadata associated with the subscription.

Response

Successfully created subscription.
organizationIdlong
Unique identifier of the organization.
loyaltyProgramIdstringformat: "uuid"
Unique identifier of the loyalty program.
versionIdinteger
Version number of the subscription.
contactIdlong
Unique identifier of the contact.
loyaltySubscriptionIdstring
Unique identifier of the subscription.
metamap from strings to any
Metadata associated with the subscription.
createdAtdatetime
Timestamp when the subscription was created.
updatedAtdatetime
Timestamp when the subscription was last updated.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
500
Internal Server Error