Billing

Discord supports a variety of payment providers to enable billing for first-party and third-party monetization.

Payment Source Object

Payment Source Structure
FieldTypeDescription
idsnowflakeThe ID of the payment source
brand?stringThe brand of the payment source (only applicable for credit cards)
country?stringThe country of the payment source
last_4?stringThe last four digits of the payment source (only applicable for credit cards)
billing_address 1billing addressThe billing address of the payment source
typeintegerThe type of the payment source
payment_gatewayintegerThe payment gateway of the payment source
payment_gateway_source_id?stringThe ID of the payment source in the payment gateway
default 1booleanWhether the payment source is the default payment source
invalidbooleanWhether the payment source is invalid
flagsintegerThe payment source's flags
deleted_at?ISO8601 timestampWhen the payment source was deleted at
expires_month?integerThe month the credit card expires at
expires_year?integerThe year the credit card expires at
email?stringThe email address associated with the payment source
bank?stringThe bank associated with the payment source
username?stringThe username associated with the payment source (only applicable for Venmo)

1 Not available in payment objects.

Example Payment Source
{
"id": "1422548914485198869",
"type": 1,
"invalid": false,
"flags": 0,
"deleted_at": null,
"brand": "visa",
"last_4": "4242",
"expires_month": 9,
"expires_year": 2077,
"billing_address": {
"name": "John Doe",
"line_1": "123 Main Street",
"line_2": "Apt 4B",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postal_code": "94105"
},
"country": "US",
"payment_gateway": 1,
"payment_gateway_source_id": "pm_DwiVlGlYwe1qxLzy4QWChQeo",
"default": false
}
Billing Address Structure
FieldTypeDescription
line_1stringThe address of the location
line_2??stringThe secondary address of the location
namestringThe name of the payment source
postal_code?stringThe postal code of the location
citystringThe city of the location
state?stringThe state or province of the location
countrystringThe country of the location
Payment Source Type
ValueNameDescription
1CARDCredit card
2PAYPALPayPal
3GIROPAYGiropay
4SOFORT (deprecated)Sofort
5PRZELEWY24Przelewy24
6SEPA_DEBITSEPA debit
7PAYSAFE_CARDPaysafe
8GCASHGCash
9GRABPAY_MYGrabPay (Malaysia)
10MOMO_WALLETMoMo Wallet
11VENMOVenmo
12GOPAY_WALLETGoPay Wallet
13KAKAOPAYKakaoPay
14BANCONTACTBancontact
15EPSEPS
16IDEALiDEAL
17CASH_APPCash App
18APPLEApple Pay
19TDS_WALLETTDS Wallet
Payment Gateway
ValueNameDescription
1STRIPEStripe
2BRAINTREEBraintree
3APPLEApple
4GOOGLEGoogle
5ADYENAdyen
6APPLE_PARTNERApple Pay
7AMAZONAmazon Pay
8VIRTUAL_CURRENCY 1Orbs
9APPLE_ADVANCED_COMMERCEApple Advanced Commerce
10TDSTDS

1 Payment gateway is internal and cannot be used directly.

Payment Source Flags
ValueNameDescription
1 << 0NEWPayment source is new
1 << 1SUCCESSFUL_PAYMENTPayment source has been successfully used at least once

Gateway Checkout Context Object

Gateway Checkout Context Structure
FieldTypeDescription
braintree_device_data??stringThe Braintree device data collected during checkout

User Trial Offer Object

User Trial Offer Structure
FieldTypeDescription
idsnowflakeThe ID of the user trial offer
user_idsnowflakeThe ID of the user the offer is for
trial_idsnowflakeThe ID of the subscription trial associated with the offer
expires_at 1?ISO8601 timestampWhen the trial offer expires
subscription_trialsubscription trial objectThe subscription trial associated with the offer

1 Trial offers only gain an expiration date when they are acknowledged.

Example User Trial Offer
{
"id": "1433666591022645361",
"user_id": "852892297661906993",
"trial_id": "1073698058383917056",
"subscription_trial": {
"id": "1073698058383917056",
"interval": 3,
"interval_count": 14,
"sku_id": "521847234246082599"
},
"expires_at": "2025-11-04T07:26:18.125782+00:00"
}

User Discount Offer Object

User Discount Offer Structure
FieldTypeDescription
idsnowflakeThe ID of the user discount offer
discount_idsnowflakeThe ID of the discount associated with the offer
user_idsnowflakeThe ID of the user the offer is for
invoice_id? 1?snowflakeThe ID of the invoice the offer was applied to
created_at? 1?ISO8601 timestampWhen the offer was created
applied_at?ISO8601 timestampWhen the offer was applied
deleted_at? 1?ISO8601 timestampWhen the offer was deleted
expires_at 2?ISO8601 timestampWhen the offer expires
discountdiscount objectThe discount associated with the offer

