Subscriptions

Subscriptions in Discord represent an user making recurring payments for at least one SKU over an ongoing period. Successful payments grant the user access to entitlements associated with the SKU.

Subscription Object

Subscription Structure
FieldTypeDescription
idsnowflakeThe ID of the subscription
typeintegerThe type of subscription
payment_gateway?integerThe payment gateway used to bill the subscription
currencystringThe lower-cased ISO 4217 currency code
itemsarray[subscription item object]The items in the subscription
payment_gateway_plan_id?stringThe payment gateway's plan ID for the subscription
payment_gateway_subscription_id??stringThe payment gateway's subscription ID for the subscription
current_period_startISO8601 timestampWhen the current billing period started
current_period_endISO8601 timestampWhen the current billing period ends
streak_started_at?ISO8601 timestampWhen the current subscription streak started
statusintegerThe status of subscription
renewal_mutations?subscription renewal mutations objectThe mutations to the subscription that will occur after renewal
trial_id?snowflakeThe ID of the trial the subscription is from
payment_source_id?snowflakeThe ID of the payment source the subscription is paid with
created_atISO8601 timestampWhen the subscription was created
canceled_at?ISO8601 timestampWhen the subscription was canceled
country_code?stringThe ISO 3166-1 alpha-2 country code the subscription is billed in
trial_ends_at?ISO8601 timestampWhen the trial ends
metadata?subscription metadata objectExtra metadata about the subscription
latest_invoice?subscription invoice objectThe latest invoice for the subscription
use_storekit_resubscribebooleanWhether the subscription should be managed through StoreKit
price?integerThe price of the subscription (only available for certain third-party subscriptions)
entitlements?array[entitlement object]The entitlements granted by the subscription
Partial Subscription Structure
FieldTypeDescription
idsnowflakeThe ID of the subscription
typeintegerThe type of subscription
payment_gateway?integerThe payment gateway used to bill the subscription
currencystringThe lower-cased ISO 4217 currency code the subscription is billed in
itemsarray[subscription item object]The items in the subscription
payment_gateway_plan_id?stringThe payment gateway's plan ID for the subscription
payment_gateway_subscription_id??stringThe payment gateway's subscription ID for the subscription
current_period_startISO8601 timestampWhen the current billing period started
current_period_endISO8601 timestampWhen the current billing period ends
streak_started_at?ISO8601 timestampWhen the current subscription streak started
Subscription Type
ValueNameDescription
1PREMIUMSubscription is a Discord premium (Nitro) subscription
2GUILDSubscription is a guild role subscription
3APPLICATIONSubscription is an application subscription
Subscription Status
ValueNameDescription
0UNPAIDSubscription is unpaid
1ACTIVESubscription is active
2PAST_DUESubscription is past due
3CANCELEDSubscription is canceled
4ENDEDSubscription has ended
6ACCOUNT_HOLDSubscription is on account hold
7BILLING_RETRYSubscription failed to bill and will retry
8PAUSEDSubscription is paused
9PAUSE_PENDINGSubscription is pending pause
Subscription Item Structure
FieldTypeDescription
idsnowflakeThe ID of the subscription item
quantityintegerHow many of the items have been/are being purchased
plan_idsnowflakeThe ID of the plan the item is for
Subscription Renewal Mutations Structure
FieldTypeDescription
payment_gateway_plan_id??stringThe payment gateway's new plan ID for the subscription
items?array[subscription item object]The new items of the subscription
Subscription Metadata Structure
FieldTypeDescription
is_egs?booleanWhether the subscription was received from an Epic Games store trial
is_holiday_promotion_2021?booleanWhether the subscription was received from 2021 Holiday promotion
ended_at?stringWhen the subscription ended
guild_id? (deprecated)snowflakeThe ID of the guild the subscription's entitlements apply to
application_subscription_guild_id?snowflakeThe ID of the guild the subscription's entitlements apply to
grace_period_expires_date?ISO8601 timestampWhen the grace period expires
apple_grace_period_expires_date?ISO8601 timestampWhen the grace period expires (only applicable for APPLE payment gateway)
google_grace_period_expires_date?ISO8601 timestampWhen the grace period expires (only applicable for GOOGLE payment gateway)
google_original_expires_date?stringWhen the subscription expires, disregarding the grace period (only applicable for GOOGLE payment gateway)
user_trial_offer_id?snowflakeThe ID of the user trial offer on the subscription
user_discount_offer_id?snowflakeThe ID of the user discount offer on the subscription
active_discount_id?snowflakeThe ID of the discount on the subscription
active_discount_expires_at?ISO8601 timestampWhen the subscription discount expires

Subscription Trial Object

Subscription Trial Structure
FieldTypeDescription
idsnowflakeThe ID of the trial
intervalintegerThe interval of the trial plan
interval_countintegerThe number of intervals included in the trial
sku_idsnowflakeThe ID of the SKU the trial is for
Example Subscription Trial
{
"id": "1073698058383917056",
"interval": 3,
"interval_count": 14,
"sku_id": "521847234246082599"
}

