
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
pawapay-sdk
Advanced tools
A comprehensive TypeScript/JavaScript SDK for integrating with the pawaPay API, enabling seamless mobile money operations such as deposits, payouts, refunds, wallet balance checks, and more.
This SDK is a one-to-one mapping with the official pawaPay API documentation.
Please always refer to the official docs for the most up-to-date API details.
https://docs.pawapay.io/v1/api-reference/
A comprehensive TypeScript/JavaScript SDK for integrating with the pawaPay API, enabling seamless mobile money operations such as deposits, payouts, refunds, wallet balance checks, and more.
npm install pawapay-sdk
You can generate UUIDs for depositId
, payoutId
, and refundId
using the uuid package (version 4):
npm install uuid
import { v4 as uuidv4 } from 'uuid';
const depositId = uuidv4();
const payoutId = uuidv4();
const refundId = uuidv4();
import { PawaPayClient } from 'pawapay-sdk';
const client = new PawaPayClient('YOUR_API_KEY', { environment: 'sandbox' });
import { v4 as uuidv4 } from 'uuid';
const depositConfig = {
depositId: uuidv4(),
amount: '100.00',
currency: 'MWK',
country: 'MWI',
correspondent: 'AIRTEL_MWI',
payer: { type: 'MSISDN', address: { value: '265991234567' } },
customerTimestamp: new Date().toISOString(),
statementDescription: 'Payment for order 1234',
metadata: [{ fieldName: 'orderId', fieldValue: '1234' }]
};
const depositResponse = await client.requestDeposit(depositConfig);
const statusResponse = await client.checkDepositStatus(depositConfig.depositId);
const resendResponse = await client.resendDepositCallback(depositConfig.depositId);
import { v4 as uuidv4 } from 'uuid';
const payoutConfig = {
payoutId: uuidv4(),
amount: '50.00',
currency: 'MWK',
correspondent: 'AIRTEL_MWI',
recipient: '265991234567',
customerTimestamp: new Date().toISOString(),
statementDescription: 'Payout for service',
country: 'MWI',
metadata: []
};
const payoutResponse = await client.requestPayout(payoutConfig);
const payoutStatus = await client.checkPayoutStatus(payoutConfig.payoutId);
const resendPayout = await client.resendPayoutCallback(payoutConfig.payoutId);
const cancelResponse = await client.cancelEnqueuedPayout(payoutConfig.payoutId);
const bulkPayouts = [payoutConfig, { ...payoutConfig, payoutId: uuidv4() }];
const bulkResponse = await client.requestBulkPayout(bulkPayouts);
import { v4 as uuidv4 } from 'uuid';
const refundConfig = {
refundId: uuidv4(),
depositId: depositConfig.depositId,
amount: '100.00',
metadata: [{ fieldName: 'reason', fieldValue: 'Customer request' }]
};
const refundResponse = await client.requestRefund(refundConfig);
const refundStatus = await client.checkRefundStatus(refundConfig.refundId);
const resendRefund = await client.resendRefundCallback(refundConfig.refundId);
const payPageConfig = {
depositId: uuidv4(),
returnUrl: 'https://merchant.com/paymentProcessed',
statementDescription: 'Ticket purchase',
amount: '20.00',
msisdn: '265991234567',
language: 'EN',
country: 'MWI',
reason: 'Event ticket',
metadata: [{ fieldName: 'eventId', fieldValue: 'E123' }]
};
const payPageResponse = await client.requestPaymentPage(payPageConfig);
const walletBalances = await client.checkWalletBalances({});
const mwBalances = await client.checkWalletBalancesByCountry('MWI', {});
const config = await client.getActiveConfiguration({});
const correspondents = await client.getAvailableCorrespondent({});
const prediction = await client.predictCorrespondent('265991234567', {});
const publicKeys = await client.getPublicKey({});
All methods return a PawaPayResponse<T, E>
object:
const response = await client.requestDeposit(depositConfig);
if (response.success) {
// Access response.data
console.log('Success:', response.data);
} else {
// Access response.error and response.status
console.error('Error:', response.error, 'Status:', response.status);
}
The following TypeScript types are exported by the pawapay-sdk
package and can be imported for use in your own code:
PawaPayError
DepositConfig
DepositResponse
RequestPayoutConfig
RequestBulkPayoutConfig
RequestPayPageConfig
RequestRefundConfig
WalletBalance
PawaPayResponse<T, E>
BaseRequestPayoutResponse
RequestBulkPayoutResponse
RequestPayPageResponse
RequestRefundResponse
WalletBalanceResponse
DepositCallback
PayoutCallback
RefundCallback
PayPageCallback
Example:
import { DepositConfig, PawaPayResponse, PawaPayError } from "pawapay-sdk";
const mwBalances = await client.checkWalletBalancesByCountry('MWI', {});
const config = await client.getActiveConfiguration({});
const correspondents = await client.getAvailableCorrespondent({});
const prediction = await client.predictCorrespondent('265991234567', {});
const publicKeys = await client.getPublicKey({});
All methods return a PawaPayResponse<T, E>
object:
const response = await client.requestDeposit(depositConfig);
if (response.success) {
// Access response.data
console.log('Success:', response.data);
} else {
// Access response.error and response.status
console.error('Error:', response.error, 'Status:', response.status);
}
sandbox
: For testing and developmentlive
: For production useMIT
FAQs
A comprehensive TypeScript/JavaScript SDK for integrating with the pawaPay API, enabling seamless mobile money operations such as deposits, payouts, refunds, wallet balance checks, and more.
We found that pawapay-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.