SetupIntents#
A SetupIntent guides you through the process of setting up a tenant's payment method for future payments. Use SetupIntents to save a card or bank account without immediately charging.
The SetupIntent object#
| Attribute | Type | Description |
|---|---|---|
id | string | Unique identifier with seti_ prefix |
object | string | Always "setup_intent" |
status | enum | requires_payment_method, requires_confirmation, requires_action, processing, succeeded, canceled |
customer | string | Customer ID |
payment_method | string | Payment Method ID |
payment_method_types | array | Allowed payment method types |
client_secret | string | Secret for client-side confirmation |
usage | enum | off_session or on_session |
metadata | hash | Key-value pairs |
created | timestamp | Time at which the object was created |
{
"id": "seti_abc123",
"object": "setup_intent",
"status": "succeeded",
"customer": "cus_123456789",
"payment_method": "pm_card_visa",
"payment_method_types": ["card"],
"usage": "off_session",
"created": 1706140800
}Create a SetupIntent#
POST /v1/setup_intents
| Parameter | Type | Required | Description |
|---|---|---|---|
customer | string | No | Customer ID |
payment_method_types | array | No | Allowed types |
usage | string | No | off_session (default) or on_session |
metadata | hash | No | Key-value pairs |
curl https://api.casapay.com/v1/setup_intents \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
-H "Content-Type: application/json" \
-d '{
"customer": "cus_123456789",
"payment_method_types": ["card", "direct_debit"]
}'Retrieve, Confirm, Cancel#
GET /v1/setup_intents/:id
POST /v1/setup_intents/:id/confirm
POST /v1/setup_intents/:id/cancel
List SetupIntents#
GET /v1/setup_intents
| Parameter | Type | Description |
|---|---|---|
customer | string | Filter by customer |
payment_method | string | Filter by payment method |
curl "https://api.casapay.com/v1/setup_intents?customer=cus_123456789" \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"