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:

  1. Assign a specific role to users who have an active subscription.
  2. Auto-assign roles when new members join (if they have an existing subscription).
  3. Remove roles when subscriptions end (via a cleanup cron job).
  4. Post notifications in configured channels.

Setup

Step 1: Invite the Bot

  1. Go to Settings > Integrations in your Inflow Dashboard.
  2. Click Discord > Get Invite Link.
  3. Click the invite URL to add the Inflow bot to your Discord server.
  4. Grant the required permissions (Manage Roles, Send Messages).

Step 2: Configure the Bot

After the bot joins your server:

  1. Go back to your Inflow Dashboard > Discord settings.
  2. Select your Discord Server (Guild).
  3. Configure notification channels:
    • Payment Channel — Receives payment success/failure notifications
    • General Channel — Receives general subscription notifications
  4. Set your Discord Invite URL — the link customers will use to join your server.
  5. 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:

  1. Enter the Discord Guild ID (your server ID).
  2. 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

  1. Customer subscribes through a subscription link.
  2. During or after checkout, they are prompted to connect their Discord account (via OAuth).
  3. Once connected, the Inflow bot automatically assigns the configured role in your server.
  4. If the customer is not yet in your server, they receive a link to join. The role is assigned when they join.
  5. 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:

EventDescription
Payment SuccessA customer completed a payment
Payment FailedA payment attempt failed
Subscription CreatedA new subscriber joined
Subscription CanceledA 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_DUE or CANCELED, their role is removed during the next cleanup cycle.