Skip to Content
PayoutsSending a Payout

Sending a Payout

Payouts require a financial role (Owner, Admin, or Finance) on the API key’s business, and the Payouts capability on your plan — see Authentication.

import { ProviderEnvironment, money } from "@vectapay/sdk"; const payout = await vectapay.payouts.send(ProviderEnvironment.PRODUCTION, { phone: "254712345678", amount: money(150000), // KES 1,500.00 commandId: "BusinessPayment", remarks: "October commission", idempotencyKey: `commission-2026-10-${affiliateId}`, });

commandId

ValueUse for
SalaryPaymentPayroll
BusinessPaymentSupplier payments, refunds, commissions
PromotionPaymentCashback, promotional payouts

Safaricom applies different tax treatment per command — pick the one that matches what the money actually is.

A payout above your business’s single-payout approval threshold requires a second person to approve it before it releases — see Approvals for the full flow and a diagram of it. send() still returns immediately either way; check the response status to see whether it’s already scheduled for release or waiting on approval.

Checking on a payout

Payouts are payments too — a payout you sent shows up in payments.get() / payments.list() with paymentType: 'B2C'. Payout outcomes are not delivered as merchant webhooks today: poll the payout (or the equivalent payment record) until it reaches a final status, or read it from the dashboard. The payout.* event types exist internally but are not sent to webhook endpoints — see Events you won’t receive.

Balance

const balance = await vectapay.payouts.getBalance(ProviderEnvironment.PRODUCTION, { providerAccountId: "...", }); // { balances: [{ accountType, amount, currency }], source: 'CACHE' | 'LIVE' } const history = await vectapay.payouts.balanceHistory({ providerAccountId: "...", days: 30 }); const summary = await vectapay.payouts.summary(); // { dailyLimit, remainingDailyCapacity, workingBalance, isLowBalance, successRate, ... }
Last updated on