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:

  1. Have a Sandbox account and API key.
  2. Have an available balance for the test.
  3. Create a bank slip (boleto) charge in the Sandbox.
  4. Get the bank slip's digitable line.
  5. 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 result

1. 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:

FieldPurpose
identificationFieldBank slip digitable line
scheduleDateScheduled payment date
descriptionInternal identification of the operation
valuePayment amount

See Create a bill payment for all of the endpoint's parameters and rules.

3. Validate the result

After sending the request:

  1. check the HTTP status and the response body;
  2. store the payment ID;
  3. track the operation status;
  4. confirm that your application processed the result correctly;
  5. 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

SandboxProduction
Uses bank slips created for testingUses real bank slips
Does not move real moneyMoves financial funds
Does not depend on bank processingDepends on the institutions involved
Used to validate the integrationProduces 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


Did this page help you?