Premium Guild Subscription Slot Object

Represents a premium guild subscription (boost) slot.

Premium Guild Subscription Slot Structure
FieldTypeDescription
idsnowflakeThe ID of the premium guild subscription slot
subscription_idsnowflakeThe ID of the subscription
canceledbooleanWhether the premium guild subscription slot was canceled
cooldown_ends_at?stringWhen the cooldown for this premium guild subscription slot ends
premium_guild_subscription?premium guild subscription objectThe premium guild subscription, if the slot was already applied
Example Premium Guild Subscription Slot
{
"id": "1315132642890350601",
"subscription_id": "1315132642890350600",
"canceled": false,
"cooldown_ends_at": null,
"premium_guild_subscription": {
"id": "1315132642890350602",
"user_id": "673658900435697665",
"guild_id": "1081635484209520802",
"ended": false,
"pause_ends_at": null,
"user": {
"id": "673658900435697665",
"username": "android",
"global_name": "Android",
"avatar": "08f104f8d5406c4d46916794fe2efeb7",
"avatar_decoration_data": {
"asset": "a_8552f9857793aed0cf816f370e2df3be",
"sku_id": "1232071712695386162",
"expires_at": null
},
"collectibles": null,
"discriminator": "0",
"public_flags": 4194560,
"primary_guild": null
}
}
}

Endpoints

Get Subscriptions

GET/users/@me/billing/subscriptions

Returns a list of subscription objects.

Query String Params
FieldTypeDescription
include_inactive?booleanWhether to include inactive subscriptions (default false)
limit?integerMax number of subscriptions to return (1-20, default unlimited)
exclude_unpaid_statuses?booleanWhether to exclude subscriptions of UNPAID status (default false)
subscription_type?integerReturn only subscriptions with the specified type
sync_level?integerThe sync level (default NONE)
User Lazy Perk Sync Level
ValueNameDescription
0NONEDo not resync anything
1ADD_PERKS_IF_DETECTEDAdd perks if detected
2FULL_RESYNCFully resync perks

Get Subscription

GET/users/@me/billing/subscriptions/{subscription.id}

Returns a subscription object for the given subscription ID.

Create Subscription

POST/users/@me/billing/subscriptions

Creates a new subscription. Returns a subscription object on success. Fires a User Subscriptions Update and Payment Update Gateway event.

JSON Params
FieldTypeDescription
items 1array[partial subscription item object]The items in the subscription
payment_source_id?snowflakeThe ID of the payment source to pay with
payment_source_token??stringThe token used to authorize with the payment source
return_url? 2?stringTThe URL to redirect to after payment is complete (max 2048 characters)
currency?stringThe lower-cased ISO 4217 currency code
trial_id??snowflakeThe ID of the trial to apply to the subscription
expected_invoice_price? 3?expected price structure objectThe expected price for the invoice in the smallest currency unit
expected_renewal_price? 3?expected price structure objectThe expected renewal price in the smallest currency unit
purchase_token 4stringThe purchase token of the payment client (max 1024 characters)
gateway_checkout_context??gateway checkout context objectThe context for the gateway checkout, if applicable
code?stringUnknown
metadata?subscription metadata request objectExtra metadata about the subscription
load_id?stringA client-generated UUID used to identify the current checkout session, used for purchase deduplication

1 Only the plan_id field is required.

2 If required, this URL is typically set to the Create Billing Popup Bridge Redirect endpoint with a response_type of success, which redirects the user back to the Discord client for handling.

3 If the actual amount charged does not match these expected values, the purchase will fail.

4 See the section on payment clients for more information.

Expected Price Structure
FieldTypeDescription
currencystringThe lower-cased ISO 4217 currency code
amountintegerThe price amount in the smallest currency unit
Subscription Metadata Request Structure
FieldTypeDescription
guild_id?snowflakeThe ID of the guild the subscription's entitlements will apply to

Modify Subscription

PATCH/users/@me/billing/subscriptions/{subscription.id}

Modifies a subscription. Returns the updated subscription object on success. Fires a User Subscriptions Update Gateway event.

Query String Params
FieldTypeDescription
location?stringThe analytics location the request initiated from
location_stack?stringThe stack of analytics locations the request initiated from
JSON Params
FieldTypeDescription
items? 1array[partial subscription item object]The items in the subscription
payment_source_id?snowflakeThe ID of the payment source to pay with
payment_source_token?stringThe token used to authorize with the payment source
return_url? 2?stringTThe URL to redirect to after payment is complete (max 2048 characters)
currency?stringThe lower-cased ISO 4217 currency code
status?integerThe status of subscription
pause_duration?integerThe duration to pause the subscription for, in days
expected_invoice_price? 3?expected price structure objectThe expected price for the invoice in the smallest currency unit
expected_renewal_price? 3?expected price structure objectThe expected renewal price in the smallest currency unit
purchase_token? 4stringThe purchase token of the payment client (max 1024 characters)
gateway_checkout_context??gateway checkout context objectThe context for the gateway checkout, if applicable
load_id?stringA client-generated UUID used to identify the current checkout session, used for purchase deduplication

