Accept Card Payments
Accept card payments in a single API request. Process credit and debit cards from Visa, Mastercard, and American Express. Each payment creates a payment order that you can track and manage.Create a Card Payment
Complete Request Example
Successful Response
What Happens During Payment
1
Customer Created or Updated
Cheqpay creates a new customer record or updates an existing one based on the
externalId.2
Card Tokenized
The card is securely tokenized. Sensitive data never touches your servers.
3
Authorization
The payment is authorized by the card network (Visa, Mastercard, Amex).
4
Funds Captured
Funds are captured immediately upon successful authorization.
5
Status Updated
Payment status updates to
COMPLETED and you can fulfill the order.6
Customer Notified
Customer receives a confirmation email (if notifications are enabled).
Required Fields
Payment Information
| Field | Type | Required | Description |
|---|---|---|---|
externalId | string | Yes | Your unique order ID |
amount | integer | Yes | Amount in cents (10000 = $100.00) |
currency | string | Yes | ISO currency code (MXN, USD) |
description | string | No | Payment description |
Customer Information
| Field | Type | Required | Description |
|---|---|---|---|
customer.firstName | string | Yes | Customer’s first name |
customer.lastName | string | Yes | Customer’s last name |
customer.email | string | Yes | Customer’s email address |
customer.phoneNumber | string | No | Phone with country code |
customer.externalId | string | No | Your customer ID |
Card Details
| Field | Type | Required | Description |
|---|---|---|---|
paymentMethod.type | string | Yes | Must be “card” |
paymentMethod.cardDetails.number | string | Yes | Card number (13-19 digits) |
paymentMethod.cardDetails.expiryMonth | string | Yes | Expiry month (01-12) |
paymentMethod.cardDetails.expiryYear | string | Yes | Expiry year (2-digit YY format, e.g., “25” for 2025) |
paymentMethod.cardDetails.cvc | string | Yes | Card security code |
Billing Address (Required)
Billing address is required for all card payments:Save Cards for Future Use
Enable faster payments for returning customers by saving the card:paymentMethodId you can use for future charges:
Learn More About Saved Cards
View complete payment methods documentation
Charge a Saved Card
Use a previously saved card with just the payment method ID:Handle Authentication (3D Secure)
Some payments require 3D Secure (3DS). The flow can be frictionless (no customer action) or require a challenge. Cheqpay guides you through three steps.Step 1 — Collect Device Data (Invisible Iframe)
When 3DS is needed, the payment order returnsPAYER_AUTHENTICATION_DEVICE_DATA_REQUIRED with a device collection URL and JWT:
Step 2 — Check Enrollment
After device collection completes, call the enrollment check endpoint:COMPLETED— Frictionless approval (no challenge). You are done.FAILED— Declined. Show an error to the customer.PAYER_AUTHENTICATION_CHALLENGE_REQUIRED— Show the 3DS challenge using the providedstepUpUrlandjwt.
Step 3 — Validate Challenge Result
When the bank finishes the challenge, you will receive a result identifier (from the iframe integration). Use it to validate and complete the payment:COMPLETED— Payment successful ✓FAILED— Declined
Complete 3D Secure Guide
Learn how to implement 3D Secure authentication
Improve Approval Rates
Include Device Information
Sending device data helps banks assess risk and approve more payments:Best Practices
Include Billing Address
Include Billing Address
Billing address verification helps prevent fraud and improves approval rates by 3-5%.
Send Device Data
Send Device Data
Device information enables better fraud detection and smoother 3D Secure flows.
Use Consistent Customer Data
Use Consistent Customer Data
Keep customer information consistent across payments for better approval rates.
Save Payment Methods
Save Payment Methods
Returning customers with saved cards have higher approval rates.
Error Handling
Handle declined payments gracefully:Error Handling Guide
Learn how to handle errors and declined payments
Testing
Use these test cards in sandbox:| Card Number | Brand | Result |
|---|---|---|
| 4000000000002503 | Visa | Successful payment |
| 5200000000002151 | Mastercard | Successful payment |
| 4000000000000002 | Visa | Card declined |
Complete Testing Guide
View all test scenarios and cards