API pipeline: Issue your own coupons
Goal: issue your own discount coupons (templates) and manage them.
Coupons you issue do not discount Cabi.Chat Pro or plans: those take only coupons issued by Cabi.Chat. API pipeline: Redeem a coupon
Steps
1. Create a template.
POST /v0/my/coupons
Idempotency-Key: 41d0…
{"title": "Spring −20%", "area": "PROMOTIONAL", "code": "SPRING20",
"discount_type": "PERCENTAGE", "discount_value": 20,
"mint_capacity": 100, "max_uses_per_user": 1, "clipped_validity_days": 30,
"valid_until": "2026-12-31T23:59:59Z", "project": "<project>"}
→ the coupon card (Private)
2. List. GET /v0/my/coupons → {"coupons": [...], "total"}.
3. Read. GET /v0/my/coupons/<coupon> → terms and counters (clips_minted, redeems_used).
4. Change. PATCH /v0/my/coupons/<coupon> with e.g. {"is_active": false}, valid_until, mint_capacity, title, content, visibility, permissions.
5. Remove. DELETE /v0/my/coupons/<coupon>, or POST /v0/my/archive {"nonce": "<coupon>", "archived": true}.
Rules
area:ENGAGING,REFERRAL,PROMOTIONAL,SUBSCRIPTIONorSIGNIN;discount_type:PERCENTAGEorFIXED; else 400.titleis required.codeis stored in upper case.- New coupons are Private. People can clip a template only if they can execute it (card rights: Cabi.Chat Graph — Card Policies).
- A clipped coupon cannot be deleted (400): archive it.
mint_capacitycaps clips;max_uses_per_usercaps uses per clip (default 1);clipped_validity_dayslimits how long a clip stays usable.
API surface
| Endpoint | Purpose | FE | AI / oracle |
|---|---|---|---|
POST /v0/my/coupons |
Create | no | yes |
GET /v0/my/coupons, GET /v0/my/coupons/{nonce} |
List, read | no | yes |
PATCH /v0/my/coupons/{nonce} |
Change | no | yes |
DELETE /v0/my/coupons/{nonce}, POST /v0/my/archive |
Delete or archive | no | yes |
Index: API pipelines — index