# MD for: https://www.mercadopago.com.uy/developers/pt/docs/qr-code/test-integration/test-purchase.md \# 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 processing flow using the QR Code. > NOTE > > The hybrid model encompasses both static and dynamic codes, allowing both test flows to be performed in integrations of this model. :::::TabsComponent ::::TabComponent{title="Static model"} Follow the steps described in each test scenario to simulate a processing flow with a static model QR code. :::AccordionComponent{title="Create and process an order"} To test the correct creation of an order and the associated transaction processing, follow the steps below. 1\. Create a store and POS ensuring you use your :toolTipComponent\[test Access Token\]{content="Private key of the application created in Mercado Pago, which is used in the backend. You can access it through \*Your integrations > Integration data > Tests > Test credentials\*. During integration, use the test Access Token and, upon completion, replace it with the production Access Token if it is your own integration, or with the Access Token obtained through OAuth in the case of third-party integrations."} when making the necessary requests. Additionally, make sure to set the \`fixed\_amount=true\` field 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\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/create-store-and-pos). 2\. Still using your :toolTipComponent\[test Access Token\]{content="Private key of the application created in Mercado Pago, which is used in the backend. You can access it through \*Your integrations > Integration data > Tests > Test credentials\*. During integration, use the test Access Token and, upon completion, replace it with the production Access Token if it is your own integration, or with the Access Token obtained through OAuth in the case of third-party integrations."}, send a \*\*POST\*\* to the endpoint \[/v1/orders\](https://www.mercadopago.com.uy/developers/en/reference/in-person-payments/qr-code/orders/create-order/post) making sure to include the \`external\_pos\_id\` from the POS created in the previous step. For more details, see the documentation \[Integrate payment processing > Create an order\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/payment-processing). 3\. Store the order identifier, returned in the response to its creation under the \`id\` parameter, to be able to verify the correct functioning of your webhook notifications. 4\. Download the Mercado Pago app on your mobile device, available for \[Android\](https://play.google.com/store/apps/details?id=com.mercadopago.wallet&pcampaignid=web\_share) and \[iOS\](https://apps.apple.com/br/app/mercado-pago-banco-digital/id925436649), 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\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/resources/test-accounts#bookmark\_validate\_login\_with\_test\_accounts). 5\. Use your mobile device to scan the QR code generated earlier. The app will show the order value and available payment options. 6\. Make the payment using the test cards available in the buyer test user account, considering the following scenarios. > WARNING > > If you are using the \[buyer test account\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/test-integration#bookmark\_get\_a\_buyer\_test\_account) automatically created with your application, the test cards will already be available for use. For older buyer test accounts, you will need to manually add the \[test cards\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/resources/test-cards) to test different payment scenarios. | Card type | Brand | Number | Security code | Expiration date | Behavior | |-|-|-|-|-|-| | Credit | Mastercard | 5031 7557 3453 0604 | 123 | 11/30 | Generates an approved payment | | Credit | Visa | 4509 9535 6623 3704 | 123 | 11/30 | Generates an approved payment | | Debit | Visa Debit | 4410 1036 7243 6886 | 123 | 11/30 | Generates a rejected payment | | Credit | American Express | 3775 5766 5576 5671 | 123 | 4/44 | Generates an approved payment without requiring CVV. | 7\. Verify that you received the Mercado Pago webhook notification for the order processing. The \`action\` field will have the value \`order.processed\`, which indicates that the order was processed, and within the \`transactions.payments\` node you can see the transaction 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" } \`\`\` ::: :::AccordionComponent{title="Refund an order"} To confirm that the processing 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\](https://www.mercadopago.com.uy/developers/en/reference/in-person-payments/qr-code/orders/refund-order/post), 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\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/payment-processing). 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 transaction 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" } \`\`\` ::: :::AccordionComponent{title="Create and cancel an order"} To validate the functioning of the cancellation flow, follow the steps below: 1\. Cancellation of a test order is only possible when it has the status \`created\`. Therefore, create a new order by sending a \*\*POST\*\* to the endpoint \[/v1/orders\](https://www.mercadopago.com.uy/developers/en/reference/in-person-payments/qr-code/orders/create-order/post). 2\. Make a request to \[Cancel order by ID\](https://www.mercadopago.com.uy/developers/en/reference/in-person-payments/qr-code/orders/cancel-order/post) including the \`id\` of the order obtained in the response to its creation, done in the previous step. 3\. Finally, verify that you received the corresponding Mercado Pago webhook notification for this transaction, which should indicate in the \`action\` field the value \`order.canceled\` and also the canceled transaction 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" } \`\`\` ::: :::: ::::TabComponent{title="Dynamic model"} Follow the steps described in each test scenario to simulate a processing flow with a dynamic model QR code. :::AccordionComponent{title="Create and process an order"} To test the correct creation of an order and the associated transaction processing, follow the steps below. 1\. Create a store and POS ensuring you use your :toolTipComponent\[test Access Token\]{content="Private key of the application created in Mercado Pago, which is used in the backend. You can access it through \*Your integrations > Integration data > Tests > Test credentials\*. During integration, use the test Access Token and, upon completion, replace it with the production Access Token if it is your own integration, or with the Access Token obtained through OAuth in the case of third-party integrations."} when making the necessary requests. Additionally, make sure to set the \`fixed\_amount=true\` field when creating the POS. For more details, see the documentation \[Create store and POS\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/create-store-and-pos). 2\. Still using your :toolTipComponent\[test Access Token\]{content="Private key of the application created in Mercado Pago, which is used in the backend. You can access it through \*Your integrations > Integration data > Tests > Test credentials\*. During integration, use the test Access Token and, upon completion, replace it with the production Access Token if it is your own integration, or with the Access Token obtained through OAuth in the case of third-party integrations."}, send a \*\*POST\*\* to the endpoint \[/v1/orders\](https://www.mercadopago.com.uy/developers/en/reference/in-person-payments/qr-code/orders/create-order/post) making sure to include the \`external\_pos\_id\` from the POS created in the previous step. For more details, see the documentation \[Integrate payment processing > Create an order\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/payment-processing). 3\. Use the \`qr\_data\` parameter obtained in the response to the order creation to generate a QR code. You can use tools or libraries that will help you convert this \*string\* into a QR code image. 4\. Store the order identifier, returned in the response to its creation under the \`id\` parameter, to be able to verify the correct functioning of your webhook notifications. 5\. Download the Mercado Pago app on your mobile device, available for \[Android\](https://play.google.com/store/apps/details?id=com.mercadopago.wallet&pcampaignid=web\_share) and \[iOS\](https://apps.apple.com/br/app/mercado-pago-banco-digital/id925436649), 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\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/resources/test-accounts#bookmark\_validate\_login\_with\_test\_accounts). 6\. Use your mobile device to scan the QR code generated earlier. The app will show the order value and available payment options. 7\. Make the payment using the test cards available in the buyer test user account, considering the following scenarios. > WARNING > > If you are using the \[buyer test account\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/test-integration#bookmark\_get\_a\_buyer\_test\_account) automatically created with your application, the test cards will already be available for use. For older buyer test accounts, you will need to manually add the \[test cards\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/resources/test-cards) to test different payment scenarios. | Card type | Brand | Number | Security code | Expiration date | Behavior | |-|-|-|-|-|-| | Credit | Mastercard | 5031 7557 3453 0604 | 123 | 11/30 | Generates an approved payment | | Credit | Visa | 4509 9535 6623 3704 | 123 | 11/30 | Generates an approved payment | | Debit | Visa Debit | 4410 1036 7243 6886 | 123 | 11/30 | Generates a rejected payment | | Credit | American Express | 3775 5766 5576 5671 | 123 | 4/44 | Generates an approved payment without requiring CVV. | 8\. Verify that you received the Mercado Pago webhook notification for the order and payment processing. The \`action\` field will have the value \`order.processed\`, which indicates that the order was processed, and within the \`transactions.payments\` node you can see the transaction 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": "1898180608" } \`\`\` ::: :::AccordionComponent{title="Refund an order"} To confirm that the processing 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\](https://www.mercadopago.com.uy/developers/en/reference/in-person-payments/qr-code/orders/refund-order/post), 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\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/payment-processing). 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 transaction 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" } \`\`\` ::: :::AccordionComponent{title="Create and cancel an order"} To validate the functioning of the cancellation flow, follow the steps below: 1\. Cancellation of a test order is only possible when it has the status \`created\`. Therefore, create a new order by sending a \*\*POST\*\* to the endpoint \[/v1/orders\](https://www.mercadopago.com.uy/developers/en/reference/in-person-payments/qr-code/orders/create-order/post). 2\. Make a request to \[Cancel order by ID\](https://www.mercadopago.com.uy/developers/en/reference/in-person-payments/qr-code/orders/cancel-order/post) including the \`id\` of the order obtained in the response to its creation, done in the previous step. 3\. Finally, verify that you received the corresponding Mercado Pago webhook notification for this transaction, which should indicate in the \`action\` field the value \`order.canceled\` and also the canceled transaction 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\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/go-to-production).