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 balance definition list
      • POSTCreate balance definition
      • GETGet balance definition
      • PUTUpdate balance definition
      • DELDelete balance definition
      • POSTCreate balance limits
      • GETGet balance limits
      • DELDelete balance limit
      • PUTUpdates balance limit
      • GETGet subscription balances
      • POSTCreate subscription balances
      • GETGet balance list
      • POSTCreate new transaction
      • POSTComplete transaction
      • POSTCancel transaction
      • POSTCreate balance order
      • GETGet Active Balances API
      • GETGet Transaction History API
LogoLogo
Help CenterAPI KeysStatusSign In
LoyaltyBalance

Create balance limits

POST
https://api.brevo.com/v3/loyalty/balance/programs/:pid/balance-definitions/:bdid/limits
POST
/v3/loyalty/balance/programs/:pid/balance-definitions/:bdid/limits
1import { BrevoClient } from "@getbrevo/brevo";
2
3async function main() {
4 const client = new BrevoClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.balance.createBalanceLimit("pid", "bdid", {
8 constraintType: "transaction",
9 durationUnit: "day",
10 durationValue: 1,
11 transactionType: "credit",
12 value: 1,
13 });
14}
15main();
1{
2 "id": "string",
3 "balanceDefinitionId": "string",
4 "transactionType": "credit",
5 "constraintType": "transaction",
6 "durationValue": 1,
7 "durationUnit": "hour",
8 "value": 1.1,
9 "slidingSchedule": true,
10 "createdAt": "2024-01-15T09:30:00Z",
11 "updatedAt": "2024-01-15T09:30:00Z"
12}
Creates balance limit and sends the created UUID along with the data
Was this page helpful?
Previous

Get balance limits

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
bdidstringRequiredformat: "uuid"
Balance Definition Id

Request

Balance Definition Payload
constraintTypeenumRequired
Defines whether the limit applies to transaction count or amount.
Allowed values:
durationUnitenumRequired
Unit of time for which the limit is applicable.
Allowed values:
durationValueintegerRequired
Number of time units for the balance limit.
transactionTypeenumRequired
Specifies whether the limit applies to credit or debit transactions.
Allowed values:
valueintegerRequired
Maximum allowed value for the specified constraint type.
slidingSchedulebooleanOptional
Determines if the limit resets on a rolling schedule.

Response

Successful creation of balance limit
idstringformat: "uuid"
Unique identifier for the balance limit.
balanceDefinitionIdstringformat: "uuid"
Balance definition ID.
transactionTypeenum
Specifies whether the limit applies to credit or debit transactions.
Allowed values:
constraintTypeenum

Defines the type of constraint (transaction count or amount).

Allowed values:
durationValueinteger
Number of time units the balance limit applies to.
durationUnitenum
Time unit for the balance limit.
Allowed values:
valuedouble
The maximum allowed value for the defined constraint.
slidingScheduleboolean
Indicates if the limit resets periodically based on a sliding schedule.
createdAtdatetime
Timestamp of when the balance limit was created.
updatedAtdatetime
Timestamp of the last update to the balance limit.

Errors

401
Unauthorized Error
403
Forbidden Error
422
Unprocessable Entity Error
424
Failed Dependency Error
500
Internal Server Error