Customers#

Customer objects allow you to store payment methods, track payments, and manage tenant information across CasaPay products.

The Customer object#

AttributeTypeDescription
idstringUnique identifier with cus_ prefix
objectstringAlways "customer"
namestringCustomer's full name
emailstringCustomer's email address
phonestringPhone number
addressobjectCustomer's address
default_payment_methodstringDefault Payment Method ID
balanceintegerCurrent balance in smallest currency unit
currencystringDefault currency
metadatahashKey-value pairs
createdtimestampTime at which the object was created
livemodebooleanWhether this is a live mode object
{
  "id": "cus_123456789",
  "object": "customer",
  "name": "Jane Doe",
  "email": "jane.doe@example.com",
  "phone": "+44 7700 900123",
  "address": {
    "line1": "123 High Street",
    "city": "London",
    "postal_code": "SW1A 1AA",
    "country": "GB"
  },
  "default_payment_method": "pm_card_visa",
  "balance": 0,
  "currency": "gbp",
  "metadata": {
    "property_id": "prop_456",
    "unit": "4B"
  },
  "created": 1706140800,
  "livemode": false
}

Create a Customer#

POST /v1/customers

ParameterTypeRequiredDescription
namestringNoFull name
emailstringNoEmail address
phonestringNoPhone number
addressobjectNoAddress
payment_methodstringNoPayment Method to attach
metadatahashNoKey-value pairs
curl https://api.casapay.com/v1/customers \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Doe",
    "email": "jane.doe@example.com",
    "metadata": { "property_id": "prop_456" }
  }'

Retrieve a Customer#

GET /v1/customers/:id

curl https://api.casapay.com/v1/customers/cus_123456789 \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"

Update a Customer#

POST /v1/customers/:id

curl https://api.casapay.com/v1/customers/cus_123456789 \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
  -H "Content-Type: application/json" \
  -d '{"email": "jane.new@example.com"}'

Delete a Customer#

DELETE /v1/customers/:id

curl -X DELETE https://api.casapay.com/v1/customers/cus_123456789 \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"

List Customers#

GET /v1/customers

ParameterTypeDescription
emailstringFilter by email
created[gte]timestampCreated on or after
limitintegerNumber of objects (1–100)
starting_afterstringCursor for pagination
curl "https://api.casapay.com/v1/customers?limit=10" \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"