> For the complete documentation index, see [llms.txt](https://docs.oxapay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oxapay.com/welcome-to-oxapay/integrations/n8n-automation/discord-bot.md).

# Discord Bot

By connecting OxaPay and Discord through n8n, you can build automated crypto payment workflows for your community, store, or private server. n8n works as the automation bridge between OxaPay and Discord, helping you generate invoices, send payment links, receive real-time payment updates, notify users or admins, and trigger fulfillment after successful payments.

<div data-with-frame="true"><figure><img src="/files/VT85a4Yb4KqZ9tLeg4pQ" alt=""><figcaption></figcaption></figure></div>

Using **OxaPay** and **Discord** together on **n8n**, you can:

* Create OxaPay invoices automatically from a Discord command
* Send payment links to a Discord channel, private staff channel, or customer DM
* Receive real-time OxaPay webhook updates inside n8n when a payment status changes
* Fulfill digital orders instantly after a confirmed payment, such as license keys, download links, private roles, or access instructions
* Store payment metadata in n8n Data Store, Google Sheets, Airtable, Notion, or your CRM for tracking and reconciliation

### Example Automation Scenarios

{% stepper %}
{% step %}

#### Scenario 1: Discord Payment Request Flow

A user or admin starts a payment request from Discord. The OxaPay node in n8n creates a new crypto payment invoice, returns the payment details such as the `track_id` and payment URL, and the workflow sends the generated payment link back to the selected Discord channel or user.&#x20;
{% endstep %}

{% step %}

#### Scenario 2: Real-Time Payment Confirmation Alerts

The OxaPay Trigger node listens for payment status updates from OxaPay. When an invoice status changes, n8n checks the payment result and sends an automatic confirmation message to Discord once the payment is marked as `Paid`.
{% endstep %}

{% step %}

#### Scenario 3: High-Value Transaction Monitoring

When the OxaPay node receives or retrieves a confirmed payment, n8n checks the transaction amount against your defined threshold. If the payment is above the limit, the workflow sends a detailed alert to a private Discord staff channel with the order ID, amount, currency, customer details, and OxaPay `track_id.`
{% endstep %}

{% step %}

#### Scenario 4: Digital Delivery After Payment Confirmation

After the OxaPay node confirms that a payment is successfully completed, n8n can automatically deliver the purchased item or access. This can include sending a license key, download link, access instructions, or assigning a paid Discord role to the customer.
{% endstep %}
{% endstepper %}

***

### Discord Payment Bot with OxaPay on n8n

This workflow builds a Discord payment automation powered by OxaPay and n8n. It allows merchants to generate payment links, send invoice messages in Discord, listen for OxaPay payment status updates, and notify customers or staff automatically.  You can download the n8n workflow file below:

{% file src="/files/5S62z8NjiWC3l7zNy9G7" %}

#### Before starting, make sure you have:

* An active OxaPay account with API access
* A **Discord bot token** created in the Discord Developer Portal
* A self-hosted n8n instance with access to community nodes

### How to build and configure this Discord Payment Bot using n8n?

1. After logging in to your Discord account, go to the [Discord Developer Portal](https://discord.com/developers/applications) and create a new application. Click **New Application**, enter a name for your app, such as `OxaPay Payment Bot`, and then click **Create**.

<div data-with-frame="true"><figure><img src="/files/M812VmTZ4gmR1VPC1SYX" alt=""><figcaption></figcaption></figure></div>

2. After creating the application, click **Bot** in the left sidebar. In the bot settings, under **Privileged Gateway Intents**, enable **Message Content Intent**, then click **Save Changes**.

<div data-with-frame="true"><figure><img src="/files/bDxd40SHa6s42NkLlyu3" alt=""><figcaption></figcaption></figure></div>

3. On the same **Bot** page, go to **Token** section and copy your bot token. If the token is not visible, click **Reset Token** to generate and reveal a new one, then copy it immediately. Keep this token secure and never share it.

<div data-with-frame="true"><figure><img src="/files/hGIKamvv2aWQYq2IZq3G" alt=""><figcaption></figcaption></figure></div>

4. In the left sidebar, click **Installation**. Under **Default Install Settings → Guild Install**, open **Scopes** and add **bot**. Then, in **Permissions**, select **Administrator**, and click **Save Changes**.

<div data-with-frame="true"><figure><img src="/files/5CRn0bRb0uHHbDCQMLu7" alt=""><figcaption></figcaption></figure></div>

5. Use the generated **Install Link** to install your application on the target Discord server. Select the server, review the requested permissions, and click **Authorize**.

<div data-with-frame="true"><figure><img src="/files/56Oys5C4MDtv7nJlmq6J" alt=""><figcaption></figcaption></figure></div>

6. Before importing or configuring the workflow, make sure the OxaPay Community Node is installed in your n8n instance. You can install it from the n8n settings by going to Settings, opening Community Nodes, selecting Install, entering the package name `n8n-nodes-oxapay`, and confirming the installation. After installation, the OxaPay node will be available in your n8n node list.

<div data-with-frame="true"><figure><img src="/files/YncCNuGLm72QPhDQcdML" alt=""><figcaption></figcaption></figure></div>

7. Now open your n8n dashboard and create a new workflow by clicking “Create Workflow”.

<div data-with-frame="true"><figure><img src="/files/qwcxTZz8tw14N98IlZWo" alt=""><figcaption></figcaption></figure></div>

8. In the top-right corner of the n8n workflow editor, click the three-dot menu, select “Import from file”, and upload the downloaded workflow JSON file.

<div data-with-frame="true"><figure><img src="/files/iMUeLKtB6J6ZvwTuUQFx" alt=""><figcaption></figcaption></figure></div>

9. Next, open each node in the workflow and configure it according to your setup. Make sure your OxaPay and Discord credentials are connected, review all required fields, and customize values such as the payment amount, currency, invoice description, Discord channel and notification message based on your business needs.

<div data-with-frame="true"><figure><img src="/files/syY2nm9YwH9wZmNWqo4u" alt=""><figcaption></figcaption></figure></div>

10. In the n8n Data Table section, create a new table by importing the provided CSV file. After importing the file, review each column, save the table and connect it to the related Data Table nodes in the workflow.

{% file src="/files/aESXRwQbp2yK0N29b4p0" %}

<div data-with-frame="true"><figure><img src="/files/KuRpNvSxot41NerIOTQd" alt=""><figcaption></figcaption></figure></div>

11. Once all nodes are configured, save the workflow in n8n. Next, open the Webhook node and copy its Production URL. Keep this URL available, as you will use it in the next steps to trigger the Discord notification workflow.
12. Deploy the Python script on an active server. Before running it, replace:

* `YOUR_DISCORD_BOT_TOKEN` with your actual Discord bot token
* `YOUR_N8N_WEBHOOK_URL` with your n8n Webhook Production URL

For security, keep both values private and load them from environment variables instead of hardcoding them in the script.

{% file src="/files/yMG74Z2NLncCkB3TSh5l" %}

13. Now, click Publish in the top-right corner. This will save and activate the workflow so it can start receiving Discord events.

<div data-with-frame="true"><figure><img src="/files/6FO4Mkx0B5YmD5aLr7r4" alt=""><figcaption></figcaption></figure></div>

14. Whenever you want to create a new payment, simply send a message containing keywords like “**OxaPay**”, “**Start**”, or “**Crypto**” in a channel where the bot is active. The bot will automatically trigger and run the payment workflow.
15. For real-time payment status notifications, create a separate n8n workflow and import the workflow file provided below. This workflow will receive OxaPay payment callbacks, check the payment status, and send automatic updates to your Discord channel.

{% file src="/files/fEGBdtTZljdzXz4HeCm8" %}

16. In this workflow, the Data Table node is used to store Discord payment records. Before running the workflow, create a new Data Table in n8n by importing the provided CSV file below.

{% file src="/files/QCRWTkBzqlKG0ii4VVws" %}

17. Once all nodes are configured, copy the Production URL from the Webhook node in this workflow and add it as the Callback URL in all OxaPay nodes that create invoices or payment requests in the previous workflow. Finally, click Publish to save and activate the workflow.

***

### Conclusion and Next Steps

**With these two n8n workflows configured, you have a functional Discord payment automation powered by OxaPay:**

* Workflow 1 creates OxaPay invoices, white-label payments, and static addresses, then sends the generated payment links or address details through Discord.
* Workflow 2 receives OxaPay webhook updates and posts real-time payment notifications to Discord

**This setup can be extended even further by:**

* Delivering license keys or download links after successful payment
* Assigning paid Discord roles automatically
* Logging payments to Google Sheets, Airtable, Notion, HubSpot, or your CRM
* Sending staff alerts for high-value or suspicious transactions
* Creating retry flows for expired or failed invoices

By combining OxaPay, Discord, and n8n, you can build scalable crypto payment workflows that are easy to customize and maintain without writing a full backend application.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.oxapay.com/welcome-to-oxapay/integrations/n8n-automation/discord-bot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