1 Only the plan_id field is required.

2 If required, this URL is typically set to the Create Billing Popup Bridge Redirect endpoint with a response_type of success, which redirects the user back to the Discord client for handling.

3 If the actual amount charged does not match these expected values, the purchase will fail.

4 See the section on payment clients for more information.

Delete Subscription

DELETE/users/@me/billing/subscriptions/{subscription.id}

Deletes a subscription. Returns a 204 empty response on success. Fires a User Subscriptions Update Gateway event.

Query String Params
FieldTypeDescription
location?stringThe analytics location the request initiated from
location_stack?stringThe stack of analytics locations the request initiated from

Create Subscription Preview

POST/users/@me/billing/subscriptions/preview

Previews a new subscription. Returns an invoice object on success.

JSON Params
FieldTypeDescription
items 1array[partial subscription item object]The items in the subscription
currency?stringThe lower-cased ISO 4217 currency code
payment_source_id??snowflakeThe ID of the payment source to pay with
trial_id??snowflakeThe ID of the trial to apply to the subscription
apply_entitlements?booleanWhether to apply entitlements (credits) to the previewed subscription
renewal?booleanWhether the previewed subscription should be a renewal
code?stringUnknown
metadata?map[string, any]Extra metadata about the subscription

1 Only the plan_id field is required.

Get Subscription Preview

GET/users/@me/billing/subscriptions/{subscription.id}/preview

Returns an invoice object representing the next upcoming invoice for the subscription.

Modify Subscription Preview

PATCH/users/@me/billing/subscriptions/{subscription.id}/preview

Previews an invoice for the given subscription ID. Returns an invoice on success.

JSON Params
FieldTypeDescription
items? 1array[partial subscription item object]The items the previewed invoice should have
payment_source_id?snowflakeThe ID of the payment source the previewed invoice should be paid with
currency?stringThe lower-cased ISO 4217 currency code
apply_entitlements?booleanWhether to apply entitlements (credits) to the previewed invoice
renewal?booleanWhether the previewed invoice should be a renewal
user_discount_offer_id?snowflakeThe ID of the discount offer to apply to the previewed invoice

1 Only the plan_id field is required.

Get Subscription Invoices

GET/users/@me/billing/subscriptions/{subscription.id}/invoices

Returns a list of invoice objects for the given subscription ID.

Pay Subscription Invoice

POST/users/@me/billing/subscriptions/{subscription.id}/invoices/{subscription_invoice.id}/pay

Pays the subscription invoice. Returns a subscription object on success.

JSON Params
FieldTypeDescription
payment_source_id?snowflakeThe ID of the payment source the invoice should be paid with
payment_source_token?stringThe token used to authorize with the payment source
currency?stringThe lower-cased ISO 4217 currency code to pay with
return_url?stringThe URL to return to after the payment is complete

Claim Subscription Promotion Reward

POST/users/@me/billing/subscriptions/{subscription.id}/promotion-reward

Claims a promotion reward from the given subscription.

Response Body
FieldTypeDescription
eligiblebooleanWhether the subscription is eligible for the reward
reasonstringThe reason whether the subscription is eligible
entitlement?entitlement objectThe granted reward entitlement
Subscription Promotion Reward Eligibility Reason
ValueDescription
user_eligible_for_rewardUser is eligible for reward
user_not_eligible_for_experimentUser is not eligible for relevant experiment

Get Premium Guild Subscription Cooldown

GET/users/@me/guilds/premium/subscriptions/cooldown

Returns the cooldown for premium guild subscription slot changes.

Response Body
FieldTypeDescription
ends_atISO8601 timestampWhen the cooldown resets
limitintegerThe maximum number of changes that can be made before the cooldown is applied
remainingintegerThe number of changes remaining before the cooldown is applied

Get Applied Premium Guild Subscriptions

GET/users/@me/guilds/premium/subscriptions

Returns a list of premium guild subscription objects applied by the current user.

Query String Params
FieldTypeDescription
paused?booleanWhether to return only paused premium guild subscriptions (default false)

Get Premium Guild Subscription Slots

GET/users/@me/guilds/premium/subscription-slots

Returns a list of premium guild subscription slot objects for the current user.

Cancel Premium Guild Subscription Slot

POST/users/@me/guilds/premium/subscription-slots/{premium_guild_subscription_slot.id}/cancel

Cancels the given premium guild subscription slot. Returns the canceled premium guild subscription slot object. Fires User Premium Guild Subscription Slot Update and optionally Guild Applied Boosts Update Gateway events.

Uncancel Premium Guild Subscription Slot

POST/users/@me/guilds/premium/subscription-slots/{premium_guild_subscription_slot.id}/uncancel

Uncancels the given premium guild subscription slot. Returns the uncanceled premium guild subscription slot object. Fires a User Premium Guild Subscription Slot Update Gateway event.