Skip to main content

Stripe

E-commerce and payment operations for customer service agents — look up charges, retrieve customer details, process refunds, check subscriptions, and view invoices.
Requires the stripe peer dependency.

Quick Start

import { Agent, openai, StripeToolkit } from "@radaros/core";

const stripe = new StripeToolkit({
  secretKey: process.env.STRIPE_SECRET_KEY,
});

const agent = new Agent({
  name: "support-agent",
  model: openai("gpt-4o"),
  instructions: "Help customers with billing inquiries. Look up charges and process refunds when needed.",
  tools: [...stripe.getTools()],
});

const result = await agent.run("Look up customer cus_ABC123 and show their recent charges.");

Config

secretKey
string
required
Stripe secret API key. Falls back to STRIPE_SECRET_KEY env var.
maxItems
number
default:"25"
Max items per list operation.

Tools

ToolDescription
stripe_list_chargesList recent charges, optionally filtered by customer.
stripe_get_customerGet customer details — email, name, balance, metadata.
stripe_create_refundCreate a full or partial refund for a charge.
stripe_list_subscriptionsList subscriptions filtered by customer or status.
stripe_get_invoiceGet invoice details including amounts, status, and PDF link.

Peer Dependency

npm install stripe

Environment Variables

VariableDescription
STRIPE_SECRET_KEYStripe secret API key (sk_live_... or sk_test_...)
Use a test mode key (sk_test_...) during development. Never expose live keys in agent interactions.