Skip to main content

Chargebacks

Manage chargebacks, submit evidence, and track dispute resolution.

Methods

create

const chargeback = await zenpays.chargebacks.create({
transactionId: 'txn_xxx',
amount: 500,
reason: 'product_not_received',
description: 'Customer did not receive the product',
})

get

const chargeback = await zenpays.chargebacks.get('chg_xxx')

list

const { data } = await zenpays.chargebacks.list({
status: 'open',
page: 1,
limit: 20,
})

updateStatus

const updated = await zenpays.chargebacks.updateStatus('chg_xxx', 'under_review', 'Reviewing evidence')

submitEvidence

const result = await zenpays.chargebacks.submitEvidence('chg_xxx', {
evidenceType: 'delivery_proof',
description: 'Delivery confirmation from courier',
documentUrl: 'https://example.com/proof.pdf',
})

addMerchantResponse

const result = await zenpays.chargebacks.addMerchantResponse('chg_xxx', {
response: 'The product was delivered on time. See tracking proof.',
documentUrls: ['https://example.com/tracking.pdf'],
})

resolve

const resolved = await zenpays.chargebacks.resolve('chg_xxx', {
resolution: 'accepted',
notes: 'Refund issued to customer',
})

cancel

const cancelled = await zenpays.chargebacks.cancel('chg_xxx')

getStats

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

getAnalytics

const analytics = await zenpays.chargebacks.getAnalytics('2024-01-01', '2024-12-31', 'month', 'INR')

export

const downloadUrl = await zenpays.chargebacks.export({ status: 'open' })

bulkUpload

const result = await zenpays.chargebacks.bulkUpload(csvFile, 'https://yoursite.com/webhook')