Skip to main content
Redirect-based alternative payment methods (APMs) — like Pix, iDEAL, Boleto, and Klarna — return a pending_action status with a redirect URL. The JS SDK’s sdk.handleAction manages the redirect automatically and resolves to the final PaymentResult once the shopper completes or cancels the out-of-band step. You write one code path; the SDK handles each method’s specific flow.

Charge an APM from the browser

Call sdk.purchaseApm() with the payment method name, amount, and return URLs. If the method requires a redirect, the result includes actionRequired.
handleAction opens the APM’s redirect in a managed popup or iframe, polls for completion, and resolves with the final PaymentResult — the same shape returned by every other Therius charge method.

sdk.handleAction — one entry point for all out-of-band steps

handleAction is the single entry point for every action type the Therius API can return. You do not need separate code paths per action:

3DS Challenges

Opens the 3DS challenge iframe and waits for the cardholder to complete authentication before resolving.

APM Redirects

Manages iDEAL, PayPal, Klarna, and other redirect-based methods in a popup or iframe.

Vouchers

Displays Boleto, Konbini, and Multibanco voucher instructions and waits for the payment event.

Final Resolution

Always resolves with the same PaymentResult shape — your success/failure handler is the same regardless of action type.

Supported APM methods

Common methods you can pass to sdk.purchaseApm: Check the Connections tab for the full list of supported methods and required fields per method.

Server-side APM integration (no SDK)

If you’re integrating from a server or a mobile native app rather than a browser, call POST /payment/purchase directly from your backend with the APM-specific fields. Your server handles the actionRequired.url redirect by forwarding the shopper to that URL in an in-app browser or redirect response.
If you’re building a mobile app, call POST /payment/purchase server-side and handle the redirect in your app’s in-app browser. The SDK’s handleAction is browser-only and relies on window.open and postMessage to track the redirect result.