Billing
Discord supports a variety of payment providers to enable billing for first-party and third-party monetization.
Payment Source Object
Payment Source Structure
| Field | Type | Description |
|---|---|---|
| id | snowflake | The ID of the payment source |
| brand? | string | The brand of the payment source (only applicable for credit cards) |
| country? | string | The country of the payment source |
| last_4? | string | The last four digits of the payment source (only applicable for credit cards) |
| billing_address 1 | billing address | The billing address of the payment source |
| type | integer | The type of the payment source |
| payment_gateway | integer | The payment gateway of the payment source |
| payment_gateway_source_id? | string | The ID of the payment source in the payment gateway |
| default 1 | boolean | Whether the payment source is the default payment source |
| invalid | boolean | Whether the payment source is invalid |
| flags | integer | The payment source's flags |
| deleted_at | ?ISO8601 timestamp | When the payment source was deleted at |
| expires_month? | integer | The month the credit card expires at |
| expires_year? | integer | The year the credit card expires at |
| email? | string | The email address associated with the payment source |
| bank? | string | The bank associated with the payment source |
| username? | string | The 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
| Field | Type | Description |
|---|---|---|
| line_1 | string | The address of the location |
| line_2? | ?string | The secondary address of the location |
| name | string | The name of the payment source |
| postal_code? | string | The postal code of the location |
| city | string | The city of the location |
| state? | string | The state or province of the location |
| country | string | The country of the location |
Payment Source Type
| Value | Name | Description |
|---|---|---|
| 1 | CARD | Credit card |
| 2 | PAYPAL | PayPal |
| 3 | GIROPAY | Giropay |
| 4 | SOFORT (deprecated) | Sofort |
| 5 | PRZELEWY24 | Przelewy24 |
| 6 | SEPA_DEBIT | SEPA debit |
| 7 | PAYSAFE_CARD | Paysafe |
| 8 | GCASH | GCash |
| 9 | GRABPAY_MY | GrabPay (Malaysia) |
| 10 | MOMO_WALLET | MoMo Wallet |
| 11 | VENMO | Venmo |
| 12 | GOPAY_WALLET | GoPay Wallet |
| 13 | KAKAOPAY | KakaoPay |
| 14 | BANCONTACT | Bancontact |
| 15 | EPS | EPS |
| 16 | IDEAL | iDEAL |
| 17 | CASH_APP | Cash App |
| 18 | APPLE | Apple Pay |
| 19 | TDS_WALLET | TDS Wallet |
Payment Gateway
| Value | Name | Description |
|---|---|---|
| 1 | STRIPE | Stripe |
| 2 | BRAINTREE | Braintree |
| 3 | APPLE | Apple |
| 4 | ||
| 5 | ADYEN | Adyen |
| 6 | APPLE_PARTNER | Apple Pay |
| 7 | AMAZON | Amazon Pay |
| 8 | VIRTUAL_CURRENCY 1 | Orbs |
| 9 | APPLE_ADVANCED_COMMERCE | Apple Advanced Commerce |
| 10 | TDS | TDS |
1 Payment gateway is internal and cannot be used directly.
Payment Source Flags
| Value | Name | Description |
|---|---|---|
| 1 << 0 | NEW | Payment source is new |
| 1 << 1 | SUCCESSFUL_PAYMENT | Payment source has been successfully used at least once |
Gateway Checkout Context Object
Gateway Checkout Context Structure
| Field | Type | Description |
|---|---|---|
| braintree_device_data? | ?string | The Braintree device data collected during checkout |
User Trial Offer Object
User Trial Offer Structure
| Field | Type | Description |
|---|---|---|
| id | snowflake | The ID of the user trial offer |
| user_id | snowflake | The ID of the user the offer is for |
| trial_id | snowflake | The ID of the subscription trial associated with the offer |
| expires_at 1 | ?ISO8601 timestamp | When the trial offer expires |
| subscription_trial | subscription trial object | The 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
| Field | Type | Description |
|---|---|---|
| id | snowflake | The ID of the user discount offer |
| discount_id | snowflake | The ID of the discount associated with the offer |
| user_id | snowflake | The ID of the user the offer is for |
| invoice_id? 1 | ?snowflake | The ID of the invoice the offer was applied to |
| created_at? 1 | ?ISO8601 timestamp | When the offer was created |
| applied_at | ?ISO8601 timestamp | When the offer was applied |
| deleted_at? 1 | ?ISO8601 timestamp | When the offer was deleted |
| expires_at 2 | ?ISO8601 timestamp | When the offer expires |
| discount | discount object | The 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
| Field | Type | Description |
|---|---|---|
| id | snowflake | The ID of the discount |
| amount | integer | The discount amount in the smallest currency unit |
| starts_at? | ?ISO8601 timestamp | When the discount starts |
| ends_at? | ?ISO8601 timestamp | When the discount ends |
| status | integer | The status of the discount |
| created_at | ISO8601 timestamp | When 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_ids | array[snowflake] | The IDs of the plans the discount applies to |
| user_usage_limit_interval | integer | The interval for the usage limit |
| user_usage_limit_interval_count | integer | The number of intervals before the usage limit resets |
| user_usage_limit | integer | The 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-codeReturns the user's country code based on requesting IP address.
Response Body
| Field | Type | Description |
|---|---|---|
| country_code | string | The ISO 3166-1 alpha-2 country code |
Get Billing Location Info
GET/users/@me/billing/location-infoReturns the user's country and subdivision code based on requesting IP address.
Response Body
| Field | Type | Description |
|---|---|---|
| country_code | string | The ISO 3166-1 alpha-2 country code |
| subdivision_code | ?string | The ISO 3166-2 subdivision code |
Get Payment Sources
GET/users/@me/billing/payment-sourcesReturns 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-sourcesCreates a payment source. Returns a payment source object on success. Fires a User Payment Sources Update Gateway event.
JSON Params
| Field | Type | Description |
|---|---|---|
| token | string | The payment source token retrieved from the payment gateway |
| payment_gateway | integer | The payment gateway of the payment source |
| billing_address | billing address object | The billing address of the payment source |
| billing_address_token? | string | The validation token obtained from the Validate Billing Address endpoint |
| return_url? | string | The URL to return to after the payment source is created |
| bank? | string | The 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
| Field | Type | Description |
|---|---|---|
| billing_address? | billing address object | The billing address of the payment source |
| default? | boolean | Whether the payment source is the default payment source |
| expires_month? | integer | The year the credit card expires at |
| expires_year? | integer | The 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-addressValidates a billing address.
| Field | Type | Description |
|---|---|---|
| billing_address | billing address object | The billing address to validate |
Response Body
| Field | Type | Description |
|---|---|---|
| token | string | The token of validated billing address |
Get Stripe Setup Intent Secret
POST/users/@me/billing/stripe/setup-intentsCreates a Stripe SetupIntent and returns the client secret. See the Stripe documentation for more information.
JSON Params
| Field | Type | Description |
|---|---|---|
| regional_payment_element_source_types? | array[integer] | Payment source types to use via Stripe's Payment Elements |
Response Body
| Field | Type | Description |
|---|---|---|
| client_secret | string | The client secret of the SetupIntent |
Create PayPal Billing Agreement Token
POST/users/@me/billing/paypal/billing-agreement-tokensCreates 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
| Field | Type | Description |
|---|---|---|
| return_url 1 | string | The URL to redirect to after approval (max 2048 characters) |
| cancel_url 1 | string | The 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
| Field | Type | Description |
|---|---|---|
| token | string | The token of the PayPal billing agreement |
Get Available Adyen Payment Methods
GET/users/@me/billing/adyen/payment-methodsReturns 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
| Field | Type | Description |
|---|---|---|
| state | string | A 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}/callbackCompletes 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
| Field | Type | Description |
|---|---|---|
| state | string | The unique identifier for the request flow |
| path | string | The redirect API path |
| query? | map[string, string] | Redirect query parameters |
| insecure? | boolean | Whether the callback is insecure (default false) |
Get Localized Pricing Promo
GET/users/@me/billing/localized-pricing-promoReturns localized pricing promo information for the user based on their country.
Response Body
| Field | Type | Description |
|---|---|---|
| country_code | string | The ISO 3166-1 alpha-2 country code |
| localized_pricing_promo | ?localized pricing promo object | The localized pricing promo information |
Localized Pricing Promo Structure
| Field | Type | Description |
|---|---|---|
| plan_id | snowflake | The ID of the discounted subscription plan |
| country_code | string | The ISO 3166-1 alpha-2 country code |
| payment_source_types | array[integer] | The allowed payment source types for the promotion |
| price | localized price object | The promotional price information |
Localized Price Structure
| Field | Type | Description |
|---|---|---|
| currency | string | The lower-cased ISO 4217 currency code |
| amount | integer | The price amount in the smallest currency unit |
Get User Offer
POST/users/@me/billing/user-offerReturns the current trial and discount offers for the user, if any.
JSON Params
| Field | Type | Description |
|---|---|---|
| payment_gateway? | integer | The payment gateway to retrieve offers for |
| offer_id? | snowflake | The specific discount ID to fetch the offer of |
Response Body
| Field | Type | Description |
|---|---|---|
| user_trial_offer | ?user trial offer object | The user's trial offer |
| user_discount_offer | ?user discount offer object | The user's discount offer |
| user_discount | ?user discount offer object | The currently applied discount offer |
Acknowledge User Offer
POST/users/@me/billing/user-offer/ackAcknowledges that the user has seen a trial or discount offer.
JSON Params
| Field | Type | Description |
|---|---|---|
| user_trial_offer_id? | snowflake | The ID of the trial offer to acknowledge |
| user_discount_offer_id? | snowflake | The ID of the discount offer to acknowledge |
Response Body
| Field | Type | Description |
|---|---|---|
| user_trial_offer | ?user trial offer object | The acknowledged trial offer |
| user_discount_offer? | ?user discount offer object | The acknowledged discount offer |
| user_discount? | ?user discount offer object | The acknowledged applied discount offer |
Create Churn User Offer
POST/users/@me/billing/churn-user-offerCreates a discount offer as a retention attempt for a user in a non-renewing state, if allowed.
Response Body
| Field | Type | Description |
|---|---|---|
| offer | user discount offer object | The created discount offer |
Get Churn User Offer
GET/users/@me/billing/churn-user-offerReturns the current retention discount offer for a user in a non-renewing state, if any.
Response Body
| Field | Type | Description |
|---|---|---|
| offer | user discount offer object | The current retention discount offer |
Get User Trial Offer
GET/users/@me/billing/user-trial-offerReturns 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}/ackAcknowledges 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/redeemRedeems a discount offer for the user. Returns a list of applied user discount offer objects on success.
JSON Params
| Field | Type | Description |
|---|---|---|
| user_discount_offer_id | snowflake | The ID of the discount offer to redeem |
Get Checkout Recovery
GET/users/@me/billing/checkout-recoveryReturns whether the client should prompt the user to continue their premium purchase.
Response Body
| Field | Type | Description |
|---|---|---|
| is_eligible? | boolean | Whether the client should prompt the user for checkout recovery |
Get Premium User Affinity
GET/users/@me/billing/nitro-affinityReturns a list of up to 3 partial user objects representing friends with a premium subscription, used to entice the user to subscribe.