Testing Bill Payment
The Sandbox environment allows you to homologate integrations related to bill payments without the need to use real boletos or perform actual financial transactions.
To perform the tests, use the digitable line from a boleto generated in your own Asaas Sandbox account.
This flow allows you to validate payment creation, operation processing, and application behavior before using it in production.
When to use
This scenario is recommended for integrations that need to:
- perform bill payments via API;
- validate automated financial flows;
- homologate accounts payable processes;
- test business rules related to payments;
- validate API responses and error handling.
Prerequisites
Before starting the tests, you must:
- Have a Sandbox account.
- Have available balance for testing in the account.
- Generate a boleto in the Sandbox environment.
- Obtain the digitable line of that boleto.
- Use the bill payment endpoint.
If you do not yet have available balance for testing, see the guide on adding balance in Sandbox.
How the test works
The payment is made using the digitable line of a boleto created in the Sandbox account itself.
Simplified flow:
Generate boleto
in Sandbox
↓
Obtain digitable line
↓
Create payment
via API
↓
Process payment
↓
Validate integration
resultThis makes it possible to homologate the complete flow without relying on external boletos or real banking operations.
Important operation fields
When creating a bill payment, some data plays a fundamental role in the flow:
| Field | Purpose |
|---|---|
| identificationField | Boleto digitable line |
| scheduleDate | Scheduled payment date |
| description | Internal operation identification |
| value | Amount to be paid |
ImportantThe complete request parameters are available in the endpoint documentation.
The purpose of this page is to demonstrate how to homologate this feature in Sandbox.
Homologation example
A common scenario consists of:
- Creating a charge in Sandbox.
- Copying the generated digitable line.
- Using that digitable line in the bill payment request.
- Validating the API response.
- Confirming that your application correctly processed the operation result.
This flow allows you to validate the integration end-to-end before using it in the production environment.
Expected behavior
During Sandbox tests:
- no real funds are moved;
- no financial institution is contacted;
- processing occurs solely for homologation purposes;
- the results are intended for integration validation.
The goal is to allow the application to test its financial flows without operational risks.
Differences between Sandbox and Production
| Sandbox | Production |
|---|---|
| Uses simulated data | Uses real boletos |
| Does not move financial resources | Moves real financial resources |
| Does not depend on real banking processing | Depends on financial institutions |
| Intended exclusively for homologation | Has real financial effects |
For this reason, it is recommended to carefully validate your application's behavior before going live in production.
Possible difficulties
If the payment is not processed as expected, check whether:
- the digitable line was copied correctly;
- the boleto used was created in Sandbox;
- there is available balance for the test;
- the required request fields were provided correctly;
- authentication is being performed using a Sandbox API Key.
Best practices
Recommended
- Use boletos generated in the Sandbox account itself.
- Validate both success and failure scenarios during homologation.
- Log and monitor API responses during testing.
- Test application behavior in processing failure scenarios.
- Do not use production data during testing.
Operational impacts
Homologating bill payments allows you to validate in advance:
- accounts payable rules;
- financial automations;
- ERP system integrations;
- API response handling;
- internal application flows.
Proper validation reduces operational failures after going live in production.
API Reference
See the call to create a bill payment:
