POST /deep-links returns a one-time URL that opens the Flume app with the user signed in. Create it on the click, and open it at once.
Before you begin
Section titled “Before you begin”- A
search_session_uuidthat belongs to the user. - A click from the user. Do not create links ahead of time.
1. Create the link on click
Section titled “1. Create the link on click”curl -X POST "https://sandbox-api.tryflume.ai/partner/v1/deep-links" \ -H "X-Flume-Partner-Key: $FLUME_PARTNER_KEY" \ -H "X-Flume-User-Token: $FLUME_USER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "search_session_uuid": "5f0c1d2e-8a7b-4c3d-9e1f-2a3b4c5d6e7f", "sku_uuid": "7f3c2a91-4b0e-4c8d-9a21-1f6b2d5e7c30"}'import os
import requests
headers = { "X-Flume-Partner-Key": os.environ["FLUME_PARTNER_KEY"], "X-Flume-User-Token": os.environ["FLUME_USER_TOKEN"],}
response = requests.post( "https://sandbox-api.tryflume.ai/partner/v1/deep-links", headers=headers, json={ "search_session_uuid": "5f0c1d2e-8a7b-4c3d-9e1f-2a3b4c5d6e7f", "sku_uuid": "7f3c2a91-4b0e-4c8d-9a21-1f6b2d5e7c30", }, timeout=30,)response.raise_for_status()print(response.json())const response = await fetch("https://sandbox-api.tryflume.ai/partner/v1/deep-links", { method: "POST", headers: { "X-Flume-Partner-Key": process.env.FLUME_PARTNER_KEY, "X-Flume-User-Token": process.env.FLUME_USER_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ "search_session_uuid": "5f0c1d2e-8a7b-4c3d-9e1f-2a3b4c5d6e7f", "sku_uuid": "7f3c2a91-4b0e-4c8d-9a21-1f6b2d5e7c30" }),});if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);console.log(await response.json());{ "url": "https://app.tryflume.ai/?utm_source=acme&utm_medium=partner#/l/dlk_q3Vh8yT…", "expires_at": "2026-10-23T09:14:22Z"}| To open | Send |
|---|---|
| The search results | search_session_uuid |
| A product | search_session_uuid, sku_uuid |
| An instant quote | search_session_uuid, sku_uuid, quote_uuid |
2. Open it
Section titled “2. Open it”Open url in a new tab, in the same click.
button.addEventListener("click", async () => { const tab = window.open("", "_blank"); if (tab) tab.opener = null; // the Flume app must not reach back into your page try { const { url } = await createDeepLinkOnYourBackend(); if (url) tab.location = url; else tab.close(); } catch { tab?.close(); }});createDeepLinkOnYourBackend is your own function. Opening the tab first keeps the browser's pop-up blocker from stopping it.
- The link works once, within 7 days.
- Never store, log or email
url. It signs the user in. - Do not parse or rebuild
url. - For a link you can store, use
product_urlfrom the save payload.
Send the user back to you
Section titled “Send the user back to you”Add redirect_uri to return the user to your page afterwards.
- It must be an
httpsURL. - Its host must be a redirect host agreed with Flume.
- Otherwise the call is a
422VALIDATION_FAILEDnamingredirect_uri.
Handle the errors
Section titled “Handle the errors”| You get | Do this |
|---|---|
404 SESSION_NOT_FOUND | Use one of this user's searches |
404 NOT_FOUND | Check sku_uuid, and that quote_uuid is one of this user's quotes |
422 SKU_NOT_IN_SEARCH | Use the search that returned the product |
422 QUOTE_NOT_READY | Wait until the quote is READY |
422 VALIDATION_FAILED | Fix the field named in error.field. A quote for another product is refused this way |
429 RATE_LIMITED | Wait Retry-After seconds |
url is null | You replayed an Idempotency-Key. Call again with a new key |