ACTIVE, you can charge it at any time by calling the charge endpoint. No customer interaction is required. The charge is processed entirely server-side.
Overview
Charging a saved card allows you to:- Bill customers for subscriptions, memberships, or recurring services
- Charge after service delivery (on-demand services, freight, freelance work)
- Process payments when orders ship or milestones are reached
Prerequisites
Before charging a saved card:- The payment method must have a status of
ACTIVE - You must have the payment method
id(returned when creating the payment method) - The card must not be expired or revoked
Creating a Charge
Endpoint
POST /payment-method/{id}/payment
Authentication
Include your API key in the request headers:Path Parameters
The unique identifier of the payment method to charge (UUID).
Request Body
Field Descriptions
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Amount to charge in MXN. Must be at least 1 MXN. |
currency | string | No | Currency code. Defaults to "MXN". |
description | string | No | Description of the charge. |
Response
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier of the payment. |
status | string | Current status of the payment (NOT_INITIALIZED, PENDING, CONFIRMED, CANCELLED, REFUNDED). |
amount | number | The charged amount. |
currency | string | Currency code. |
Code Examples
Checking Payment Status
After creating a charge, you can check its status at any time:GET /payment-method/{id}/payment/{paymentId}
Important Business Rules
Currency restriction. Only MXN (Mexican Peso) is currently supported. Charges in other currencies will be rejected.
Error Handling
| Status Code | Error | Solution |
|---|---|---|
| 400 | Payment method not ACTIVE | Verify the payment method status is ACTIVE before charging. |
| 400 | Invalid amount | Ensure the amount is at least 1 MXN. |
| 400 | Currency not supported | Use "MXN" as the currency. |
| 401 | Unauthorized | Check your API key is valid and included in headers. |
| 404 | Payment method not found | Verify the payment method ID is correct. |
Next Steps
Process Refunds
Issue full refunds for charges made against saved cards.
Manage Payment Methods
List, retrieve, and revoke payment methods and view payment history.