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
Copy file name to clipboardExpand all lines: docs/change_log/2024-08-28-subscription-api-and-entitlement-migration.md
+11-7
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,17 @@ topics:
6
6
breaking: true
7
7
---
8
8
9
+
> info
10
+
> Updates to this Change Log entry was published on **October 7, 2024** to reflect up-to-date information. See the [new Change Log entry](#DOCS_CHANGE_LOG/updates-to-entitlement-migration-guide) for details on updates.
11
+
9
12
We are migrating our entitlement system to a new behavior where entitlements will not end until explicitly canceled, representing a breaking change for subscription management. We are introducing a [Subscription API](#DOCS_RESOURCES_SUBSCRIPTION) and [Subscription Events](#DOCS_TOPICS_GATEWAY_EVENTS/subscriptions) to allow handling subscription-related events.
10
13
11
14
> warn
12
15
> This change will be rolled out to all existing applications that have entitlements for user and guild subscription SKUs, starting on October 1, 2024.
13
16
14
17
#### Entitlement Migration Details
15
18
-`ENTITLEMENT_CREATE` events will now be triggered with a null `ends_at` value for all ongoing subscriptions, indicating an indefinite entitlement.
16
-
-`ENTITLEMENT_UPDATE` events will occur only when a subscription is canceled, with the `ends_at` value indicating the end date.
19
+
-`ENTITLEMENT_UPDATE` events will occur only when a subscription ends, with the `ends_at` value indicating the end date.
17
20
- Discord-managed Subscription entitlements will have an `type` value of `PURCHASE` (type `1`) instead of `APPLICATION_SUBSCRIPTION` (type `8`).
18
21
19
22
### Migration Plan & Guide:
@@ -56,7 +59,7 @@ Post-migration, entitlements for Subscription SKUs purchased through Discord wil
56
59
### Migration Timeline
57
60
58
61
-**Migration Start Date:** October 1, 2024
59
-
-**Migration End Date:**October 31, 2024
62
+
-**Migration End Date:**November 1, 2024
60
63
61
64
### Migration Impacts
62
65
@@ -65,7 +68,8 @@ Post-migration, entitlements for Subscription SKUs purchased through Discord wil
65
68
-**During Migration Window:**
66
69
- These will automatically transfer to the new system.
67
70
- A new `ENTITLEMENT_CREATE` event will be triggered to indicate the migration. This does not indicate a net new entitlement.
68
-
- No further events will be generated until cancellation, which will then trigger an `ENTITLEMENT_UPDATE` event.
71
+
- No further events will be generated until the entitlement ends, which will then trigger an `ENTITLEMENT_UPDATE` event.
72
+
- The `ends_at` value in the `ENTITLEMENT_UPDATE` event and in the Entitlement API will indicate the timestamp when the entitlement ends.
69
73
70
74
### 2) Existing Entitlements Set to End
71
75
@@ -79,12 +83,12 @@ Post-migration, entitlements for Subscription SKUs purchased through Discord wil
79
83
- Adjust your system to handle `ends_at` being null, which now indicates an indefinite entitlement.
80
84
- Adjust your system not to expect type `APPLICATION_SUBSCRIPTION` (type `8`) for Discord-managed subscription entitlements.
81
85
-**Post-Migration:**
82
-
- Monitor for `ENTITLEMENT_CREATE`and `ENTITLEMENT_UPDATE` events.
83
-
- Update your handling of `ends_at` timestampsto manage cancellations effectively.
86
+
- Monitor for `ENTITLEMENT_CREATE`, `ENTITLEMENT_UPDATE`, `SUBSCRIPTION_CREATE`, and `SUBSCRIPTION_UPDATE` events.
87
+
- Update any references to an entitlement `ends_at` timestamps, which now indicate the ending of an entitlement. If you need to know when a subscription's period ends, use the [Subscription API](#DOCS_RESOURCES_SUBSCRIPTION) and related [Subscription Gateway Events](#DOCS_TOPICS_GATEWAY_EVENTS/subscriptions).
84
88
85
89
<Collapsibletitle="Entitlement Migration Example Scenario"description="Step-by-step example of an entitlement upgrading to the new entitlement system"icon="view"open>
86
90
- The Entitlement Migration begins on October 1, 2024
87
91
- You have an existing user subscription that has an existing `ends_at` timestamp for October 10, 2024.
88
-
- If the subscription renews successfully, you will receive an `ENTITLEMENT_UPDATE` event on October 10, 2024, with an `ends_at` value of null
89
-
- If you receive an `ENTITLEMENT_UPDATE` event with an `ends_at` timestamp, the entitlement for this subscription is expected to end at the timestamp value unless you receive subsequent `ENTITLEMENT_UPDATE` events between the cancellation and the `ends_at` value.
92
+
- If the subscription renews successfully, you will receive an `ENTITLEMENT_CREATE` event on October 10, 2024, with an `ends_at` value of null
93
+
-~~If you receive an `ENTITLEMENT_UPDATE` event with an `ends_at` timestamp, the entitlement for this subscription is expected to end at the timestamp value unless you receive subsequent `ENTITLEMENT_UPDATE` events between the cancellation and the `ends_at` value.~~
The entitlement migration started on **October 1, 2024** and will continue through 11:59PM PST on **November 1, 2024**.
9
+
10
+
We updated our previous entitlement migration guide to provide more up-to-date information on impacts of developer impacts. Here's a summary of the changes we made:
11
+
12
+
- The migration will run through November 1, 2024 to ensure that any entitlements that are set to renew in October will be properly migrated to the new entitlement system upon renewal.
13
+
-`ENTITLEMENT_UPDATE` events will only occur when a subscription ends.
14
+
- The value of the `ends_at` in `ENTITLEMENT_UPDATE` events indicate the timestamp for **when the entitlement is no longer valid**.
15
+
- The `ends_at` value on the [entitlement object](#DOCS_RESOURCES_ENTITLEMENT/entitlement-object) is set when the subscription ends.
16
+
- To receive the value of when a subscription was canceled, you should listen for the `SUBSCRIPTION_UPDATE` events or use the [Subscription API](#DOCS_RESOURCES_SUBSCRIPTION).
17
+
18
+
View the [updated migration guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration).
19
+
20
+
To see a full diff of the changes, refer to this pull request: [Entitlement Migration Guide Updates](https://github.com/discord/discord-api-docs/pull/7201).
Copy file name to clipboardExpand all lines: docs/monetization/Implementing_App_Subscriptions.mdx
+30-8
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ When creating subscriptions, you will need to choose between user or guild subsc
19
19
## How App Subscriptions Work
20
20
21
21
> danger
22
-
> **Starting on October 1st, 2024**, the`ENTITLEMENT_CREATE` and `ENTITLEMENT_UPDATE` event behavior is changing. Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information on what is changing and how to prepare.
22
+
> **Starting on October 1st, 2024**, the`ENTITLEMENT_CREATE` and `ENTITLEMENT_UPDATE` event behavior described below is changing. Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information on what is changing and how to prepare.
23
23
24
24
- When a user purchases your subscription SKU, Discord creates an [Entitlement](#DOCS_RESOURCES_ENTITLEMENT) for the user (or guild) and that specific Subscription [SKU](#DOCS_RESOURCES_SKU).
25
25
- You will receive an `ENTITLEMENT_CREATE` event via the Gateway.
@@ -36,10 +36,30 @@ When creating subscriptions, you will need to choose between user or guild subsc
36
36
- This entitlement will be available on `Interaction Payloads` initiated from the entitled user or users in a guild (for guild subscriptions).
37
37
- This subscription will be available via the `LIST Subscriptions` API endpoint.
38
38
- This entitlement is granted indefinitely until the user decides to cancel their subscription. `ends_at` will be null.
39
-
- When a user cancels their subscription, you will receive an `ENTITLEMENT_UPDATE` event with an `ends_at` timestamp representing when the subscription ends and when related premium functionality should be revoked.
40
-
-If the user changes their mind and reactivates their subscription, you will receive another`ENTITLEMENT_UPDATE` event setting the`ends_at` timestamp to null.
39
+
- When a user cancels their subscription, your app will not receive any entitlement events.
40
+
-When a subscription ends, the entitlement to the subscription will end. Developers will receive an`ENTITLEMENT_UPDATE` event with an`ends_at` timestamp indicating when the subscription ended.
41
41
42
42
Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information on what is changing and how to prepare.
43
+
44
+
### Using Subscription Events for the Subscription Lifecycle
45
+
46
+
Because entitlements are granted indefinitely and don't update on renewal or cancellation, you can use subscription events to track the lifecycle of a subscription.
47
+
48
+
> info
49
+
> This is not a complete list of when events may occur. You should use the presence of an entitlement to determine if a user has access to your premium features. The Subscription API and related events are intended for reporting and lifecycle management purposes and **should not be used as the source of truth of whether a user has access to your premium features**.
50
+
51
+
| Event Name | Subscription Behavior | Updated Fields |
|`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 |
54
+
|`SUBSCRIPTION_UPDATE`| Subscription is granted an entitlement |`status` is `0 (active)`|
55
+
|`SUBSCRIPTION_UPDATE`| Subscription is renewed |`current_period_start`, `current_period_end` timestamps updated |
56
+
|`SUBSCRIPTION_UPDATE`| Subscription is canceled |`canceled_at` timestamp updated, `status` is `1 (ending)`|
57
+
|`SUBSCRIPTION_UPDATE`| Subscription ends |`status` is `2 (inactive)`, this event is processed asynchronously and will not be immediate |
58
+
|`SUBSCRIPTION_UPDATE`| Subscription is resumed/uncanceled by user |`status` is `0 (active)`|
59
+
60
+
> info
61
+
> These docs will be incorporated into the main documentation on November 1, 2024.
62
+
43
63
</Collapsible>
44
64
45
65
---
@@ -53,15 +73,17 @@ Depending on your app's features, you can use a combination of [Gateway events](
53
73
### Accessing Entitlements with Gateway Events
54
74
55
75
> danger
56
-
> **Starting on October 1st, 2024**, the `ENTITLEMENT_CREATE` and `ENTITLEMENT_UPDATE` event behavior is changing. Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information on what is changing and how to prepare.
76
+
> **Starting on October 1, 2024**, the `ENTITLEMENT_CREATE` and `ENTITLEMENT_UPDATE` event behavior described below is changing. Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information on what is changing and how to prepare. The docs will be updated on November 1, 2024 to reflect the new behavior.
57
77
58
78
When users subscribe or renew a subscription with your app, Discord will emit [Entitlement Gateway events](#DOCS_TOPICS_GATEWAY_EVENTS/entitlements).
59
79
60
-
For subscription SKUs, you will receive the following events:
80
+
For subscription SKUs, you will receive the following entitlement events:
61
81
62
-
-[`ENTITLEMENT_CREATE`](#DOCS_TOPICS_GATEWAY_EVENTS/entitlement-create): When a user subscribes to your app.
63
-
-[`ENTITLEMENT_UPDATE`](#DOCS_TOPICS_GATEWAY_EVENTS/entitlement-update): When a user renews their subscription.
64
-
-[`ENTITLEMENT_DELETE`](#DOCS_TOPICS_GATEWAY_EVENTS/entitlement-delete): When Discord refunds a subscription, removes an entitlement, or when a developer [deletes a Test Entitlement](#DOCS_RESOURCES_ENTITLEMENT/delete-test-entitlement).
|`ENTITLEMENT_CREATE`| When a user is granted an entitlement to your app's subscription SKU |
85
+
|`ENTITLEMENT_UPDATE`| When a subscription is resumed, renewed, or canceled |
86
+
|`ENTITLEMENT_DELETE`| When Discord refunds a subscription, removes an entitlement, or when a developer [deletes a Test Entitlement](#DOCS_RESOURCES_ENTITLEMENT/delete-test-entitlement)|
Copy file name to clipboardExpand all lines: docs/topics/Gateway_Events.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -591,7 +591,7 @@ Sent when an entitlement is created. The inner payload is an [entitlement](#DOCS
591
591
#### Entitlement Update
592
592
593
593
> danger
594
-
> Starting on October 1st, 2024, the `ENTITLEMENT_UPDATE` event behavior will be changing. You will no longer receive an `ENTITLEMENT_UPDATE` event on successful renewal When a user cancels, you will receive an `ENTITLEMENT_UPDATE` events with a valid `ends_at` value reflecting when their subscription ends. Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information.
594
+
> Starting on October 1, 2024, the `ENTITLEMENT_UPDATE` event behavior will be changing. You will no longer receive an `ENTITLEMENT_UPDATE` event on successful renewal When a user cancels, you will receive an `ENTITLEMENT_UPDATE` events with an `ends_at` value when the subscription ends. See the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information.
595
595
596
596
Sent when an entitlement is updated. The inner payload is an [entitlement](#DOCS_RESOURCES_ENTITLEMENT/entitlement-object) object.
0 commit comments