Perform test purchase
The testing process varies according to the integrated QR Code model. Select the corresponding model and follow the steps below to simulate a complete payment flow using the QR Code.
Follow the steps described in each test scenario to simulate a payment flow with a static model QR code.
To test the correct creation of an order and the associated payment processing, follow the steps below.
-
Create a store and POS ensuring you use your test Access Token when making the necessary requests. Additionally, make sure to set the
fixed_amount=truefield when creating the POS. The links in the QR object response provide the QR code images for your POS. For more details, see the documentation Create store and POS. -
Still using your test Access Token, send a POST to the endpoint /v1/orders making sure to include the
external_pos_idfrom the POS created in the previous step. For more details, see the documentation Integrate payment processing > Create an order. -
Store the order identifier, returned in the response to its creation under the
idparameter, to be able to verify the correct functioning of your webhook notifications. -
Download the Mercado Pago app on your mobile device, available for Android and iOS, install it, and then log in with the buyer test account credentials. If, when logging in with a test account or navigating through the Your integrations sections, email authentication is requested, access our documentation to learn how to validate login with test accounts.
-
Use your mobile device to scan the QR code generated earlier. The app will show the order value and available payment options.
-
Make the payment using the test cards available in the buyer test user account, considering the following scenarios:
| Card type | Brand | Number | Security code | Expiration date | Behavior |
| Credit | Mastercard | 5416 7526 0258 2580 | 123 | 11/30 | Generates an approved payment |
| Credit | Visa | 4168 8188 4444 7115 | 123 | 11/30 | Generates an approved payment |
| Debit | Mastercard Debit | 5241 0198 2664 6950 | 123 | 11/30 | Generates a rejected payment |
| Credit | Mastercard | 5545 2528 7325 6265 | 123 | 4/44 | Generates an approved payment without requiring CVV. |
- Verify that you received the Mercado Pago webhook notification for the order and payment processing. The
actionfield will have the valueorder.processed, which indicates that the order was processed, and within thetransactions.paymentsnode you can see the payment status, as shown in the webhook notification example below.
json
{ "action": "order.processed", "api_version": "v1", "application_id": "7364289770550796", "data": { "external_reference": "ER_123456", "id": "ORD01JV3AW3NFSTSTB669F41NACDX", "status": "processed", "status_detail": "accredited", "total_amount": "30.00", "total_paid_amount": "30.00", "transactions": { "payments": [ { "amount": "30.00", "id": "PAY01JV3AW3NFSTSTB669F4JSAA6C", "paid_amount": "30.00", "payment_method": { "id": "account_money", "installments": 1, "type": "account_money" }, "reference": { "id": "92937960454" }, "status": "processed", "status_detail": "accredited" } ] }, "type": "qr", "version": 2 }, "date_created": "2025-05-12T22:46:59.635090485Z", "live_mode": false, "type": "order", "user_id": "1403498245" }
To confirm that the payment flow works correctly, you can perform a refund of the transaction processed in the previous step.
To do this, send a POST to the endpoint Refund an order, making sure to include the id of the order you want to refund and which was obtained in the response to its creation. If you have questions about how to do this, access the section Integrate payment processing > Refund an order.
Finally, verify that you received the corresponding Mercado Pago webhook notification for this transaction, which should indicate in the action field the value order.refunded and also the refunded payment status.
json
{ "action": "order.refunded", "api_version": "v1", "application_id": "7364289770550796", "data": { "external_reference": "ER_123456", "id": "ORD01JV3AW7R6WME2XT0KZRX7HVS6", "status": "refunded", "status_detail": "refunded", "total_amount": "30.00", "total_paid_amount": "30.00", "type": "qr", "version": 3 }, "date_created": "2025-05-12T22:47:05.813331521Z", "live_mode": false, "type": "order", "user_id": "1403498245" }
To validate the functioning of the payment cancellation flow, follow the steps below:
- Cancellation of a test order is only possible when it has the status
created. Therefore, create a new payment order by sending a POST to the endpoint /v1/orders. - Make a request to Cancel order by ID including the
idof the order obtained in the response to its creation, done in the previous step. - Finally, verify that you received the corresponding Mercado Pago webhook notification for this transaction, which should indicate in the
actionfield the valueorder.canceledand also the canceled payment status.
json
{ "action": "order.canceled", "api_version": "v1", "application_id": "7364289770550796", "data": { "external_reference": "ER_123456", "id": "ORD01JV3AW2C31TE7FY2C4VHTJKB2", "status": "canceled", "status_detail": "canceled", "total_amount": "30.00", "type": "qr", "version": 2 }, "date_created": "2025-05-12T22:46:57.697535027Z", "live_mode": false, "type": "order", "user_id": "1403498245" }
After testing all scenarios and verifying the correct functioning of your QR code integration, you can go to production.