Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Premium Apps: SKU and Entitlement fields #6477

Merged
merged 9 commits into from
Oct 13, 2023
10 changes: 5 additions & 5 deletions docs/monetization/Entitlements.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Entitlements in Discord represent that a user or guild has access to a premium o
|----------------|-------------------|---------------------------------------------------------------------------------------------|
| id | snowflake | ID of the entitlement |
| sku_id | snowflake | ID of the SKU |
| user_id? | snowflake | ID of the user that is granted access to the entitlement's sku |
| guild_id? | snowflake | ID of the guild that is granted access to the entitlement's sku |
| application_id | snowflake | ID of the parent application |
| user_id? | snowflake | ID of the user that is granted access to the entitlement's sku |
| type | integer | [Type of entitlement](#DOCS_MONETIZATION_ENTITLEMENTS/entitlement-object-entitlement-types) |
| consumed | boolean | Not applicable for App Subscriptions. Subscriptions are not consumed and will be `false` |
| deleted | boolean | Entitlement was deleted |
| starts_at? | ISO8601 timestamp | Start date at which the entitlement is valid. Not present when using test entitlements. |
| ends_at? | ISO8601 timestamp | Date at which the entitlement is no longer valid. Not present when using test entitlements. |
| guild_id? | snowflake | ID of the guild that is granted access to the entitlement's sku |

###### Entitlement Example

Expand Down Expand Up @@ -54,8 +54,8 @@ Returns all entitlements for a given app, active and expired.
|----------------|-----------------------------------|------------------------------------------------------|
| user_id? | snowflake | User ID to look up entitlements for |
| sku_ids? | comma-delimited set of snowflakes | Optional list of SKU IDs to check entitlements for |
| before? | snowflake | Retrieve entitlements before this time |
| after? | snowflake | Retrieve entitlements after this time |
| before? | snowflake | Retrieve entitlements before this entitlement ID |
| after? | snowflake | Retrieve entitlements after this entitlement ID |
| limit? | integer | Number of entitlements to return, 1-100, default 100 |
| guild_id? | snowflake | Guild ID to look up entitlements for |
| exclude_ended? | boolean | Whether entitlements should be omitted |
Expand Down
9 changes: 5 additions & 4 deletions docs/monetization/SKUs.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ For subscriptions, there are two types of access levels you can offer to users:

The `flags` field can be used to differentiate user and server subscriptions with a bitwise `&&` operator.

| Value | Type |
|--------|--------------------|
| 1 << 7 | GUILD_SUBSCRIPTION |
| 1 << 8 | USER_SUBSCRIPTION |
| Value | Type | Description |
|--------|--------------------|---------------------------------------------------------------------------------------------------------------------------|
| 1 << 2 | AVAILABLE | SKU is available for purchase |
| 1 << 7 | GUILD_SUBSCRIPTION | Recurring SKU that can be purchased by a user and applied to a single server. Grants access to every user in that server. |
| 1 << 8 | USER_SUBSCRIPTION | Recurring SKU purchased by a user for themselves. Grants access to the purchasing user in every server. |

## Customizing Your SKUs

Expand Down
20 changes: 20 additions & 0 deletions docs/topics/Gateway_Events.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ Receive events are Gateway events encapsulated in an [event payload](#DOCS_TOPIC
| [Thread List Sync](#DOCS_TOPICS_GATEWAY_EVENTS/thread-list-sync) | Sent when gaining access to a channel, contains all active threads in that channel |
| [Thread Member Update](#DOCS_TOPICS_GATEWAY_EVENTS/thread-member-update) | [Thread member](#DOCS_RESOURCES_CHANNEL/thread-member-object) for the current user was updated |
| [Thread Members Update](#DOCS_TOPICS_GATEWAY_EVENTS/thread-members-update) | Some user(s) were added to or removed from a thread |
| [Entitlement Create](#DOCS_TOPICS_GATEWAY_EVENTS/entitlement-create) | Entitlement was created |
| [Entitlement Update](#DOCS_TOPICS_GATEWAY_EVENTS/entitlement-update) | Entitlement was updated or renewed |
| [Entitlement Delete](#DOCS_TOPICS_GATEWAY_EVENTS/entitlement-delete) | Entitlement was deleted |
| [Guild Create](#DOCS_TOPICS_GATEWAY_EVENTS/guild-create) | Lazy-load for unavailable guild, guild became available, or user joined a new guild |
| [Guild Update](#DOCS_TOPICS_GATEWAY_EVENTS/guild-update) | Guild was updated |
| [Guild Delete](#DOCS_TOPICS_GATEWAY_EVENTS/guild-delete) | Guild became unavailable, or user left/was removed from a guild |
Expand Down Expand Up @@ -543,6 +546,23 @@ Sent when a message is pinned or unpinned in a text channel. This is not sent wh
| channel_id | snowflake | ID of the channel |
| last_pin_timestamp? | ?ISO8601 timestamp | Time at which the most recent pinned message was pinned |

### Entitlements

#### Entitlement Create

Sent when an entitlement is created. The inner payload is a [entitlement](#DOCS_MONETIZATION_ENTITLEMENTS/entitlement-object) object.
colinloretz marked this conversation as resolved.
Show resolved Hide resolved

#### Entitlement Update

Sent when an entitlement is renewed for the next billing period. The inner payload is an [entitlement](#DOCS_MONETIZATION_ENTITLEMENTS/entitlement-object) object. The `ends_at` field will have an updated value with the new expiration date.
colinloretz marked this conversation as resolved.
Show resolved Hide resolved

#### Entitlement Delete

Sent when an entitlement is deleted. The inner payload is a [entitlement](#DOCS_MONETIZATION_ENTITLEMENTS/entitlement-object) object. Entitlements are not deleted when they expire. Entitlement deletions are infrequent and only occur when:
colinloretz marked this conversation as resolved.
Show resolved Hide resolved

- Discord issues a refund for a subscription
- Discord removes an entitlement from a user via internal tooling
colinloretz marked this conversation as resolved.
Show resolved Hide resolved

### Guilds

#### Guild Create
Expand Down