For Developers

Integrate PUSD into your app with the Business API: accept payments, check balances, and build on Pi.

Business API (v1)
REST API for merchants and platforms. Create payment requests, get payment status, and read balance.

Authenticate with an API key (X-API-Key or Authorization: Bearer). Create keys using the backend script and scope them to payments:read, payments:write, balance:read.

  • POST /api/v1/business/payments — Create a payment (amount, reference, optional callback URL)
  • GET /api/v1/business/payments/:id — Get payment status (id or reference)
  • GET /api/v1/business/balance — Get merchant PUSD balance

Use the payUrl from create payment to send payers to a checkout flow. Webhooks are supported for payment.completed and payment.failed.

Full API reference: see pusd-backend/docs/BUSINESS-API.md in the repo.

SDK & Sandbox
Use the JS/TS client and test on testnet before going live.

A lightweight BusinessApiClient is available in this app at @/lib/api/businessClient. Import and use with your API key:

import { createBusinessClient } from '@/lib/api/businessClient';

const client = createBusinessClient(process.env.PUSD_API_KEY!, process.env.PUSD_API_BASE);
const { data } = await client.createPayment({ amount: 10, reference: 'order-1' });
// data.payUrl -> send customer here

For testnet, point baseUrl to your testnet backend and use a pusd_test_ key. Test PUSD and Pi are available on Pi Testnet.