Common Use Cases
Customer Verification Flow
// Create a new customer verification
const verification = await proofenance.verifications.create({
customer_id: 'cust_123',
verification_type: 'identity',
callback_url: 'https://your-app.com/webhooks'
});
// Redirect customer to verification URL
window.location.href = verification.verification_url;Webhook Handler
// Handle webhook events
app.post('/webhooks', async (req, res) => {
const event = req.body;
switch (event.type) {
case 'verification.completed':
// Update customer status
await updateCustomerStatus(event.data.customer_id, 'verified');
break;
case 'verification.failed':
// Handle failed verification
await handleFailedVerification(event.data.customer_id);
break;
}
res.json({ received: true });
});