11. Emulating a scheduled charge

11. Emulating a scheduled charge

Sending the request

Your POST must be sent to https://sandbox.pagbrasil.com/mock/pix/automatic/chargeRecurrences setting the content-type of the request header and body as "x-www-form-urlencoded". Please note that this URL shall only be used for integration and testing procedures.

During charge attempts, the bank executes internal routines that cannot be replicated in the sandbox environment. To address this limitation, we provide an endpoint that emulates the charge retry routines for already scheduled recurrences. The purpose of this endpoint is to process all charges scheduled for a specific date in the sandbox environment. To distinguish between test scenarios, the amount field is used. Any charge will be approved, except in the following cases:

  • amount_brl=111.22 - Simulates a charge error, but succeeds on the final attempt.

  • amount_brl=111.33 - Simulates a charge error, resulting in failure on all attempts.

Request parameters:

Field

Description

Required

Length

Field

Description

Required

Length

secret

Secret phrase as defined in the PagBrasil Dashboard.

Yes

128

pbtoken

Token assigned to your merchant account. Your token is displayed at the PagBrasil Dashboard, menu Account > Settings.

Yes

32

date

Format YYYY-MM-DD. It’s necessary to inform the date of the charge.

Yes

10

Note: A successful response for the request will be "Charges processed.”.

CONFIDENTIAL