Skip to content

Discord Integration

Automatically assign Discord roles when customers make purchases.

Overview

The Discord integration allows you to:

  • Assign roles when products are purchased
  • Remove roles when subscriptions expire
  • Require Discord authentication at checkout
  • Sync customer Discord accounts

How It Works

Pixlpay uses a Custom Discord Bot architecture for role delivery. You create your own Discord bot at the Discord Developer Portal, and Pixlpay handles all the interaction logic through Discord's HTTP Interactions system.

Customer Purchase
       |
       v
+------------------+
|  Pixlpay         |
|  (queues role)   |
+--------+---------+
         |
         v
Customer runs /claim in Discord
         |
         v
+------------------+
|  Discord sends   |
|  interaction to  |
|  Pixlpay         |
+--------+---------+
         |
         v
Pixlpay assigns role using your bot token
         |
         v
Customer receives role instantly!

Why This Architecture?

  • Zero Hosting: No server or VPS required - Pixlpay handles everything
  • Always Online: Discord's infrastructure ensures 100% uptime
  • Easy Setup: Just create a Discord application and paste credentials
  • Instant Updates: New features are automatically available
  • Secure: Your bot token is encrypted and never exposed

Setting Up Discord

Step 1: Create a Discord Application

  1. Go to Discord Developer Portal
  2. Click New Application
  3. Name it (e.g., "My Store Bot")
  4. Go to Bot section
  5. Click Add Bot or Reset Token
  6. Copy the Bot Token (you'll need this later)

Step 2: Invite Bot to Your Server

  1. Go to OAuth2 > URL Generator
  2. Select scopes: bot and applications.commands
  3. Select permissions: Manage Roles
  4. Copy the generated URL
  5. Open the URL and select your Discord server
  6. Authorize the bot

Important

The bot's role must be higher than roles it assigns. Drag the bot's role above other roles in Server Settings > Roles.

Step 3: Configure in Pixlpay

  1. Go to Settings > Integrations > Discord in your store dashboard
  2. Scroll to Custom Bot Setup
  3. Enter your credentials:
    • Application ID - From General Information page
    • Public Key - From General Information page (64-character hex string)
    • Bot Token - From Bot section
  4. Click Save & Register Commands

Step 4: Set the Interactions Endpoint URL

  1. In Discord Developer Portal, go to your application's General Information
  2. Find the Interactions Endpoint URL field
  3. Enter your store's webhook URL:
    https://api.pixlpay.net/webhook/discord/interactions/{your-store-slug}
  4. Click Save Changes

Finding Your URL

The exact URL is shown in your Pixlpay dashboard under Settings > Integrations > Discord > Custom Bot Setup. You can copy it directly from there.

For complete step-by-step instructions, see the Custom Discord Bot Setup Guide.

Configuring Role Delivery

On Products

When creating or editing a product:

  1. Go to the Delivery tab
  2. Enable Discord Role
  3. Select your Discord server
  4. Choose the role to assign

Multiple Roles

You can assign multiple roles per product:

  1. Click Add Role
  2. Select additional roles
  3. Save the product

Customer Commands

Once configured, customers can use these commands in your Discord server:

CommandDescription
/claimClaim all pending role deliveries
/checkView pending and recent role deliveries
/helpShow available commands

Requiring Discord at Checkout

Force customers to connect Discord before purchase:

  1. Go to Settings > Checkout
  2. Enable Require Discord
  3. Customers must authenticate before paying

Subscription Behavior

For subscription products:

  • On Purchase - Role is assigned immediately
  • On Renewal - Role remains active
  • On Cancellation - Role is removed after period ends
  • On Expiration - Role is automatically removed

Troubleshooting

Bot Can't Assign Role

  • Ensure bot role is higher than target role in Discord
  • Check bot has "Manage Roles" permission
  • Verify role ID is correct

Customer Not Receiving Role

  • Confirm customer authenticated with Discord
  • Check if customer is in your Discord server
  • Have customer run /claim in your Discord server
  • Check the order delivery status in your dashboard

Discord Connection Failed

  • Verify Application ID, Public Key, and Bot Token in Pixlpay settings
  • Ensure Interactions Endpoint URL is correct in Discord Developer Portal
  • Re-save your bot credentials

Commands Not Appearing

  • Slash commands can take up to 1 hour to appear globally
  • Re-invite the bot with applications.commands scope
  • Click "Re-register Commands" in Pixlpay dashboard

"Member not found in guild"

The customer is not in your Discord server. They need to join before the role can be assigned.

Best Practices

  1. Unique Bot Name - Give your bot a name related to your store for brand recognition
  2. Custom Avatar - Upload a logo for your bot in Discord Developer Portal
  3. Role Hierarchy - Keep your bot's role high but below admin roles
  4. Monitor Stats - Check the dashboard regularly for errors
  5. Communicate - Tell customers to use /claim after purchase in order confirmation emails

Next Steps

Built for game developers, by game developers.