Entitlements
Entitlements in Discord represent a user or guild's access to a specific SKU. Entitlements can represent purchases, subscriptions, or gifts, and are used to power many different features in Discord.
Entitlement Object
Entitlement Structure
| Field | Type | Description |
|---|---|---|
| id | snowflake | The ID of the entitlement |
| type | integer | The type of entitlement |
| sku_id | snowflake | The ID of the SKU granted |
| application_id | snowflake | The ID of the application that owns the SKU |
| user_id | snowflake | The ID of the user that is granted access to the SKU |
| user? | partial user object | The user that is granted access to the SKU |
| guild_id? | snowflake | The ID of the guild that is granted access to the SKU |
| parent_id? | snowflake | The ID of the parent entitlement |
| deleted | boolean | Whether the entitlement is deleted |
| consumed? | boolean | For consumable items, whether the entitlement has been consumed |
| branches? | array[snowflake] | The IDs of the application branches granted |
| starts_at | ?ISO8601 timestamp | When the entitlement validity period starts |
| ends_at | ?ISO8601 timestamp | When the entitlement validity period ends |
| promotion_id | ?snowflake | The ID of the promotion the entitlement is from |
| subscription_id? | snowflake | The ID of the subscription the entitlement is from |
| gift_code_flags | integer | The flags for the gift code the entitlement is attached to |
| gift_code_batch_id? | snowflake | The ID of the batch the gift code attached to the entitlement is from |
| gifter_user_id? | snowflake | The ID of the user that gifted the entitlement |
| gift_style? | integer | The style of the gift attached to the entitlement |
| fulfillment_status? | integer | The tenant fulfillment status of the entitlement |
| fulfilled_at? | ISO8601 timestamp | When the entitlement was fulfilled |
| source_type? | integer | The special source type of the entitlement |
| tenant_metadata? | tenant metadata object | Tenant metadata for the entitlement |
| sku? | SKU object | The SKU granted |
| subscription_plan? | partial subscription plan object | The subscription plan granted |
Tenant Metadata Structure
| Field | Type | Description |
|---|---|---|
| quest_rewards | quest rewards metadata object | Metadata about the quest rewards granted by the entitlement |
Quest Rewards Metadata Structure
| Field | Type | Description |
|---|---|---|
| tag | integer | The reward type of the entitlement |
| reward_code? | quest reward code object | The reward granted by the entitlement |
Entitlement Type
| Value | Name | Description |
|---|---|---|
| 1 | PURCHASE | Entitlement was purchased by a user |
| 2 | PREMIUM_SUBSCRIPTION | Entitlement is for a premium (Nitro) subscription |
| 3 | DEVELOPER_GIFT | Entitlement was gifted by a developer |
| 4 | TEST_MODE_PURCHASE | Entitlement was purchased by a developer in application test mode |
| 5 | FREE_PURCHASE | Entitlement was granted when the SKU was free |
| 6 | USER_GIFT | Entitlement was gifted by another user |
| 7 | PREMIUM_PURCHASE | Entitlement was claimed for free via a premium subscription |
| 8 | APPLICATION_SUBSCRIPTION | Entitlement is for an application subscription |
| 9 | FREE_STAFF_PURCHASE | Entitlement was claimed for free by a Discord employee |
| 10 | QUEST_REWARD | Entitlement was granted as a reward for completing a quest |
| 11 | FRACTIONAL_REDEMPTION | Entitlement is for a fractional premium subscription |
| 12 | VIRTUAL_CURRENCY_REDEMPTION | Entitlement was purchased with virtual currency (Orbs) |
| 13 | GUILD_POWERUP | Entitlement was purchased with premium guild subscriptions (boosts) |
Entitlement Fulfillment Status
| Value | Name | Description |
|---|---|---|
| 0 | UNKNOWN | Unknown fulfillment status |
| 1 | FULFILLMENT_NOT_NEEDED | Fulfillment is not needed for this entitlement |
| 2 | FULFILLMENT_NEEDED | Fulfillment is needed for this entitlement |
| 3 | FULFILLED | Entitlement has been fulfilled |
| 4 | FULFILLMENT_FAILED | Fulfillment of the entitlement has failed |
| 5 | UNFULFILLMENT_NEEDED | Unfulfillment is needed for this entitlement |
| 6 | UNFULFILLED | Entitlement has been unfulfilled |
| 7 | UNFULFILLMENT_FAILED | Unfulfillment of the entitlement has failed |
| 8 | UNFULFILLMENT_NEEDED_MANUAL | Manual unfulfillment is needed for this entitlement |
Entitlement Source Type
| Value | Name | Description |
|---|---|---|
| 1 | QUEST_REWARD | Entitlement was granted as a reward for completing a quest |
| 2 | DEVELOPER_GIFT | Entitlement was gifted by a developer |
| 3 | INVOICE | Entitlement was granted via an invoice |
| 4 | REVERSE_TRIAL | Entitlement was granted as part of a reverse trial |
| 5 | USER_GIFT | Entitlement was gifted by another user |
| 6 | GUILD_POWERUP | Entitlement was granted via the guild powerups feature |
| 7 | HOLIDAY_PROMOTION | Entitlement was granted as part of a first-party promotion |
| 8 | FRACTIONAL_PREMIUM_GIVEBACK | Unknown |
| 9 | SUBSCRIPTION | Entitlement is for a subscription holder |
| 11 | SUBSCRIPTION_MEMBER | Entitlement is for a subscription member |
Example Entitlement
{ "id": "1014639973498097686", "sku_id": "557494559257526272", "application_id": "557494559257526272", "user_id": "852892297661906993", "promotion_id": null, "type": 3, "deleted": false, "gift_code_flags": 0, "starts_at": null, "ends_at": null, "branches": ["557494559257526272"], "gift_code_batch_id": "916443614618464296"}Gift Code Object
A gift from one user to another, which can be redeemed for an entitlement.
Gift Code Structure
| Field | Type | Description |
|---|---|---|
| code | string | The gift code |
| sku_id | snowflake | The ID of the SKU that the gift code grants |
| application_id | snowflake | The ID of the application that owns the SKU |
| flags? | integer | The flags for the gift code |
| uses | integer | The number of times the gift code has been used |
| max_uses | integer | The maximum number of times the gift code can be used |
| redeemed | boolean | Whether the gift code has been redeemed by the current user |
| expires_at | ?ISO8601 timestamp | When the gift code expires |
| batch_id? | snowflake | The ID of the batch the gift code is from |
| entitlement_branches? | array[snowflake] | The IDs of the application branches granted by the gift code |
| gift_style? | ?integer | The style of the gift code |
| user? | partial user object | The user that created the gift code |
| store_listing? | store listing object | The store listing for the SKU the gift code grants |
| subscription_plan_id? | snowflake | The ID of the subscription plan the gift code grants |
| subscription_plan? | subscription plan object | The subscription plan the gift code grants |
| subscription_trial? | subscription trial object | The subscription trial the gift code is from |
| promotion? | promotion object | The promotion the gift code is from |
Gift Code Flags
| Value | Name | Description |
|---|---|---|
| 1 << 0 | PAYMENT_SOURCE_REQUIRED | Gift requires a payment source to redeem |
| 1 << 1 | EXISTING_SUBSCRIPTION_DISALLOWED | Gift cannot be redeemed by users with existing premium subscriptions |
| 1 << 2 | NOT_SELF_REDEEMABLE | Gift cannot be redeemed by the gifter |
| 1 << 3 | PROMOTION | Gift is from a promotion |
Gift Style
| Value | Name | Description |
|---|---|---|
| 1 | SNOWGLOBE | Snowglobe style gift code |
| 2 | BOX | Box style gift code |
| 3 | CUP | Cup style gift code |
| 4 | STANDARD_BOX | Standard box style gift code |
| 5 | CAKE | Cake style gift code |
| 6 | CHEST | Chest style gift code |
| 7 | COFFEE | Coffee style gift code |
| 8 | SEASONAL_STANDARD_BOX | Seasonal standard box style gift code |
| 9 | SEASONAL_CAKE | Seasonal cake style gift code |
| 10 | SEASONAL_CHEST | Seasonal chest style gift code |
| 11 | SEASONAL_COFFEE | Seasonal coffee style gift code |
| 12 | NITROWEEN_STANDARD | Nitroween standard style gift code |
Example Gift Code
{ "code": "2CG6SV9QtRxerJTgCYNDnU7M", "sku_id": "521847234246082599", "application_id": "521842831262875670", "uses": 1, "max_uses": 1, "expires_at": null, "redeemed": false, "batch_id": "1215710455985610833", "store_listing": { "id": "521848044908576803", "summary": " ", "sku": { "id": "521847234246082599", "type": 5, "product_line": 1, "dependent_sku_id": null, "application_id": "521842831262875670", "manifest_labels": null, "access_type": 1, "name": "Nitro", "features": [], "release_date": null, "premium": false, "slug": "nitro", "flags": 68, "show_age_gate": false }, "thumbnail": { "id": "971526227435323423", "size": 227396, "mime_type": "image/png", "width": 834, "height": 474 }, "benefits": [] }, "subscription_plan_id": "642251038925127690"}Gift Code Batch Object
A batch of gift codes created together.
Gift Code Batch Structure
| Field | Type | Description |
|---|---|---|
| id | snowflake | The ID of the gift code batch |
| sku_id | snowflake | The ID of the SKU for the gift code batch |
| amount | integer | The number of gift codes in the batch |
| description? | string | The description for the gift code batch |
| entitlement_branches? | array[snowflake] | The IDs of the application branches granted |
| entitlement_starts_at? | ISO8601 timestamp | When the entitlements' validity period starts |
| entitlement_ends_at? | ISO8601 timestamp | When the entitlements' validity period ends |
Example Gift Code Batch
{ "id": "916443614618464296", "sku_id": "557494559257526272", "amount": 10, "description": "Holiday Giveaway", "entitlement_branches": ["557494559257526272"]}Endpoints
Get User Entitlements
GET/users/@me/entitlementsReturns a list of entitlement objects granted to the current user, both active and expired.
Query String Params
| Field | Type | Description |
|---|---|---|
| with_sku? | boolean | Whether to include SKU objects in the response (default false) |
| with_application? | boolean | Whether to include application objects in the SKUs (default false) |
| exclude_ended? | boolean | Whether ended entitlements should be omitted (default false) |
| entitlement_type? | integer | The type of entitlement to filter by |
Get User Giftable Entitlements
GET/users/@me/entitlements/giftsReturns a list of entitlement objects that the current user can gift.
Query String Params
| Field | Type | Description |
|---|---|---|
| country_code? | string | The user's ISO 3166-1 alpha-2 country code |
Get Guild Entitlements
GET/guilds/{guild.id}/entitlementsReturns a list of entitlement objects granted to the given guild, both active and expired.
Query String Params
| Field | Type | Description |
|---|---|---|
| with_sku? | boolean | Whether to include SKU objects in the response (default false) |
| with_application? | boolean | Whether to include application objects in the SKUs (default false) |
| exclude_ended? | boolean | Whether ended entitlements should be omitted (default false) |
| exclude_deleted? | boolean | Whether deleted entitlements should be omitted (default true) |
| entitlement_type? | integer | The type of entitlement to filter by |
Get Application Entitlements
GET/applications/{application.id}/entitlementsReturns a list of entitlement objects for the given application, both active and expired.
Query String Params
| Field | Type | Description |
|---|---|---|
| user_id? | snowflake | The ID of the user to look up entitlements for |
| sku_ids? | array[snowflake] | The IDs of the SKUs to look up entitlements for |
| guild_id? | snowflake | The ID of the guild to look up entitlements for |
| exclude_ended? | boolean | Whether ended entitlements should be omitted (default false) |
| exclude_deleted? | boolean | Whether deleted entitlements should be omitted (default true) |
| before? | snowflake | Get entitlements before this entitlement ID |
| after? | snowflake | Get entitlements after this entitlement ID |
| limit? | integer | Max number of entitlements to return (1-100, default 100) |
Get User Application Entitlements
GET/users/@me/applications/{application.id}/entitlementsReturns a list of entitlement objects granted to the current user for the given application.
Query String Params
| Field | Type | Description |
|---|---|---|
| sku_ids? | array[snowflake] | The IDs of the SKUs to look up entitlements for |
| exclude_consumed | boolean | Whether consumed entitlements should be omitted (default true) |
Get Application Entitlement
GET/applications/{application.id}/entitlements/{entitlement.id}Returns an entitlement object for the given application and entitlement ID.
Create Application Entitlement
POST/applications/{application.id}/entitlementsCreates a test entitlement to a given subscription SKU for a given guild or user. Returns an entitlement object on success. Fires an Entitlement Create Gateway event.
JSON Params
| Field | Type | Description |
|---|---|---|
| sku_id | snowflake | The ID of the SKU to grant the entitlement to |
| owner_id | snowflake | The ID of the guild or user to grant the entitlement to |
| owner_type | integer | The type of owner of the entitlement |
Entitlement Owner Type
| Value | Name | Description |
|---|---|---|
| 1 | GUILD | Entitlement is for a guild |
| 2 | USER | Entitlement is for a user |
Consume Application Entitlement
POST/applications/{application.id}/entitlements/{entitlement.id}/consumeFor one-time purchase consumable SKUs, marks a given entitlement for the user as consumed. Returns a 204 empty response on success. Fires an Entitlement Update Gateway event.
Delete Application Entitlement
DELETE/applications/{application.id}/entitlements/{entitlement.id}Deletes a currently-active test entitlement. Returns a 204 empty response on success. Fires an Entitlement Delete Gateway event.
Get Gift Code
GET/entitlements/gift-codes/{gift_code.code}Returns a gift code object for the given code.
Query String Params
| Field | Type | Description |
|---|---|---|
| with_application? | boolean | Whether to include the application object in the SKU (default false) |
| with_subscription_plan? | boolean | Whether to include the subscription plan object in the response (default false) |
Redeem Gift Code
POST/entitlements/gift-codes/{gift_code.code}/redeemRedeems a gift code for the current user. Returns an entitlement object on success. Fires an Entitlement Create and Gift Code Update Gateway event.
JSON Params
| Field | Type | Description |
|---|---|---|
| payment_source_id? | ?string | The ID of the payment source to use for the gift code redemption |
| channel_id? | ?snowflake | The ID of the channel the gift code is being redeemed in |
| gateway_checkout_context? | ?gateway checkout context object | The context for the gateway checkout, if applicable |
Get User Gift Codes
GET/users/@me/entitlements/gift-codesReturns a list of gift code objects that the current user has created.
Query String Params
| Field | Type | Description |
|---|---|---|
| sku_ids? | array[snowflake] | The IDs of the SKUs to filter by |
| subscription_plan_id? | snowflake | The ID of the subscription plan to filter by |
Create User Gift Code
POST/users/@me/entitlements/gift-codesCreates a gift code. Requires an eligible giftable entitlement. Returns a gift code object on success. Fires a Gift Code Create Gateway event.
JSON Params
| Field | Type | Description |
|---|---|---|
| sku_id | snowflake | The ID of the SKU to create a gift code for |
| subscription_plan_id? | snowflake | The ID of the subscription plan to create a gift code for |
| gift_style? | integer | The style of the gift created |
Revoke User Gift Code
DELETE/users/@me/entitlements/gift-codes/{gift_code.code}Revokes a gift code created by the current user. Returns a 204 empty response on success.
Get Application Gift Code Batches
GET/applications/{application.id}/gift-code-batchesReturns a list of gift code batch objects for the given application. User must be the owner of the application or member of the owning team.
Create Application Gift Code Batch
POST/applications/{application.id}/gift-code-batchesCreates a batch of gift codes. Returns a gift code batch object on success. User must be the owner of the application or developer of the owning team.
JSON Params
| Field | Type | Description |
|---|---|---|
| sku_id | snowflake | The ID of the SKU to create gift codes for |
| amount | integer | The number of gift codes to create (1-2500) |
| description | string | The description for the gift code batch |
| entitlement_branches? | array[snowflake] | The IDs of the application branches granted by the gift codes |
| entitlement_starts_at? | ISO8601 timestamp | When the entitlements' validity period starts |
| entitlement_ends_at? | ISO8601 timestamp | When the entitlements' validity period ends |
Get Application Gift Code Batch
GET/applications/{application.id}/gift-code-batches/{gift_code_batch.id}Returns a CSV file containing all gift codes in the given batch. User must be the owner of the application or member of the owning team.