Skip to main content

Vendors

Manage vendors/partners, track commissions, referrals, and process payouts. Access via zenpays.vendors.

Vendor Management​

create​

const vendor = await zenpays.vendors.create({
name: 'Acme Corp',
email: '[email protected]',
phone: '+911234567890',
country: 'IN',
commissionRate: 5, // percentage
})

list​

const { data } = await zenpays.vendors.list({
search: 'acme',
status: 'active',
page: 1,
limit: 20,
})

getStats​

const stats = await zenpays.vendors.getStats()

get​

const vendor = await zenpays.vendors.get('vnd_xxx')

update​

const updated = await zenpays.vendors.update('vnd_xxx', { commissionRate: 7.5 })

delete​

Soft-delete a vendor.

await zenpays.vendors.delete('vnd_xxx')

updateStatus​

const updated = await zenpays.vendors.updateStatus('vnd_xxx', 'suspended')
// status: 'active' | 'inactive' | 'suspended'

KYC​

updateKyc​

const updated = await zenpays.vendors.updateKyc('vnd_xxx', {
verificationLevel: 'advanced',
documents: ['doc_xxx'],
})

Commissions & Referrals​

listCommissions​

const commissions = await zenpays.vendors.listCommissions('vnd_xxx')

listReferrals​

const referrals = await zenpays.vendors.listReferrals('vnd_xxx')

createReferral​

const referral = await zenpays.vendors.createReferral('vnd_xxx', {
referredMerchantId: 'mer_xxx',
referralCode: 'ACME2024',
})

Payouts & Analytics​

processPayout​

const payout = await zenpays.vendors.processPayout('vnd_xxx', {
amount: 5000,
currency: 'INR',
})

getAnalytics​

const analytics = await zenpays.vendors.getAnalytics('vnd_xxx')