You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Developers with monetization enabled can now create and publish multiple subscription SKUs of the same type for their app. This allows developers to offer different subscription tiers with varying benefits and pricing. Users can upgrade and downgrade between published subscription SKUs.
9
+
10
+
### What's Changed
11
+
12
+
#### Developer Portal
13
+
- Under the `Monetization` tab, you can now publish multiple subscription SKUs of the same type for your app.
14
+
15
+
#### App's Store Page
16
+
- When multiple subscription SKUs are published: Users can now upgrade or downgrade between different published subscription SKUs.
17
+
18
+
#### User App Subscription Settings
19
+
- When multiple subscription SKUs are published: Users can now upgrade or downgrade between different published subscription SKUs.
20
+
- These settings are available under `User Settings → Subscriptions → App Subscriptions`.
21
+
22
+
#### Subscription Object
23
+
- New field `renewal_sku_ids` added to the [subscription object](#DOCS_RESOURCES_SUBSCRIPTION/subscription-object) response for `SUBSCRIPTION_UPDATE` events and API endpoints.
24
+
-`renewal_sku_ids` is a list of snowflakes that indicate the SKU(s) that the user will be subscribed to at renewal.
25
+
26
+
#### Updated Guide: Managing SKUs
27
+
- The [Managing SKUs](#DOCS_MONETIZATION_MANAGING_SKUS/creating-a-sku) guide has been updated to include information about creating and managing multiple subscription SKUs.
- The [Implementing App Subscriptions](#DOCS_MONETIZATION_IMPLEMENTING_APP_SUBSCRIPTIONS/supporting-upgrades-and-downgrades) guide has been updated to include information about supporting upgrades and downgrades between multiple subscription SKUs.
Copy file name to clipboardExpand all lines: docs/monetization/Implementing_App_Subscriptions.mdx
+91-2Lines changed: 91 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ Because entitlements are granted indefinitely and don't update on renewal or can
39
39
|`SUBSCRIPTION_CREATE`| Subscription is created |`status` is either `0 (active)` if an entitlement has been granted or `1 (ending)` if an entitlement has not yet been granted |
40
40
|`SUBSCRIPTION_UPDATE`| Subscription is granted an entitlement |`status` is `0 (active)`|
41
41
|`SUBSCRIPTION_UPDATE`| Subscription is renewed |`current_period_start`, `current_period_end` timestamps updated |
42
+
|`SUBSCRIPTION_UPDATE`| Subscription is upgraded or downgraded |`sku_ids`, `entitlement_ids`, `renewal_sku_ids` may be updated |
42
43
|`SUBSCRIPTION_UPDATE`| Subscription is canceled |`canceled_at` timestamp updated, `status` is `1 (ending)`|
43
44
|`SUBSCRIPTION_UPDATE`| Subscription ends |`status` is `2 (inactive)`, this event is processed asynchronously and will not be immediate |
44
45
|`SUBSCRIPTION_UPDATE`| Subscription is resumed/uncanceled by user |`status` is `0 (active)`|
@@ -60,7 +61,7 @@ For subscription SKUs, you will receive the following entitlement events:
|`ENTITLEMENT_CREATE`| When a user is granted an entitlement to your app's subscription SKU |
63
-
|`ENTITLEMENT_UPDATE`| When a subscription ends |
64
+
|`ENTITLEMENT_UPDATE`| When an entitlement to a subscription SKU ends|
64
65
|`ENTITLEMENT_DELETE`| When Discord refunds a subscription, removes an entitlement, or when a developer [deletes a Test Entitlement](#DOCS_RESOURCES_ENTITLEMENT/delete-test-entitlement)|
65
66
66
67
### Accessing Entitlements with the HTTP API
@@ -91,14 +92,102 @@ You can do this by sending a message with a [button](#DOCS_INTERACTIONS_MESSAGE_
91
92
92
93
If you are using the [Embedded App SDK](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK) to build an [Activity](#DOCS_ACTIVITIES_OVERVIEW), you can also launch the purchase flow for a specific SKU using the SDK. Check out the [Implementing In-App Purchases for Activities](#DOCS_MONETIZATION_IMPLEMENTING_IAP_FOR_ACTIVITIES) guide to learn more about monetization with the Embedded App SDK.
93
94
95
+
### Purchasing from the Store Page
96
+
97
+
Users can start, upgrade, or downgrade their subscription from your app's [Store](#DOCS_MONETIZATION_MANAGING_SKUS/viewing-your-store-page) page. You can link directly to your Store page using our [Application Directory Store URL scheme](#DOCS_MONETIZATION_MANAGING_SKUS/linking-to-your-store).
98
+
99
+
---
100
+
101
+
## Supporting Subscriptions
102
+
103
+
To support subscriptions in your app, you need to [create a subscription SKU](#DOCS_MONETIZATION_MANAGING_SKUS/creating-a-sku) and handle the following scenarios:
104
+
105
+
### Starting a new subscription
106
+
107
+
When a user subscribes to a new subscription, you will receive the following events:
|`SUBSCRIPTION_CREATE`| when the subscription is initially created. `status` is `0 (active)` if the entitlement has been granted or `1 (ending)` if the entitlement has not yet been granted. |
112
+
|`ENTITLEMENT_CREATE`| when the user is granted an entitlement for the new subscription |
113
+
|`SUBSCRIPTION_UPDATE`| when the subscription is updated with the `entitlement_ids`, `renewal_sku_ids`, and `status` (`0 (active)`) |
114
+
115
+
### Cancelling an existing subscription
116
+
117
+
Users can cancel their subscription at any time from their Subscription settings.
118
+
119
+
When a user cancels their subscription, you will receive the following events:
|`SUBSCRIPTION_UPDATE`| when the subscription is updated to end with a `status` of `1 (ending)` and `canceled_at` is set to the timestamp the user canceled |
124
+
125
+
The user's subscription and entitlement are still valid until the subscription `current_period_end` is reached.
126
+
127
+
If the subscription is not resumed before the subscription `current_period_end`, it will end and you will receive the following events:
|`SUBSCRIPTION_UPDATE`| when the subscription is set to continue with a `status` of `0 (active)` and `canceled_at` is set to null |
143
+
144
+
---
145
+
146
+
## Supporting Upgrades and Downgrades
147
+
148
+
If you offer multiple subscription tiers in your app, users can upgrade or downgrade their subscription at any time from your [Store page](#DOCS_MONETIZATION_MANAGING_SKUS/viewing-your-store-page) or their App Subscription settings.
149
+
150
+
To create multiple subscription tiers, you will need to [create multiple subscription SKUs](#DOCS_MONETIZATION_MANAGING_SKUS/creating-a-sku) and support the following scenarios in your app:
151
+
152
+
### Upgrading an existing subscription
153
+
154
+
If an user is on a lower tier subscription and upgrades to subscription tier that is the same price or higher, the user is charged the difference in price between the two subscriptions and the subscription period resets at the time of upgrading.
155
+
156
+
When the subscription is upgraded, the current entitlement for the lower tier will end immediately and you will receive the following events:
|`ENTITLEMENT_UPDATE`| when the current entitlement ends. `ends_at` gets updated with a timestamp |
161
+
|`ENTITLEMENT_CREATE`| when a new entitlement is created for the upgrade subscription SKU |
162
+
|`SUBSCRIPTION_UPDATE`| when the subscription is updated with the new `entitlement_ids`, `sku_ids`, `current_period_start`, `current_period_end`|
163
+
164
+
165
+
### Downgrading an existing subscription
166
+
167
+
If an user is on a higher tier subscription and downgrades to a lower tier subscription, the user is not charged immediately because the price is lower than what was already paid.
168
+
169
+
The user has already paid for their current plan until `subscription.current_period_end` so their current plan will be valid until then and you will receive the following event:
|`ENTITLEMENT_UPDATE`| when the current entitlement ends. `ends_at` gets updated with a timestamp |
180
+
|`ENTITLEMENT_CREATE`| when a new entitlement is created for the downgraded subscription SKU |
181
+
|`SUBSCRIPTION_UPDATE`| when the subscription is updated with the new `entitlement_ids`, `sku_ids`, `current_period_start`, `current_period_end`|
182
+
94
183
---
95
184
96
185
## Using the Subscription API
97
186
98
187
> info
99
188
> When implementing monetization, [Entitlements](#DOCS_RESOURCES_ENTITLEMENT) should be considered the source of truth for a user's access to a specific SKU. The Subscription API is intended for reporting and lifecycle management purposes that happen outside the flow of a user's interaction with your app.
100
189
101
-
You can use the [Subscription API](#DOCS_RESOURCES_SUBSCRIPTION) to check on the status of your app subscriptions. This API allows you to list all subscriptions for your app for reporting purposes and to check on the status of subscriptions without having to access entitlements directly.
190
+
You can use the [Subscription API](#DOCS_RESOURCES_SUBSCRIPTION) to check on the status of your app subscriptions. This API allows you to list subscriptions by user for reporting purposes and to check on the status of subscriptions without having to access entitlements directly.
102
191
103
192
-[List SKU Subscriptions](#DOCS_RESOURCES_SUBSCRIPTION/list-sku-subscriptions): List all subscriptions for a specific SKU in your app.
104
193
-[Get SKU Subscription](#DOCS_RESOURCES_SUBSCRIPTION/get-sku-subscription): Get a specific subscription in your app.
Copy file name to clipboardExpand all lines: docs/monetization/Managing_SKUs.mdx
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -19,11 +19,19 @@ When you click on `Create SKU`, you have the option to select from the following
19
19
20
20
Once you select the SKU type, enter a name for your SKU to continue.
21
21
22
+
### Creating Subscription Tiers
23
+
24
+
You can create multiple subscription tiers to offer different benefits at different price points. Each tier can have its own set of benefits and price and is represented by unique SKUs.
25
+
26
+
To support upgrading and downgrading between subscription tiers, see our guide on [Implementing App Subscriptions](#DOCS_MONETIZATION_IMPLEMENTING_APP_SUBSCRIPTIONS/supporting-upgrades-and-downgrades).
| user_id | snowflake | ID of the user who is subscribed |
15
-
| sku_ids | array of snowflakes | List of SKUs subscribed to |
16
-
| entitlement_ids | array of snowflakes | List of entitlements granted for this subscription |
17
-
| current_period_start | ISO8601 timestamp | Start of the current subscription period |
18
-
| current_period_end | ISO8601 timestamp | End of the current subscription period |
19
-
| status | SubscriptionStatus | Current status of the subscription |
20
-
| canceled_at | ISO8601 timestamp? | When the subscription was canceled |
21
-
| country? | string | ISO3166-1 alpha-2 country code of the payment source used to purchase the subscription. Missing unless queried with a private OAuth scope. |
| user_id | snowflake | ID of the user who is subscribed |
15
+
| sku_ids | array of snowflakes | List of SKUs subscribed to |
16
+
| entitlement_ids | array of snowflakes | List of entitlements granted for this subscription |
17
+
| renewal_sku_ids | ?array of snowflakes | List of SKUs that this user will be subscribed to at renewal |
18
+
| current_period_start | ISO8601 timestamp | Start of the current subscription period |
19
+
| current_period_end | ISO8601 timestamp | End of the current subscription period |
20
+
| status | SubscriptionStatus | Current status of the subscription |
21
+
| canceled_at | ?ISO8601 timestamp | When the subscription was canceled |
22
+
| country? | string | ISO3166-1 alpha-2 country code of the payment source used to purchase the subscription. Missing unless queried with a private OAuth scope. |
22
23
23
24
The start of a subscription is determined by its ID. When the subscription renews, its current period is updated.
24
25
@@ -32,6 +33,7 @@ If the user cancels the subscription, the subscription will enter the `ENDING` s
0 commit comments