Documentation Index
Fetch the complete documentation index at: https://docs.zafapay.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Depot is a redirect-based payment method. After creating a payment via API, redirect the customer to payment_url to complete the payment.
Payment Flow
Create Payment
Call POST /v1/payments to create a payment and obtain payment_url
Redirect Customer
Redirect customer to payment_url
Customer Completes Payment
Customer completes payment on Depot’s page
Redirect Back
Customer is redirected to your success_redirect_url or failure_redirect_url
Verify Result
Optionally verify payment status using Get Payment API
Implementation Example
// 1. Create payment via API
const response = await fetch('https://api.sandbox.zafapay.com/v1/payments', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 100,
currency: 'usd',
external_id: 'order_12345'
})
});
const payment = await response.json();
// 2. Redirect customer to Depot payment page
window.location.href = payment.payment_url;
Webhook Integration
For reliable payment confirmation, set up webhooks:
// Webhook handler
app.post('/webhooks/zafapay', async (req, res) => {
const event = req.body;
if (event.type === 'payment.completed') {
// Update order status
await updateOrder(event.data.external_id, 'paid');
}
res.json({ received: true });
});
For complete API parameters and response details, see the Create Payment API reference.