FlowPrime guides

Payments: sell your product and turn a payment into a customer account

FlowPrime runs the checkout for the product you sell, on YOUR Stripe account: you define products, tiers and quotas, FlowPrime mints the Stripe prices, prints a buy link per tier, and turns each paid checkout into a customer account and a licence your app can read. The money settles in your Stripe balance; FlowPrime takes no share of it. Use this guide when the product charges its customers. If nobody pays inside the product, you need none of it.

What you can do

Capability How Status
See whether a Stripe account is linked and can charge reseller_stripe_account_get live
Link your own Stripe account (a restricted key) dashboard, Business > Settings > Payment account dashboard
Create a product with tiers, prices, trial days and quotas reseller_operator_product_create live
List and read products, tiers, Stripe ids and buy links reseller_operator_products_list, reseller_operator_product_get live
Rename, re-price, change quotas or trial days, add a tier reseller_operator_product_update live
Read the quotas a buyer of each tier is granted license_plans_list live
Rotate the signing secret of a product's licence webhook (webhookUrl) reseller_operator_product_rotate_webhook_secret live
Change a product's webhookUrl after creation not settable by a workspace planned
Share a checkout link per tier buyUrl from reseller_operator_product_get live
Start a checkout from your own landing page REST: POST /v1/checkout/operator (public, no credential) via service_contract service=reseller live
Send a buyer to checkout when they sign in without a purchase checkoutUrl on the customer sign-in app (auth_create_oidc_app, auth_update_oidc_app) live
Check what one customer is entitled to license_customer_entitlements live
Your app checks the signed-in customer's plan REST: GET /v1/entitlements on license with the customer's token live
"Manage subscription" link (invoices, card, cancel) REST: POST /v1/customer/billing-portal on reseller with the customer's token live
Give a customer free months reseller_operator_grant_free_months live
Extend a customer's trial (no subscription yet), even one that already ended license_customer_licenses for the licence id, then license_extend_trial; dashboard: the customer's page, Extend trial live
Give a customer extra quota on one plan limit, for good or until a date license_quota_grant, license_quota_list, license_quota_revoke; dashboard: the customer's page, Extra quota live
See what needs attention today: failed payments, trials and manual sales about to end, purchases left halfway dashboard (Business > Business overview) dashboard
List who bought what reseller_operator_subscriptions_list (also dashboard, Business > Customers) live
MRR and this month's new and cancelled subscriptions per product reseller_operator_revenue_summary (see platform_guide topic=reporting) live
Cancel a customer's subscription now dashboard, Business > Customers (the customer's page) dashboard
Give one customer free access with no card dashboard, product page (free checkout link) dashboard
Record a sale you made outside Stripe (invoice, transfer, a trial you give by hand): the customer gets their account and plan with no checkout reseller_operator_record_manual_sale (endsAt for a trial, invoiceReference/invoiceUrl for your own invoice), reseller_operator_set_manual_sale_invoice to add it later, reseller_operator_change_manual_sale_plan to move it to another plan, reseller_operator_end_manual_sale; REST POST /v1/admin/operator-manual-sales and POST /v1/admin/operator-manual-sales/{id}/plan for your backend (client credentials with scope api). A customer who already owns an account in your workspace keeps that one account: a sale or a purchase joins it live
Time-boxed top-up for one customer (extra quota) dashboard, Customers > Licenses dashboard
Promo codes at checkout create them in your own Stripe dashboard; every checkout accepts them live
Free plan or card-less trial on a product (license free tier) readable in license_plans_list, not settable by a workspace planned
One-time purchase, lifetime deal, setup fee, packs checkout runs in subscription mode only planned
Metered, pay-as-you-go, per-seat quantity or overage billing prices are flat per tier; quotas are counted by your app planned
Change plan inside the billing portal the portal leaves plan changes out planned
Check whether your workspace can pay providers, and set its default payout rule and fee reseller_payouts_get, reseller_payouts_defaults_update live
Add a provider you pay (a payee) and send them Stripe's sign-up link reseller_payee_create, reseller_payee_signup_link (also dashboard, Business > Payees) live
List payees, change one's payout rule, see their payouts reseller_payees_list, reseller_payee_update, reseller_payee_payouts live
Pay your providers out of a sale and keep a fee (marketplace payouts, a take rate) reseller_booking_checkout, reseller_bookings_list, reseller_booking_refund (see "Pay your providers") live
Tell your app when a booking is paid, refunded or disputed, or a provider can be paid reseller_payouts_events_update (see "Events to your app") live
Your fee: a percentage, a fixed amount, or both with a minimum and a maximum; for the workspace, one provider or one booking reseller_payouts_defaults_update, reseller_payee_update, fee fields on reseller_booking_checkout (see "Your fee") live
A subscription that pays a provider every invoice payee on POST /v1/checkout/operator or ?payee= on a buy link live
One payment split across several providers; paying out only after the job is done not implemented planned

