Skip to main content
The @fossapay/node package is the server-side SDK for FossaPay APIs. It requires Node.js 18 or newer.

Install and initialize

Keep the API key in a secret manager or protected server environment.
1

Verify the business

Confirm which business and environment are connected to the API key.
2

Create the customer

Create the individual who will own the wallet.
3

Create the wallet

Provision a dedicated NGN collection account or a supported stablecoin wallet.
4

Track transactions and webhooks

Store FossaPay IDs and your references, then reconcile state from signed webhooks and retrieval methods.

Customers

Wallets and collections

The collections resource is an alias for dedicated customer NGN accounts:

Transactions

Bank resolution and payouts

Resolve the account before creating a payout. Nigerian account numbers must contain exactly 10 digits.
Payouts require an active live full-access API key. Test API keys cannot initiate payouts. The SDK supports individual payouts only.

Verify webhooks

Use x-fossapay-signature-v2 and pass the exact raw request body to the SDK.
Store event.eventId and ignore an event already processed.

Idempotency and retries

Customer creation, wallet creation, payouts, and wallet transfers accept an optional idempotencyKey and timeoutMs. The SDK generates a key when omitted, but you should provide a stable key whenever your system may recreate the request in another process. GET requests and idempotent writes are retried for connection failures and retryable HTTP responses. Set maxRetries and timeoutMs when initializing the client to change the defaults.

Handle errors

Available resources