Skip to main content
The @agentaos/pay package lets you accept regulated stablecoin payments from your Node.js backend. Stripe-like developer experience: create checkouts, handle webhooks, export invoices.

Install

npm install @agentaos/pay

Quick Start

import { AgentaOS } from '@agentaos/pay';

const agentaos = new AgentaOS(process.env.AGENTAOS_API_KEY!);

const checkout = await agentaos.checkouts.create({
  amount: 49.99,
  currency: 'EUR',
  description: 'Pro Plan - Monthly',
  successUrl: 'https://myshop.com/success',
  cancelUrl: 'https://myshop.com/cart',
  webhookUrl: 'https://myshop.com/webhooks',
});

// Send your customer here to pay
console.log(checkout.checkoutUrl);
Backend only. Never use this SDK in browser code. Your API key grants full access to all payments.

How It Works

1

Create checkout

Your server calls checkouts.create() with amount, currency, and URLs.
2

Redirect customer

Send the customer to checkoutUrl - they see the AgentaOS checkout page.
3

Customer pays

Customer connects their wallet and confirms the payment on-chain.
4

Webhook notification

AgentaOS sends checkout.session.completed to your webhookUrl with the transaction hash.
5

Fulfill order

Verify the webhook signature, then deliver the product.

What You Can Do

FeatureMethod
Accept a paymentagentaos.checkouts.create()
Check payment statusagentaos.checkouts.retrieve()
Create reusable payment linksagentaos.paymentLinks.create()
Verify webhook signaturesagentaos.webhooks.verify()
List all transactionsagentaos.transactions.list()
Download invoicesagentaos.invoices.downloadPdf()
Export monthly CSVagentaos.invoices.exportCsv()
Download statement PDFagentaos.invoices.downloadStatement()

Authentication

Get your API key from app.agentaos.ai → Developer → API Keys.
const agentaos = new AgentaOS('sk_live_...', {
  baseUrl: 'https://api.agentaos.ai', // default
  timeout: 30000,                      // ms
  maxRetries: 2,                       // retries on 5xx
  debug: false,                        // log requests to stderr
});

Requirements

  • Node.js 20+
  • Zero dependencies (uses native fetch and crypto)