Pub Version GitHub

MercadoPago Flutter

A Flutter package that mix the best of mercadopago_transparent and mercado_pago packages.

Note: this is a work in progress project.

For detailed docs about MercadoPago, please visit MercadoPago Developers Guides.


Currently includes:

  • Document identification types available on MercadoPago.
  • New card token generation.
  • Card token generation for an already saved card.


Initialize the package by generating a new MercadoPago instance:

import 'package:mp_flutter/mp_flutter.dart';

MercadoCredentials mercadoCredentials = MercadoCredentials(accessToken: 'ACESS_TOKEN');

final mercadoPago = MercadoPago(mercadoCredentials);

Document Types

To get a list of identification types available on MercadoPago

List<DocumentType>? documentTypes = <DocumentType>[];

  .then((obj) {
    if (obj.isSuccessful) {
      documentTypes = (json.decode( as List)
        .map((dt) => DocumentType.fromJson(dt))

Generate new card token

To generate a new card token use the newCard function.

Note: To get more details about payment types, id, etc, visit: MercadoPago payment methods docs.

CardToken cardToken;

  code: '123',
  year: '2025',
  month: 11,
  cardNumber: '4509953566233704',
  documentNumber: '12345678',
  documentType: 'DNI',
  fullName: 'APRO'
).then((obj) {
  if (obj.isSuccessful) {
    cardToken = CardToken.fromJson(;

Token with Card

Generate a token from a card already saved

CardSavedToken cardSavedToken;

  cardId: '1587964933876',
  securityCode: '333'
).then((obj) {
  if (obj.isSuccessful) {
    cardSavedToken = CardSavedToken.fromJson(;


Please, feel free to open an Issue if you found any bugs or submit a PR.


mp_flutter is licensed under MIT.


View Github