Documentation

POST /api/store/checkout

Open a customer order against a published store.

RequestPOST /api/store/checkout
AuthenticationSession cookie required
Handlerbackend/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

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.
product_idbodystringRequiredThe 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

200A payment session opened.

FieldTypeDescription
statusstring`checkout_started`.
referencestringThe order reference. Pass it to `GET /api/store/confirm`.
pay_urlstringWhere to send the browser.
charged_yetbooleanFalse. A session is not a payment.
credited_tostringThe owner recorded when the order opened.

Errors

StatusReasonWhen
409The store is not in a state that can take an order.
502The payment provider answered with an error.
503payment_unavailablePayments are not configured on this machine.

Related

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