Discord Integration
Available via: Dashboard only (configuration)
Overview
The Discord integration lets you:
- Assign roles to subscribers based on their subscription offer
- Remove roles when a subscription is canceled or expires
- Send notifications to Discord channels for payment and subscription events
- Allow customers to link their Discord account to their subscription
How It Works
Inflow runs a global Discord bot that you invite to your server. Once connected, the bot can:
- Assign a specific role to users who have an active subscription.
- Auto-assign roles when new members join (if they have an existing subscription).
- Remove roles when subscriptions end (via a cleanup cron job).
- Post notifications in configured channels.
Setup
Step 1: Invite the Bot
- Go to Settings > Integrations in your Inflow Dashboard.
- Click Discord > Get Invite Link.
- Click the invite URL to add the Inflow bot to your Discord server.
- Grant the required permissions (Manage Roles, Send Messages).
Step 2: Configure the Bot
After the bot joins your server:
- Go back to your Inflow Dashboard > Discord settings.
- Select your Discord Server (Guild).
- Configure notification channels:
- Payment Channel — Receives payment success/failure notifications
- General Channel — Receives general subscription notifications
- Set your Discord Invite URL — the link customers will use to join your server.
- Toggle notification preferences:
- Payment success notifications
- Payment failure notifications
- Subscription created notifications
- Subscription canceled notifications
Step 3: Link Roles to Subscription Offers
When creating or editing a subscription offer:
- Enter the Discord Guild ID (your server ID).
- Enter the Discord Role ID (the role to assign to subscribers).
You can find these IDs by enabling Developer Mode in Discord, then right-clicking on the server or role.
# Example: Creating an offer with Discord role
curl -X POST https://api.inflowpay.xyz/subscription/offer \
-H "X-Inflow-Api-Key: inflow_priv_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "VIP Plan",
"description": "Access to VIP Discord channels",
"amountInCents": 999,
"currency": "EUR",
"interval": "month",
"intervalCount": 1,
"discordGuildId": "123456789012345678",
"discordRoleId": "987654321098765432"
}'Customer Flow
- Customer subscribes through a subscription link.
- During or after checkout, they are prompted to connect their Discord account (via OAuth).
- Once connected, the Inflow bot automatically assigns the configured role in your server.
- If the customer is not yet in your server, they receive a link to join. The role is assigned when they join.
- When the subscription ends, the role is automatically removed.
Customer Portal
Customers can also connect or disconnect their Discord account from the customer self-service portal:
- Connect Discord — Initiates Discord OAuth and links their account
- Disconnect Discord — Removes the Discord link (role is removed)
Notifications
The bot can post messages in your Discord channels for:
| Event | Description |
|---|---|
| Payment Success | A customer completed a payment |
| Payment Failed | A payment attempt failed |
| Subscription Created | A new subscriber joined |
| Subscription Canceled | A subscriber canceled |
Multiple Servers
You can connect the Inflow bot to multiple Discord servers. Each server can have its own configuration and notification channels.
Important Notes
- The Inflow bot must have the Manage Roles permission and its role must be higher in the role hierarchy than the roles it assigns.
- Role assignment happens automatically — no manual action is needed after setup.
- Discord role IDs and Guild IDs are numeric strings (e.g.,
"123456789012345678"). - If a customer's subscription enters
PAST_DUEorCANCELED, their role is removed during the next cleanup cycle.
Updated 1 day ago