Follow these steps to make your first integration with Khipu using Instant Payments.
First, you need an account on Khipu.
Once registered, create a collection account and link it to a bank account to receive payments.
From your private session on Khipu Portal, access to:
- Account options (on your sidebar)
- Unfold the option "To integrate Khipu into your website"
- Get your 'Collector ID' (unique identifier)
- Get your 'New API Key' (use the development mode key for testing)
⚠️ Store your secret key in a safe place. Never expose it publicly.
Make an HTTP POST
request to the Khipu endpoint:
POST https://khipu.com/api/3.0/payments
Authorization: Basic {base64_encode(id_cobrador:clave_secreta)}
Content-Type: application/json
{
"subject": "Compra de prueba",
"amount": 1000,
"currency": "CLP",
"transaction_id": "pedido-1234",
"return_url": "https://tu-sitio.com/exito",
"cancel_url": "https://tu-sitio.com/cancelado",
"notify_url": "https://tu-sitio.com/notificacion"
}
The response will include a URL:
"payment_url": "https://khipu.com/payment/show/..."
Redirect the user to this URL so they can complete the payment. Once completed, Khipu will redirect the user back to your site via: return_url
.
Khipu will send a webhook to notify_url
with the payment details.
Only consider the payment valid once you have received and verified this notification.
Once everything works in testing, repeat the process using your production credentials.
Make sure notifications are enabled, your bank account is registered, and your site is accessible from the internet.
✅ Done! You're now ready to start receiving payments with Khipu.