Cards
Payment integration with credit and/or debit cards in the Checkout API can be done in two ways for mobile applications. The recommended integration is through the Card Payment Brick (via Mercado Pago SDK Checkout), but if you want to be responsible for defining how the information is retrieved, you can integrate through Core Methods (via Mercado Pago SDK Core Methods), available for Android and iOS applications.
See below the main flow of the mobile integration via Card Payment.
The Card Payment (via Mercado Pago SDK Checkout) accelerates the implementation of card payments in native Android and iOS applications. The SDK displays the form, retrieves the required card data, allows installment selection, securely tokenizes the information, and processes the payment against an order previously created in the backend.
The main flow of this integration with the SDK Checkout is CardTransaction, where the backend creates the order with the Access Token and sends only the orderId and the clientToken to the application. This way, the private credential remains protected and the sensitive card data is handled in compliance with PCI security standards.
To integrate the Card Payment, you must first have configured the Mercado Pago SDK Checkout in the development environment and, from there, follow the steps below according to the chosen operating system.
The SDK Checkout for Android is the native library for integrating card payments in Android applications. Built in Kotlin with Jetpack Compose support, it encapsulates all communication with the Orders API — card tokenization, installment selection, brand validation, and payment submission — in a managed flow, without the developer having to handle sensitive data directly.
Distribution is done via Jetpack Compose BoM to ensure consistent versions across modules, with minimum requirements of Android 6.0+ (SDK version 23 or higher) and Kotlin 2.0+.
Before displaying the Card Payment, create an order in your backend through the /v1/ordersPOST endpoint, using your test Access TokenPrivate key of the application created in Mercado Pago and used in the backend. You can access it in Your integrations > Integration data > Tests > Test credentials..
In the CardTransaction flow, create the order in manual mode (processing_mode=manual) and do not send the payment transaction at this point. The response will provide the order id and the client_token required for the SDK to tokenize the card and process the payment against the existing order.
curlcurl -X POST \ 'https://api.mercadopago.com/v1/orders' \ -H 'Content-Type: application/json' \ -H 'X-Idempotency-Key: {{SOME_UNIQUE_VALUE}}' \ -H 'Authorization: Bearer {{YOUR_ACCESS_TOKEN}}' \ -d '{ "type": "online", "processing_mode": "manual", "total_amount": "100.00", "external_reference": "ext_ref_1234", "payer": { "email": "test@testuser.com" }, "items": [ { "title": "Product", "quantity": 1, "unit_price": "100.00" } ] }'
| Parameter | Type | Description | Required |
Authorization | Header | Refers to your private key, the test Access TokenPrivate key of the application created in Mercado Pago, used in the backend. You can access it through Your integrations > Integration data > Tests > Test credentials. The test Access Token starts with the prefix `APP_USR`.. | Required |
X-Idempotency-Key | Header | Idempotency key. This key ensures each request is processed only once, avoiding duplicates. Use a unique value in the request header, such as a UUID V4 or a random string. | Required |
processing_mode | Body. String | Order processing mode. Possible values are: - automatic: to create and process the order in automatic mode. - manual: to create the order and process it later. In this case, use manual to allow the SDK to complete and process the transaction through the client_token. | Required |
total_amount | Body. String | Total transaction amount. | Required |
payer.email | Body. String | Payer email. | Required |
On success, the API will return the created order and the authentication token for processing in the application.
json{ "id": "ORD01JS2V6CM8KJ0EC4H502TGK1WP", "status": "created", "client_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "total_amount": "100.00" }
Use the id value as orderId and the client_token value as clientToken in the SDK configuration.
In the SDK Checkout, pass the data from the order created in your backend to MPOrder. The SDK will display the form, allow installment selection, tokenize the card, and process the payment against that order.
kotlinval checkout = MercadoPagoCheckout.Builder( context = this, checkoutType = MPCheckoutType.CardTransaction( order = MPOrder( orderId = "ORD01JS2V6CM8KJ0EC4H502TGK1WP", clientToken = "order-client-token" ) ) ).build() checkout.show { result -> when (result) { is MercadoPagoCheckoutResult.Success -> { val data = result.paymentData // MPPaymentData.CardTransaction // Use data.orderId, data.orderStatus, etc. } is MercadoPagoCheckoutResult.Error -> { // Show an error message or offer a new attempt } is MercadoPagoCheckoutResult.UserCancelled -> { // Return to the cart or to the previous step } } }
| Parameter | Type | Description |
orderId | String | Order identifier (id) returned upon its creation. |
clientToken | String | Token (client_token) returned upon the order creation, representing the user credentials. |
On success, the SDK will return the following information in MPPaymentData.CardTransaction:
| Parameter | Type | Description |
orderId | String | Order identifier. |
orderStatus | String | Order status after processing. |
paymentMethodId | String | Payment method identifier. |
paymentTypeId | String | Payment method type. |
In the Core Methods integration (via the Mercado Pago SDK Core Methods) for mobile applications, the developer is responsible for defining how the information needed to complete the payment will be retrieved, including the document type and the card data (issuer and installments). This gives full flexibility to build the checkout flow experience, unlike the Card Payment integration, where the information is retrieved automatically and the interface is predefined.
The SDK Core Methods uses information captured by the secure fields, enabling the execution of the main payment operations.
In the Core Methods integration for Android applications, each method should be used according to your payment flow needs. To use them, start by creating a Core Methods instance in your class using the following Kotlin code: val coreMethods = MercadoPagoSDK.getInstance().coreMethods.
This way, you can use any of the methods listed below:
Secure fields are components designed to ensure the privacy and protection of sensitive data entered by the buyer. In full compliance with PCI standardsSet of security rules that seek to protect payment card data against fraud and data breaches., these fields ensure the application never has direct access to the entered information, which is transmitted securely only for token and transaction creation.
All interactions with these fields occur through callbacks, allowing the capture of relevant events without exposing user data. The methods described below use instances of these secure fields, so it is essential that they are properly configured in the checkout interface before using them.
Each component notifies the integrating application when a value changes, without exposing the entered data, and also reports the validation result of the field according to PCI and card rules.
In the table below you will find the details of the available components. For more information on configuration, consult the corresponding reference in GitHub.
The Get payment methods method returns the list of payment methods available from the provided card BIN, considering the rules and financial institutions valid for the configured country. This method allows you to identify the card brand, correctly define the next checkout steps, and validate card acceptance.
kotlinval coreMethods = MercadoPagoSDK.getInstance().coreMethods coroutineScope { val result = coreMethods.getPaymentMethods(bin = bin) when (result) { is Result.Success -> { print("Request success: ${result.data}") } is Result.Error -> { when (result.error) { is ResultError.Request -> { print("Request error: ${result.error}") } is ResultError.Validation -> { print("Validation error: ${result.error}") } } } } }
| Parameter | Type | Description | Required |
bin | String | The first 8 digits of the credit card, obtained via the onBinChange callback of CardNumberTextFieldEvent. | Required |
For more information about the call response, consult the method documentation on GitHub.
The Get installment conditions method searches for all installment options available for a given card and transaction amount. It considers the rules of the issuer, payment method, and purchase amount, returning all valid installment options, including number of installments, interest, installment amount, total amount, and more.
The getInstallments method call must be made for all card types (debit and credit) to verify whether payment can be completed via that method.
kotlinval coreMethods = MercadoPagoSDK.getInstance().coreMethods coroutineScope { val result = coreMethods.getInstallments( bin = bin, amount = BigDecimal("100.00") ) when (result) { is Result.Success -> { print("Request success: ${result.data}") } is Result.Error -> { when (result.error) { is ResultError.Request -> { print("Request error: ${result.error}") } is ResultError.Validation -> { print("Validation error: ${result.error}") } } } } }
Installment information to show the buyer all the details of the purchase amount and installments before finalizing the payment.| Parameter | Type | Description | Required |
bin | String | The first 8 digits of the credit card, obtained via the onBinChange callback of CardNumberTextFieldEvent. | Required |
amount | BigDecimal | Total transaction amount. | Required |
For more information about the call response, consult the method documentation on GitHub.
For certain payment methods and brands, Mercado Pago requires the identification of the card issuer. This method returns the list of available issuers for the provided BIN, allowing the buyer to select the correct issuer when necessary.
kotlinval coreMethods = MercadoPagoSDK.getInstance().coreMethods coroutineScope { val result = coreMethods.getCardIssuers( bin = bin, paymentMethodId = paymentMethodId, ) when (result) { is Result.Success -> { print("Request success: ${result.data}") } is Result.Error -> { when (result.error) { is ResultError.Request -> { print("Request error: ${result.error}") } is ResultError.Validation -> { print("Validation error: ${result.error}") } } } } }
| Parameter | Type | Description | Required |
bin | String | The first 8 digits of the credit card, obtained via the onBinChange callback of CardNumberTextFieldEvent. | Required |
paymentMethodId | String | Payment method ID, normally obtained from the result of the PaymentMethods method. | Required |
For more information about the call response, consult the method documentation on GitHub.
Mercado Pago requires validation of the cardholder's identification document. Use this method to receive all accepted document types for the country configured in the integration.
kotlinval coreMethods = MercadoPagoSDK.getInstance().coreMethods coroutineScope { val result = coreMethods.getIdentificationTypes() when (result) { is Result.Success -> { print("Request success: ${result.data}") } is Result.Error -> { when (result.error) { is ResultError.Request -> { print("Request error: ${result.error}") } is ResultError.Validation -> { print("Validation error: ${result.error}") } } } } }
For more information about the call response, consult the method documentation on GitHub.
This method generates a temporary token from the provided card data. The generated token is required for the payment transaction via the Mercado Pago API, as it replaces the sensitive card data, ensuring greater security in the process.
generateCardToken method.Create a token for a new card
To securely generate a token for a new card, use the class that protects the entered data and pass it to the generateCardToken method. Before executing the method, verify that all required fields are correctly filled.
kotlinval coreMethods = MercadoPagoSDK.getInstance().coreMethods coroutineScope { val result = coreMethods.generateCardToken( cardNumberState = cardNumberPCIFieldState, expirationDateState = expirationDatePCIFieldState, securityCodeState = securityCodePCIFieldState, buyerIdentification = BuyerIdentification( name = "APRO", number = "12345678909", type = "CPF" ) ) when (result) { is Result.Success -> { print("Request success: ${result.data}") } is Result.Error -> { when (result.error) { is ResultError.Request -> { print("Request error: ${result.error}") } is ResultError.Validation -> { print("Validation error: ${result.error}") } } } } }
| Parameter | Type | Description | Required |
cardNumberState | PCIFieldState | Card number field state. | Required |
expirationDateState | PCIFieldState | Card expiration field state. | Required |
securityCodeState | PCIFieldState | Card security code field state. | Required |
buyerIdentification | BuyerIdentification | Buyer identification class. | Required |
For more information about the call response, consult the method documentation on GitHub.
Create a token for an existing card
In Mercado Pago transactions, the card data registered by the buyer is stored securely and is not accessible from your backend. Only the card ID is provided to the application, which you must use to generate a temporary token. This protects sensitive information, as only the ID is handled, while the card number, CVV, and expiration date are not exposed and remain secure.
kotlinval coreMethods = MercadoPagoSDK.getInstance().coreMethods coroutineScope { val result = coreMethods.generateCardToken( cardId = cardId, expirationDateState = expirationDatePCIFieldState, securityCodeState = securityCodePCIFieldState, buyerIdentification = BuyerIdentification( name = "APRO", number = "12345678909", type = "CPF" ) ) when (result) { is Result.Success -> { print("Request success: ${result.data}") } is Result.Error -> { when (result.error) { is ResultError.Request -> { print("Request error: ${result.error}") } is ResultError.Validation -> { print("Validation error: ${result.error}") } } } } }
| Parameter | Type | Description | Required |
cardId | String | Existing generated card ID. | Required |
securityCodeState | PCIFieldState | Card security code field state. | Required |
expirationDateState | PCIFieldState | Card expiration field state. | Optional |
buyerIdentification | BuyerIdentification | Buyer identification class. | Required |
For more information about the call response, consult the method documentation on GitHub.
Payment submission must be done by creating an order that contains the associated payment transaction.
To do this, send a request with your test Access TokenPrivate key of the application created in Mercado Pago, used in the backend. You can access it through Your integrations > Integration data > Tests > Test credentials. The test Access Token starts with the prefix `APP_USR`. and the required parameters listed below to the /v1/ordersPOST endpoint.
curlcurl -X POST \ 'https://api.mercadopago.com/v1/orders'\ -H 'Content-Type: application/json' \ -H 'X-Idempotency-Key: {{SOME_UNIQUE_VALUE}}' \ -H 'Authorization: Bearer {{YOUR_ACCESS_TOKEN}}' \ -d '{ "type": "online", "processing_mode": "automatic", "total_amount": "50.00", "external_reference": "ext_ref_1234", "payer": { "email": "test@testuser.com" }, "transactions": { "payments": [ { "amount": "50.00", "payment_method": { "id": "master", "type": "credit_card", "token": "1223123", "installments": 1 } } ] } }'
| Parameter | Type | Description | Required/Optional |
Authorization | Header | Refers to your private key, the test Access TokenPrivate key of the application created in Mercado Pago, used in the backend. You can access it through Your integrations > Integration data > Tests > Test credentials. The test Access Token starts with the prefix `APP_USR`.. | Required |
X-Idempotency-Key | Header | Idempotency key. This key ensures each request is processed only once, avoiding duplicates. Use a unique value in the request header, such as a UUID V4 or a random string. | Required |
processing_mode | Body. String | Order processing mode. Possible values are: - automatic: to create and process the order in automatic mode. - manual: to create the order and process it later. For more information, see the Integration model section. | Required |
total_amount | Body. String | Total transaction amount. | Required |
transactions.payments.payment_method.id | Body. String | Payment method identifier. In this case, it is the brand of each card. You can consult the full list of available identifiers by sending a request to the Get payment methodsGET endpoint. | Required |
transactions.payments.payment_method.type | Body. String | Payment method type. For credit card payments use credit_card, and for debit card payments use debit_card. | Required |
transactions.payments.payment_method.token | Body. String | Card token. Required field for credit and debit card payments. | Required |
On success, the response will be similar to the example below.
json{ "id": "ORD01JS2V6CM8KJ0EC4H502TGK1WP", "type": "online", "processing_mode": "automatic", "external_reference": "ext_ref_1234", "total_amount": "50.00", "total_paid_amount": "50.00", "country_code": "URY", "user_id": "2021490138", "status": "processed", "status_detail": "accredited", "capture_mode": "automatic_async", "created_date": "2025-04-17T21:41:33.96Z", "last_updated_date": "2025-04-17T21:41:35.144Z", "integration_data": { "application_id": "874202490252970" }, "transactions": { "payments": [ { "id": "PAY01JS2V6CM8KJ0EC4H504R7YE34", "amount": "50.00", "paid_amount": "50.00", "reference_id": "0002yjis6j", "status": "processed", "status_detail": "accredited", "payment_method": { "id": "master", "type": "credit_card", "token": "519ada5ac7431ef6ce24ac19c38f6768", "installments": 1 } } ] } }
| Parameter | Type | Description |
transactions.payments.status | String | Transaction status. For example, processed indicates the payment was approved. See the Transaction status section for all possible values. |
transactions.payments.status_detail | String | Transaction status detail. For example, accredited indicates the payment was approved and credited. |
transactions.payments.paid_amount | String | Amount effectively paid in the transaction. |
Once the order and payment are created, you can check the possible states in the Order status and Transaction status sections, respectively.