Skip to content

Introduction

Sanwo (Yoruba: “to pay”) is a free, open-source payment SDK that gives you a single, unified API for every payment provider on every platform. It is licensed under Apache-2.0 — no fees, no accounts, no strings attached.

Every payment provider ships its own SDK with its own API surface, its own configuration format, and its own quirks. Integrating one is fine. Integrating three across web and mobile is a nightmare. Swapping providers means rewriting your checkout flow.

Sanwo fixes this. You write your payment code once. When you want to switch from Paystack to Flutterwave, you change a single import.

Provider Package
Paystack @sanwohq/paystack
Flutterwave @sanwohq/flutterwave
Razorpay @sanwohq/razorpay
Monnify @sanwohq/monnify
Interswitch @sanwohq/interswitch

More providers are coming. Open an issue to request one.

Platform Package
Web / JavaScript @sanwohq/web
React @sanwohq/react
React Native @sanwohq/react-native
Flutter sanwo_flutter
iOS / Swift Swift Package Manager
Android / Kotlin JitPack

Sanwo’s API has three core types:

A provider defines which payment gateway to use. You import one and pass it to Sanwo at initialization.

import { paystack } from "@sanwohq/paystack";

CheckoutOptions describes what to charge. The shape is identical across every provider.

const options = {
amount: 500000, // minor units (e.g. 5000.00 NGN = 500000 kobo)
currency: "NGN",
customer: { email: "customer@example.com" },
reference: "order_abc123",
};

CheckoutResult is a discriminated union on status that tells you what happened.

type CheckoutResult =
| { status: "successful"; reference: string; providerResponse: unknown }
| { status: "cancelled" }
| { status: "failed"; error: string }
| { status: "pending"; reference: string };
  1. You pass a provider and checkout options to Sanwo.
  2. Sanwo renders the provider’s checkout UI inside an iframe (web) or webview (mobile).
  3. Sanwo handles all bridge communication between your app and the provider’s UI.
  4. When the customer completes (or cancels) payment, Sanwo returns a typed CheckoutResult.

Sanwo is a thin orchestration layer. Payments flow directly from your customer to the payment provider. Sanwo never touches your money. Your provider dashboard, webhooks, and settlement process stay exactly the same.