Payments & customers
Charges
Make direct charges to saved payment methods. Ideal for recurring charges or one-click payments.
POST
/v1/charges
Create charge
Charges a saved payment method.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
amount |
number | Yes | Amount in decimals (e.g. 100.00 = $100.00) |
currency |
string | Yes | ISO currency code |
payment_method |
string | Conditional* | ID of the saved payment method |
token |
string | Conditional* | Card token generated with recaudo.js (tok_xxx for Conekta, pm_xxx for Stripe) |
card |
object | No | Card info from recaudo.js: { brand, last4, exp_month, exp_year }. Recommended for better tracking |
customer |
string | Conditional* | Customer ID (required if using payment_method) |
description |
string | No | Charge description |
Request
curl -X POST https://recaudo.app/api/v1/charges \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"amount": 250.00,
"currency": "MXN",
"token": "tok_abc123...",
"card": {
"brand": "visa",
"last4": "4242",
"exp_month": 12,
"exp_year": 2027
},
"description": "Cargo por servicio premium"
}'
Response
201
{
"id": "8d8f4fa9-cbab-4913-93b1-38bdc9999eb8",
"object": "charge",
"amount": 250.00,
"currency": "MXN",
"status": "succeeded",
"customer_id": "8e250c25-9d84-4892-98ec-d71fc1fcd3c7",
"payment_method_id": "pm_card_xyz123",
"description": "Cargo por servicio premium",
"payment_intent_id": "pi_789xyz",
"receipt_url": "https://recaudo.app/receipt/8d8f4fa9-cbab-4913-93b1-38bdc9999eb8",
"created_at": "2024-01-15T10:30:00Z"
}
POST
/v1/charges/:id/refund
Refund charge
Makes a full or partial refund of a charge.
Request (partial refund)
curl -X POST https://recaudo.app/api/v1/charges/8d8f4fa9-cbab-4913-93b1-38bdc9999eb8/refund \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"amount": 100.00,
"reason": "customer_request"
}'
Response
200
{
"id": "re_xyz789abc",
"object": "refund",
"amount": 100.00,
"currency": "MXN",
"charge_id": "8d8f4fa9-cbab-4913-93b1-38bdc9999eb8",
"status": "succeeded",
"reason": "customer_request",
"created_at": "2024-01-15T11:00:00Z"
}
Was this page helpful?
Thanks for letting us know.