Open the embed on the buy sheet
One extra field when you issue a user_code sends your user straight to the screen they tapped for, with your amount filled in. Here is the whole path, from button to buy sheet.
Give your button a destination
Decide what the button in your app should open. For “Buy ₹500 of gold” that is the
buyscreen withamount500. Keep it on your server: the destination travels with the link you mint, never in a URL your app builds.Mint a link with launch, on your server
POST/partner/users/initembedapp.post("/gold/buy-500", async (req, res) => { const r = await fetch("https://api.oropocket.com/partner/users/init", { method: "POST", headers: { Authorization: `Bearer ${process.env.OROPOCKET_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ flow: "embed", mobile: req.user.mobile, launch: { screen: "buy", metal: "gold", amount: 500 }, }), }); const body = await r.json(); if (!body.success) return res.status(400).json(body.error); // e.g. INVALID_LAUNCH res.json({ url: body.data.embed_url }); });The response is the usual one, plus the
launchwe accepted. Mint the link when the user taps — it is single-use and lasts 10 minutes.Open embed_url in your WebView
Exactly as without a launch: load
embed_urlin the WebView you already set up. If you haven't, follow WebView & UPI setup first — the buy sheet hands off to UPI apps, which a WebView blocks unless you forward those links.What your user sees
A returning user lands on the buy sheet with ₹500 entered and gold selected. A new user verifies their mobile and fills in their profile first, then lands on the same sheet. They can change the amount, and nothing is charged until they choose how to pay and approve it.
Other buttons, same pattern
| Button in your app | launch |
|---|---|
| Start a wedding SIP | { "screen": "sip", "amount": 1000, "frequency": "monthly", "goal": "wedding" } — lands on the SIP amount step. |
| Sell 0.5 g of gold | { "screen": "sell", "metal": "gold", "grams": 0.5 } — capped at what the user can sell. |
| Spin the wheel | { "screen": "spin" } |
| Invite friends | { "screen": "rewards" } |
| My transactions | { "screen": "transactions" } |
| Complete KYC | { "screen": "kyc" } |
| Gift gold | { "screen": "gift", "amount": 501 } |
Check it
- The sheet opens once. Refresh the embed and you are on the dashboard — that is by design.
- A request without
launchstill opens on the dashboard. - A 403
LAUNCH_NOT_ENABLEDmeans the switch isn't on yet; every other error is listed in Open the embed on a screen.