KNET for mobile app
Last updated: October 30, 2026
Accept KNET payments on your app with Flow for mobile, our pre-built, customizable payment user interface that you can embed directly into your mobile application. Flow lets you accept payments using Checkout.com's global network of payment methods with a single integration.
- The customer opens the checkout screen.
- You perform a server-side request to create a payment session.
- You use the payment session data on the client side to create and render Flow for mobile.
- Flow for mobile displays the available payment methods to the customer.
- When the customer selects KNET and taps Pay, Flow for mobile redirects them to the KNET page to authorize the payment.
- After the customer authorizes the payment, they return to your app, and you receive a webhook notifying you of the payment status.
Make sure you have a test account with Checkout.com.
Create a public key and a secret key from the Dashboard, with the following key scopes:
- Public key –
payment-sessions:payandvault-tokenization - Secret key –
payment-sessions
To receive webhooks for the payment events, configure your webhook server.
Integrate with Flow for mobile before continuing.
Ensure your account has KNET enabled. To enable KNET, contact your account manager or request support.
In your project-level build.gradle, add the following repositories:
1repositories {2mavenCentral()3maven { url = uri("https://jitpack.io") }4maven { url = uri("https://maven.fpregistry.io/releases") }5}
In your app-level build.gradle, add the following dependency:
1dependencies {2implementation 'com.checkout:checkout-android-components:$latest_version'3implementation('com.checkout:checkout-android-components-payment-methods-redirect:$latest_version')4}
When the customer is ready to pay, send a server-side request to securely create a PaymentSession object. The PaymentSession contains the information required to handle all steps of the payment flow.
Note
Do not embed your secret key in your client-side code.
Call the Create a Payment Session endpoint.
Information
Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see API endpoints.
post
https://{prefix}.api.checkout.com/payment-sessions
1{2"amount": 1000,3"currency": "KWD",4"reference": "ORDER_01234",5"display_name": "Online shop",6"payment_type": "Regular",7"billing": {8"address": {9"country": "KW"10}11},12"customer": {13"name": "Jia Tsang",14"email": "jia.tsang@example.com"15},16"items": [17{18"reference": "0001",19"name": "Gold Necklace",20"quantity": 1,21"unit_price": 100022}23],24"success_url": "https://example.com/payments/success",25"failure_url": "https://example.com/payments/failure"26}
In the request body, provide the following:
currency– The three-letter ISO 4217 currency code. Set toKWD.billing.address.country– The customer's billing country. Set toKW.
Include reference to set your unique reference for the payment.
1{2"id": "ps_2Un6I6lRpIAiIEwQIyxWVnV9CqQ",3"payment_session_secret": "pss_9823241e-2cec-4c98-b23d-7b29ow4e2e34"4}
The payment session response also determines which payment methods Flow for mobile displays to the customer, based on the customer's device and region.
Enable KNET in Flow for mobile when creating a CheckoutComponents instance.
Pass Knet.NAME when creating a flow or standalone component. Knet.NAME is a pre-built PaymentMethodName("knet") constant exposed by the SDK:
1import com.checkout.components.paymentmethods.redirect.knet.Knet23// Include KNET in a Flow component (renders all available payment methods)4val flow = checkoutComponents.create(ComponentName.Flow)56// Or create a standalone KNET component7val knetComponent = checkoutComponents.create(Knet.NAME)
KNET only renders when the backend payment session includes it in supportedPaymentMethods. Creating the component when the session does not support it has no effect.
Render the component in Compose UI with Render() or in a View container with provideView():
1// Compose2knetComponent.Render()34// View5knetComponent.provideView(containerView)
Depending on the payment outcome, Checkout.com redirects the customer to the success_url or failure_url you specified when you created the PaymentSession.
We send you a webhook notifying you of changes to the payment's status. Wait for the webhook callback before you start your order fulfillment process.
For payments submitted with Flow, the PaymentSession ID appears in the webhook payload's data.metadata.cko_payment_session_id field.
You can listen to the existing onSuccess callback or onError callback to handle the payment response for KNET payments, alongside card and wallet outcomes:
1val configuration = CheckoutComponentConfiguration(2context = context,3paymentSession = PaymentSessionResponse(4id = paymentSessionID,5paymentSessionToken = paymentSessionToken,6paymentSessionSecret = paymentSessionSecret,7),8publicKey = "pk_...",9environment = Environment.SANDBOX, // or Environment.PRODUCTION10componentCallback = object : ComponentCallback {11override fun onSuccess(component: Component, paymentID: String) {12// Payment completed: navigate to confirmation screen13}14override fun onError(component: Component, error: CheckoutError) {15// Payment declined, failed, or cancelled: show error UI16}17}18)