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
FieldTypeDescription
idsnowflakeThe ID of the entitlement
typeintegerThe type of entitlement
sku_idsnowflakeThe ID of the SKU granted
application_idsnowflakeThe ID of the application that owns the SKU
user_idsnowflakeThe ID of the user that is granted access to the SKU
user?partial user objectThe user that is granted access to the SKU
guild_id?snowflakeThe ID of the guild that is granted access to the SKU
parent_id?snowflakeThe ID of the parent entitlement
deletedbooleanWhether the entitlement is deleted
consumed?booleanFor consumable items, whether the entitlement has been consumed
branches?array[snowflake]The IDs of the application branches granted
starts_at?ISO8601 timestampWhen the entitlement validity period starts
ends_at?ISO8601 timestampWhen the entitlement validity period ends
promotion_id?snowflakeThe ID of the promotion the entitlement is from
subscription_id?snowflakeThe ID of the subscription the entitlement is from
gift_code_flagsintegerThe flags for the gift code the entitlement is attached to
gift_code_batch_id?snowflakeThe ID of the batch the gift code attached to the entitlement is from
gifter_user_id?snowflakeThe ID of the user that gifted the entitlement
gift_style?integerThe style of the gift attached to the entitlement
fulfillment_status?integerThe tenant fulfillment status of the entitlement
fulfilled_at?ISO8601 timestampWhen the entitlement was fulfilled
source_type?integerThe special source type of the entitlement
tenant_metadata?tenant metadata objectTenant metadata for the entitlement
sku?SKU objectThe SKU granted
subscription_plan?partial subscription plan objectThe subscription plan granted
Tenant Metadata Structure
FieldTypeDescription
quest_rewardsquest rewards metadata objectMetadata about the quest rewards granted by the entitlement
Quest Rewards Metadata Structure
FieldTypeDescription
tagintegerThe reward type of the entitlement
reward_code?quest reward code objectThe reward granted by the entitlement
Entitlement Type
ValueNameDescription
1PURCHASEEntitlement was purchased by a user
2PREMIUM_SUBSCRIPTIONEntitlement is for a premium (Nitro) subscription
3DEVELOPER_GIFTEntitlement was gifted by a developer
4TEST_MODE_PURCHASEEntitlement was purchased by a developer in application test mode
5FREE_PURCHASEEntitlement was granted when the SKU was free
6USER_GIFTEntitlement was gifted by another user
7PREMIUM_PURCHASEEntitlement was claimed for free via a premium subscription
8APPLICATION_SUBSCRIPTIONEntitlement is for an application subscription
9FREE_STAFF_PURCHASEEntitlement was claimed for free by a Discord employee
10QUEST_REWARDEntitlement was granted as a reward for completing a quest
11FRACTIONAL_REDEMPTIONEntitlement is for a fractional premium subscription
12VIRTUAL_CURRENCY_REDEMPTIONEntitlement was purchased with virtual currency (Orbs)
13GUILD_POWERUPEntitlement was purchased with premium guild subscriptions (boosts)
Entitlement Fulfillment Status
ValueNameDescription
0UNKNOWNUnknown fulfillment status
1FULFILLMENT_NOT_NEEDEDFulfillment is not needed for this entitlement
2FULFILLMENT_NEEDEDFulfillment is needed for this entitlement
3FULFILLEDEntitlement has been fulfilled
4FULFILLMENT_FAILEDFulfillment of the entitlement has failed
5UNFULFILLMENT_NEEDEDUnfulfillment is needed for this entitlement
6UNFULFILLEDEntitlement has been unfulfilled
7UNFULFILLMENT_FAILEDUnfulfillment of the entitlement has failed
8UNFULFILLMENT_NEEDED_MANUALManual unfulfillment is needed for this entitlement
Entitlement Source Type
ValueNameDescription
1QUEST_REWARDEntitlement was granted as a reward for completing a quest
2DEVELOPER_GIFTEntitlement was gifted by a developer
3INVOICEEntitlement was granted via an invoice
4REVERSE_TRIALEntitlement was granted as part of a reverse trial
5USER_GIFTEntitlement was gifted by another user
6GUILD_POWERUPEntitlement was granted via the guild powerups feature
7HOLIDAY_PROMOTIONEntitlement was granted as part of a first-party promotion
8FRACTIONAL_PREMIUM_GIVEBACKUnknown
9SUBSCRIPTIONEntitlement is for a subscription holder
11SUBSCRIPTION_MEMBEREntitlement 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
FieldTypeDescription
codestringThe gift code
sku_idsnowflakeThe ID of the SKU that the gift code grants
application_idsnowflakeThe ID of the application that owns the SKU
flags?integerThe flags for the gift code
usesintegerThe number of times the gift code has been used
max_usesintegerThe maximum number of times the gift code can be used
redeemedbooleanWhether the gift code has been redeemed by the current user
expires_at?ISO8601 timestampWhen the gift code expires
batch_id?snowflakeThe 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??integerThe style of the gift code
user?partial user objectThe user that created the gift code
store_listing?store listing objectThe store listing for the SKU the gift code grants
subscription_plan_id?snowflakeThe ID of the subscription plan the gift code grants
subscription_plan?subscription plan objectThe subscription plan the gift code grants
subscription_trial?subscription trial objectThe subscription trial the gift code is from
promotion?promotion objectThe promotion the gift code is from
Gift Code Flags
ValueNameDescription
1 << 0PAYMENT_SOURCE_REQUIREDGift requires a payment source to redeem
1 << 1EXISTING_SUBSCRIPTION_DISALLOWEDGift cannot be redeemed by users with existing premium subscriptions
1 << 2NOT_SELF_REDEEMABLEGift cannot be redeemed by the gifter
1 << 3PROMOTIONGift is from a promotion
Gift Style
ValueNameDescription
1SNOWGLOBESnowglobe style gift code
2BOXBox style gift code
3CUPCup style gift code
4STANDARD_BOXStandard box style gift code
5CAKECake style gift code
6CHESTChest style gift code
7COFFEECoffee style gift code
8SEASONAL_STANDARD_BOXSeasonal standard box style gift code
9SEASONAL_CAKESeasonal cake style gift code
10SEASONAL_CHESTSeasonal chest style gift code
11SEASONAL_COFFEESeasonal coffee style gift code
12NITROWEEN_STANDARDNitroween 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
FieldTypeDescription
idsnowflakeThe ID of the gift code batch
sku_idsnowflakeThe ID of the SKU for the gift code batch
amountintegerThe number of gift codes in the batch
description?stringThe description for the gift code batch
entitlement_branches?array[snowflake]The IDs of the application branches granted
entitlement_starts_at?ISO8601 timestampWhen the entitlements' validity period starts
entitlement_ends_at?ISO8601 timestampWhen 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/entitlements

