Perform a Test Purchase with Pix
To test your integration with Pix you'll need to create an order with predefined values. This means that it will only be possible to verify the operation of your integration through a requisition, and not by simulating a purchase. For this, follow the steps below.
To perform these tests, send the following request to the /v1/ordersPOST endpoint, along 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..
curlcurl --request POST \ --url https://api.mercadopago.com/v1/orders \ --header 'Content-Type: application/json' \ --data '{ "type": "online", "external_reference": "ext_ref_1234", "total_amount": "50.00", "payer": { "email": "test_payer@example.com", "first_name": "APRO" }, "transactions": { "payments": [ { "amount": "50.00", "payment_method": { "id": "pix", "type": "bank_transfer" } } ] } }'
The value APRO for the payer.first_name field is what determines that this predefined request returns as a response a created order with the status action_required, as shown below. Afterwards, the payment status will automatically change to approved.
json{ "id": "ORD01JP84C939T20S0P1DN382FQ6K", "type": "online", "processing_mode": "automatic", "external_reference": "ext_ref_1234", "total_amount": "50.00", "country_code": "BRA", "user_id": "123456", "status": "action_required", "status_detail": "waiting_transfer", "capture_mode": "automatic", "created_date": "2025-03-13T16:11:10.826Z", "last_updated_date": "2025-03-13T16:11:11.736Z", "integration_data": { "application_id": "123456789" }, "transactions": { "payments": [ { "id": "PAY01JP84C939T20S0P1DN6FCMWQC", "amount": "50.00", "reference_id": "0002gw9x2v", "status": "action_required", "status_detail": "waiting_transfer", "payment_method": { "id": "pix", "type": "bank_transfer", "ticket_url": "https://www.mercadopago.com.br/sandbox/payments/104669748043/ticket?caller_id=1985141462&hash=1eff4445-4454-4308-a6b0-d2a1651ca44f", "qr_code": "00020126580014br.gov.bcb.pix0136b76aa9c2-2ec4-4110-954e-ebfe34f05b615204000053039865406200.005802BR5918TESTUSER20543760926009Sao Paulo62250521mpqrinter1046697480436304B70B", "qr_code_base64": "" } } ] } }
Finally, to verify if the test order was created correctly, send a request to the /v1/orders/{id}GET endpoint, replacing id with the order identification, received in the response to its creation.
Alternatively, you can check the payment result from your application. To do so, go to Integrations and select the application card. Make sure the selector at the top is set to Test and, on the Home screen, select the Test payments tab. Then, find the payment and click it to view its details and status.
Ready! Once these steps are completed, the integration of Pix as a payment method is complete, and you can either continue testing other integrated payment methods, or go to production.