Card Payment API
This API enables you to manage recurring subscriptions with credit and debit cards. With this API you can create subscriptions, preauthorize amounts, capture transactions, and cancel subscriptions when needed.Key Concepts
Subscriptions
A subscription is an agreement between the merchant and the customer to make recurring payments. Each subscription has:- Plan Name: Identifier name of the subscription plan
- Periodicity: Frequency of recurring payments
- Token: Token of the card associated with the subscription
- Customer Data: Customer information associated with the subscription
Periodicity
Periodicity defines how frequently subscription payments will be processed:| Value | Description |
|---|---|
monthly | Recurring monthly payments |
yearly | Recurring yearly payments |
custom | Custom periodicity according to plan configuration |
Transaction Flow
The payment process with subscriptions follows this flow:Preauthorization
Preauthorization reserves an amount on the customer’s card without making the actual charge. This allows:- Verifying that the card has sufficient funds
- Reserving the amount for later capture
- Validating that the card is still valid
Capture
Capture performs the actual charge to the customer’s card. You can only capture transactions that have been previously preauthorized.Subscription Renewal
To process recurring payments on existing subscriptions, use the renewal preauthorization endpoint. This endpoint:- Links the new transaction with the original preauthorization
- Maintains the history of related transactions
- Allows processing payments in each subscription cycle
Endpoints
Create Subscription
/subscription/card
Creates a new subscription by associating a card with a recurring payment plan.
Cancel Subscription
/subscription/card/cancel
Cancels an existing subscription. The operation is idempotent.
Preauthorize Transaction
/subscription/card/authorize
Preauthorizes an amount for a subscription without making the actual charge.
Renew Preauthorization
/subscription/card/authorize/renewal
Preauthorizes an amount for a new cycle of an existing subscription.
Capture Transaction
/subscription/card/capture
Captures a previously preauthorized transaction, performing the actual charge to the card.
Authentication
All endpoints require authentication through:- Basic Authentication: User credentials and password in the
Authorizationheader - Token-Top: Merchant authentication token in the
Token-Topheader - X-Merchant-ID: Unique identifier of the merchant invoking Card Payment services (required)
- X-Request-ID: Tracking identifier for request correlation (required)
Transaction States
Transactions can have the following states:| State | Description |
|---|---|
PENDING | Transaction created but not yet processed |
PROCESSING | Transaction in validation/authorization process |
APPROVED | Transaction approved successfully |
DECLINED | Transaction rejected by the provider |
REFUNDED | Transaction refunded |
CANCELLED | Transaction cancelled |
ERROR | Error in transaction processing |
Transaction Types
| Type | Description |
|---|---|
PRE_AUTH_TRANSACTION | Initial preauthorization |
RENEWAL_PRE_AUTH_TRANSACTION | Renewal preauthorization |
COMPLETION_TRANSACTION | Transaction capture |
Error Handling
All endpoints return responses with standard structure:- code: Response code
- status: Operation status
- message: Descriptive message
- data: Response data (if applicable)
ErrorResponse object is returned with:
- code: Specific error code
- message: Descriptive error message
- details: Additional error details (optional)