Returns a list of entitlement objects granted to the current user, both active and expired.

Query String Params
FieldTypeDescription
with_sku?booleanWhether to include SKU objects in the response (default false)
with_application?booleanWhether to include application objects in the SKUs (default false)
exclude_ended?booleanWhether ended entitlements should be omitted (default false)
entitlement_type?integerThe type of entitlement to filter by

Get User Giftable Entitlements

GET/users/@me/entitlements/gifts

Returns a list of entitlement objects that the current user can gift.

Query String Params
FieldTypeDescription
country_code?stringThe user's ISO 3166-1 alpha-2 country code

Get Guild Entitlements

GET/guilds/{guild.id}/entitlements

Returns a list of entitlement objects granted to the given guild, both active and expired.

Query String Params
FieldTypeDescription
with_sku?booleanWhether to include SKU objects in the response (default false)
with_application?booleanWhether to include application objects in the SKUs (default false)
exclude_ended?booleanWhether ended entitlements should be omitted (default false)
exclude_deleted?booleanWhether deleted entitlements should be omitted (default true)
entitlement_type?integerThe type of entitlement to filter by

Get Application Entitlements

GET/applications/{application.id}/entitlements

Returns a list of entitlement objects for the given application, both active and expired.

Query String Params
FieldTypeDescription
user_id?snowflakeThe 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?snowflakeThe ID of the guild to look up entitlements for
exclude_ended?booleanWhether ended entitlements should be omitted (default false)
exclude_deleted?booleanWhether deleted entitlements should be omitted (default true)
before?snowflakeGet entitlements before this entitlement ID
after?snowflakeGet entitlements after this entitlement ID
limit?integerMax number of entitlements to return (1-100, default 100)

Get User Application Entitlements

GET/users/@me/applications/{application.id}/entitlements

Returns a list of entitlement objects granted to the current user for the given application.

Query String Params
FieldTypeDescription
sku_ids?array[snowflake]The IDs of the SKUs to look up entitlements for
exclude_consumedbooleanWhether 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}/entitlements

Creates 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
FieldTypeDescription
sku_idsnowflakeThe ID of the SKU to grant the entitlement to
owner_idsnowflakeThe ID of the guild or user to grant the entitlement to
owner_typeintegerThe type of owner of the entitlement
Entitlement Owner Type
ValueNameDescription
1GUILDEntitlement is for a guild
2USEREntitlement is for a user

Consume Application Entitlement

POST/applications/{application.id}/entitlements/{entitlement.id}/consume

For 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
FieldTypeDescription
with_application?booleanWhether to include the application object in the SKU (default false)
with_subscription_plan?booleanWhether to include the subscription plan object in the response (default false)

Redeem Gift Code

POST/entitlements/gift-codes/{gift_code.code}/redeem

Redeems 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
FieldTypeDescription
payment_source_id??stringThe ID of the payment source to use for the gift code redemption
channel_id??snowflakeThe ID of the channel the gift code is being redeemed in
gateway_checkout_context??gateway checkout context objectThe context for the gateway checkout, if applicable

Get User Gift Codes

GET/users/@me/entitlements/gift-codes

Returns a list of gift code objects that the current user has created.

Query String Params
FieldTypeDescription
sku_ids?array[snowflake]The IDs of the SKUs to filter by
subscription_plan_id?snowflakeThe ID of the subscription plan to filter by

Create User Gift Code

POST/users/@me/entitlements/gift-codes

Creates a gift code. Requires an eligible giftable entitlement. Returns a gift code object on success. Fires a Gift Code Create Gateway event.

JSON Params
FieldTypeDescription
sku_idsnowflakeThe ID of the SKU to create a gift code for
subscription_plan_id?snowflakeThe ID of the subscription plan to create a gift code for
gift_style?integerThe 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-batches

Returns 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-batches

Creates 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
FieldTypeDescription
sku_idsnowflakeThe ID of the SKU to create gift codes for
amountintegerThe number of gift codes to create (1-2500)
descriptionstringThe 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 timestampWhen the entitlements' validity period starts
entitlement_ends_at?ISO8601 timestampWhen 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.