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 order

POST
https://api.brevo.com/v3/loyalty/balance/programs/:pid/create-order
POST
/v3/loyalty/balance/programs/:pid/create-order
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.createBalanceOrder("pid", {
8 amount: 1.1,
9 balanceDefinitionId: "string",
10 contactId: 1,
11 dueAt: "string",
12 source: "engine",
13 });
14}
15main();
1{
2 "amount": 1.1,
3 "contactId": 1,
4 "createdAt": "string",
5 "dueAt": "string",
6 "loyaltyProgramId": "string",
7 "updatedAt": "string",
8 "balanceDefinitionId": "string",
9 "expiresAt": "string",
10 "id": "string",
11 "meta": {},
12 "processedAt": "string",
13 "transactionid": "string"
14}
Returns created order
Was this page helpful?
Previous

Get Active Balances API

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

Request

Order Payload
amountdoubleRequired

Order amount (must be non-zero).

balanceDefinitionIdstringRequired

Unique identifier (UUID) of the associated balance definition.

contactIdintegerRequired>=1

Unique identifier of the contact placing the order (must be ≥ 1).

dueAtstringRequired
RFC3339 timestamp specifying when the order is due.
sourceenumRequired
Specifies the origin of the order.
Allowed values:
expiresAtstringOptional
Optional RFC3339 timestamp defining order expiration.
metamap from strings to anyOptional
Optional metadata associated with the order.

Response

Successful creation of order
amountdouble

Order amount (must not be zero).

contactIdinteger>=1

Unique identifier of the contact placing the order (must be ≥ 1).

createdAtstring
RFC3339 timestamp indicating when the order was created.
dueAtstring
RFC3339 timestamp specifying when the order is due in the future.
loyaltyProgramIdstring
Unique identifier of the loyalty program associated with the order.
updatedAtstring
RFC3339 timestamp indicating the last update to the order.
balanceDefinitionIdstring

Optional unique identifier (UUID) of the associated balance definition.

expiresAtstring
Optional RFC3339 timestamp defining order expiration in the future.
idstring
Unique identifier for the balance order.
metamap from strings to any
Optional metadata associated with the order.
processedAtstring
Optional RFC3339 timestamp indicating when the order was processed.
transactionidstring
Optional reference to the associated transaction ID.

Errors

401
Unauthorized Error
403
Forbidden Error
422
Unprocessable Entity Error
500
Internal Server Error