Coupon
A Coupon is a discount on Offers, by amount or percent, for one charge, several months or every charge, limited by date and redemptions.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
percentOff | number | The percent taken off each charge it applies to; set this or amountOff. Never randomized. | |
amountOff | money | The fixed amount taken off each charge it applies to. Never randomized. | |
duration | string | required | How long it applies: once, repeating for months, or forever. |
months | integer | How many months a repeating Coupon applies. | |
code | string | The promotion code a buyer types at checkout, when the Coupon has one. | |
redeemBy | datetime | The last moment it can be redeemed. | |
maxRedemptions | integer | How many times it can be redeemed across all Customers. |
Object
{
"$id": "https: //api.sb/ tutorloop.com/ coupons/ coupon_1",
"$type": "Coupon",
"percentOff": 1,
"amountOff": {
"amount": 60,
"currency": "USD"
},
"duration": "once",
"months": 1,
"code": "LAUNCH20",
"redeemBy": "2026-10-22T12: 00: 00Z",
"maxRedemptions": 1
}Relationships
- A Coupon discounts many Offers: a Coupon applies only to the Offers it names; an Offer may accept several Coupons.
discounts, inversecoupons.
Verbs
createCreates a Coupon.POST /{namespace}/couponsgetReturns one Coupon by id.GET /{namespace}/coupons/{id}listReturns Coupons, newest first, one page at a time.GET /{namespace}/couponsupdateChanges the given properties of a Coupon.PATCH /{namespace}/coupons/{id}
Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.
| Operation | owner | admin | member | viewer |
|---|---|---|---|---|
Coupon.create | Yes | Yes | Yes | No |
Coupon.get | Yes | Yes | Yes | Yes |
Coupon.list | Yes | Yes | Yes | Yes |
Coupon.update | Yes | Yes | Yes | No |
Call it
Add a coupon to QuietCopy.Example
A design tool offers the code LAUNCH30: 30% off for 3 months on its yearly and monthly Offers. It can be redeemed 500 times before the end of the month.