The Redirect Flow#
Mozarto supports two transaction flows, both initiated through the same endpoint:Pay-In: a redirect-based flow (Mozarto returns a hosted payment URL).
Pay-Out: a server-to-server flow (no redirect URL).
Both flows are asynchronous: you initiate the transaction, and the final result is delivered via webhook.Pay-In flow (redirect-based)#
Use Pay-In when you need to take money from a user.Your backend calls POST /v1/api/mozarto/cashier with type: "PAYIN" and the selected pspType.
Mozarto creates a payment session/invoice with the PSP and returns a hosted payment page URL.
Your frontend redirects the user to that URL to complete payment on the PSP page.
After the user completes or cancels, the PSP may return the user back to your site (success/failure/cancel URLs).
Mozarto delivers the authoritative final status to your webhookUrl.
The redirect step is the only part that involves the user's browser; everything else is server-to-server.Redirect URL field name#
The response field that contains the hosted payment page URL differs by provider. Do not hardcode a single field name - read the correct key from the relevant PSP page before implementing redirect logic.| Provider | Redirect URL field |
|---|
| ForumPay | data.url |
| Worldpay | data.paymentUrl |
| Payone | data.redirect_url |
| Gigadat | data.webflowURL |
Handling the pending state#
The API response confirms that the transaction was created and returns the redirect URL. It does not confirm payment. The initial transaction_status is always "Pending".Your frontend must handle this state explicitly:Display a loading indicator or a "payment in progress" screen immediately after initiating the transaction - before redirecting the user.
Keep the pending state visible if the user returns to your site from the PSP page before the webhook has been received.
Do not credit the user or update balances based on the API response or the PSP return URL. Wait for the webhook with a terminal transaction_status (Approved, Declined, Failed, or Cancelled).
A user returning from the PSP page is a UI navigation event only - it carries no authoritative payment outcome.Pay-Out flow (server-to-server)#
Use Pay-Out when you need to send funds to a user (for example: a Pay-Out).Your backend calls POST /v1/api/mozarto/cashier with type: "PAYOUT" and the selected pspType.
Mozarto submits the payout/transfer request to the PSP.
There is no redirect URL to open in the browser.
Mozarto delivers the final status to your webhookUrl once the PSP confirms success/failure (sometimes after manual approval, depending on provider/account settings).
Key principles#
The API response only confirms that the transaction was created/accepted. It is not final settlement.
Treat any PSP return-to-site as UI navigation, not as confirmation of success.
The authoritative final outcome is delivered asynchronously via webhook.
Where to find specifics#
Modified at 2026-05-08 07:34:06