Documentation
POST /api/journey/[id]/consume
Redeem a journey carrier once.
| Request | POST /api/journey/[id]/consume |
|---|---|
| Authentication | Session cookie required |
| Handler | flowfinds-organ/app/api/journey/[id]/consume/route.ts |
What it does
Consumes the carrier and returns its payload. A carrier is consumed after a full document load, which for a guest can be the very navigation that creates them, so this mints a guest rather than refusing. The security properties are unchanged: the single-use identifier bound to the request fingerprint is what authorises consumption, and a carrier bound to a sign-in link is still refused for a guest, because a guest's synthetic address can never equal a magic-link email.
Authentication
Session cookie required. Send the ff_session cookie. Without one the engine treats the caller as a new visitor with no holds and no claims, and returns a new cookie to use from then on.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | The carrier identifier. |
Request
The cookie jar carries the session between calls. Angle-bracketed values are the parameter types from the table above.
curl -s -b cookies.txt -c cookies.txt \
-X POST -H 'Content-Type: application/json' \
"https://flowfinds.ai/api/journey/[id]/consume"const res = await fetch("https://flowfinds.ai/api/journey/[id]/consume", {
method: "POST",
credentials: "include",
});
const data = await res.json();import requests
s = requests.Session()
r = s.post("https://flowfinds.ai/api/journey/[id]/consume")
data = r.json()Recorded example
curl -s -b cookies.txt -c cookies.txt \
-X POST -H 'Content-Type: application/json' \
-d '{}' \
"$FLOWFINDS_ORIGIN/api/journey/<id>/consume"Responses
200 — The carrier was redeemed. The body is the payload that was stored.
Errors
| Status | Reason | When |
|---|---|---|
403 | owner-mismatch | The carrier is bound to a sign-in link for a different address. |
404 | — | The carrier is unknown or has already been consumed. |
Related
POST /api/intent— Ask the commerce assistant, or resolve a navigation intent.POST /api/pages— Generate a page from an intent.POST /api/journey— Issue a single-use journey carrier.GET /api/walkthrough— The walkthrough's steps and this user's position in it.POST /api/walkthrough/advance— Move forward or back a step.POST /api/walkthrough/dismiss— Dismiss the walkthrough.POST /api/auth/request-link— Request a magic sign-in link.GET /api/auth/callback— Redeem a magic link.
Back to the API reference index, or read the cookbook for recipes that compose this endpoint with others.