Browser Redirect Checkout

Accept payments in your mobile app by redirecting users to a Coinflow-hosted checkout page in the browser.

Looking to embed the card form natively inside your app instead of redirecting out? See the Mobile SDK overview for Swift, Android, Flutter, and React Native integrations.

Overview

This guide shows how to accept payments in a mobile app by redirecting users from your app to a Coinflow-hosted checkout page in the browser. It’s the lightest-weight integration option — no frontend SDK to install and no card form to render yourself.

Use this approach when:

  • You want the simplest possible integration path.
  • Leaving the app briefly during checkout is acceptable.
  • You already use universal links or deep links for return flows.

Watch a Demo


How It Works

  1. User initiates a purchase in your app (e.g., taps “Buy Coins”).
  2. Your app makes a request to your server
  3. Your server requests a checkout link from Coinflow and passes it back to the user
  4. The app opens the returned link in the user’s browser or a webview.
  5. User completes payment on the secure checkout page.
  6. User is redirected back to your app via a callback URL you can set.

iOS Redirect Example

Below is a simplified example from our demo app, showing how to request a checkout link and redirect the user:

Using a WKWebView instead of redirecting to Safari? If you’re embedding the checkout in a WKWebView, your message handler must be named exactly "ReactNativeWebView" for the checkout UI to render properly. See the “Listen to Client-Side Messages on Swift iOS” recipe in the Recipes tab for a complete implementation guide.

1 private func goToCheckoutPage() {
2 let checkoutUrlStr = getCheckoutURLFromServer()
3 let checkoutUrl = URL(string: checkoutUrlStr)!
4 DispatchQueue.main.async {
5 openURL(checkoutUrl)
6 }
7 }

API Request Example (cURL)

You can also test the API directly using cURL:

1curl -X POST "https://api-sandbox.coinflow.cash/api/checkout/link" \
2 -H "Authorization: YOUR_API_KEY" \
3 -H "x-coinflow-auth-user-id: USER_ID" \
4 -H "Content-Type: application/json" \
5 -d '{
6 "subtotal": {
7 "currency": "USD",
8 "cents": 5000
9 },
10 "standaloneLinkConfig": {
11 "callbackUrl": "yourapp://checkout-complete",
12 "endUserDeviceIpAddress": "127.0.0.1"
13 }
14 }'

This standalone link config is what determines whether or not the checkout page is allowed to render outside of an Iframe embedded on a website that you have whitelisted. If you pass in this config, we allow the Coinflow checkout page to be viewed as a standalone link, which works great in use cases like redirecting to it from your mobile app.

Callback URL

The callback URL is what we redirect to upon successful completion of a checkout. For a mobile app, this will be typically a universal link that takes the user back to the app for you to update their app state given their successful payment.

End User Device IP Address

This will be the IP Address of the user that is planning to checkout.

Response

The response will include a link field with the checkout URL.

1{
2 "link": "https://sandbox-merchant.coinflow.cash/solana/purchase-v2/your-merchant-name?query_params=here"
3}

Resources