Skip to content
WeZend

Campaigns & content

Unique discount codes

Load a pool of single-use codes and use {{discount_code}} in a message — each recipient gets a unique code, claimed atomically.

A pool holds many single-use codes; the {{discount_code}} placeholder claims one per recipient at send time, so a shared code never leaks to a coupon site.

Create a pool

curl https://api.wezend.com/v1/discount-pools \
  -H "X-API-Key: <key>" -H "Content-Type: application/json" \
  -d '{ "name": "Summer 2026" }'

Add codes (from your store)

curl https://api.wezend.com/v1/discount-pools/<poolId>/codes \
  -H "X-API-Key: <key>" -H "Content-Type: application/json" \
  -d '{ "codes": "SUMMER-A1B2, SUMMER-C3D4, SUMMER-E5F6" }'

codes accepts an array or a string split on commas / spaces / newlines. Generate the codes as single-use in your e-commerce or POS system first, so your checkout validates them.

Or generate random codes

curl https://api.wezend.com/v1/discount-pools/<poolId>/generate \
  -H "X-API-Key: <key>" -H "Content-Type: application/json" \
  -d '{ "count": 5000, "prefix": "SUMMER" }'

Use in a message

Put {{discount_code}} in an email, SMS or RCS body. At send time each recipient claims one unused code atomically — no double-issue even at high volume. List pools with GET /v1/discount-pools. Size the pool to your audience and top it up before large sends.

One platform. Every customer interaction.

Replace your patchwork of messaging APIs, CDP and automation tools with a single engagement platform built for scale.

No credit card required · EU data residency · 99.99% uptime SLA