Fast Payments by Mercado Pago
With Fast Payments by Mercado Pago, you allow eligible buyers to pay with the methods already available in their Mercado Pago account, without entering their payment data again.
The integration uses Payment Brick, a ready-to-use visual component that speeds up implementation and keeps the payment experience within the checkout. This reduces the experience development required and lets you focus the implementation on payment configuration and processing.
In addition, integrations for mobile applications are outside the scope of this integration.
| Experience | Available payment methods | Mobile web integration | Desktop web integration | Main integration elements |
| Mercado Pago renders the payment methods and handles authentication. | Saved cards and account money, according to eligibility. | Android (Chrome, Firefox, and Microsoft Edge). iOS (Chrome and Safari). | Chrome, Firefox, Safari, and Microsoft Edge. | quickCheckout: ["fastPayment"] in initialization, payment method types declared in paymentMethods (creditCard, debitCard, prepaidCard, and bankTransfer), and PaymentFormData. |
With Payment Brick, Mercado Pago renders the available methods, authenticates the buyer, and delivers the payment data through the onSubmit callback. On desktop web, the buyer confirms the payment with an OTP. On mobile web, the buyer can confirm it with Passkey or OTP and, on Android, also in the Mercado Pago or Mercado Libre app. Payment processing is performed by creating an order through the /v1/ordersPOST endpoint.
sequenceDiagram
participant Buyer
participant Brick as Payment Brick
participant MP as Mercado Pago
participant Backend as Your backend
Brick->>MP: Initializes with quickCheckout and the declared methods
MP->>MP: Validates eligibility, session, and methods
MP->>MP: Applies the declared methods and the installment range
MP->>Buyer: Requests authentication by OTP on desktop, or by Passkey, OTP, or the Mercado Pago or Mercado Libre app (Android) on mobile
Buyer-->>MP: Authorizes the payment
MP-->>Brick: onSubmit(PaymentFormData)
Brick->>Backend: Sends PaymentFormData
Backend->>MP: POST /v1/orders
MP-->>Backend: Returns the order
PaymentFormData, tokens, emails, or payment payloads to the console or telemetry.Follow the steps below to integrate Payment Brick.
Add the JS SDK v2 to the page's <head> using the URL below, which loads the current SDK version without requiring you to pin a version.
html<script src="https://sdk.mercadopago.com/js/v2"></script>
The tag exposes the global MercadoPago constructor used in the next step.
With the SDK loaded in the previous step, initialize MercadoPago with your Public Key and create the Payment Brick instance. The SDK provides the constructor and the component; your integration configures the payment methods and callbacks.
Initialize Payment Brick with quickCheckout: ["fastPayment"] in initialization. Then, declare in paymentMethods the payment method types the buyer can use with the creditCard, debitCard, prepaidCard, and bankTransfer keys.
These keys also configure the payment methods available in the guest flow. For more information, see Choose the Fast Payments methods, in step 3.
javascriptconst mp = new MercadoPago("YOUR_PUBLIC_KEY"); const bricks = mp.bricks(); const settings = { initialization: { amount: 100, payer: { email: "test@testuser.com" }, quickCheckout: ["fastPayment"], }, customization: { paymentMethods: { creditCard: "all", debitCard: "all", prepaidCard: "all", bankTransfer: ["account_money"], }, }, callbacks: { onReady: () => hideLoader(), onSubmit: async (paymentFormData) => { const response = await fetch("/process_payment", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(paymentFormData), }); if (!response.ok) throw new Error("PAYMENT_PROCESSING_FAILED"); return response.json(); }, onError: (error) => { hideLoader(); if (!isFastPaymentUnavailableError(error)) return; hideFastPayments(); showCheckoutFallback(); }, }, }; await bricks.create("payment", "paymentBrick_container", settings);
creditCard, debitCard, and prepaidCard declared, this example creates a mixed checkout. In that case, Fast Payments critical errors do not trigger onError, and the contingency flow in step 6. Handle errors does not run. That flow applies only to a Fast Payments-only checkout, such as bankTransfer: ["account_money"]./process_payment route belongs to your integration. Protect it with your technology's session and CSRF (Cross-Site Request Forgery) controls, validate the request body on the server, and return generic messages.
Never expose the Access TokenPrivate key used in the backend to authenticate requests to Mercado Pago APIs. It must never be shared or exposed in the frontend. in the browser.
When Payment Brick is ready, the onReady callback runs and you can remove the loading indicator.
Activate Fast Payments
To activate Fast Payments, include "fastPayment" in the initialization.quickCheckout list and declare the payment method types in customization.paymentMethods, as described in Choose the Fast Payments methods, in step 3.
This configuration is available only in Payment Brick. In other Bricks, such as Wallet Brick, the SDK ignores quickCheckout.
When configuring the activation, consider the following behaviors:
- If
quickCheckoutis not a list containing"fastPayment"with that exact spelling, Payment Brick keeps the guest flow and logs a warning to the console. This happens, for example, with an empty list, an object, a string, or["FastPayment"]. "fastPayment"is the only accepted value for now. Payment Brick ignores other items in the list and logs a warning to the console.- If no payment method type is declared in
paymentMethods, Fast Payments has no methods to display and Payment Brick logs a warning to the console. - Fast Payments requires
initialization.amountgreater than zero and a validinitialization.payer.email, which identifies the buyer's Mercado Pago account. Without this data, Payment Brick keeps the guest flow.
Limitations with Fast Payments active
The following limitations apply whenever Fast Payments is active for the buyer, in any configuration (Fast Payments-only or mixed checkout). When the buyer is not eligible and Payment Brick displays the guest flow, the component works as before.
update({ amount })returnsfalse, logs a warning to the console, and changes nothing, not evenshippingoritemssent in the same call. The component does not triggeronError. To use another amount, reload Payment Brick. While a Fast Payments payment is being submitted,update({ amount })also returnsfalse.processingMode: "gateway"andmerchantAccountIdare ignored throughout Payment Brick, which processes payments asaggregator, and logs a warning to the console.- When at least one Fast Payments method is displayed, the option to pay with redirection to Mercado Pago (
wallet_purchase) is not displayed, with or withoutinitialization.marketplace, anddefaultPaymentOption.walletFormdoes not open any option. - While Fast Payments credit options are not available, the Mercado Pago credits onboarding option (
onboarding_credits) is still displayed as usual.
With Fast Payments active, configure the methods you want to offer at checkout. In addition to selecting the accepted method types and card brands, you can define the installment range and combine the experience with saved cards from Customers & Cards.
Choose the Fast Payments methods
Declare the payment method types in customization.paymentMethods. Mercado Pago applies this configuration to the methods saved in the buyer's account and displays only those that match the declared types and card brands.
| Key | Accepted values | Effect on Fast Payments |
creditCard | "all" or card brand identifiers (string or list), such as "visa" or ["visa", "master"]. | Displays saved credit cards. When you specify card brands, displays only cards of those brands. |
debitCard | "all" or card brand identifiers. | Displays saved debit cards, according to the specified card brands. |
prepaidCard | "all" or card brand identifiers. | Displays saved prepaid cards, according to the specified card brands. |
bankTransfer | "all" or a list containing "account_money". | Displays account money. |
Card brand identifiers are not case-sensitive. To disable a payment method type, use "none", "", [], or null in the corresponding key.
If no key is declared or the configuration does not allow any Fast Payments method, the component does not display methods from this flow and logs a warning to the console.
Checkout behavior
The keys declared in paymentMethods also configure the methods available in the guest flow. Therefore, the selected methods determine whether the checkout offers only Fast Payments or combines this experience with guest flow options (mixed checkout).
With quickCheckout: ["fastPayment"] active, the eligible buyer sees the following options:
Configuration in paymentMethods | Options displayed to the eligible buyer | Checkout behavior |
bankTransfer: ["account_money"] | Account money. | Fast Payments-only checkout. |
creditCard: "all" | Credit cards saved in Fast Payments and a form to enter a new card. | Mixed checkout. |
bankTransfer: "all" | Account money from Fast Payments and bank transfer methods from the guest flow. | Mixed checkout. |
The account_money method is available only in Fast Payments. Buyers who are not eligible see only the methods configured for the guest flow.
If the checkout offers only Fast Payments, implement the contingency flow described in step 6. Handle errors for unavailability cases.
Configure installments (optional)
To limit the installment options of Fast Payments cards, use minInstallments and maxInstallments in customization.paymentMethods. These parameters define the minimum and maximum number of installments, respectively.
Payment Brick applies the configured range as follows:
- Displays only the installment options within the range. If a card has no option within that range, it is not displayed, and the Payment Brick logs a warning to the console.
- When
minInstallmentsis greater than or equal to2, does not display debit and prepaid cards, since these methods accept only single payments. - When
minInstallmentsis greater thanmaxInstallments, swaps the values and logs a warning to the console.
Combine with saved cards from Customers & Cards (optional)
If your integration also uses saved cards from Customers & Cards, send initialization.payer.customerId and cardsIds, as described in Include saved cards.
When a card is saved both in the buyer's Mercado Pago account and in Customers & Cards, Payment Brick applies the following behaviors:
- Displays the card only once, as Fast Payments.
- If the
paymentMethodsconfiguration hides the Fast Payments card, displays the Customers & Cards card. defaultPaymentOption.savedCardFormwith the identifier of one of these cards opens the Fast Payments card.
The onSubmit callback delivers an object containing the payment data (PaymentFormData). Send this object directly to your backend without wrapping it in another structure, such as { formData: paymentFormData }.
javascriptconst callbacks = { onSubmit: async (paymentFormData) => { const response = await fetch("/process_payment", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(paymentFormData), }); if (!response.ok) throw new Error("PAYMENT_PROCESSING_FAILED"); return response.json(); }, };
PaymentFormData as the request body, without changes or an outer key such as { formData: paymentFormData }. This way, the body keeps the PaymentFormData envelope (paymentType, selectedPaymentMethod, and formData), and your backend must read the payment fields from formData.When the selected method comes from Fast Payments (a card saved in the account or account money), formData includes fast_payment: true, available at paymentFormData.formData.fast_payment. For other methods, the key is not sent.
Use formData.fast_payment in your backend to decide how to process the payment. Fast Payments methods are processed only by creating an order (POST /v1/orders), as described in step 5. Send payment. If your integration processes the other Payment Brick methods through the Payments API (POST /v1/payments), keep that flow for them and send only payments with fast_payment: true to POST /v1/orders. If your integration already uses POST /v1/orders for all methods, no routing is needed.
javascript// Backend (Node.js), /process_payment route app.post("/process_payment", async (req, res) => { const { formData } = req.body; // PaymentFormData received unchanged if (formData.fast_payment === true) { // Fast Payments: always through the Orders API return res.json(await createOrder(formData)); // POST /v1/orders } // Other methods: keep the integration's current flow return res.json(await createPayment(formData)); // POST /v1/payments or POST /v1/orders });
The createOrder and createPayment functions are illustrative.
The payment must be sent by creating an order containing the associated payment transaction.
If your integration uses Split Payments 1:N or 3DS, the adjustments to the payment submission are in (Optional) Combine Fast Payments with other features, at the end of this page.
To do this, send a request with your Test Access TokenPrivate key linked to an application, used in the backend to authenticate operations in the test environment. You can find it in the application's Credentials section, within the test environment. It cannot process real payments, must never be exposed in the frontend, and starts with the `APP_USR` prefix. and the required parameters listed below to the /v1/ordersPOST endpoint. Use the payment data (PaymentFormData) received from Payment Brick in the previous step.
processing_mode=manual) can have an expiration period defined in the expiration_time field. If the field is not sent, the default period is P1D (one day). When the period expires before the order reaches a final status, it is automatically closed, the associated pending payments are canceled, and the integrator is notified.curlcurl --request POST \ --url 'https://api.mercadopago.com/v1/orders' \ --header 'Authorization: Bearer {{YOUR_ACCESS_TOKEN}}' \ --header 'Content-Type: application/json' \ --header 'X-Idempotency-Key: {{SOME_UNIQUE_VALUE}}' \ --data '{ "type": "online", "processing_mode": "automatic", "external_reference": "order_1234", "total_amount": "100.00", "payer": { "email": "test@testuser.com" }, "config": { "location": { "state_id": "AR-B" } }, "transactions": { "payments": [ { "amount": "100.00", "payment_method": { "id": "{{PAYMENT_METHOD_ID}}", "type": "{{PAYMENT_METHOD_TYPE}}", "token": "{{PAYMENT_METHOD_TOKEN}}", "installments": 1 } } ] } }'
429 Too Many Requests error, wait for the time indicated in the response's Retry-After header before trying again. See Possible errors for more information.The table below describes the required request parameters and any optional parameters with important particularities.
| Parameter | Type | Description | Requirement |
Authorization | Header | Refers to your private key, the test Access TokenPrivate key linked to an application, used in the backend to authenticate operations in the test environment. You can find it in the application's Credentials section, within the test environment. It cannot process real payments, must never be exposed in the frontend, and starts with the `APP_USR` prefix.. | Required |
X-Idempotency-Key | Header | Idempotency key. This key ensures that 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 |
type | Body. String | Order type. For payments processed through Checkout API, the value must be online. | 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 this integration, use automatic. For more information, see the Integration model section. | Required |
expiration_time | Body. String | When an order is created in manual mode (processing_mode=manual), this parameter lets you define its expiration time using the ISO 8601 duration format. The period starts at created_date and the maximum limit is 2920 hours. If not sent, the default value will be P1D (one day). This parameter must not be sent when creating an order in automatic mode (processing_mode=automatic). | Optional |
config.location | Body. Object | Information about the payer's location. | Optional |
config.location.state_id | Body. String | Code of the payer's state, province, or administrative region, formed by the two-letter country code, followed by a hyphen and the location code. See the accepted values.Buenos Aires (AR-B); Capital Federal (AR-C); Catamarca (AR-K); Chaco (AR-H); Chubut (AR-U); Córdoba (AR-X); Corrientes (AR-W); Entre Ríos (AR-E); Formosa (AR-P); Jujuy (AR-Y); La Pampa (AR-L); La Rioja (AR-F); Mendoza (AR-M); Misiones (AR-N); Neuquén (AR-Q); Río Negro (AR-R); Salta (AR-A); San Juan (AR-J); San Luis (AR-D); Santa Cruz (AR-Z); Santa Fe (AR-S); Santiago del Estero (AR-G); Tierra del Fuego (AR-V); Tucumán (AR-T). | Optional |
external_reference | Body. String | External order reference, which can be, for example, a hashcode functioning as a transaction source identifier. It must match the checkout that originated PaymentFormData. | Required |
total_amount | Body. String | Total transaction amount. It must be greater than 0 and match the amount calculated by your integration. | Required |
payer.email | Body. String | Buyer email returned in PaymentFormData. | Required |
transactions.payments[].amount | Body. String | Payment amount. It must be equal to total_amount. | Required |
transactions.payments[].payment_method.id | Body. String | Identifier of the selected payment method, received in PaymentFormData. For account money, the value is account_money; for cards, send the identifier received. | Required |
transactions.payments[].payment_method.type | Body. String | Category of the payment method received in PaymentFormData, such as credit_card, debit_card, prepaid_card, or account_money. | Required |
transactions.payments[].payment_method.token | Body. String | Token for the authorized method, received in PaymentFormData. Send it unchanged. | Required |
transactions.payments[].payment_method.installments | Body. Integer | Installment selected by the buyer for cards. Omit it for account money. | Conditional |
On success, the response will look similar to the following example.
json{ "id": "ORD01JS2V6CM8KJ0EC4H502TGK1WP", "type": "online", "processing_mode": "automatic", "external_reference": "order_1234", "total_amount": "100.00", "total_paid_amount": "100.00", "status": "processed", "status_detail": "accredited", "transactions": { "payments": [ { "id": "PAY01JS2V6CM8KJ0EC4H504R7YE34", "amount": "100.00", "paid_amount": "100.00", "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 actually paid in the transaction. |
expiration_time | String | Expiration period (in ISO 8601 format) returned for an order created in manual mode (processing_mode=manual), counted from created_date. When omitted from the request, the returned default will be P1D (one day). This parameter will not be returned for an order created in automatic mode (processing_mode=automatic). |
After creating the order, configure notifications to receive payment updates.
If the onError callback reports a Fast Payments error with type equal to critical, run the following contingency flow to end the unavailable experience and offer an alternative checkout:
- Use
onReadyto end the loading state and prevent the interface from remaining blocked. - Hide or remove the Fast Payments by Mercado Pago container to prevent further interactions with an unavailable option.
- Stop additional automatic retries to prevent a request loop.
- Display an informative message to the buyer and provide the fallback checkout.
- Log only the step in which the failure occurred and a sanitized correlation identifier, without including sensitive data.
The onError callback receives an object with the fields type, which classifies the error as critical or non_critical; cause, which identifies its cause; and message, which describes the error.
Fast Payments has two stages: authentication, performed by Mercado Pago when Payment Brick initializes, without buyer interaction, and authorization, in which the buyer confirms the payment with OTP, Passkey, or the app. Authentication failures are critical; authorization failures or cancellations are non_critical.
The table below lists the Fast Payments errors:
cause | type | When it occurs |
wallet_not_available | critical | The buyer is not eligible or the site is not supported. |
wallet_authentication_failed | critical | Technical failure when starting buyer authentication, during Payment Brick initialization and before the Fast Payments methods are displayed. The buyer has not interacted yet. |
wallet_payment_methods_failed | critical | The methods saved in the buyer's account could not be loaded. |
wallet_payment_methods_unavailable | critical | No saved payment method is compatible with the declared methods or with the configured installment range. |
wallet_authorize_payment_failed | non_critical | The buyer's payment confirmation (OTP, Passkey, or app) failed or was canceled. onSubmit is not called and the buyer can try again. |
The handling depends on the error type and on the methods available at checkout:
criticalerrors: triggeronErroronly when Payment Brick has no other payment method to display, in a Fast Payments-only checkout. In that case, run the contingency flow described in this step. In a mixed checkout, the component keeps the guest flow methods available and these errors do not triggeronError.non_criticalerror: the authorization failure does not triggeronSubmit, and the buyer can try again.
javascriptconst isFastPaymentUnavailableError = (error) => error.type === "critical" && error.cause.startsWith("wallet_"); const callbacks = { onReady: () => { hideLoader(); }, onError: (error) => { hideLoader(); if (!isFastPaymentUnavailableError(error)) return; hideFastPayments(); showCheckoutFallback(); }, };
hideLoader, hideFastPayments, and showCheckoutFallback are illustrative functions that must be implemented by your integration.Each critical cause is reported only once. After it, unmount Payment Brick and display the fallback checkout.
The example below combines the page structure, Payment Brick initialization, and the submission of PaymentFormData to your backend. The /process_payment route must create the order as described in step 5. Send payment.
- Create the container in which Payment Brick will render and load the SDK and the file containing the integration logic.
html<div id="paymentBrick_container"></div> <script src="https://sdk.mercadopago.com/js/v2"></script> <script src="./checkout.js"></script>
- Then, in the
checkout.jsfile, initialize the payment component (Payment) withquickCheckout: ["fastPayment"]and the payment method types the buyer can use. The submission callback (onSubmit) sends the payment data object (PaymentFormData) unchanged to your backend route, while the error callback (onError) displays the fallback checkout if Fast Payments by Mercado Pago is unavailable.
javascriptconst mp = new MercadoPago("YOUR_PUBLIC_KEY"); const bricks = mp.bricks(); const isFastPaymentUnavailableError = (error) => error.type === "critical" && error.cause.startsWith("wallet_"); const settings = { initialization: { amount: 100, payer: { email: "test@testuser.com" }, quickCheckout: ["fastPayment"], }, customization: { paymentMethods: { creditCard: "all", debitCard: "all", prepaidCard: "all", bankTransfer: ["account_money"], }, }, callbacks: { onReady: () => hideLoader(), onSubmit: async (paymentFormData) => { const response = await fetch("/process_payment", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(paymentFormData), }); if (!response.ok) throw new Error("PAYMENT_PROCESSING_FAILED"); return response.json(); }, onError: (error) => { hideLoader(); if (!isFastPaymentUnavailableError(error)) return; hideFastPayments(); showCheckoutFallback(); }, }, }; await bricks.create("payment", "paymentBrick_container", settings);
creditCard, debitCard, and prepaidCard declared, this example creates a mixed checkout. In that case, Fast Payments critical errors do not trigger onError, and the contingency flow in step 6. Handle errors does not run. That flow applies only to a Fast Payments-only checkout, such as bankTransfer: ["account_money"].hideLoader, hideFastPayments, and showCheckoutFallback functions are illustrative. Implement them according to your integration's interface and fallback checkout.If your integration uses any of the features below, adjust the payment submission in step 5. Send payment, made through the /v1/ordersPOST endpoint.
For 3DS, also implement the display of the Challenge in the frontend. For more details on each feature, see the Split Payments 1:N and 3DS documentation.
Combine Fast Payments with Split Payments 1:N
Split Payments 1:N lets you split the amount of an order between a primary seller and up to 10 secondary sellers. Before including a secondary seller in the order, confirm that their split consent has ACTIVE status.
When creating the order, apply the following adjustments:
- Include the
splitsarray, with thereceiver_id,receiver_type(ownerorpartner), andamountof each participant. - Set
config.split_rules.amount_typetofixedorpercentage. - Send the
X-Meli-Session-Idheader with the buyer's Device ID.
Combine Fast Payments with 3DS 2.0
With Fast Payments, you can use 3DS 2.0 for card payments. It lets the issuer request additional authentication, according to the transaction risk.
To integrate this flow, follow these steps:
- When creating the order, include
config.online.transaction_securitywithvalidation: "on_fraud_risk"andliability_shift: "required". - If the response returns
status: action_requiredandstatus_detail: pending_challenge, display the Challenge in an iframe at checkout, using the URL returned intransactions.payments[].payment_method.transaction_security.url. - After the Challenge is completed, check the updated order status through the /v1/orders/{id}GET endpoint.
Completing the Challenge does not guarantee that the payment has reached a final status. Follow the 3DS documentation to identify when authentication is complete and track the payment result.
To select the methods available at checkout, follow the guidance in step 3. Configure the payment methods, considering the methods compatible with each feature.
The example below shows how to declare the methods in customization.paymentMethods:
javascriptconst settings = { initialization: { amount: 100, payer: { email: "test@testuser.com" }, quickCheckout: ["fastPayment"], }, customization: { paymentMethods: { creditCard: "all", debitCard: "all", bankTransfer: ["account_money"], }, }, };
The creditCard and debitCard keys also enable the form to enter a new card. This form is compatible with Split Payments 1:N and 3DS.