1 These fields are only present for applied offers.

2 Discount offers only gain an expiration date when they are acknowledged.

Discount Structure
FieldTypeDescription
idsnowflakeThe ID of the discount
amountintegerThe discount amount in the smallest currency unit
starts_at??ISO8601 timestampWhen the discount starts
ends_at??ISO8601 timestampWhen the discount ends
statusintegerThe status of the discount
created_atISO8601 timestampWhen the discount was created
sku_ids?array[snowflake]The IDs of the subscription SKUs the discount applies to
sku_group_ids?array[snowflake]The IDs of the subscription SKU groups the discount applies to
plan_idsarray[snowflake]The IDs of the plans the discount applies to
user_usage_limit_intervalintegerThe interval for the usage limit
user_usage_limit_interval_countintegerThe number of intervals before the usage limit resets
user_usage_limitintegerThe maximum number of times a user can use the discount
Discount Status

The values of this enum are currently unknown. Help us by figuring them out and submitting a pull request!

Example User Discount Offer
{
"id": "1433666591022645360",
"user_id": "852892297661906993",
"discount_id": "1204865493622587392",
"applied_at": null,
"expires_at": "2025-11-04T07:26:18.125782+00:00",
"discount": {
"id": "1204865493622587392",
"amount": 30,
"starts_at": null,
"ends_at": null,
"status": 2,
"created_at": "2024-02-08T16:44:28.903181+00:00",
"sku_ids": null,
"sku_group_ids": null,
"plan_ids": ["511651880837840896"],
"user_usage_limit_interval": 3,
"user_usage_limit_interval_count": 1,
"user_usage_limit": 1
}
}

Endpoints

Get Billing Country Code

GET/users/@me/billing/country-code

Returns the user's country code based on requesting IP address.

Response Body
FieldTypeDescription
country_codestringThe ISO 3166-1 alpha-2 country code

Get Billing Location Info

GET/users/@me/billing/location-info

Returns the user's country and subdivision code based on requesting IP address.

Response Body
FieldTypeDescription
country_codestringThe ISO 3166-1 alpha-2 country code
subdivision_code?stringThe ISO 3166-2 subdivision code

Get Payment Sources

GET/users/@me/billing/payment-sources

Returns a list of payment source objects. Note that the billing_address fields within these objects will be partial for security reasons, containing only name and country.

Get Payment Source

GET/users/@me/billing/payment-sources/{payment_source.id}

Returns a payment source object for a given payment source ID.

Create Payment Source

POST/users/@me/billing/payment-sources

Creates a payment source. Returns a payment source object on success. Fires a User Payment Sources Update Gateway event.

JSON Params
FieldTypeDescription
tokenstringThe payment source token retrieved from the payment gateway
payment_gatewayintegerThe payment gateway of the payment source
billing_addressbilling address objectThe billing address of the payment source
billing_address_token?stringThe validation token obtained from the Validate Billing Address endpoint
return_url?stringThe URL to return to after the payment source is created
bank?stringThe bank information for the payment source

Modify Payment Source

PATCH/users/@me/billing/payment-sources/{payment_source.id}

Modifies a payment source. Returns an updated payment source object on success. Fires a User Payment Sources Update Gateway event.

JSON Params
FieldTypeDescription
billing_address?billing address objectThe billing address of the payment source
default?booleanWhether the payment source is the default payment source
expires_month?integerThe year the credit card expires at
expires_year?integerThe month the credit card expires at

Delete Payment Source

DELETE/users/@me/billing/payment-sources/{payment_source.id}

Deletes a payment source. Returns a 204 empty response on success. Fires a User Payment Sources Update Gateway event.

Validate Billing Address

POST/users/@me/billing/payment-sources/validate-billing-address

Validates a billing address.

FieldTypeDescription
billing_addressbilling address objectThe billing address to validate
Response Body
FieldTypeDescription
tokenstringThe token of validated billing address

Get Stripe Setup Intent Secret

POST/users/@me/billing/stripe/setup-intents

Creates a Stripe SetupIntent and returns the client secret. See the Stripe documentation for more information.

JSON Params
FieldTypeDescription
regional_payment_element_source_types?array[integer]Payment source types to use via Stripe's Payment Elements
Response Body
FieldTypeDescription
client_secretstringThe client secret of the SetupIntent

Create PayPal Billing Agreement Token

POST/users/@me/billing/paypal/billing-agreement-tokens

Creates a PayPal billing agreement and returns its token. See the PayPal documentation for more information. This token is used to redirect the user to PayPal to approve the billing agreement through a URL: https://www.paypal.com/agreements/approve?nolegacy=1&ba_token={token}

JSON Params
FieldTypeDescription
return_url 1stringThe URL to redirect to after approval (max 2048 characters)
cancel_url 1stringThe URL to redirect to after cancellation (max 2048 characters)

