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#

AttributeTypeDescription
idstringUnique identifier with seti_ prefix
objectstringAlways "setup_intent"
statusenumrequires_payment_method, requires_confirmation, requires_action, processing, succeeded, canceled
customerstringCustomer ID
payment_methodstringPayment Method ID
payment_method_typesarrayAllowed payment method types
client_secretstringSecret for client-side confirmation
usageenumoff_session or on_session
metadatahashKey-value pairs
createdtimestampTime 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

ParameterTypeRequiredDescription
customerstringNoCustomer ID
payment_method_typesarrayNoAllowed types
usagestringNooff_session (default) or on_session
metadatahashNoKey-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

ParameterTypeDescription
customerstringFilter by customer
payment_methodstringFilter by payment method
curl "https://api.casapay.com/v1/setup_intents?customer=cus_123456789" \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"