Skip to content

SDK Usage

For TypeScript/JavaScript projects, use the @ovn/paystream-client SDK for type-safe API access.

Installation

bash
npm install @ovn/paystream-client

Initialization

ts
import { PaystreamClient } from "@ovn/paystream-client";

const client = new PaystreamClient({
  apiKey: process.env.PAYSTREAM_API_KEY!,
  apiUrl: "https://api.ovnpays.com/api/v1",
});

Examples

Create a Payout

ts
const payout = await client.payouts.create({
  recipientId: "drv_abc123",
  amount: 45000, // $450.00 in cents
  description: "Load #L-12345",
  rail: "standard",
});

List Drivers

ts
const drivers = await client.drivers.list({
  limit: 50,
  status: "active",
});

Create a Batch

ts
const batch = await client.batches.create({
  name: "Weekly Payouts",
  payments: [
    {
      recipientId: "drv_001",
      amount: 50000,
      description: "Load #1001",
    },
  ],
});