Overview
Most partners integrate the TLAY Connect SDK into their own app. Users pay, claim data, connect their card and install plans without leaving your app, while the SDK talks to the TLAY Connect platform. Partners without an app can point users to TLAY Connect instead.
Partners own the campaign rules and budget, the user channel and the merchant address — plus, when integrating the SDK, the in-app UI and user accounts.
SDK integration
The TLAY Connect SDK wraps payment verification, card connection and plan installation in a few modules. Your users stay in your app the whole time.
| Platform | Status | Requirements |
|---|---|---|
| Android (native / Kotlin) | Available | [Android version TBD], Bluetooth Low Energy |
| iOS (native / Swift) | In development | iOS 15.6 or later, real devices only (no Simulator) |
| React Native | In development — one API for Android and iOS | As above, per platform |
| Module | What it does |
|---|---|
account | Links your user to a TLAY Connect account using a user token issued by your backend |
wallet | Wallet signature binding, stablecoin payments, transaction submission; works with your app’s existing wallet signer or the built-in wallet |
cards | Scan and connect Bluetooth SIMs (with card password), read the EID, link the card and write plans to it; built-in eSIM installs go through the OS install flow (Apple’s setup screen on iOS, confirmed by the user) |
campaigns | Live campaigns; submit a transaction and get the eligibility result |
entitlements | List plans, install to card with step-by-step progress callbacks, renew, usage and end date |
ui (optional) | Prebuilt screens for card connection, install progress and usage, themed to your brand |
- Once you join, get the SDK package and sandbox keys (a publishable client key and a server secret).
- Add the SDK to your app and declare the Bluetooth and network permissions.
- On your backend, use the server secret to issue a TLAY Connect user token for each user; the app starts its session with it.
- Build card connection and plan installs first, then the campaign or purchase flow.
- Pass acceptance testing on testnet, then switch to production keys and go live.
// Initialize
TlayConnect.init(context, TlayConfig(
publishableKey = "pk_test_…",
environment = Environment.SANDBOX
))
// Start a user session with a token from your backend
TlayConnect.account.signIn(userToken)
// Scan, connect and link a Bluetooth SIM
val card = TlayConnect.cards.scan().first()
TlayConnect.cards.connect(card, password = cardPassword)
TlayConnect.cards.bind(card)
// Install a ready plan to the card, with progress callbacks
TlayConnect.entitlements.install(entitlementId) { stage ->
progressView.show(stage)
}
Keep the server secret on your backend. Never ship it inside the app.
Core concepts
| Object | Description |
|---|---|
Campaign | A set of reward rules: qualifying action, time window, budget, limits and reward plan |
Eligibility | The result of checking one on-chain transfer against one campaign: qualified, or rejected with a reason |
PaymentIntent | Created when a user buys or renews a plan; locks the price, has its own deposit address, valid for 30 minutes |
Entitlement | A plan the user holds, from a campaign reward or a purchase, linked to one card |
Renewal | Adds another period of the same plan to an existing entitlement; no reinstall needed |
Card | A linked eUICC identified by its EID; a card belongs to one user at a time |
Campaign settings
Today, the TLAY team sets up your campaign in the ops console with the fields below. Every change is recorded in the audit log.
| Field | Description | Example |
|---|---|---|
| Merchant address | The address users must pay for a payment to qualify | Your merchant address |
| Network and token | Only this stablecoin on this network is accepted | [Network] · [Stablecoin] |
| Minimum amount | Per-payment minimum, compared at the token’s native precision | [Amount] |
| Time window | Judged by the timestamp of the block containing the transaction | Start and end time |
| Reward plan | The plan issued when a payment qualifies | Japan · 1 GB · 7 days |
| Total budget | Maximum rewards; reserved and settled within one transaction | 100 rewards |
| Per-user / per-card limit | How many times one user or one card can claim | 1 |
| Require wallet signature | When on, only wallets with a proven signature count | On |
Eligibility and rejection reasons
Each on-chain transfer is checked once per campaign and the result is stored. Resubmitting, re-scanning or processing the same transaction concurrently never creates a second reward. Rejected payments carry one of these reasons:
| Code | Meaning |
|---|---|
CAMPAIGN_INACTIVE | The campaign is paused or not enabled |
OUTSIDE_WINDOW | The transaction falls outside the campaign window |
WRONG_TOKEN | Wrong token or network |
WRONG_RECIPIENT | The recipient isn’t the campaign’s merchant address |
BELOW_MIN | Below the minimum amount |
SELF_TRANSFER | A self-transfer, or the payer is an address the platform controls |
PAYER_NOT_BOUND | The paying wallet isn’t linked to any user |
WALLET_NOT_VERIFIED | The campaign requires a signature, but the wallet was only registered by address |
NO_CARD | The user hasn’t linked a card |
USER_LIMIT | Over the per-user limit |
CARD_LIMIT | Over the per-card limit |
BUDGET_EXHAUSTED | The campaign budget is used up |
On-chain confirmation
- The platform only acts on finalized transactions. A transaction submitted before finality returns
pendingand is processed automatically once final. - Each transfer event is identified by
chain_id + tx_hash + log_indexand deduplicated on ingestion. - The platform monitors campaign merchant addresses and payment deposit addresses; the app can also submit a transaction hash directly. Both paths use the same checks.
- Purchases are matched by their unique deposit address, never by guessing from amount or time.
Entitlement lifecycle
reserved→fulfilling→ready→installed→active→finished
| Status | Description |
|---|---|
reserved | Budget or payment locked, waiting to be issued |
fulfilling | The plan is being provisioned, or an unclear result is being reconciled |
ready | Activation details ready; not installed on a card yet |
installed | The app reported a successful install |
active | The plan is in use |
suspended | Paused by the operator |
finished | Data used up or plan expired |
failed | Definitive failure; campaign budget released automatically, purchases refunded |
manual_review | The outcome can’t be proven automatically; handed to the ops team |
If provisioning times out, the platform reconciles before deciding to retry. It retries automatically only when it can prove the plan wasn’t provisioned — it never provisions twice.
Platform API (v1)
This is the API the SDK uses under the hood; call it directly if you build your own UI or integrate server-side. REST + JSON, base URL [https://api.your-domain/v1]. Everything except the config endpoint requires Authorization: Bearer <token>.
| Method | Path | Purpose |
|---|---|---|
| GET | /config | Public settings: network, token, explorer |
| POST | /auth/register | Register with an invite code; returns a token |
| POST | /wallet/challenge | Get a wallet signing challenge |
| POST | /wallet/bind | Link a wallet (verified when signed) |
| POST | /cards/bind | Link a card by EID |
| GET | /products | Plans on sale |
| GET | /campaigns | Live campaigns and remaining rewards |
| POST | /campaigns/:id/submit-tx | Submit a transaction hash; returns eligibility |
| POST | /payment-intents | Create a purchase payment intent |
| GET | /payment-intents/:id | Payment intent status |
| GET | /entitlements, /entitlements/:id | Entitlements and details (usage, renewal history) |
| GET / POST | /entitlements/:id/renewal | Renewal quote / create a renewal payment intent |
| POST | /entitlements/:id/install-report | Report the install result and step timings |
POST /v1/campaigns/c_123/submit-tx
Authorization: Bearer <token>
Content-Type: application/json
{ "txHash": "0x3686…98db1ea3" }
200 OK
{
"state": "processed",
"eligibilities": [
{
"status": "qualified",
"reason": null,
"entitlementId": "e_456"
}
]
}
Error format
422 Unprocessable Entity
{
"error": {
"code": "RENEWAL_NOT_ELIGIBLE",
"message": "…",
"details": { "reason": "ORDER_FINISHED" }
}
}
Reports and data
- Per campaign: cards linked, qualified and rejected payments (by reason), entitlements by status, issuing success rate, duplicate rewards, and P50 / P90 time from confirmed payment to ready-to-install.
- CSV exports mask wallet addresses, EIDs and ICCIDs and never include activation codes.
- Sent weekly; a live dashboard is [planned].
Security and audit
- Server secrets stay on the server and never appear in the app, logs or exports; clients use only the publishable key and user tokens.
- Activation codes are encrypted at rest and returned only to the user who owns the entitlement.
- Every manual action in the ops console — reissue, refund, suspend, resume, renewal handling — records the operator, the reason and the before and after state.
- Each partner can be limited to an allowlist of plans and an issuing cap; requests over the limit are blocked before provisioning.