Documentation Index
Fetch the complete documentation index at: https://docs.dodopayments.com/llms.txt
Use this file to discover all available pages before exploring further.
The Discord entitlement adds a paying customer to your server (and optionally assigns them a role) the moment their subscription becomes active or their one-time purchase clears. Cancellation, refunds, and plan changes revoke the role automatically.
What gets delivered
- The customer connects their Discord account through an OAuth link in their delivery email or customer portal.
- Once they authorize, Dodo Payments adds them to your server (or finds their existing membership) and assigns the role you configured.
- If you didn’t pick a specific role, server membership alone is granted.
Connect Discord
Open Entitlements
In your Dodo Payments dashboard, go to Entitlements and click + to start a new entitlement.
Pick Discord
Choose Discord Access as the integration. If you have not yet connected Discord for your business, you’ll be prompted to Connect Discord.
Clicking through opens Discord in a new tab. Sign in, pick the server you want to gate, and confirm the bot’s permissions (Manage Roles, Kick Members, Create Invite) on that server.

When Discord redirects back, you’ll see a confirmation that the server is connected.




Pick a server and role
Back in the dashboard, select the server (guild) you just connected. Optionally pick a role to assign on delivery, or leave it blank to grant server membership only. Give the entitlement a name and click Create Entitlement.

Customer flow
- The customer completes checkout.
- Dodo Payments creates a grant in
pendingstatus with anoauth_urlpointing to Discord. - The customer receives an email with a “Join the Discord” button (the OAuth link). The link is also visible in their customer portal.
- After the customer authorizes, the bot adds them to the server and assigns the configured role. The grant moves to
delivered. - If the subscription is cancelled, paused, or expires, or if the merchant manually revokes, the bot removes the role and the grant moves to
revoked.
Required configuration
| Field | Required | Description |
|---|---|---|
guild_id | Yes | The Discord server ID. The dashboard picker fills this in for you. |
role_id | No | The role to assign on delivery. Omit for server-membership-only access. |
Create via API
Webhooks
Subscribe to theentitlement_grant.* webhook events to track Discord grants:
entitlement_grant.createdfires withstatus: "pending"and anoauth_urlfor the customer to authorize.entitlement_grant.deliveredfires once the role is assigned.entitlement_grant.revokedfires when the role is removed.
Troubleshooting
Customer never sees the role assigned
Customer never sees the role assigned
The grant is in
pending until the customer completes the OAuth flow. Check the entitlement’s grants list and confirm whether they clicked the OAuth link. Resend the delivery email if needed.Grant moves to failed with permission errors
Grant moves to failed with permission errors
Make sure the Dodo Payments bot remains in the server, has
Manage Roles permission, and is positioned above the role being assigned. Re-saving the entitlement re-runs validation.Customer cancelled but still has the role
Customer cancelled but still has the role
Discord propagates role removals immediately, but the customer’s local Discord client may cache. They should reconnect or refresh; server-side state is correct.