Coupon .update
PATCH /{namespace}/coupons/{id}
Changes the given properties of a Coupon.
- Noun
- Coupon
- Mode
do- Event
Coupon.updated
Update changes the given properties of a Coupon. It is inherited: every Noun has get, list, create, update and delete.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Coupon. |
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 | 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. |
Outputs
| Output | Type | Required | Description |
|---|---|---|---|
coupon | Coupon | required | The Coupon. |
Effects
- Emits
Coupon.updated. - Two-way:
try,send,do.
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | Coupon.update |
When it waits
| Gate | Default |
|---|---|
| Decision class | Low: two-way, nothing at stake |
| Delay window | None: it runs once review passes. |
| Limit | The call Limit of the Permission it runs under. |
| Over the Limit | It waits pending for an Approval from the Founder. Approved, it runs; refused, it ends refused with limit-exceeded; unanswered by its deadline, it ends canceled. |