An Offer is a wrapper around a Discount that allows for explicit redemption and usage controls.
Offers lets you reuse discounts: you can give two partners the same underlying discount (e.g., "get a 60-day free trial") and manage redemption constraints independently. Similarly you can create seasonal offers tied to the same discount with different start/end dates.
You must supply an id when creating each offer. This id must be unique for all offers across the entire application. Offers can also be identified by generating single-use codes. If single-use codes are created for an offer, the offer's id cannot be used in the activation flow.
Attributes:
Name | Type | Description |
---|---|---|
id | string | Unique id defined by the Application. Once set, the id cannot be changed. |
discount | object | The associated Discount object. |
starts_at | integer | Unix timestamp of when the offer starts (in seconds since the Unix epoch). If set to 0, the offer will start immediately. |
ends_at | integer | Unix timestamp of when the offer ends (in seconds since the Unix epoch). If set to 0, the offer will never end. |
max_redemptions | integer | The maximum number of times the offer can be redeemed. If set to 0 , the offer can be redeemed an unlimited number of times. This field is ignored if require_code is true. |
redemptions | integer | The number of times the offer has been redeemed to-date. |
active_eligible | boolean | If this offer should be made available to active accounts. |
pending_cancel_eligible | boolean | If this offer should be made available to accounts that have cancelled (will not auto-renew but still have access). |
signup_eligible | boolean | If this offer should be made available to new accounts (signups). |
winback_eligible | boolean | If this offer should be made available to winbacks (churned accounts starting a new subscription). |
require_code | boolean | If this offer should be redeemed through codes. If single-use codes are used to identify an offer, max_redemptions will be ignored. |
created_at | integer | Unix timestamp of when the offer was created (in seconds since the Unix epoch). |
updated_at | integer | Unix timestamp of when the offer was last updated (in seconds since the Unix epoch). |