Skip to main content

Payouts

Process payouts — single, batch, and intent-based flows. Access via zenpays.payouts.

Single Payouts

getMethods

const methods = await zenpays.payouts.getMethods()

preview

const preview = await zenpays.payouts.preview({
amount: 5000,
currency: 'INR',
country: 'IN',
payoutType: 'bank_transfer',
})
// Returns: { tspProvider, requiredFields, estimatedProcessingTime, fees, totalAmount }

create

const payout = await zenpays.payouts.create({
amount: 5000,
currency: 'INR',
beneficiary: {
name: 'John Doe',
accountNumber: '1234567890',
ifscCode: 'HDFC0001234',
},
})

get

const payout = await zenpays.payouts.get('po_xxx')

list

const { data } = await zenpays.payouts.list({ status: 'completed', limit: 20 })

listByCustomer

const { data } = await zenpays.payouts.listByCustomer('cust_xxx', { limit: 10 })

retry

const retried = await zenpays.payouts.retry('po_xxx', 'optional_tsp_provider')

cancel

const cancelled = await zenpays.payouts.cancel('po_xxx', 'No longer needed')

getStats

const stats = await zenpays.payouts.getStats('2024-01-01', '2024-12-31')

getAnalytics

const analytics = await zenpays.payouts.getAnalytics('30d')

getDashboardAnalytics

const dashboard = await zenpays.payouts.getDashboardAnalytics()
// Returns: PayoutAnalytics & { summary: PayoutStats }

export

const downloadUrl = await zenpays.payouts.export({ status: 'completed' })

Batch Payouts

createBatch

const batch = await zenpays.payouts.createBatch({
name: 'April Payroll',
payouts: [
{ amount: 5000, currency: 'INR', beneficiary: { name: 'John', accountNumber: '123' } },
{ amount: 3000, currency: 'INR', beneficiary: { name: 'Jane', accountNumber: '456' } },
],
})

getBatch

const batch = await zenpays.payouts.getBatch('batch_xxx')

listBatches

const { data } = await zenpays.payouts.listBatches({ status: 'pending', limit: 10 })

confirmBatch

const confirmed = await zenpays.payouts.confirmBatch('batch_xxx')

getBatchPayouts

const { data } = await zenpays.payouts.getBatchPayouts('batch_xxx', { limit: 50 })

cancelBatch

const result = await zenpays.payouts.cancelBatch('batch_xxx')
// Returns: { success, message }

Payout Intents

Intent-based payout flow: create intent → confirm with beneficiary fields → payout executes.

createPayoutIntent

const intent = await zenpays.payouts.createPayoutIntent({
amount: 5000,
currency: 'INR',
country: 'IN',
payoutType: 'bank_transfer',
description: 'Vendor payment',
})

confirmPayoutIntent

const confirmed = await zenpays.payouts.confirmPayoutIntent('poi_xxx', {
beneficiaryName: 'John Doe',
accountNumber: '1234567890',
ifscCode: 'HDFC0001234',
})

getPayoutIntent

const intent = await zenpays.payouts.getPayoutIntent('poi_xxx')

listPayoutIntents

const { data } = await zenpays.payouts.listPayoutIntents({ status: 'pending', limit: 20 })

cancelPayoutIntent

const cancelled = await zenpays.payouts.cancelPayoutIntent('poi_xxx', 'Changed plans')