Documentation

POST /api/intent/order

Override the section the storefront leads with.

RequestPOST /api/intent/order
AuthenticationSession cookie required
Handlerbackend/server.py

What it does

The founder names the section to lead with. Both sides are recorded and returned: the override is stamped `provenance: "founder_override"` and `engine_dissent` carries what the engine would have led with and the dated row behind it, so the screen can say 'you asked for X; we would have led with Y, because …' rather than quietly discarding one of the two facts.

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

ParameterInTypeRequiredDescription
ff_sessioncookiestringOptionalThe session identifier. Omit it on the first call and store the value the response sets; every later call must send the same one or the engine treats the caller as a new visitor with no holds and no claims.
sectionbodystringRequiredThe section to lead with. Refused as `no_section` when absent, `unknown_section` when it is not a section of the store.

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' \
  -d '{"section":"<string>"}' \
  "https://flowfinds.ai/api/intent/order"
const res = await fetch("https://flowfinds.ai/api/intent/order", {
  method: "POST",
  credentials: "include",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "section": "<string>"
  }),
});
const data = await res.json();
import requests

s = requests.Session()
r = s.post("https://flowfinds.ai/api/intent/order", json={
    "section": "<string>"
  })
data = r.json()

Recorded example

curl -s -b cookies.txt -c cookies.txt \
  -X POST -H 'Content-Type: application/json' \
  -d '{"section":"…"}' \
  "$FLOWFINDS_ORIGIN/api/intent/order"

Responses

200The order was applied.

FieldTypeDescription
statusstring`ordered`, or `order_failed` when the applied lead does not match the request.
product_idstringThe product.
leadstringThe section now leading.
provenancestring`founder_override`.
engine_dissentobject`would_have_led` and the dated row behind it.

Errors

StatusReasonWhen
400no_sectionNo section was named.
400unknown_sectionThe named section is not part of the store.
409build_in_progressA build is already running.
500order_build_raisedThe regeneration raised.

Related

Back to the API reference index, or read the cookbook for recipes that compose this endpoint with others.