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
      • GETGet all your coupon collections
      • POSTCreate а coupon collection
      • GETGet a coupon collection by id
      • PATCHUpdate a coupon collection by id
      • POSTCreate coupons for a coupon collection
  • Loyalty
LogoLogo
Help CenterAPI KeysStatusSign In
EcommerceCoupons

Create coupons for a coupon collection

POST
https://api.brevo.com/v3/coupons
POST
/v3/coupons
1import { BrevoClient } from "@getbrevo/brevo";
2
3async function main() {
4 const client = new BrevoClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.coupons.createCoupons({
8 collectionId: "23befbae-1505-47a8-bd27-e30ef739f32c",
9 coupons: [
10 "Uf12AF",
11 ],
12 });
13}
14main();

Add coupons to an existing coupon collection. The coupons array must contain between 1 and 10,000 unique coupon code strings, all associated with the specified collectionId. Coupon creation is processed asynchronously and a 204 status is returned immediately upon acceptance. Returns a 404 error if the specified coupon collection does not exist.

Was this page helpful?
Previous

Create a payment request

Next
Built with

Authentication

api-keystring

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

Request

Values to create coupons
collectionIdstringRequiredformat: "uuidv4"
The id of the coupon collection for which the coupons will be created
couponslist of stringsRequired

Response

Coupons creation in progress

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error