AI resources

Import cards in the Mercado Pago panel

The card import feature allows businesses that already have a customer and card database to securely migrate that data to Mercado Pago. Once the migration is complete, payments are processed through the Mercado Pago platform without interruptions for customers.

This process creates tokenized cardsSecure representation of card data using a unique identifier (token) that replaces sensitive information. The token allows processing payments without exposing the actual card data. in bulk by sending an encrypted file containing card data.

To access the card import tool, you need to contact your Mercado Pago business representative beforehand. After completing this step, you will receive a URL to access the file submission interface in the Mercado Pago panel.

If you encounter any errors or unexpected issues during the integration of this solution, contact your business representative.

Grant access to collaborators

By default, access to the card import portal is restricted to users with an administrator profile. To allow other collaborators to also use this feature, create a role with the appropriate permission and assign it to the desired users.

File preparation

Prepare a .csv file specifying the data for each customer and their cards. Include the first line with the headers and separate each field with commas. All fields are required. The file supports up to 100,000 rows; if you have more cards, split the information into multiple files. The average token creation time is 60 minutes per 10,000 rows. The .csv file name must contain only letters, numbers, hyphens (-), underscores (_), and periods (.). See the specifications in the following table:

OrderHeaderDescriptionFormatExample
1external_referenceUnique customer identifier in your system.AlphanumericORD-123456
2customer_emailCardholder's email address.Alphanumeric. The username in the email must contain at least 2 characters.ej@email.com
3card_numberCard number.Numeric, from 13 to 19 digits.1234567812345678
4expiration_monthExpiration month.Numeric, 2 digits.01
5expiration_yearExpiration year.Numeric, 2 digits.25
6cardholder_nameName as it appears on the card.Use only letters without accents and spaces, avoiding numbers and special characters such as . , ; : - _ / \ ' " & @ + ( ) ñ and ç.ATILIO GARCIA

Below, you will find an example of a .csv file.

csv

external_reference,customer_email,card_number,expiration_month,expiration_year,cardholder_name
ORD-123456,ej@email.com,1234567812345678,01,25,PABLO SANCHEZ
CLI-789012,test_payer@example.com,5480832801033311,12,26,MARIA GONZALEZ
USR-345678,test_payer@example.com,4509953566233704,06,27,JOAO SILVA
REF-456789,test_payer@example.com,4012888888881881,03,28,CAROLINA PEREZ

File validations

The cardholder_name field must contain only letters without accents and spaces, avoiding numbers and special characters such as . , ; : - _ / \ ' " & @ + ( ) ñ and ç.

File encryption

The .csv file must be encrypted before submission. The expected format is PGPPretty Good Privacy: encryption protocol that ensures data confidentiality and integrity through public key cryptography. with .asc or .enc extension.

See below the encryption process using GnuPG, a free encryption software. You can use other tools or methods as long as the result is in PGP format.


Encrypted file submission

  1. Access the URL provided by your business representative.
  2. In the Token generation interface, drag or select the encrypted file (.asc or .enc).

Batch token generation screen

  1. Verify the file name is correct and click Generate Tokens.

File upload interface

The system will display the status "Generating tokens...". Completion may take several hours depending on the file size. You can monitor the procedure in the Latest results field.

Latest results section

Results file interpretation

Once processing is complete, check the result on the Mercado Pago panel. Only cases processed completely successfully or partially generate a results file.

Results location

  1. Check the most recent status of your submissions in the Latest results section.
  2. Click the download link to get a .csv file with details of the generated tokens and any errors.

Processing status Results history

If you have completed the token creation but have not yet processed charges on the platform, contact your business representative to continue with the integration process.

Error resolution

If processing was partial, the results file will include the errors found. See the following table to identify and resolve each error type.

Results file example

ErrorDescriptionResolution
Customer record generated incorrectlyError creating the customer record or adding the card.Review customer and card data. If the error persists, contact your business representative.
Error linking a cardCould not determine the payment method.Review card data or use a different card.
Token generated incorrectlyIncorrect card data was entered.Review the card number and expiration date.
Expired expiration dateThe expiration dates entered are past dates.Verify that expiration dates are in the future.
Invalid email formatThe email does not meet the allowed format (example@email.com).Correct the email format.
Invalid email syntaxThe email contains disallowed characters.Review the email characters.
The card is invalidThe registered data corresponds to an invalid card.Use a different card.

Common file errors

See the most common issues when preparing the file and how to fix them.

ProblemInvalid exampleHow to fix it
cardholder_name with disallowed charactersJOSE PEREZ S.A., MARÍA GÓMEZ, JOÃO SILVA, ANA-MARIA, CLIENTE & CIAUse only letters without accents and spaces. For example: JOSE PEREZ, MARIA GOMEZ, JOAO SILVA.
Malformed CSV fileEntire row enclosed in quotes or different separator usedExport the file as comma-separated CSV and keep the exact header from the template.
Empty linesA row with no data between recordsRemove empty lines before sending the file.
Expired cardexpiration_month=01, expiration_year=24Send only cards with a future expiration date.
Incorrect card_numberToken, card_id or internal identifier instead of PANSend the plain PAN of the card, with 13 to 19 digits.
Invalid customer_email formatcliente@, cliente.com, cliente@@email.comUse a standard email format, for example cliente@email.com.

Once you have identified the errors, fix and upload a new file only with corrected data for records that had problems. You can perform as many imports as needed.