1 These URLs are typically set to the Create Billing Popup Bridge Redirect endpoint (with a response_type of return and cancel, respectively), which redirects the user back to the Discord client for handling.

Response Body
FieldTypeDescription
tokenstringThe token of the PayPal billing agreement

Get Available Adyen Payment Methods

GET/users/@me/billing/adyen/payment-methods

Returns available payment methods for the ADYEN payment gateway. This endpoint is a proxy for getting available payment methods for transactions using the Adyen API. See the Adyen documentation for more information.

Create Billing Popup Bridge

POST/billing/popup-bridge/{payment_source.type}

Creates a billing popup bridge to handle third-party payment flows.

Response Body
FieldTypeDescription
statestringA unique identifier for the request flow

Create Billing Popup Bridge Redirect

GET/billing/popup-bridge/{payment_source.type}/callback/{state}/{response_type}

Redirects the user back to the Discord client after completing a third-party payment flow. The client uses Create Billing Popup Bridge Callback to complete the flow.

Create Billing Popup Bridge Callback

POST/billing/popup-bridge/{payment_source.type}/callback

Completes a third-party payment flow after being redirected back from the payment provider. Returns a 204 empty response on success. Fires a Billing Popup Bridge Callback Gateway event.

JSON Params
FieldTypeDescription
statestringThe unique identifier for the request flow
pathstringThe redirect API path
query?map[string, string]Redirect query parameters
insecure?booleanWhether the callback is insecure (default false)

Get Localized Pricing Promo

GET/users/@me/billing/localized-pricing-promo

Returns localized pricing promo information for the user based on their country.

Response Body
FieldTypeDescription
country_codestringThe ISO 3166-1 alpha-2 country code
localized_pricing_promo?localized pricing promo objectThe localized pricing promo information
Localized Pricing Promo Structure
FieldTypeDescription
plan_idsnowflakeThe ID of the discounted subscription plan
country_codestringThe ISO 3166-1 alpha-2 country code
payment_source_typesarray[integer]The allowed payment source types for the promotion
pricelocalized price objectThe promotional price information
Localized Price Structure
FieldTypeDescription
currencystringThe lower-cased ISO 4217 currency code
amountintegerThe price amount in the smallest currency unit

Get User Offer

POST/users/@me/billing/user-offer

Returns the current trial and discount offers for the user, if any.

JSON Params
FieldTypeDescription
payment_gateway?integerThe payment gateway to retrieve offers for
offer_id?snowflakeThe specific discount ID to fetch the offer of
Response Body
FieldTypeDescription
user_trial_offer?user trial offer objectThe user's trial offer
user_discount_offer?user discount offer objectThe user's discount offer
user_discount?user discount offer objectThe currently applied discount offer

Acknowledge User Offer

POST/users/@me/billing/user-offer/ack

Acknowledges that the user has seen a trial or discount offer.

JSON Params
FieldTypeDescription
user_trial_offer_id?snowflakeThe ID of the trial offer to acknowledge
user_discount_offer_id?snowflakeThe ID of the discount offer to acknowledge
Response Body
FieldTypeDescription
user_trial_offer?user trial offer objectThe acknowledged trial offer
user_discount_offer??user discount offer objectThe acknowledged discount offer
user_discount??user discount offer objectThe acknowledged applied discount offer

Create Churn User Offer

POST/users/@me/billing/churn-user-offer

Creates a discount offer as a retention attempt for a user in a non-renewing state, if allowed.

Response Body
FieldTypeDescription
offeruser discount offer objectThe created discount offer

Get Churn User Offer

GET/users/@me/billing/churn-user-offer

Returns the current retention discount offer for a user in a non-renewing state, if any.

Response Body
FieldTypeDescription
offeruser discount offer objectThe current retention discount offer

Get User Trial Offer

GET/users/@me/billing/user-trial-offer

Returns a user trial offer object for the user, if any.

Acknowledge User Trial Offer

POST/users/@me/billing/user-trial-offer/{user_trial_offer.id}/ack

Acknowledges that the user has seen a trial offer. Returns the acknowledged user trial offer object on success.

Redeem User Offer

POST/users/@me/billing/user-offer/redeem

Redeems a discount offer for the user. Returns a list of applied user discount offer objects on success.

JSON Params
FieldTypeDescription
user_discount_offer_idsnowflakeThe ID of the discount offer to redeem

Get Checkout Recovery

GET/users/@me/billing/checkout-recovery

Returns whether the client should prompt the user to continue their premium purchase.

Response Body
FieldTypeDescription
is_eligible?booleanWhether the client should prompt the user for checkout recovery

Get Premium User Affinity

GET/users/@me/billing/nitro-affinity

Returns a list of up to 3 partial user objects representing friends with a premium subscription, used to entice the user to subscribe.