Who this is for: Developers (client + server) who need to integrate Subotiz payments inside their own iOS / Android app.What you will build: Launching the Subotiz checkout page inside your app, receiving the payment result, and confirming the order via webhook.Prerequisites: A Subotiz merchant account with a Secret API Key and a webhook signing key; a server environment capable of receiving webhooks.Scope: In-app payment integration. Web / H5 integration and merchant-dashboard payment method configuration are out of scope.
Overview
In-app payments use the link-to-checkout model: your server creates a Checkout Session, and your app opens the Subotiz checkout page with the system browser inside the app. The checkout page is presented as an overlay on top of your app, so the user never leaves your app. Once payment is complete the browser closes and hands control back to the app; the order status is determined by the webhook. The integration consists of four steps, with responsibilities split as follows.Three Design Principles
- The session is created by your server. The app never holds the Secret API Key; amounts and products are decided server-side, which prevents client-side tampering.
- The webhook is the single source of truth for order status. Fulfillment and entitlement activation must rely on the webhook, not on the return received by the app. The return only triggers UI.
- You must use the system in-app browser. It shares system cookies and supports Apple Pay / Google Pay. Do not host the checkout page in a bare WebView that allows JS injection.
First, Choose an Integration Mode
There are two integration modes for the app scenario, and their Apple Pay support differs. Decide before you start development.Supported Payment Methods
The table below reflects support in the in-app browser scenario. The payment methods actually available are determined by your merchant configuration, so rely on thepayment_methods returned by the create session API.
Subotiz Payments runs on different underlying acquiring channels, and the available payment methods differ accordingly — methods marked “Depends on the acquiring channel” are not available to every merchant. Always rely on the
payment_methods returned by the create session API; do not hardcode a payment method list from this table.For other third-party channels (Airwallex, Checkout, Oceanpayment, and so on), please contact Subotiz to confirm in-app support.Integration Steps
1
Server Setup
Configure the following environment variables on your server. Do not bundle them into the app.
2
Step 1: Create a Checkout Session (server)
When the customer taps buy in the app, your server calls the Subotiz API to create a Checkout Session. Set
return_url and cancel_url to return addresses on your own domain.Key Parameters
order_id: Your platform’s internal order ID, used for subsequent business data correlationintegration_method: Set tohostedto use the hosted page integration methodreturn_url: The page the customer is redirected to after a successful payment; in the app scenario this should point to your Universal Link / App Linkcancel_url: The page the customer is redirected to if they cancel payment
session_url (the checkout URL), in the form https://checkout.subotiz.com/m/{mid}/checkout/{sessionId}.3
Step 2: Open the Checkout Page In-App (app)
Once the app has the
session_url, open it with the in-app browser container provided by the system.Observable result: The checkout page appears as an overlay on top of the app, and the customer can see the list of payment methods.
4
Step 3: Receive the Return (app)
After payment completes, Subotiz redirects to the
return_url (or cancel_url) you passed when creating the session; the in-app browser then closes and control returns to the app.- iOS: Implement
onOpenURLon the view hosting the checkout page, and dismiss the Safari view once the return arrives. - Android: Register the Activity that receives the return in
AndroidManifest.xml(launchMode="singleTask"plus anintent-filterwithautoVerify).
5
Step 4: Confirm the Order (server + app)
Implement a webhook endpoint on your server. This is the single source of truth for order status. Three things to get right:
- Verify the signature — validate
X-Signatureas described in Webhook reliability verification. Verification needs the raw body, so do not parse the JSON first; - Deduplicate idempotently — deduplicate by event id, because the same event may be delivered more than once;
- Return 200 quickly — move slow business processing off the request path instead of blocking the response.
Constraints
Mandatory Requirements
Recommendations and Notes
Verification Checklist
Once the integration is complete, confirm each of the following:- The server can successfully create a session and return
session_url - Opening the checkout page in-app presents it as an overlay, and the user does not leave the app
- The expected payment methods are visible on the checkout page (matching
payment_methods) - The Apple Pay button is visible and can be launched on a real iOS device (the test amount must be above your channel’s minimum charge, see L2)
- After a successful payment the browser closes automatically and returns to the app
- The server receives the webhook, signature verification passes, and repeated deliveries do not cause duplicate fulfillment
- When the browser is closed manually and no return is triggered, the app still gets the correct order status through polling after being reopened
- After a cancelled payment the order status is correct and no entitlement is granted by mistake