Skip to content

Commit b70346a

Browse files
authored
Updated docs: new behavior -> standard behavior (#7258)
1 parent 55b4945 commit b70346a

File tree

3 files changed

+28
-32
lines changed

3 files changed

+28
-32
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: "Entitlement Migration Completed"
3+
date: "2024-11-05"
4+
topics:
5+
- "Premium Apps"
6+
---
7+
8+
The [entitlement migration](#DOCS_CHANGE_LOG/premium-apps-entitlement-migration-and-new-subscription-api) which began on **October 1, 2024**, has been successfully completed as of **November 1, 2024**.
9+
10+
### What's Changed
11+
12+
- The documentation has been updated to reflect the new entitlement system as the standard behavior.
13+
- `ENTITLEMENT_UPDATE` event for subscription-related entitlements now only occur when the subscription ends.
14+
- The `ends_at` value on the [entitlement object](#DOCS_RESOURCES_ENTITLEMENT/entitlement-object) is now set when the subscription ends.
15+
- To determine when a subscription was canceled, listen for `SUBSCRIPTION_UPDATE` events or use the [Subscription API](#DOCS_RESOURCES_SUBSCRIPTION) to retrieve the subscription's `status` and `canceled_at` timestamp.
16+
17+
For more details about the migration process, please refer to the [migration guide](#DOCS_CHANGE_LOG/updates-to-entitlement-migration-guide).

docs/events/Gateway_Events.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -587,18 +587,19 @@ Sent when a message is pinned or unpinned in a text channel. This is not sent wh
587587

588588
#### Entitlement Create
589589

590+
> warn
591+
> Note: The`ENTITLEMENT_CREATE` event behavior changed on October 1, 2024. Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/premium-apps-entitlement-migration-and-new-subscription-api) for more information on what changed.
592+
590593
Sent when an entitlement is created. The inner payload is an [entitlement](#DOCS_RESOURCES_ENTITLEMENT/entitlement-object) object.
591594

592595
#### Entitlement Update
593596

594-
> danger
595-
> 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/premium-apps-entitlement-migration-and-new-subscription-api) for more information.
597+
> warn
598+
> Note: The`ENTITLEMENT_UPDATE` event behavior changed on October 1, 2024. Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/premium-apps-entitlement-migration-and-new-subscription-api) for more information on what changed.
596599
597600
Sent when an entitlement is updated. The inner payload is an [entitlement](#DOCS_RESOURCES_ENTITLEMENT/entitlement-object) object.
598601

599-
For subscription entitlements, when a user's subscription is renewed you will receive an `ENTITLEMENT_UPDATE` event with a new `ends_at` date that reflects the end of the new billing period.
600-
601-
If a user cancels their subscription, you will stop receiving `ENTITLEMENT_UPDATE` events that update the `ends_at` value.
602+
For subscription entitlements, this event is triggered only when a user's subscription ends, providing an `ends_at` timestamp that indicates the end of the entitlement.
602603

603604
#### Entitlement Delete
604605

docs/monetization/Implementing_App_Subscriptions.mdx

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,6 @@ When creating subscriptions, you will need to choose between user or guild subsc
1818

1919
## How App Subscriptions Work
2020

21-
> danger
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/premium-apps-entitlement-migration-and-new-subscription-api) for more information on what is changing and how to prepare.
23-
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-
- You will receive an `ENTITLEMENT_CREATE` event via the Gateway.
26-
- This entitlement will be available via the `LIST Entitlements` API endpoint.
27-
- This entitlement will be available on `Interaction Payloads` initiated from the entitled user or users in a guild (for guild subscriptions).
28-
- This subscription will be available via the `LIST Subscriptions` API endpoint.
29-
- This entitlement is granted and updated with a new `ends_at` date for each succesful billing interval until the user decides to cancel their subscription.
30-
- When a user cancels their subscription, you will **not** receive an `ENTITLEMENT_UPDATE` with a new `ends_at` value, the entitlement will just expire at the current `ends_at` value.
31-
32-
<Collapsible title="How App Subscriptions Work - Starting October 1st, 2024" icon="warning">
3321
- 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).
3422
- You will receive an `ENTITLEMENT_CREATE` event via the Gateway.
3523
- This entitlement will be available via the `LIST Entitlements` API endpoint.
@@ -39,8 +27,6 @@ When creating subscriptions, you will need to choose between user or guild subsc
3927
- When a user cancels their subscription, your app will not receive any entitlement events.
4028
- 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.
4129

42-
Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/premium-apps-entitlement-migration-and-new-subscription-api) for more information on what is changing and how to prepare.
43-
4430
### Using Subscription Events for the Subscription Lifecycle
4531

4632
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.
@@ -57,32 +43,24 @@ Because entitlements are granted indefinitely and don't update on renewal or can
5743
| `SUBSCRIPTION_UPDATE` | Subscription ends | `status` is `2 (inactive)`, this event is processed asynchronously and will not be immediate |
5844
| `SUBSCRIPTION_UPDATE` | Subscription is resumed/uncanceled by user | `status` is `0 (active)` |
5945

60-
> info
61-
> These docs will be incorporated into the main documentation on November 1, 2024.
62-
63-
</Collapsible>
64-
6546
---
6647

6748
## Working with Entitlements
6849

69-
When a user purchases a subscription, an entitlement is created. [Entitlements](#DOCS_RESOURCES_ENTITLEMENT) represent the user's access to your consumable or durable item.
50+
When a user purchases a subscription, an entitlement is created. [Entitlements](#DOCS_RESOURCES_ENTITLEMENT) represent the user's access to your app's premium features.
7051

71-
Depending on your app's features, you can use a combination of [Gateway events](#DOCS_EVENTS_GATEWAY_EVENTS/entitlements), the [Entitlement HTTP API](#DOCS_RESOURCES_ENTITLEMENT), and [interaction payloads](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING) to keep track of user and guild entitlements and grant perks to users who have subscribed to your app.
52+
Depending on your app's features, you can use a combination of [Gateway events](#DOCS_EVENTS_GATEWAY_EVENTS/entitlements), the [Entitlement HTTP API](#DOCS_RESOURCES_ENTITLEMENT), and [interaction payloads](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING) to keep track of user and guild entitlements and grant features to users who are subscribed to your app.
7253

7354
### Accessing Entitlements with Gateway Events
7455

75-
> danger
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/premium-apps-entitlement-migration-and-new-subscription-api) 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.
77-
78-
When users subscribe or renew a subscription with your app, Discord will emit [Entitlement Gateway events](#DOCS_EVENTS_GATEWAY_EVENTS/entitlements).
56+
When users make a purchase in your app, Discord will emit [Entitlement Gateway events](#DOCS_EVENTS_GATEWAY_EVENTS/entitlements).
7957

8058
For subscription SKUs, you will receive the following entitlement events:
8159

8260
| Event | Description |
8361
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
8462
| `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 |
63+
| `ENTITLEMENT_UPDATE` | When a subscription ends |
8664
| `ENTITLEMENT_DELETE` | When Discord refunds a subscription, removes an entitlement, or when a developer [deletes a Test Entitlement](#DOCS_RESOURCES_ENTITLEMENT/delete-test-entitlement) |
8765

8866
### Accessing Entitlements with the HTTP API
@@ -143,7 +121,7 @@ This method will not let you test out the full payment flow in Discord but will
143121

144122
If you'd like to test the full payment flow for your app, you can do so by interacting with your Store page or a [premium styled button](#DOCS_MONETIZATION_IMPLEMENTING_APP_SUBSCRIPTIONS/prompting-users-to-subscribe). Any team members associated with your app will automatically see a 100% discount on the price of the subscription, allowing you to purchase without the use of live payment method.
145123

146-
After checkout, you will have a live subscription that includes a `starts_at` and `ends_at` value. If you cancel this subscription, it will remain an active entitlement until the `ends_at` timestamp. This subscription will renew until canceled and can be used in testing subscription renewals in your app.
124+
After checkout, you will have a live subscription. This subscription will renew until canceled and can be used in testing subscription renewals in your app. If you cancel this subscription, it will remain an active entitlement until the end of the subscription billing period, represented by the `period_ends_at` field on the [Subscription](#DOCS_RESOURCES_SUBSCRIPTION/subscription-object).
147125

148126
> info
149127
> You can only delete entitlements created using the [create entitlement](#DOCS_RESOURCES_ENTITLEMENT/create-test-entitlement) endpoint. If you need to toggle access to your premium features during your development process, it is best to use Test Entitlements.

0 commit comments

Comments
 (0)