Skip to main content
Braze Connected Content fetches data from the Voucherify API at message send time and displays it in your Braze messages. You can publish coupons, invite referrers, retrieve loyalty card balances, add gift card credits, and more.

How does it work?

When Braze sends a message, the Connected Content script calls the Voucherify API, fetches the response, and injects the data into the message template before delivery. A basic Connected Content script looks as follows:
Connected content basic schema
{% connected_content
   "voucherify-API-ENDPOINT-url"
   :method post
   :headers {
      "X-App-Id": "Voucherify-API-key",
      "X-App-Token": "Voucherify-Secret-key"
   }
   :content_type application/json
   :retry
   :save {{result_variable}}
%}
The script contains the following elements:
  • API endpoint URL: The Voucherify API endpoint to call (for example, /v1/publications).
  • :method: The HTTP method – post for creating resources, get for fetching data.
  • :headers: Your Voucherify API credentials (X-App-Id and X-App-Token) for authentication.
  • :content_type: Set to application/json for Voucherify API calls.
  • :retry: Retries the call up to 5 times if the request fails.
  • :save: Stores the API response in a variable you can reference in the message body.

What can you do with Connected Content?

Connected Content scripts support various Voucherify use cases:
Use caseDescription
Publish unique coupon codesAssign and send a unique discount code to each customer.
Generate personalized codesCreate codes with custom prefixes based on customer attributes.
Invite referrersPublish referral codes for customers to share.
Fetch loyalty card balanceDisplay a customer’s current loyalty points and expiration dates.
Add loyalty pointsAward points through custom event earning rules.
Add gift card creditsTop up a customer’s gift card balance.
List unused couponsShow customers their available, unredeemed codes.
Resend existing codesRemind customers about codes they already received.
See the Connected Content script reference for ready-to-use scripts for each use case.

API endpoints

Connected Content calls the Voucherify API. The examples in this documentation use the default European cluster. Change the endpoint if your project is in another region or uses a dedicated cluster. You can check your API endpoint in Voucherify under Project settings > General > API endpoint.
Shared clusterEndpoint for Braze Connected Content
Europe (default)https://api.voucherify.io/v1/
United Stateshttps://us1.api.voucherify.io/v1/
Asia (Singapore)https://as1.api.voucherify.io/v1/

Optimization and security

Without proper optimization, each Connected Content message triggers at least two Voucherify API calls. This can drain your hourly and monthly limits. Before going to production, configure:
  • Rate limiting: Limit the number of messages Braze sends per minute to protect both APIs.
  • Caching: Add cache_id and :cache_max_age to reduce duplicate API calls.
  • Retry: Use the :retry attribute so Braze retries failed requests up to 5 times.
  • Source ID: Use source_id to ensure each customer receives only one unique code per campaign.
Read Optimize your Connected Content scripts for detailed configuration instructions.

Next steps

Visit the following pages to explore possibilities of using Voucherify with Braze Connected Content.

Get started

Publish your first coupon code with a step-by-step tutorial.

Optimize scripts

Configure caching, retry, and rate limiting for production.

Script reference

Browse ready-to-use script templates for all use cases.
Last modified on March 26, 2026