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

Complete transaction

POST
https://api.brevo.com/v3/loyalty/balance/programs/:pid/transactions/:tid/complete
POST
/v3/loyalty/balance/programs/:pid/transactions/:tid/complete
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.completeTransaction("pid", "tid");
8}
9main();
1{
2 "id": "string",
3 "amount": 1.1,
4 "transactionType": "credit",
5 "meta": {},
6 "status": "pending",
7 "loyaltyProgramId": "string",
8 "balanceDefinitionId": "string",
9 "contactId": 1,
10 "eventTime": "2024-01-15T09:30:00Z",
11 "rejectReason": "string",
12 "rejectedAt": "2024-01-15T09:30:00Z",
13 "expirationDate": "2024-01-15T09:30:00Z",
14 "completedAt": "2024-01-15T09:30:00Z",
15 "cancelledAt": "2024-01-15T09:30:00Z",
16 "createdAt": "2024-01-15T09:30:00Z",
17 "updatedAt": "2024-01-15T09:30:00Z"
18}
Completes transaction
Was this page helpful?
Previous

Cancel transaction

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
tidstringRequiredformat: "uuid"
Transaction Id

Response

Transaction information
idstringformat: "uuid"

Unique identifier (UUID) of the transaction.

amountdouble
The transaction amount.
transactionTypeenum
The type of the transaction.
Allowed values:
metamap from strings to any
Optional metadata associated with the transaction.
statusenum
The current status of the transaction.
Allowed values:
loyaltyProgramIdstringformat: "uuid"

Unique identifier (UUID) of the associated loyalty program.

balanceDefinitionIdstringformat: "uuid"

Unique identifier (UUID) of the associated balance definition.

contactIdlong
Unique identifier of the contact associated with the transaction.
eventTimedatetime

Optional timestamp indicating when the transaction event occurred (ISO 8601 format).

rejectReasonstring

Reason for rejection if the transaction was declined (nullable).

rejectedAtdatetime

Timestamp when the transaction was rejected (nullable).

expirationDatedatetime

Expiry date of the transaction (nullable).

completedAtdatetime

Timestamp when the transaction was completed (nullable).

cancelledAtdatetime

Timestamp when the transaction was canceled (nullable).

createdAtdatetime
Timestamp when the transaction was created.
updatedAtdatetime
Timestamp when the transaction was last updated.

Errors

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