Wallgent
Guides

Add Payments to Your Dify Workflows

Connect Wallgent to Dify as a custom tool using the OpenAPI specification.

Prerequisites

  • A Wallgent account and API key (get one here)
  • A Dify workspace (cloud or self-hosted)

1. Add Wallgent as a Custom Tool

In the Dify dashboard:

  1. Go to Tools in the left sidebar
  2. Click Custom > Create Custom Tool
  3. Set the name to Wallgent
  4. Import the OpenAPI spec by pasting this URL:
https://api.wallgent.com/v1/openapi.json
  1. Click Import to load all available operations

2. Configure Authentication

In the tool's Authentication settings:

  • Auth Type: API Key
  • Header Name: Authorization
  • API Key: Bearer wg_test_your_key_here

Click Save.

3. Use in an Agent

  1. Create a new Agent app in Dify
  2. Under Tools, enable the Wallgent custom tool
  3. Select the operations your agent should access (e.g., POST /v1/wallets, POST /v1/payments, GET /v1/wallets/{id}/balance)
  4. Set the agent's system prompt:
You are a financial agent. Use the Wallgent tools to create wallets,
check balances, and send payments when asked.
  1. Test in the preview panel: ask "Create a wallet called demo-agent and fund it with $100"

4. Use in a Workflow

For deterministic flows, add Wallgent as a Tool node in any Dify workflow:

  1. Create a new Workflow app
  2. Add a Tool node and select a Wallgent operation (e.g., send_payment)
  3. Map the input variables from upstream nodes (e.g., wallet IDs and amount from a form input)
  4. Connect the output to downstream nodes for processing or display

Next Steps

On this page