Documentation
POST /api/store/checkout
Open a customer order against a published store.
| Request | POST /api/store/checkout |
|---|---|
| Authentication | Session cookie required |
| Handler | backend/server.py |
What it does
Starts a payment for a storefront order. `charged_yet` is explicitly false: opening a session is not a payment. `credited_to` records the owner at the moment the order was opened, and that is the account the confirmation credits — not whoever happens to own the product later.
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 |
|---|---|---|---|---|
ff_session | cookie | string | Optional | The 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. |
product_id | body | string | Required | The product being bought. |
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 '{"product_id":"<string>"}' \
"https://flowfinds.ai/api/store/checkout"const res = await fetch("https://flowfinds.ai/api/store/checkout", {
method: "POST",
credentials: "include",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"product_id": "<string>"
}),
});
const data = await res.json();import requests
s = requests.Session()
r = s.post("https://flowfinds.ai/api/store/checkout", json={
"product_id": "<string>"
})
data = r.json()Recorded example
curl -s -b cookies.txt -c cookies.txt \
-X POST -H 'Content-Type: application/json' \
-d '{"product_id":"…"}' \
"$FLOWFINDS_ORIGIN/api/store/checkout"Responses
200 — A payment session opened.
| Field | Type | Description |
|---|---|---|
status | string | `checkout_started`. |
reference | string | The order reference. Pass it to `GET /api/store/confirm`. |
pay_url | string | Where to send the browser. |
charged_yet | boolean | False. A session is not a payment. |
credited_to | string | The owner recorded when the order opened. |
Errors
| Status | Reason | When |
|---|---|---|
409 | — | The store is not in a state that can take an order. |
502 | — | The payment provider answered with an error. |
503 | payment_unavailable | Payments are not configured on this machine. |
Related
GET /api/store— The state of the session's storefront.POST /api/store— Start generating the storefront for the session's product.POST /api/store/publish— Verify and publish the storefront, regenerating it if verification demands.POST /api/intent— Ask the engine what it would change on a surface, and why.POST /api/intent/apply— Apply a proposed intent, regenerating the store.POST /api/intent/order— Override the section the storefront leads with.POST /api/intent/revert— Undo the last applied intent.POST /api/ai/edit— Edit the storefront in natural language.
Back to the API reference index, or read the cookbook for recipes that compose this endpoint with others.