Skip to main content

Widget Callbacks

Listen for these events rather than waiting on a callback from the client. From the client side, on the client, the customer could close the browser window or quit the app before the callback executes, and malicious clients could manipulate the response.

We recommend handling the following events:

CallbackDescriptionPayload
onSuccessTriggered when the payment is successful{ event: "success_callback", metadata: { preApproveId: string, externalTrxId: string }}
onEventTriggered for various step events during the process.{ event: EVENT }. Refer to Widget Events
onRejectTriggered when the user rejects the payment or when there is an error that does not allow the transaction to continue{ event: "error_callback" | "reject_callback", metadata: { preApproveId: string, externalTrxId: string, reason: REASON } } Refer to Reject Reasons

Widget events​

EventDescription
idNumber_formClient is ready to enter its identification number.
loading_conditionsThe widget is loading either right after being initialized with pre-evaluation or after the user enters their identification number
installment_optionsThe user is shown the available installment options.
check_condtionsThe user is shown the chosen installment option conditions.
payment_subscriptionThe user is subscribing PAC.
auth_factorThe user is verifying their identity. For recurring users, two authentication factors must be validated.
signatureThe user is signing their contract. Only applies for first-time purchases.
successThe user has successfully signed or authenticated and is shown the success screen with attached documents.
rejectThe user is redirected to an error or rejection screen and cannot proceed with the transaction.

Reject Reasons​

The onReject callback can be triggered with different event types and reasons:

reject_callback reasons​

ReasonDescription
RISK_REJECTEDThe transaction was rejected due to risk assessment.
USER_HAS_ACTIVE_LOANThe user already has an active BNPL credit associated with their account.
NOT_ENOUGH_AUTH_FACTORSThe user doesn't have sufficient authentication factors available, likely due to previously blocking them.
AUTHENTICATION_MAX_ATTEMPTS_REJECTEDMaximum authentication attempts reached during the verification process.

error_callback reasons​

ReasonDescription
DEFAULT_ERRORA generic error occurred during the process.
CONTRACT_SIGNATURE_ERRORAn error occurred while signing the contract.
TOKEN_EXPIREDThe session token expired after 10 minutes.