Testing bill payment
Use the digitable line of a bank slip (boleto) created in the Sandbox to validate bill payments without moving real money.
By the end of this guide, you will have created a bill payment and validated the processing of the operation in the Sandbox.
When to use it
Use this flow to test:
- bill payments through the API;
- accounts payable automations;
- integrations with ERP systems;
- balance validations;
- handling of API responses;
- success and error scenarios.
Before you start
You need to:
- Have a Sandbox account and API key.
- Have an available balance for the test.
- Create a bank slip (boleto) charge in the Sandbox.
- Get the bank slip's digitable line.
- Use the bill payment endpoint.
If the account has no balance, see Add balance to your Sandbox account.
How it works
Create a charge
via bank slip
↓
Get the digitable line
↓
Create the payment
through the API
↓
Track processing
↓
Validate the result1. Create a bank slip in the Sandbox
Create a bank slip (boleto) charge in the same Sandbox account used to make the payment.
After creation, copy the generated digitable line.
Use only bank slips created in the Sandbox.
External or Production bank slips must not be used in this validation flow.
2. Create the bill payment
Use the digitable line in the bill payment endpoint.
The main fields are:
| Field | Purpose |
|---|---|
identificationField | Bank slip digitable line |
scheduleDate | Scheduled payment date |
description | Internal identification of the operation |
value | Payment amount |
See Create a bill payment for all of the endpoint's parameters and rules.
3. Validate the result
After sending the request:
- check the HTTP status and the response body;
- store the payment ID;
- track the operation status;
- confirm that your application processed the result correctly;
- record any failures for analysis.
Processing takes place for validation purposes only.
No financial institution is contacted and no real money is moved.
If the payment is not created
Check that:
- the digitable line was copied correctly;
- the bank slip was created in the Sandbox;
- the account has sufficient balance;
- the URL used belongs to the Sandbox;
- the API key belongs to the same environment;
- the required fields were sent correctly;
- the scheduled date is valid.
Differences between Sandbox and Production
| Sandbox | Production |
|---|---|
| Uses bank slips created for testing | Uses real bank slips |
| Does not move real money | Moves financial funds |
| Does not depend on bank processing | Depends on the institutions involved |
| Used to validate the integration | Produces real financial effects |
A successful test in the Sandbox does not guarantee that any bank slip will be processed in Production, since the production environment has validations and external dependencies.
Validation checklist
Before considering the flow validated, confirm that your application:
- validates the balance before the operation;
- handles success and error responses;
- stores the payment ID;
- tracks status changes;
- prevents duplicate payments;
- records enough logs for investigation;
- correctly distinguishes between Sandbox and Production;
- does not use production data in tests.
Next steps
Updated 5 days ago