Before you start

  1. A linked, active Stripe account, to sell through checkout. Call reseller_stripe_account_get: connected must be true and status must be active. Without one you can still create products and sell them by manual sale (reseller_operator_record_manual_sale); a product created that way goes on Stripe at its first checkout once the account is active. livemode false means test keys (no real money). Linking happens only in the dashboard (Business > Settings > Payment account), by pasting a restricted key of your own Stripe account (see "Your Stripe account" below). Linking also registers the Stripe webhook that feeds purchases back to FlowPrime (webhookRegistered, routerWired).
  2. A customer sign-in app for the product itself (see platform_guide topic=auth). Buyers sign in through it.
  3. A product slug nobody else holds. Slugs are global across FlowPrime.

Your Stripe account

FlowPrime works on a Stripe account you own; it never holds your money and never opens a Stripe account for you.

Workspaces linked before 2026-11 may show mode: connect (an Express account FlowPrime opened). It keeps working, but it can never pay providers, because Stripe does not let an account run by a platform set up Connect of its own. To pay providers, disconnect it and link your own account; products and subscriptions created on the old account stay there.

Step by step

Create a product with tiers

  1. reseller_stripe_account_get - stop if not active; creating a product needs it.
  2. reseller_operator_product_create with:
  3. The answer is accepted with pendingServices. Poll reseller_operator_product_get until status is live.
  4. license_plans_list with the product slug (or licenseProductId) to confirm the quotas license will grant.
  5. Each tier in reseller_operator_product_get carries buyUrl and sellable. When sellable is false, reasons says why.

Sell it

How a purchase becomes a customer account

  1. The buyer pays on Stripe. Stripe tells FlowPrime; you do not handle that webhook.
  2. License records the purchase against the e-mail that paid: product, tier, status, quotas and currentPeriodEnd.
  3. If the product sells a new workspace (a plan with sellsNewWorkspace true), an owner grant is held for that e-mail. An unknown e-mail gets a verified login and a set-password mail.
  4. At the buyer's first interactive sign-in through your customer app, the grant is redeemed: a new customer account is born with the buyer as owner. Two purchases before the first sign-in give two accounts; the sign-in asks which one.
  5. Your app reads the plan with GET /v1/entitlements?email=<account_owner_email>&product=<slug>, sending the signed-in customer's access token. A customer token reads your operator tenant automatically. An unknown customer answers 200 with active:false, never an error.

An addon or upgrade, or a plan with sellsNewWorkspace false, writes no grant: the buyer must already hold a seat (or get one by invitation) for the purchase to be usable.

After payment: renewals, failures, cancellation, refunds

From your server, call POST /v1/customer/billing-portal on reseller with the signed-in customer's own access token as the bearer and { "returnUrl": "https://app.example.com/billing", "product": "<slug>" }. Redirect to the url it answers. Only the account owner (claim account_role = owner) may open it. 404 no_billing_account means this customer never paid through Stripe.

Rehearse a purchase end to end

  1. Link the Stripe account with test keys first; reseller_stripe_account_get then answers livemode: false.
  2. Open a tier's buyUrl with ?email= set to a second e-mail you control (not your team login) and pay with Stripe's test card 4242 4242 4242 4242.
  3. license_customer_entitlements with that e-mail: the tier, active: true and a currentPeriodEnd.
  4. Set the password from the welcome mail and sign in through your customer app: the token carries the new account with account_role owner.
  5. Switch the dashboard link to live keys only when this works.

