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

Tweak documentation for premium apps (aka. application subscriptions) #6452

Merged
merged 5 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/interactions/Receiving_and_Responding.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,14 @@ There are a number of ways you can respond to an interaction:
| UPDATE_MESSAGE\* | 7 | for components, edit the message the component was attached to |
| APPLICATION_COMMAND_AUTOCOMPLETE_RESULT | 8 | respond to an autocomplete interaction with suggested choices |
| MODAL\*\* | 9 | respond to an interaction with a popup modal |
| PREMIUM_REQUIRED\*\* | 10 | respond to an interaction with an upgrade button, only available for apps with monetization enabled |
| PREMIUM_REQUIRED\*\*\* | 10 | respond to an interaction with an upgrade button, only available for apps with monetization enabled |

\* Only valid for [component-based](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/) interactions

\*\* Not available for `MODAL_SUBMIT` and `PING` interactions.

\*\*\* Not available for `APPLICATION_COMMAND_AUTOCOMPLETE` and `PING` interactions.

###### Interaction Callback Data Structure

###### Messages
Expand Down
2 changes: 1 addition & 1 deletion docs/monetization/App_Subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Currently, you can only have one published subscription SKU for your app, so you

## Configuring App Subscriptions

Once you have an idea what type of subscription you want to offer your app, you can create and [customize your SKU](#DOCS_MONETIZATION_SKUS/customizing-your-skus) to reflect the premium features that you are adding to your app. This is a good place to outline the benefits your users will receive from having an app subscription.
Once you have an idea what type of subscription you want to offer for your app, you can create and [customize your SKU](#DOCS_MONETIZATION_SKUS/customizing-your-skus) to reflect the premium features that you are adding to your app. This is a good place to outline the benefits your users will receive from having an app subscription.

Once an app has a published SKU, there are 4 ways users will be able to subscribe:

Expand Down
2 changes: 1 addition & 1 deletion docs/monetization/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Only team owners can enable monetization for an app. When a team owner enables m
- App belongs to a developer team
- Team owner must be at least 18 years old
- Team must have verified emails and 2FA set up
- App uses slash commands, or has been approved for the Message Content privileged intent
- App uses slash commands, or has been approved for the privileged `Message Content` intent
- App has a link to your Terms of Service
- This document is an agreement between you and users governing the use of your app.
- App has a link to your Privacy Policy
Expand Down
28 changes: 14 additions & 14 deletions docs/monetization/SKUs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ SKUs (stock-keeping units) in Discord represent premium offerings that can be ma

###### SKU Structure

| Field | Type | Description |
|----------------|-----------|-------------------------------------------------------------|
| id | todo | ID of SKU |
| type | integer | [Type of SKU](#DOCS_MONETIZATION_SKUS/sku-object-sku-types) |
| application_id | snowflake | ID of the parent application |
| name | string | Customer-facing name of your premium offering |
| slug | string | System-generated URL slug based on the SKU's name |
| Field | Type | Description |
|----------------|-----------|-----------------------------------------------------------------------------------------------------------------------------|
| id | snowflake | ID of SKU |
| type | integer | [Type of SKU](#DOCS_MONETIZATION_SKUS/sku-object-sku-types) |
| application_id | snowflake | ID of the parent application |
| name | string | Customer-facing name of your premium offering |
| slug | string | System-generated URL slug based on the SKU's name |
| flags | integer | [SKU flags](#DOCS_MONETIZATION_SKUS/sku-object-sku-flags) combined as a [bitfield](https://en.wikipedia.org/wiki/Bit_field) |

###### SKU Example

Expand Down Expand Up @@ -43,15 +44,19 @@ For subscriptions, SKUs will have a type of either `SUBSCRIPTION` represented by
| SUBSCRIPTION | 5 | Represents a recurring subscription |
| SUBSCRIPTION_GROUP | 6 | System-generated group for each SUBSCRIPTION SKU created |

###### SKU Flags

For subscriptions, there are two types of access levels you can offer to users:

- **Guild Subscriptions**: A subscription purchased by a user and applied to a single server. Everyone in that server gets your premium benefits.
- **User Subscriptions**: A subscription purchased by a user for themselves. They get access to your premium benefits in every server.

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

- Guild Subscriptions: `1 << 7`
- User Subscriptions: `1 << 8`
| Value | Type |
|--------|--------------------|
| 1 << 7 | GUILD_SUBSCRIPTION |
| 1 << 8 | USER_SUBSCRIPTION |

## Customizing Your SKUs

Expand Down Expand Up @@ -106,11 +111,6 @@ Congratulations on going live! 🥳

Returns all SKUs for a given application. Because of how our SKU and subscription systems work, you will see two SKUs for your premium offering. For integration and testing entitlements, you should use the SKU with `type: 5`.

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

- Server Subscriptions: `1 << 7`
- User Subscriptions: `1 << 8`

```json
[
{
Expand Down