When trying to enable Transak integration for in-app crypto purchase, many face an unpleasant surprise: most on-ramp providers require redirecting the customer to an external site, which drastically reduces conversion. Transak is one of the few that allows embedding a purchase via a WebView widget while preserving the app's branding. But integrating into native iOS or Android projects is not always trivial: you need to correctly form the URL, sign partner requests with JWT, handle deep links and webhooks, and also comply with App Store Review Guidelines (Section 4.2 and 5.1). Over years of work (we've been on the market for over 5 years) we've hit our heads on these rakes and are ready to share a working recipe. This article details a guide to integrating Transak with code examples for Android (Kotlin) and iOS (Swift), as well as practical tips for setting up signatures and webhooks.
Problems That Integration Solves
Users often face high commissions, long KYC, or lack of support for the needed network. Transak solves this with a minimum commission of 0.5% on bank transfers, support for 130+ countries and 90+ cryptocurrencies, including Ethereum, BSC, Polygon, Solana. Partner JWT signing allows reducing the commission by an additional 0.2% and removing Transak branding. We guarantee the widget will fit your app's design via theme customization and hiding unnecessary menus. For a typical transaction of $500, the savings from partner signing can be $2.50 per transaction.
How We Do It: Integration Process
Forming URL for Transak Global
Base URL: https://global.transak.com
// Android — building the URL
val params = mapOf(
"apiKey" to transakApiKey,
"walletAddress" to userWalletAddress,
"network" to "ethereum", // ethereum, bsc, polygon, solana
"defaultCryptoCurrency" to "USDC",
"fiatCurrency" to "EUR",
"productsAvailed" to "BUY", // BUY, SELL, or BUY,SELL
"hideMenu" to "true", // remove Transak navigation
"themeColor" to "1A1A2E", // hex without #
"redirectURL" to "myapp://transak-callback",
"exchangeScreenTitle" to "Buy USDC"
)
val queryString = params.entries.joinToString("&") { (k, v) -> "$k=${URLEncoder.encode(v, Charsets.UTF_8)}" }
val widgetUrl = "https://global.transak.com/?$queryString"
For production — API key from dashboard.transak.com. Staging key (STAGING_TRANSAK_API_KEY) for testing: Transak test cards accept 4111111111111111 with any CVV.
Partner Signature (JWT)
On production accounts, Transak requires a signed JWT for authorized partners. Without it, the Transak widget works as public (with Transak branding). With partner signing — custom branding, lower commissions. For example, on an average order of $1000, the savings will be about $5 due to a 0.5% commission reduction.
// Server-side JWT generation (Node.js)
const jwt = require('jsonwebtoken');
const payload = {
apiKey: process.env.TRANSAK_API_KEY,
walletAddress: userWalletAddress,
userData: { firstName, email } // optional, for preKYC
};
const token = jwt.sign(payload, process.env.TRANSAK_SECRET, { expiresIn: '1h' });
// Pass token to the app, add as &partnerOrderId={token}
Handling Deep Links and Webhooks
After a purchase completes, Transak redirects the user to redirectURL. You need to configure Universal Links / App Links for iOS/Android for deep link integration. On the server side, verification of Transak webhooks using HMAC-SHA512 is mandatory — this protects against fake status updates. Key events: ORDER_CREATED, PAYMENT_DONE_MARKED_BY_USER, ORDER_COMPLETED, ORDER_FAILED.
Example webhook handling (Node.js)
const crypto = require('crypto');
app.post('/transak-webhook', (req, res) => {
const signature = req.headers['x-transak-signature'];
const payload = JSON.stringify(req.body);
const expected = crypto.createHmac('sha512', process.env.TRANSAK_SECRET).update(payload).digest('hex');
if (signature !== expected) {
return res.status(403).send('Invalid signature');
}
// Process event
const event = req.body.event;
if (event === 'ORDER_COMPLETED') {
// credit funds to user
}
res.sendStatus(200);
});
More about Transak API and webhooks — Transak documentation
Comparison of Transak with Other On-Ramp Solutions
| Provider |
Commission |
Country Support |
Cryptocurrencies |
KYC Threshold |
| Transak |
from 0.5% (SWIFT) |
130+ |
90+ |
from $50 |
| MoonPay |
from 1% (cards) |
100+ |
80+ |
from $150 |
| Ramp |
from 0.49% (SEPA) |
110+ |
70+ |
from $100 |
Transak wins due to low KYC threshold and support for both on-ramp and off-ramp in one widget. Commission savings can reach 30% compared to MoonPay, and on transactions over $1000 — up to $30 per operation. Additionally, Transak processes requests 2x faster than MoonPay thanks to optimized API and automated KYC.
Webhook Events Table
| Event Type |
Description |
Required Actions |
| ORDER_CREATED |
User started purchase |
Log, show status |
| PAYMENT_DONE_MARKED_BY_USER |
User paid |
Check within a minute |
| ORDER_COMPLETED |
Cryptocurrency sent |
Credit to balance |
| ORDER_FAILED |
Transaction declined |
Notify user, refund |
What's Included in Turnkey Work
- Requirements analysis: selecting networks and tokens, setting up partner account.
- Transak mobile app widget integration: Android (WebView + Kotlin) / iOS (WebView + Swift) with custom URL.
- JWT signing: server-side token generation for partner branding.
- Deep link integration: setting up Universal Links / App Links for returning to the app.
- Transak webhooks: server-side event processing and balance update.
- KYC support: optionally pre-fill user data for faster process.
- Testing: with Staging key and test cards.
- Documentation and training: instructions for your team.
- Integration guarantee: all technical nuances are worked out before launch.
Integration Process Step by Step
- Audit — determine supported networks, tokens, payment methods for your audience.
- Set up Transak account — get API keys, configure webhooks, partner branding.
- Widget integration — embed WebView with signed URL.
- Deep link handling — return to app after purchase.
- Server side — webhooks, verification, balance update.
- Testing — with test cards and Staging key.
- Production launch — switch key, monitor.
Typical Integration Mistakes
- Using public API key in production — Transak widget will have Transak branding, commission higher by 0.5%.
- Skipping webhook verification — anyone can send fake ORDER_COMPLETED.
- Improper error handling on failed purchase — user loses money without notification.
Ensuring Integration Security
Always use signed JWT for production requests and verify webhooks via HMAC signature. Store secret keys on the server, do not include them in the mobile app. Setting up Universal Links and App Links ensures secure return to the app after purchase.
Why Choose Transak as an On-Ramp Solution?
Transak offers a low KYC threshold (from $50), support for 130+ countries and 90+ cryptocurrencies, and both on-ramp and off-ramp in one widget. Commissions start from 0.5% on bank transfers, which is 30% lower than MoonPay for large amounts. This makes it the best choice for mobile apps targeting a global audience.
We guarantee all technical complexities will be addressed. Integration timeline — from 3 days to 2 weeks depending on complexity. Request a consultation for a free project evaluation. Our engineers have over 5 years of experience and have implemented more than 50 on-ramp integrations. The integration service typically costs between $2,000 and $5,000 for a standard setup, depending on complexity. Get a customized commercial proposal by contacting us.
Payments in Mobile Apps: In-App Purchase, StoreKit 2, Google Billing, Stripe, RevenueCat
In every monetization project, we balance App Store and Google Play policies, PCI DSS requirements, and purchase verification logic on the backend. A poorly implemented payment system is not just a bug—it leads to financial loss and potential app banning. Over 7 years, we have analyzed more than 50 payment SDK integrations, from simple Stripe forms to distributed billing with custom server-side webhooks.
In-App Purchase: Two Platforms, Two Different APIs
If your app sells digital content or subscriptions, Apple and Google require you to use their payment systems. This is non-negotiable: violating App Store rule 3.1.1 or Google Play Developer Policy results in app removal. Physical goods and offline services are a different story.
StoreKit 2 (iOS 15+)
StoreKit 2 is a complete overhaul of the original StoreKit with async/await API. Product.products(for:), product.purchase(), Transaction.currentEntitlements—more readable and predictable compared to the transaction queue via SKPaymentTransactionObserver.
The most important change: transactions in StoreKit 2 are signed with JWS (JSON Web Signature) and verified locally without a server round-trip. Transaction.verificationResult returns .verified(Transaction) or .unverified(Transaction, VerificationError). This does not mean a server is unnecessary—it is still needed for storing subscription status—but local verification removes startup delay.
StoreKit.AppTransaction verifies the actual app download from the App Store. Required for paid downloads or non-renewing purchases.
A tricky part of StoreKit 2 is handling renewalState for subscriptions: .subscribed, .expired, .inBillingRetryPeriod, .inGracePeriod, .revoked. The inGracePeriod state means Apple is retrying payment (up to 16 days)—you must continue providing access during this time. Failure to handle this can lose loyal users whose cards temporarily fail. Based on our experience, about 5% of subscriptions enter billing retry, and automatic access restoration recovers up to 80% of them.
Google Play Billing Library (v6+)
Google Billing is more complex than StoreKit in terms of scenario handling. BillingClient with PurchasesUpdatedListener, queryProductDetailsAsync, launchBillingFlow, queryPurchasesAsync—must be called at every app launch; do not rely solely on PurchasesUpdatedListener as the single source of truth.
Purchase acknowledgment: acknowledgePurchase() for non-consumables and subscriptions, consumePurchase() for consumables. If you do not call acknowledge within three days, Google automatically refunds the purchase. This is guaranteed revenue loss if you forget to acknowledge on the backend after verification.
ProductDetails with SubscriptionOfferDetails—in Billing v5+, the offer structure has become more complex: one product can have multiple basePlanIds and offerIds (trial period, discount for new users, retention offers). BillingFlowParams.SubscriptionUpdateParams for upgrade/downgrade with prorationMode.
Why Is Server-Side Verification Mandatory?
Never trust only client-side code when unlocking paid content. Client-side verification can be bypassed by modifying the app.
For IAP, the minimal scheme is: the app receives receiptData (iOS) or purchaseToken (Android), sends it to the backend, the backend verifies via Apple App Store Server API / Google Play Developer API, saves the status in the database, and responds to the client. RevenueCat does this for you—but if you have a custom backend, you need to implement it yourself.
Webhooks are more important than they seem. Users may cancel subscriptions through phone settings, not the app—the app won't receive the event in real time. Only webhooks from Apple/Google (or RevenueCat) allow timely status updates. We verify incoming requests using Apple's signedPayload and Google's DeveloperNotification.
How Does RevenueCat Simplify Integration?
Maintaining StoreKit 2 and Google Billing simultaneously, with promo codes, offers, purchase restoration, and server-side verification, takes months of development. RevenueCat handles most of this layer.
RevenueCat is not just a payment SDK. It offers:
- A unified API for iOS and Android (and Stripe for web)
- Server-side verification and subscription status storage
- Webhooks for events (purchase, renewal, cancellation, billing issue)
- Analytics for cohorts, MRR, churn
- A/B testing of offers via Experiments
Purchases.configure(withAPIKey:) at startup, Purchases.shared.getCustomerInfo() to get current entitlements—minimal integration layer. Purchases.shared.purchase(package:) instead of directly calling StoreKit/Billing.
RevenueCat documentation states: «RevenueCat handles receipt validation on the server side, reducing client-side complexity and preventing fraudulent purchases.»
Limitations of RevenueCat: it is paid (free up to $2.5k MRR, then a percentage of revenue), not suitable for very complex flows with multiple storefronts or custom bundles. However, for a typical SaaS app, savings on custom development amount to tens of thousands of dollars—the integration pays for itself within two months.
Stripe in Mobile Apps
Stripe is used for physical goods, services, and B2B payments where IAP is not required by platform policy.
Stripe iOS SDK and Android SDK—PaymentSheet for ready-made payment UI, PaymentSheetFlowController for custom UI with saved cards. Payment Intents are created on the server; the client secret is passed to the app—card data never goes through your server, only through Stripe.
Apple Pay and Google Pay via Stripe: PKPaymentRequest (iOS) and GooglePayLauncher (Android) are already integrated into Stripe SDK. Apple Pay conversion rates are 1.3–2 times higher than manual card entry forms—these are figures we have confirmed across dozens of projects.
Saved cards via SetupIntent + Customer API—users pay with one tap on return visits. Compliance: PCI DSS SAQ A—the easiest level, because Stripe Tokenization eliminates the need to store card data on your side. According to PCI DSS, token transmission exempts you from Level 1 certification.
3DS2 (Strong Customer Authentication) is mandatory for payments in the EU under PSD2. Stripe handles it automatically via PaymentIntent.confirmPayment, but you need to correctly handle the .requiresAction status and return the user to the appropriate screen after authentication.
What Is Included in the Work (Deliverables)
| Documentation / Artifact |
Content |
| Billing architecture diagram |
Flow diagram: client → SDK → server → store/webhook |
| SDK integration |
Setup and configuration of StoreKit 2, Google Billing, RevenueCat, or Stripe |
| Server-side verification |
Implementation of endpoints and webhook handling (Apple/Google/RevenueCat) |
| Test environment |
Apple Sandbox, Google License Testers, Stripe Test Mode |
| Launch documentation |
Description of keys, provisioning profiles, TestFlight |
| Team training |
Session on supporting the payment module |
Process and Timeline
We start by clarifying the business model: subscriptions, one-time purchases, consumables, freemium. The architecture depends on this. Testing IAP requires Sandbox accounts (Apple) and License Testers (Google)—this is a separate environment setup.
Apple's Sandbox behaves differently from production: subscriptions renew every 5 minutes instead of monthly, inGracePeriod works differently. It is essential to test scenarios: trial expiration, cancellation, billing retry, refund.
| Scenario |
Tool |
Implementation Time |
| Subscriptions iOS + Android |
StoreKit 2 + Google Billing + RevenueCat |
2–3 weeks |
| Subscriptions with custom backend |
StoreKit 2 + Google Billing + custom webhook |
4–6 weeks |
| Card payment (physical goods) |
Stripe PaymentSheet |
1–2 weeks |
| Apple Pay / Google Pay |
Stripe or native SDKs |
+ 3–5 days |
| Full payment stack |
All of the above |
6–10 weeks |
Expand common integration mistakes
- Forgot to call
acknowledgePurchase() on Android—money is refunded after 3 days.
- Did not handle
inGracePeriod—loyal users are blocked from access.
- Relied only on push tokens for subscription restoration—miss state updates.
- Used production keys in TestFlight—real charges occur.
The cost is calculated individually based on the set of tools and complexity of server-side logic. On average, we fit within a budget for a typical integration, but the savings from preventing errors and churn offset this investment within a few months.
Get a consultation for your project—contact us. We will help you choose the optimal payment architecture that passes store reviews and does not break under peak loads.