Verify the licence webhook

Each licence event POSTed to your product's webhookUrl carries, when the product has a webhookSecret:

X-FlowPrime-Signature: t=1731150000,v1=5f2b...
X-FlowPrime-Event-Id: 6f1c2a9e-0d4b-4c35-9a51-2b7a8e0f1d33
X-Webhook-Signature: sha256=9a0c...
import hashlib, hmac, os, time

SECRET = os.environ["LICENSE_WEBHOOK_SECRET"].encode()   # webhookSecret
TOLERANCE = 300                                          # seconds

def verify(raw: bytes, header: str) -> bool:
    parts = [p.split("=", 1) for p in header.split(",") if "=" in p]
    t = next((v for k, v in parts if k == "t"), "")
    if not t.isdigit() or abs(time.time() - int(t)) > TOLERANCE:
        return False
    expected = hmac.new(SECRET, t.encode() + b"." + raw, hashlib.sha256).hexdigest()
    return any(hmac.compare_digest(expected, v) for k, v in parts if k == "v1")

# in your handler: raw = the request body bytes, untouched
# if not verify(raw, headers["X-FlowPrime-Signature"]): answer 401
# if headers["X-FlowPrime-Event-Id"] was already handled: answer 200 and stop

To rotate the secret:

  1. reseller_operator_product_rotate_webhook_secret with the product slug and, optionally, graceHours (default 24, at most 168). The answer holds the new webhook_secret once: store it on your server.
  2. Until previous_valid_until, X-FlowPrime-Signature carries two v1 values, one per secret, so a receiver with either secret verifies. Deploy the new secret before then. X-Webhook-Signature uses the new secret at once.
  3. graceHours: 0 retires the old secret immediately, for a secret you know has leaked.

The tool also sets a secret on a product created without one.

A subscription that pays a provider

Both the buy link (?payee=<payee id>) and POST /v1/checkout/operator (payee) take an optional payee id. Every invoice of that subscription then pays the payee, minus the percentage of the fee that applies to that payee: their own fee if they have one, else your workspace's fee (reseller_payouts_get). Only the percentage applies, because Stripe takes a subscription's fee as a percentage of each invoice: fixed, minimum and maximum parts are ignored, and a payee whose own fee has no percentage pays no fee on subscriptions. The fee is never taken from the public request, so a buyer cannot change it. The payee must be can_be_paid or payouts_on (see "Pay your providers" below).

Help one customer: trial, quota, sale or free months

Pick by what the customer has:

Manual sales: invoices and revenue

Give free months

  1. reseller_operator_grant_free_months with email, months (1 to 12), reason (3 to 500 characters). dryRun defaults to true and writes nothing.
  2. Read the plan and any refusal. Then call again with dryRun=false and the requestId and planToken the preview answered.
  3. What happens depends on the subscription: active gets the next N invoices discounted; past_due has its unpaid invoices forgiven and counted; cancel_scheduled is refused unless resumeScheduledCancel=true; cancelled answers a checkout LINK for you to send (no mail is sent).

Pay your providers (marketplace payouts)

A workspace that sells work its providers do (a cleaning company and its cleaners) charges the customer and pays the provider out of the sale, keeping a fee. It runs on your own Stripe account with Stripe Connect turned on. Each provider is a payee: a Stripe Express account under yours, which the provider sets up through Stripe's sign-up link. The dashboard shows the same list under Business > Payees.

Before you start

  1. Your own Stripe account is linked (see "Your Stripe account" above). A legacy mode: connect account cannot pay providers.
  2. Connect is turned on in your Stripe dashboard: Connect > finish setup (the platform profile). Only the account owner can do this; no tool can.
  3. The restricted key has the Connect permissions too: Write: Connected accounts, Account Links and Refunds; Read: Transfers and Application fees. Edit the key in Stripe (or create a new one) and replace it in the dashboard, Business > Settings > Payment account.

