---
agentTools:
  projectIndex: https://sendinblue.readme.io/llms.txt
---

# Create balance definition

Creates balance definition and returns information

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "contact": {
      "email": "contact@brevo.com",
      "name": "Brevo Support",
      "url": "https://account.brevo.com/support"
    },
    "description": "Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to :\n  - Manage your campaigns and get the statistics\n  - Manage your contacts\n  - Send transactional Emails and SMS\n  - and much more...\n\nYou can download our wrappers at https://github.com/orgs/brevo\n**Possible responses**\n  | Code | Message |\n  | :-------------: | ------------- |\n  | 200  | OK. Successful Request  |\n  | 201  | OK. Successful Creation |\n  | 202  | OK. Request accepted |\n  | 204  | OK. Successful Update/Deletion  |\n  | 400  | Error. Bad Request  |\n  | 401  | Error. Authentication Needed  |\n  | 402  | Error. Not enough credit, plan upgrade needed  |\n  | 403  | Error. Permission denied  |\n  | 404  | Error. Object does not exist |\n  | 405  | Error. Method not allowed  |\n  | 406  | Error. Not Acceptable  |\n  | 422  | Error. Unprocessable Entity |\n",
    "license": {
      "name": "MIT",
      "url": "http://opensource.org/licenses/MIT"
    },
    "title": "Brevo API",
    "version": "3.0.0"
  },
  "servers": [
    {
      "url": "https://api.brevo.com/v3"
    }
  ],
  "security": [
    {
      "api-key": []
    },
    {
      "partner-key": []
    }
  ],
  "paths": {
    "/loyalty/balance/programs/{pid}/balance-definitions": {
      "post": {
        "description": "Creates balance definition and returns information",
        "parameters": [
          {
            "description": "Loyalty Program Id",
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "Payload for creating a new balance definition, specifying expiration rules, rounding strategies, and constraints.",
                "properties": {
                  "balanceAvailabilityDurationModifier": {
                    "description": "Defines when the balance expires within the selected duration.",
                    "enum": [
                      "noModification",
                      "startOfPeriod",
                      "endOfPeriod"
                    ],
                    "type": "string"
                  },
                  "balanceAvailabilityDurationUnit": {
                    "description": "Unit of time for balance validity.",
                    "enum": [
                      "day",
                      "week",
                      "month",
                      "year"
                    ],
                    "type": "string"
                  },
                  "balanceAvailabilityDurationValue": {
                    "description": "Number of time units before the balance expires.",
                    "type": "integer"
                  },
                  "balanceExpirationDate": {
                    "description": "Fixed expiration date (`dd/mm` format) as an alternative to duration-based expiry.",
                    "format": "date",
                    "type": "string"
                  },
                  "balanceOptionAmountOvertakingStrategy": {
                    "description": "Defines whether partial credit is allowed when reaching max balance.",
                    "enum": [
                      "strict",
                      "partial"
                    ],
                    "type": "string"
                  },
                  "balanceOptionCreditRounding": {
                    "description": "Defines rounding strategy for credit transactions.",
                    "enum": [
                      "lower",
                      "upper",
                      "natural"
                    ],
                    "type": "string"
                  },
                  "balanceOptionDebitRounding": {
                    "description": "Defines rounding strategy for debit transactions.",
                    "enum": [
                      "lower",
                      "upper",
                      "natural"
                    ],
                    "type": "string"
                  },
                  "description": {
                    "description": "Short description of the balance definition.",
                    "maxLength": 256,
                    "type": "string"
                  },
                  "imageRef": {
                    "description": "URL of an optional image reference.",
                    "type": "string"
                  },
                  "maxAmount": {
                    "description": "Maximum allowable balance amount.",
                    "type": "number"
                  },
                  "maxCreditAmountLimit": {
                    "description": "Maximum credit allowed per operation.",
                    "type": "number"
                  },
                  "maxDebitAmountLimit": {
                    "description": "Maximum debit allowed per operation.",
                    "type": "number"
                  },
                  "meta": {
                    "description": "Additional metadata for the balance definition.",
                    "type": "object"
                  },
                  "minAmount": {
                    "description": "Minimum allowable balance amount.",
                    "type": "number"
                  },
                  "name": {
                    "description": "Name of the balance definition.",
                    "maxLength": 128,
                    "type": "string"
                  },
                  "unit": {
                    "description": "Unit of balance measurement.",
                    "enum": [
                      "POINTS",
                      "EUR",
                      "USD",
                      "MXN",
                      "GBP",
                      "INR",
                      "CAD",
                      "SGD",
                      "RON",
                      "JPY",
                      "MYR",
                      "CLP",
                      "PEN",
                      "MAD",
                      "AUD",
                      "CHF",
                      "BRL"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "unit"
                ],
                "type": "object"
              }
            }
          },
          "description": "Create Balance Definition Payload",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/balanceDefinition"
                }
              }
            },
            "description": "Successful creation of balance definition"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorModel"
                }
              }
            },
            "description": "Request Authentication Failed"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorModel"
                }
              }
            },
            "description": "Cannot Authenticate Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorModel"
                }
              }
            },
            "description": "No content"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorModel"
                }
              }
            },
            "description": "Validation errors"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorModel"
                }
              }
            },
            "description": "Internal error occurred"
          }
        },
        "summary": "Create balance definition",
        "tags": [
          "Balance"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "api-key": {
        "description": "The API key should be passed in the request headers as `api-key` for authentication.",
        "in": "header",
        "name": "api-key",
        "type": "apiKey"
      },
      "partner-key": {
        "description": "The partner key should be passed in the request headers as `partner-key` along with `api-key` pair for successful authentication of partner (Optional).",
        "in": "header",
        "name": "partner-key",
        "type": "apiKey"
      }
    },
    "schemas": {
      "errorModel": {
        "properties": {
          "code": {
            "description": "Error code displayed in case of a failure",
            "example": "method_not_allowed",
            "type": "string"
          },
          "message": {
            "description": "Readable message associated to the failure",
            "example": "POST Method is not allowed on this path",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "type": "object"
      },
      "balanceDefinition": {
        "properties": {
          "balanceAvailabilityDurationModifier": {
            "description": "startOfPeriod depicts the balancy expiry on start of day/week/month/year. endOfPeriod depicts the balancy expiry on end of day/week/month/year",
            "enum": [
              "startOfPeriod",
              "endOfPeriod",
              "noModification"
            ],
            "type": "string"
          },
          "balanceAvailabilityDurationUnit": {
            "description": "Unit of time for the balance's availability (e.g., day/week/month/year).",
            "type": "string"
          },
          "balanceAvailabilityDurationValue": {
            "description": "Number of days/weeks/month/year for balance expiry",
            "type": "integer"
          },
          "balanceExpirationDate": {
            "description": "Date when the balance expires and can no longer be used, in dd/mm format. The balance will be expired when this date appears next in the calendar and only one of balanceExpirationDate or balance availability fields can be used.",
            "format": "date-time",
            "type": "string"
          },
          "balanceOptionAmountOvertakingStrategy": {
            "description": "Partial enables partial credit of balance if maximum balance limit is reaching. Strict enables rejection of transaction if it will breach the max credit amount limit.",
            "type": "string"
          },
          "balanceOptionCreditRounding": {
            "description": "Rounding strategy for credit transactions.",
            "type": "string"
          },
          "balanceOptionDebitRounding": {
            "description": "Rounding strategy for debit transactions.",
            "type": "string"
          },
          "createdAt": {
            "description": "Timestamp of balance definition creation.",
            "format": "date-time",
            "type": "string"
          },
          "deletedAt": {
            "description": "Timestamp of balance definition deletion (nullable).",
            "type": "string"
          },
          "description": {
            "description": "Short description of the balance definition.",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier for the balance definition.",
            "type": "string"
          },
          "imageRef": {
            "description": "Optional image reference URL.",
            "type": "string"
          },
          "maxAmount": {
            "description": "Maximum allowable balance.",
            "type": "number"
          },
          "maxCreditAmountLimit": {
            "description": "Max credit allowed per operation.",
            "type": "number"
          },
          "maxDebitAmountLimit": {
            "description": "Max debit allowed per operation.",
            "type": "number"
          },
          "meta": {
            "additionalProperties": {},
            "description": "Additional metadata for the balance definition.",
            "type": "object"
          },
          "minAmount": {
            "description": "Minimum allowable balance.",
            "type": "number"
          },
          "name": {
            "description": "Name of the balance definition.",
            "type": "string"
          },
          "unit": {
            "description": "Unit of balance (e.g., points, currency).",
            "type": "string"
          },
          "updatedAt": {
            "description": "Timestamp of the last update.",
            "type": "string"
          }
        },
        "type": "object"
      }
    }
  },
  "x-samples-languages": [
    "curl"
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 91,
      "1": 104,
      "2": 180,
      "3": 205,
      "4": 240,
      "5": 82,
      "6": 207,
      "7": 0,
      "8": 3,
      "9": 36,
      "10": 63,
      "11": 142
    }
  }
}
```