@volr/checkout-sdk
v0.1.3
Published
Volr Checkout SDK — Server-side SDK for creating and managing stablecoin checkouts
Maintainers
Readme
@volr/checkout-sdk
Server-side SDK for creating and managing stablecoin checkouts via Volr.
Install
npm install @volr/checkout-sdkQuick Start
import { VolrCheckout } from '@volr/checkout-sdk';
const volr = new VolrCheckout({ serverKey: process.env.VOLR_SERVER_KEY! });
// Create a checkout
const checkout = await volr.create({
fiatAmount: '25.00',
fiatCurrency: 'USD',
itemName: 'Premium Plan',
successUrl: 'https://yoursite.com/success',
referenceId: 'order_123',
});
// Redirect customer
// → https://checkout.volr.io/c/{checkout.id}Webhook Verification
import { VolrCheckout } from '@volr/checkout-sdk';
const isValid = await VolrCheckout.verifySignature(
rawBody,
req.headers['x-volr-signature'],
process.env.VOLR_WEBHOOK_SECRET!,
);API
new VolrCheckout(config)
| Option | Type | Default |
|--------|------|---------|
| serverKey | string | — (required) |
| baseUrl | string | https://api.volr.io |
| timeout | number | 30000 |
Methods
| Method | Returns |
|--------|---------|
| create(params) | Promise<Checkout> |
| get(id) | Promise<Checkout> |
| list(params?) | Promise<Checkout[]> |
| cancel(id) | Promise<void> |
| createRefund(checkoutId, params) | Promise<Refund> |
| listRefunds(checkoutId) | Promise<Refund[]> |
| getSetupStatus() | Promise<SetupStatus> |
| VolrCheckout.verifySignature(payload, signature, secret) | Promise<boolean> |
Links
- Documentation
- Dashboard
- Volr Skills — AI-native integration guide
License
MIT