Steps

  1. reseller_payouts_get. When connectEnabled is false, tell the person connectNextStep and stop: nothing else works until it is done.
  2. reseller_payouts_defaults_update sets how often payees are paid out (payoutInterval: daily, weekly, monthly or manual), how many days a payment waits first (payoutDelayDays, 0 = Stripe's minimum) and the fee you keep (see "Your fee" below). Set payeeWork (what your providers do, e.g. "House cleaning booked through Cleaning Connect") and payeeIndustry (Stripe's four-digit merchant category code, e.g. 7349 for cleaning): Stripe gets them with each payee, so providers are not asked for a website or a product description during sign-up.
  3. reseller_payee_create with name, email and country (two letters), plus work and industry when this provider does something other than your default. The payee starts as invited.
  4. reseller_payee_signup_link with the payee id, then send or show the url to the provider. It is single use and short-lived: make a new one each time.
  5. Wait until reseller_payees_list shows the payee as can_be_paid or payouts_on (refresh=true reads Stripe now). restricted means Stripe needs more (requirements): send a new sign-up link.
  6. reseller_booking_checkout for each booking: payeeId, amountCents, currency, description, optional reference (your booking id). Send the customer to url. The payee gets the amount minus the fee (see "Your fee" below); the answer's booking.feeCents and payeeShareCents say how it split, and payeeNetCents later says what the payee keeps after refunds.
  7. reseller_booking_refund to refund a paid booking, whole or in part. The customer gets the money back and the refunded amount is taken back from the payee's Stripe balance. By default your fee goes back to the customer in proportion, so the payee loses only their share. keepFee=true keeps your whole fee, so the payee pays for it: on a full refund they end up owing your fee and payeeNetCents goes below zero. A refund cannot be undone: confirm the booking and the amount with the person first.

Your fee

A fee is what your workspace keeps from a payment that pays a provider. It has four optional parts:

Part Field Meaning
Percentage feePercent e.g. 10 for 10% of the payment
Fixed amount feeFixedCents added to the percentage, e.g. 200 for 2.00
Minimum feeMinCents the fee is never below this
Maximum feeMaxCents the fee is never above this

feeFixedCents, feeMinCents and feeMaxCents are money, so they need feeCurrency (e.g. nzd); a percentage alone needs none. The fee is never more than the payment itself. Example: 10% + 2.00, at least 5.00, at most 30.00 keeps 5.00 on a 20.00 booking, 12.00 on 100.00 and 30.00 on 400.00.

Where a fee is set, and which one a payment uses (the first that exists wins):

  1. The booking's own: fee fields on reseller_booking_checkout. They are always in the booking's currency, so no feeCurrency.
  2. The payee's own: reseller_payee_update with fee fields, or on reseller_payee_create. useDefaultFee=true removes it. reseller_payees_list shows each payee's fee and followsDefaultFee.
  3. The workspace's: reseller_payouts_defaults_update with fee fields; clearFee=true removes it. reseller_payouts_get shows it as defaults.fee.
  4. None: the provider gets the whole payment.

Rules that matter:

What a provider earned and when they get it

What your workspace carries

Events to your app

Your app hears about its bookings and providers without asking: reseller_payouts_events_update with url (an https endpoint of your server) answers eventsSecret once. Store it as a server secret; each new call makes a new one and the old one stops working. clear=true stops the events, and reseller_payouts_get shows the current eventsUrl. The same setting is in the dashboard, Business > Settings > Payouts.

type When
booking.paid the customer paid; the provider's share is in their Stripe balance
booking.payment_failed a delayed payment method failed; nothing was paid
booking.refunded a refund went through, from FlowPrime or from Stripe's own dashboard (refundedNowCents, and the booking's status is partially_refunded or refunded)
booking.disputed the customer disputed the charge with their bank; answer it in Stripe
booking.dispute_closed the dispute ended (booking.disputeStatus says how)
payee.updated a provider's status changed, e.g. invited to can_be_paid after they finish Stripe's sign-up, or to restricted when Stripe needs more (previousStatus is the old one)

Each event is a POST of JSON to your URL:

{
  "id": "evt_fp_3f9c2a1b8e7d6c5b4a392817",
  "object": "event",
  "source": "flowprime",
  "type": "booking.paid",
  "org": "your-workspace",
  "created": 1763200000,
  "data": { "booking": { "id": "bkg_...", "payeeId": "pye_...", "reference": "your-job-42", "amountCents": 10000, "feeCents": 1200, "payeeNetCents": 8800, "status": "paid" } }
}

