Accept APMs
Offer alternative payment methods (APMs) such as iDEAL, Bancontact, BLIK, TWINT and Revolut Pay on the hosted payment page, or send the customer straight to their bank from your own checkout: how to switch them on, how the payment flows, what the customer sees at each step and what to test before going live.
Alternative payment methods, APMs for short, let the customer pay from a bank account or a payment app instead of a card. The payment page sends them to their bank, or to the app on their phone, to approve the payment, then brings them back. This guide covers switching APMs on, the integration, what the customer sees at each step, and what to test.
Before you start
APMs are available on request. Tell your account manager which ones you want, and we enable them on your account.
| APM | instrument | Used by customers | Settles in |
|---|---|---|---|
| iDEAL | ideal | In the Netherlands | EUR |
| Bancontact | bancontact | In Belgium | EUR |
| BLIK | blik | In Poland | PLN |
| TWINT | twint | In Switzerland | CHF |
| Revolut Pay | revolut_bank | With a Revolut account | EUR |
Your payment stays in the currency you created it in. The customer approves the amount in the APM's currency, converted by our provider at the time of payment, and every webhook and GET /payments response reports your currency and amount.
APMs are for one-time payments
An APM payment leaves no saved card behind, so it can't fund a subscription's renewals. Subscription checkouts never show APMs.
Integration
Your integration is the one-time payment flow, plus one field. List what the payment's page may offer in methods on POST /payments, with apms for every APM enabled on your account, or the APMs by name:
const r = await fetch("https://api.mintcash.me/payments", {
method: "POST",
headers: {
Authorization: `Basic ${btoa(`${publicKey}:${secretKey}`)}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
externalId: orderId,
amount: 49.99,
currency: "USD",
methods: ["card", "wallets", "apms"],
returnUrl: `${baseUrl}/order/${orderId}/complete`,
customer: {
externalId: customerId,
email: customer.email,
name: customer.name,
},
}),
});
const { redirectUrl, methods } = await r.json();The response's methods lists what the page will offer this customer, for example ["card", "apple_pay", "ideal", "bancontact"]. Every rule of methods, how to show the same payment in separate frames of your checkout, and the list layout are in Choose what the checkout offers. The rest of this guide is about the APM flow itself.
- You create the payment; we respond with the
redirectUrl. - The payment page shows a button for each APM in
methodsthat's enabled on your account. - The customer picks one and approves the payment at their bank. A bank's page can't run inside a frame, so an embedded page opens it in a new tab, which closes itself when the customer returns. A full-page checkout goes to the bank in the same tab.
- We send the webhook to your
callbackUrlwith the final state. Approval can take a few minutes, and the payment stayspendinguntil the bank confirms it.
Webhooks report the APM as instrument, for example "instrument": "ideal", with card set to null. GET /payments/{paymentId} includes instrument once the customer has chosen a method.
Choosing APMs per payment
To offer only the APMs that suit your customer, name them instead of apms. A single one is fine:
{ "methods": ["card", "ideal"] }An APM that isn't enabled on your account is left out, and the response's methods shows what the page will offer, so an APM we switch off doesn't break your payment creation. To match your customer's country, map it from your own records and fall back to apms when nothing applies:
const APMS_BY_COUNTRY: Record<string, string[]> = {
NL: ["ideal"],
BE: ["bancontact"],
PL: ["blik"],
CH: ["twint"],
};
const requested = ["card", "wallets", ...(APMS_BY_COUNTRY[customerCountry] ?? ["apms"])];What the customer sees, and what you receive
Each row is one moment of the flow: what the page shows, the payment's status, and what reaches you as a webhook and, when embedded, as a mintcash:checkout message.
| Moment | The customer sees | Status | You receive |
|---|---|---|---|
| Page loads | The APM buttons, as tiles or a list | created | Nothing yet |
| Taps an APM, full page | "Taking you to iDEAL…", then the bank's page in the same tab | pending | payment.pending |
| Taps an APM, embedded | The bank opens in a new tab. The frame shows "Waiting for payment" with a "Reopen payment" button in case the tab was closed | pending | payment.pending, and mintcash:progress with stage started |
| The bank can't start the payment | "iDEAL isn't available right now, and you haven't been charged. Choose another way to pay." The other methods stay usable | back to created | Nothing; the payment is open again. After three such failures on one payment it is declined instead |
| The bank refuses before the customer reaches it | "Payment not completed. Your payment wasn't completed, so no charge was made…" | failed | payment.failed, and mintcash:checkout with status declined |
| Approves at the bank | "Payment complete", or "Payment received" when embedded | succeeded | payment.succeeded, and mintcash:checkout with status succeeded |
| Cancels at the bank | "Payment not completed…" | failed | payment.failed, and mintcash:checkout with status failed |
| Still at the bank after five minutes | The frame keeps waiting, checking less often | pending | mintcash:checkout with status pending, once; the final status follows when the bank answers |
| Comes back through a banking app | A result page in a new tab, asking them to switch back to your tab, with a link to your returnUrl | per outcome | The webhook for that outcome |
| Returns to the checkout while the payment is still open | "Your iDEAL payment isn't finished…" with a "Continue to iDEAL" button | pending | Nothing new |
| The browser blocks the bank tab (embedded) | "Your browser blocked the iDEAL tab, so nothing was started. Allow pop-ups for this page and try again, or pay another way." | created | Nothing |
| Pays in one frame, then tries another frame of the same payment | That frame reports the payment as in progress | pending | mintcash:checkout with status pending from that frame |






How long a payment stays open
- The payment page link works for 15 minutes after creation while nothing has been started. After that it shows an expired notice, and you create a new payment.
- Once the customer has reached the bank, the payment stays
pendinguntil the bank answers, however long that takes. Our page keeps watching: every few seconds for the first five minutes, then every fifteen. An embedded page postspendingonce at the five-minute mark so you can show a "still processing" state, and posts the final status when it arrives. - We can't tell an abandoned bank page from a slow one. If the customer leaves the bank without deciding, the payment stays
pendinguntil our provider closes it, which can take as long as the bank's own time limit. Don't block the customer on it: let them start a new payment. The old one can't be paid twice, but if they do complete it later you receive itspayment.succeededlike any other, so handle a late success the way you handle one for a card. - If an APM fails to start (the bank is unreachable, say), the payment is reopened and the customer can pick another method. After three failed starts on one payment it is declined, so a broken method can't hold a payment open forever.
Coming back from a banking app
On a phone, the bank can send the customer to its app, and the app returns them in a new browser tab. That tab shows the result and asks the customer to switch back to your tab, which already has the outcome. When the payment has a returnUrl, it also offers a link back to it, with ?paymentId= appended. Make sure that page works when opened in a new tab and keeps the customer signed in: session cookies set with SameSite=Strict aren't sent on that link, so use SameSite=Lax. When instrument started the bank, the response has nextAction, and the app returns the customer straight to your returnUrl, as in Handling the return, skipping our result tab.
Embedding
APMs leave the page. An embedded checkout opens the bank in a new tab from the click on the APM button and keeps watching in the frame, so:
- Your
<iframe>needsallow="payment"as for every checkout. If it also has asandboxattribute, addallow-popups allow-popups-to-escape-sandbox, or every APM button reports the tab as blocked. - Keep the frame mounted from
mintcash:progressuntilmintcash:checkoutarrives: the result lands in the frame, not in the bank tab. - The bank tab closes itself when the customer returns. If the browser refuses, it shows the result and asks the customer to switch back.
Send the customer straight to the bank
If your own checkout already lets the customer pick an APM, you can skip our payment page. Name the APM they chose in instrument, and we start the bank payment as we create it. The customer goes from your page to their bank and comes back to your returnUrl. No MintCash page is in their path.
curl -u "<your_public_key>:<your_secret_key>" \
-X POST \
-H 'content-type: application/json' \
-d '{
"externalId": "order_1042",
"amount": 49.99,
"currency": "USD",
"instrument": "revolut_bank",
"shopper": {
"ip": "203.0.113.24",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_1 like Mac OS X) ...",
"language": "en-GB"
},
"returnUrl": "https://shop.example/order/1042/complete",
"customer": {
"externalId": "cust_88",
"email": "jan@example.com",
"name": "Jan de Vries"
}
}' \
https://api.mintcash.me/paymentsinstrumentnames one APM:ideal,bancontact,blik,twintorrevolut_bank. It must be enabled on your account, and your account must use the hosted payment page.shopper.ipis required and must be a public IPv4 or IPv6 address. Send the customer's IP, taken from their request to your server, not your server's own or a private address from behind your load balancer: banks use it for their risk checks.userAgentandlanguageare optional but help the bank.returnUrlis required: it is where the bank sends the customer back.- Send
instrumentinstead ofmethods, not with it. It can't be combined withcardToken,walletTokenorapplePayOnlyeither.
methods: ["revolut_bank"] without instrument is unchanged: it gives a payment page with one button, and the customer taps it to go to the bank.
Opening the bank in a new tab
Browsers only let a page open a tab during the customer's click. By the time your server has created the payment, that moment has passed and the tab would be blocked. So open an empty tab inside the click handler, before you call your server, then point it at the bank once you have the response:
async function payWith(instrument: string) {
const tab = window.open("", "_blank");
if (tab) tab.opener = null;
const r = await fetch("/api/checkout/apm", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ orderId, instrument }),
});
const { status, redirectUrl } = await r.json();
if (status === "failed" || !redirectUrl) {
tab?.close();
return showDeclined();
}
if (tab) {
tab.location.href = redirectUrl;
} else {
window.location.href = redirectUrl;
}
}Your /api/checkout/apm route calls POST /payments with the customer's IP from the incoming request and returns status and redirectUrl. Setting opener to null stops the bank's page from reaching back into yours. If the browser blocked the tab anyway, the example falls back to the same tab.
To stay in one tab instead, skip window.open and set window.location.href = redirectUrl. Your returnUrl is then the result page the customer comes back to.
Never in a frame
Bank pages refuse to load inside a frame. Open redirectUrl in a tab
or the top-level window, never in an <iframe>.
The three outcomes
Every outcome is a 200. Read status to tell them apart.
Started. The payment is pending and redirectUrl is the bank's page. nextAction carries the same link, for code that prefers to branch on it:
{
"id": "pay_6f1c",
"status": "pending",
"instrument": "revolut_bank",
"redirectUrl": "https://bank.example/pay/0050001234567890",
"nextAction": {
"type": "redirect",
"url": "https://bank.example/pay/0050001234567890"
},
"checkoutToken": "cs_abc",
"checkoutUrl": "https://pay.mintcash.com/c/cs_abc",
"methods": ["revolut_bank"]
}Not started. Our provider couldn't start the bank payment. The payment stays created, there is no nextAction, and redirectUrl is the one-button payment page, the same one methods: ["revolut_bank"] gives. Send the customer there: they can try the APM again from it. If the start is still in flight, the response looks the same but the payment is pending, and the page shows the attempt in progress.
Declined. The payment is failed and there is no redirectUrl. To try again, create a new payment with a new externalId.
status | nextAction | redirectUrl | What to do |
|---|---|---|---|
pending | Present | The bank's page | Send the customer to redirectUrl |
created | Absent | The one-button payment page | Send the customer to redirectUrl |
pending | Absent | The payment page, in progress | Send the customer to redirectUrl |
failed | Absent | Absent | Show a decline, retry with a new externalId |
So the rule is: unless the payment is failed, send the customer to redirectUrl.
A request that breaks the rules above is refused with 400 invalid_argument, and no payment is created:
message | Cause |
|---|---|
send either methods or instrument, not both | instrument together with methods |
instrument can't be combined with cardToken, walletToken or applePayOnly | instrument with any of those fields |
instrument must be a bank method: ideal, bancontact, blik, twint or revolut_bank | An instrument that isn't an APM |
instrument needs shopper.ip, the shopper's IP address | shopper.ip missing, invalid or private |
instrument needs a returnUrl to bring the shopper back | returnUrl missing |
shopper is only used with instrument | shopper without instrument |
instrument requires hosted checkout to be enabled | Your account doesn't use the payment page |
instrument ideal is not enabled for this merchant | The APM isn't enabled on your account |
Branch on code, not on message: see Errors.
Retries
Repeating the request with the same externalId while the payment is pending never starts a second bank attempt. It returns the same redirectUrl and nextAction, even after the payment page has expired, or the payment page if no bank link was stored. So a retry after a timeout or a 5xx is safe, and so is reopening the bank for a customer who closed the tab by accident.
Waiting in your own dialog
checkoutUrl is our payment page for this payment, present whenever checkoutToken is. You don't need it. If your checkout opens the bank in a new tab from a dialog, you can load checkoutUrl in an <iframe> in that dialog as a waiting screen: it shows the payment as still being processed and posts mintcash:checkout when the outcome arrives, as in Embed the checkout.
Handling the return
The bank sends the customer to your returnUrl with ?paymentId= appended, for example https://shop.example/order/1042/complete?paymentId=pay_6f1c.
- Reaching
returnUrlisn't proof of payment. ReadpaymentIdand callGET /payments/{paymentId}. Show a "processing" state until the status is final: the customer can arrive before the bank has answered, and before our webhook reaches you. - Fulfil only on the webhook.
payment.succeededandpayment.failedarrive as for any APM payment, withinstrumentnaming the method, for example"revolut_bank". - The page must work in a fresh tab. On a phone, the banking app returns the customer in a new browser tab, so the page can't rely on state held by the tab that opened the bank. Keep the customer signed in with session cookies set to
SameSite=Lax:SameSite=Strictcookies aren't sent when the bank links back.
GET /payments/{paymentId} and the webhooks are the same as for a payment that went through our page.
What to test
APMs can't be exercised in sandbox: creating a payment with APMs in methods works, and the page renders the buttons, so you can build and style your layout there, but a tap on an APM button can't reach a bank. instrument is no different: sandbox can't reach a bank for these methods either. Once APMs are enabled on your live account, run each flow you plan to ship with a small amount:
- Happy path: approve at the bank and confirm
payment.succeeded. - Cancellation: cancel at the bank and confirm
payment.failed. - Embedded: confirm the bank opens in a new tab and your page receives
mintcash:progressand thenmintcash:checkout. - Phone: pay through a banking app and confirm the link back lands on a working, signed-in page.
- Straight to the bank, if you use
instrument: confirm the bank opens from your click without being blocked, that a response withoutnextActionsends the customer to the payment page, and that yourreturnUrlpage shows "processing" until the payment is final, also when opened in a fresh tab. - Two frames, if you use them: start paying in one, then try the other, and confirm it reports the payment as in progress.
Accept Apple Pay
Offer Apple Pay on the hosted payment page, as a wallet-only page or as a standalone button: what to send your account manager, how the payment flows and what to test before going live.
Choose what the checkout offers
Pick the payment methods a payment's page offers with `methods`, narrow what one frame shows with `view`, and lay out the same payment across several frames of your own checkout.