CasaPay Gateway#
The CasaPay Gateway is a hosted checkout for rental payments. You create a session from your backend, redirect the tenant to the returned gateway_url, and CasaPay handles identity verification, the deposit decision, and the card or bank payment. You get the result on a webhook.
curl -X POST https://manage.casapay.com/api/v1/gateway/sessions \
-H 'Authorization: Bearer sk_live_...' \
-H 'Content-Type: application/json' \
-d '{
"tenant": {
"email": "tenant@example.com",
"first_name": "Mari",
"last_name": "Tamm"
},
"agreement_type": "ontime",
"cover_amount": 800,
"deposit_mode": "choice",
"first_payment_amount": 650,
"currency": "EUR",
"success_url": "https://your-app.com/done",
"cancel_url": "https://your-app.com/cancelled"
}'What you can build#
| Use case | Agreement type | Notes |
|---|---|---|
| Collect a one-off payment or invoice | payment_link | No guarantee, no deposit. |
| First month rent + deposit at move-in | ontime or cover | Deposit paid in cash or guaranteed by CasaPay. |
| Recurring rent on an existing tenant | ontime or cover | Reuse the agreement, create follow-up invoices. |
Core objects#
- Session - one checkout attempt. Identified by a
gwy_-prefixedsession_id. Carries the amounts, the steps the tenant must complete, and the final payment state. - Payment agreement - the durable link between a tenant and your entity. Created automatically by the first session, or up front via the agreements endpoint. Has a numeric
idand anemail_alias. - Invoice - a payable amount attached to an agreement. Created per session, per follow-up invoice, or by emailing a PDF to the agreement alias.
How a payment flows#
- You create a session and redirect the tenant to
gateway_url. - The tenant completes any required steps - identity verification, deposit choice - then pays by card or bank link.
- CasaPay books the invoice, marks it paid, and schedules the payout to your bank account.
- You receive a
gateway.session.completedwebhook.
Read Checkout flow for the full sequence, or jump to the Quickstart.
Base URLs#
| Environment | Base URL |
|---|---|
| Live | https://manage.casapay.com |
| Sandbox | https://manage.test.casapay.com |
All gateway endpoints are prefixed with /api/v1/gateway.
Test mode
Sandbox sessions expose a payment simulator instead of a real card form, so you can drive success, decline and timeout outcomes deterministically. See Testing.