data.booking and data.payee are the same objects reseller_bookings_list and reseller_payees_list answer, so your handler can reuse one parser.

From your product's server

Everything above works from your product's own backend, with no person signed in. This is how a marketplace product built on FlowPrime runs payments end to end.

  1. Once, set up: link your Stripe account and turn on Connect (dashboard, Business > Settings > Payment account; the owner's step). Then set your fee, payout rule and payeeWork (reseller_payouts_defaults_update), and your eventsUrl (reseller_payouts_events_update).
  2. Your backend's token: a platform sign-in app with client_credentials AND the api scope: auth_create_oidc_app name="<Product> backend" surface=platform grantTypes=client_credentials scopes=api (or auth_update_oidc_app scopes=api on an existing one). Without api every payee and booking call answers 403. Get the token as in platform_guide topic=auth, "Call FlowPrime from your backend", and send it as Authorization: Bearer <token> with X-Org-Slug: <your workspace> to https://api.fastflow.tech/reseller. The routes are those under the tools (service_contract service=reseller has the bodies): GET /v1/admin/payouts, PUT /v1/admin/payouts/defaults, PUT and DELETE /v1/admin/payouts/events, GET and POST /v1/admin/payees, GET and PUT /v1/admin/payees/{id}, POST /v1/admin/payees/{id}/link, GET /v1/admin/payees/{id}/payouts, POST /v1/admin/bookings/checkout, GET /v1/admin/bookings, POST /v1/admin/bookings/{id}/refund.
  3. A provider joins your product: create the payee with their name, email and country, keep its id on your provider record, and send them the sign-up link. A link works once: give refreshUrl a page of yours that makes a new link and redirects to it, so an expired link heals itself. Wait for payee.updated with status can_be_paid or payouts_on before offering their work for sale.
  4. A customer books: create the booking checkout with the provider's payeeId, the amount and your own job id in reference, and redirect the customer to url. Set successUrl and cancelUrl to your own pages. Confirm the job when booking.paid arrives, never from the redirect alone: a customer can close the tab before it.
  5. Something goes wrong: refund through the API (confirm with a person first), and handle booking.refunded, booking.disputed and payee.updated with restricted in your app (cancel the job, pause the provider).
  6. Money moves by itself: Stripe pays each provider out on your payout rule. Your product shows what they earned from GET /v1/admin/bookings?payeeId= (payeeNetCents) and their payouts from GET /v1/admin/payees/{id}/payouts.

Your product keeps what is yours: its database of jobs, customers and providers (FlowPrime ids stored next to your own), your booking rules and your screens. FlowPrime keeps the money side: accounts, checkout, fees, refunds, payouts and the events.

Not supported yet

Errors

Reseller answers {error, code}; the tool error carries both. connect_not_enabled: step 2 of "Before you start". own_account_required or no_stripe_account: link your own account. key_missing_connect_permissions: step 3. payee_not_ready: the payee has not finished sign-up, send a new sign-up link. stripe_account_not_ready: your own Stripe account cannot take charges yet (reseller_stripe_account_get); the account owner fixes it in Stripe. invalid_fee, invalid_amount, invalid_interval, invalid_delay, invalid_currency, invalid_work, invalid_industry, fee_currency_required, fee_currency_mismatch, name_required, email_required, country_required, description_required, invalid_events_url (the events URL must be a public https address): fix the argument (a booking's amountCents is at least 50). router_unavailable: FlowPrime's event router did not answer, try again in a minute. A 422 with another code is Stripe's own refusal, passed through with Stripe's message. payee_not_found, booking_not_found, booking_not_paid: check the id or the booking's status.

Things that trip agents up

After the purchase: e-mailing the buyer

FlowPrime sends the account mails itself (set your password, invitations), through the mail providers of your workspace: until a provider is set up in the dashboard, those mails are not delivered (platform_guide topic=mail). For your own mails (welcome, receipt, onboarding) either send them from your backend when your webhookUrl receives license.created (platform_guide topic=mail), or start a marketing sequence with marketing_trigger_event (platform_guide topic=marketing).

Reference

Where to go next