Back to AI Overview

MoneyGraph + ChatGPT

Build GPT assistants with MoneyGraph tools for payments, payouts, and financial operations

Custom GPT Tools

Define MoneyGraph as a function tool

Real-time Processing

Execute payments in conversation

Secure Handling

API keys never exposed to users

How It Works

ChatGPT can call MoneyGraph through custom function tools. Your backend server receives the tool call, executes the MoneyGraph SDK operation, and returns structured results to the GPT.

1

User Request

User asks GPT to send payment

2

Tool Call

GPT triggers MoneyGraph tool

3

SDK Execution

Your server calls MoneyGraph SDK

Implementation Guide

1

Install MoneyGraph SDK

Add the SDK to your Node.js backend that will handle GPT tool calls.

npm install @moneygraph/sdk
2

Define MoneyGraph Tools

Create function definitions that describe MoneyGraph operations to ChatGPT. These tools tell the GPT what financial operations are available.

⚠️
Verification Required

Tool schemas must exactly match the MoneyGraph API specification. Consult the SDK documentation for accurate parameter names and types.

Conceptual Tool Definition
// TODO: Verify tool schema against MoneyGraph SDK before use
// This is a conceptual example - actual tool definitions must match
// the MoneyGraph API specification exactly

{
  "name": "moneygraph_send_payout",
  "description": "Send money to a recipient via MoneyGraph",
  "parameters": {
    "type": "object",
    "properties": {
      "amount": {
        "type": "number",
        "description": "Amount to send"
      },
      "currency": {
        "type": "string",
        "description": "Currency code (e.g., USD, EUR, NGN)"
      },
      "recipient": {
        "type": "object",
        "description": "Recipient details",
        "properties": {
          "name": { "type": "string" },
          "email": { "type": "string" },
          "bank_account": { "type": "string" }
        }
      }
    },
    "required": ["amount", "currency", "recipient"]
  }
}

// IMPORTANT: Verify against actual SDK documentation
3

Implement Tool Handler

Create a backend function that receives tool calls from ChatGPT and executes MoneyGraph SDK operations.

⚠️
SDK Verification Required

This code is conceptual. Before use, verify against @moneygraph/sdk v2.0.2: import paths, client initialization, method names, parameter structure, and response format.

handler.ts (Conceptual - Requires Verification)
// TODO: Verify this handler against @moneygraph/sdk v2.0.2
// DO NOT USE until verified against actual SDK

import { MoneyGraphClient } from '@moneygraph/sdk'; // VERIFY IMPORT PATH

export async function handleMoneyGraphTool(toolCall: any) {
  // VERIFY: Client initialization pattern
  const client = new MoneyGraphClient({
    apiKey: process.env.MONEYGRAPH_API_KEY,
    environment: 'production'
  });

  const { amount, currency, recipient } = toolCall.arguments;

  try {
    // VERIFY: Method name and signature
    const result = await client.payouts.create({
      amount,
      currency,
      recipient: {
        name: recipient.name,
        email: recipient.email,
        destination: {
          type: 'bank_account',
          account_number: recipient.bank_account
        }
      }
    });

    return {
      success: true,
      transaction_id: result.id,
      status: result.status
    };
  } catch (error) {
    return {
      success: false,
      error: error.message
    };
  }
}

// VERIFICATION REQUIRED: Check SDK documentation for correct:
// - Import paths
// - Client initialization
// - Method names (payouts.create, etc.)
// - Parameter structure
// - Response format
4

Configure GPT with Tools

In the ChatGPT custom GPT builder or API, register your MoneyGraph tools with the function definitions and your backend endpoint.

5

Test and Deploy

Test your integration in sandbox mode before deploying to production. Verify all tool calls work correctly and error handling is robust.

Best Practices

  • Always validate tool call parameters before passing to MoneyGraph SDK
  • Store API keys securely in environment variables, never in GPT configuration
  • Implement proper error handling and return clear error messages to the GPT
  • Use structured responses that the GPT can easily parse and present to users
  • Test in sandbox environment before enabling production payments
  • Implement rate limiting and usage monitoring for financial operations

📘 SDK Documentation

For accurate implementation details, always refer to the official SDK documentation:

View @moneygraph/sdk on npm →