How to test features

How to Test Features in Sandbox

Although it works very similarly to the production environment, some features need to be tested in a specific way.

On the pages below, you’ll find detailed instructions on how to test each of these features in the sandbox:

  • How to perform transfers.How to simulate accounts payable.
  • How to test credit card payments.
  • How to test a payment via QR Code.
  • How to test critical actions.

You can also check the features that can be tested in our sandbox here .

In addition, you can use our documentation to make calls directly in the sandbox environment. Learn how to do this here: How to test calls in the documentation.


1- Testing Credit Card Payments

For credit card charges, you can use test cards to simulate a payment directly through the credit card charge creation endpoints. Here’s an example of a valid card:

Credit Card: 4444 4444 4444 4444

Expiration: Any month after today’s date CVV: 123 (or any other 3 random digits)

You can also use credit card generators for testing . All of them will work and confirm the payment.

To test payments with errors, use the cards below:

Mastercard: 5184019740373151

Visa: 4916561358240741

See the call to create a credit card charge here .


2 - Testing Bill Payments

If you want to test bill payments in Sandbox, you can make the call using the digitable line of any boleto generated in your own Asaas account within the Sandbox environment.


See the call to pay a bill here .


3 - Testing Transfers

Introduction

The Asaas Sandbox environment allows for a full simulation of financial transfers, enabling you to validate integrations safely without moving real funds.

This guide explains how to test Pix and TED transfers, highlighting expected behaviors and features available exclusively in this environment.


Testing Pix Transfers

Option 1: Using BACEN Test Pix Keys The Central Bank provides a set of fictitious Pix keys specifically for testing transfers in homologation environments such as the Asaas Sandbox.

When making a transfer to any of these fictitious keys, the operation:

  • Will be immediately completed successfully.
  • The amount will be debited from the Sandbox account.
  • No funds will be credited anywhere, as these are fictitious keys.

Check the official list of test Pix keys provided by BACEN:


Name: Joao Silva Silva  
CPF/CNPJ: 99992222263  
Key: [email protected]  
BANK Virtual Mensageria 04 (99999004)  
AGENCY 0002  
ACCOUNT 11345678 (CACC)  


Name: Jose Silva  
CPF/CNPJ: 99993333387  
Key: [email protected]  
BANK Virtual Mensageria 04 (99999004)  
AGENCY 0003  
ACCOUNT 12145678 (CACC)  


Name: Jose Silva Silva  
CPF/CNPJ: 99994444409  
Key: [email protected]  
BANK Virtual Mensageria 04 (99999004)  
AGENCY 0004  
ACCOUNT 12315678 (CACC)  


Name: Jose da Silva  
CPF/CNPJ: 99995555514  
Key: [email protected]  
BANK Virtual Mensageria 04 (99999004)  
AGENCY 0004  
ACCOUNT 12341678 (CACC)  

Option 2: Using Pix Keys from Other Sandbox Accounts

You can create a Pix key in your own Sandbox account or in another Sandbox account to run more complete tests.

In this case:

  • The amount will be debited from the source account.
  • The amount will be credited to the destination account.
  • The entire flow occurs within the Sandbox environment, allowing you to validate real debit and credit scenarios.

Example flow: Sandbox Account A → makes Pix → Pix Key of Sandbox Account B → Account B receives the credit.

❗️

Important

  • Transfers to fictitious keys do not generate credit records in any account.
  • Transfers between real Sandbox accounts perfectly simulate transfers between bank accounts in production.

Testing TED Transfers

In the Sandbox environment, TED transfers include manual controls available exclusively in the Asaas interface (not via API).

After starting a TED transfer, you will have two options in the interface to simulate the operation result:

Confirm Transfer:

  • Simulates a successful settlement. The amount is debited from the Sandbox account.
  • The transfer status changes to Completed.

Simulate Failure:

  • Simulates a failed transfer.
  • The amount is not debited.
  • The transfer status changes to Failed.
📘

NOTICE:

  • In Sandbox, no transfer results in real financial movement.
  • All tests can be performed safely, with no risk of affecting production environments.
  • Using fictitious Pix keys is recommended to test successful flows without setting up multiple accounts.
  • To test debit and credit scenarios, use multiple Sandbox accounts with real Pix keys.

The Asaas Sandbox provides a safe and controlled environment to validate all Pix and TED transfer flows, from successes to failures, ensuring higher quality and security in your integration before moving to production.

See the call to perform transfers here .


4 - Testing Pix QR Code Payments

If you want to test the integration flow of a static QR Code, there is a simple way to do it.

After creating a static QR Code in Sandbox , use the Pay a QR Code endpoint by sending the payload of your generated QR Code.

POST /v3/pix/qrCodes/pay See the complete reference for this endpoint.

{
    qrCode: {
      payload: '00020126710014br.gov.bcb.pix01362ae3db4c-9f04-44de-9a39-adcc98a334c20209Churrasco520400005303986540550.005802BR5913John Doe6009Joinville62290525JHOND00000000465493ASA6304DB5E'
    },
    value: 50
}

When performing this action, a Pix-type charge will automatically be created, receiving this payment with the fields pixTransaction and pixQrCodeId filled in.


5 - How to Test Critical Actions

In the Sandbox environment, you can validate the critical action token using the default value 000000.

If necessary, we can disable the token for transfers in Sandbox. However, it is important to note that the token is a security validation, and without it, the account may be more susceptible to unauthorized actions.

As a suggestion, if you have one or more specific IPs moving the account, restrict access so only those are allowed. If Asaas detects an action from any other IP, it will block it. You can also use our webhook withdrawal validation mechanism for greater security.

To request this, send an email to the Integrations Success team .


6 - Trying to Pay a Pix QR Code in Sandbox Without a Registered Key = 404 Error

Context

When using the route:

POST 
/v3/pix/qrCodes/pay

in the sandbox environment, a 404 Not Found error may occur when trying to pay a Pix QR Code generated from a charge created via the interface, without a Pix key registered in the account.

This happens because, in the test environment, the Pix QR Code payload is not registered if the account does not have a valid Pix key — or when the charge was created using Bradesco’s Pix integration (which does not generate the payload in Sandbox).

Important Note


Although technically the 404 error is correct (the payload truly does not exist in Sandbox), we understand this can be confusing for developers integrating with the API, since:

  • The route used is valid.
  • The payload was correctly extracted from the charge.
  • The expectation is that the QR Code should work for tests.

How to Avoid the Error

To ensure the test works in the Sandbox environment, you must register a Pix key in the account and generate a new charge with a QR Code linked to that key.

See the call to pay a QR Code here .


7 - How to Generate New Charges for a Subscription

If you want to test the generation of new charges for a subscription in Sandbox, you need to generate the subscription booklet.

When generating the booklet, all charges for the subscription up to the defined end date will be created automatically. For example, if the booklet is generated until December, all subscription charges until December will be created.

See the call to generate a subscription booklet here .