Charges#
Charges represent actual money movements created by PaymentIntents. A PaymentIntent may create multiple charges if the first attempt fails and is retried.
The Charge object#
| Attribute | Type | Description |
|---|---|---|
id | string | Unique identifier with ch_ prefix |
object | string | Always "charge" |
amount | integer | Amount charged in smallest currency unit |
currency | string | ISO 4217 currency code |
status | enum | succeeded, pending, failed |
customer | string | Customer ID |
payment_intent | string | Associated PaymentIntent ID |
payment_method | string | Payment Method used |
description | string | Charge description |
refunded | boolean | Whether fully refunded |
amount_refunded | integer | Amount refunded |
failure_code | string | Error code if failed |
failure_message | string | Human-readable failure message |
receipt_url | string | URL of the charge receipt |
metadata | hash | Key-value pairs |
created | timestamp | Time at which the object was created |
{
"id": "ch_abc123",
"object": "charge",
"amount": 120000,
"currency": "eur",
"status": "succeeded",
"customer": "cus_123456789",
"payment_intent": "pi_1a2b3c4d",
"payment_method": "pm_card_visa",
"description": "Rent payment — February 2025",
"refunded": false,
"amount_refunded": 0,
"receipt_url": "https://pay.casapay.com/receipts/ch_abc123",
"created": 1706140800
}Retrieve a Charge#
GET /v1/charges/:id
curl https://api.casapay.com/v1/charges/ch_abc123 \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"List Charges#
GET /v1/charges
| Parameter | Type | Description |
|---|---|---|
customer | string | Filter by customer |
payment_intent | string | Filter by PaymentIntent |
created[gte] | timestamp | Created on or after |
limit | integer | Number of objects (1–100) |
curl "https://api.casapay.com/v1/charges?payment_intent=pi_1a2b3c4d" \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"