Metadata#
Most CasaPay objects support a metadata parameter. You can use this parameter to attach arbitrary key-value data to objects, which can be useful for storing additional information in a structured format.
Setting Metadata#
You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long.
curl https://api.casapay.com/v1/customers/cus_123456789 \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"property_id": "prop_456",
"lease_start": "2025-01-01",
"unit_number": "4B"
}
}'Use Cases#
Metadata is useful for:
- Internal references: Store your own IDs alongside CasaPay objects
- Tracking: Add property IDs, lease references, or unit numbers
- Filtering: Some list endpoints support filtering by metadata values
- Reporting: Include metadata in exported reports
Removing Metadata#
To remove a metadata key, set its value to an empty string:
curl https://api.casapay.com/v1/customers/cus_123456789 \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
-H "Content-Type: application/json" \
-d '{"metadata": {"property_id": ""}}'Metadata is not used by CasaPay — for instance, it is not used to authorize or decline charges — and won't be seen by your tenants unless you choose to show it.