Hosted subscriptions
- 1 endpoint
Every route acts with what the subscription's wallet signs (a transaction or a message), never on a merchant's credential.
Get hosted subscription bills#
GET /hosted/
Lists a subscription's 10 most recent bills, newest first, in their public shape (public: the id is the secret; one page). An unknown subscription, or another kind of id, answers 404; a subscription not billed yet, no items.
- Auth
- None needed
- On-Behalf-Of
- Not used (public route)
- Idempotency-Key
- Ignored
- Success
- 200
request.sh
curl "https://api.qbitflow.app/v2/hosted/subscriptions/$SUBSCRIPTION_UUID/bills"# 200: a page of Bill ({ items, hasMore: false })Path parameters
uuidstringRequiredThe subscription: sub@… or its bare uuid
txuuid
Response
A page: { "items": Bill[], "hasMore": …, "nextCursor"?: … }. Pass nextCursor back as cursor for the next page; it is absent when hasMore is false.
30 fields of each Bill
11 fields only its owner reads are never sent here (a public route).
uuidstringallow read and create, (generated on creation of the payment link)
A prefixed id (pay@…, sub@…)
createdAtstringfromstringtostringamountstringThe amount in the currency's units, exact, a decimal string ("10" for 10 USDC): amountMinUnits / 10^decimals
amountMinUnitsstringThe amount in the currency's smallest unit, a string of digits ("10000000" for 10 USDC, 6 decimals)
amountUsdstringWhat the customer paid, in USD, a decimal string: the price (and, on a one-time payment, the fees its checkout added: fees), which the contracts split between QBitFlow's fee (the referrer's share included), the organization's fee and the merchant (settlement.split). The network fee a customer pays on top (settlement.split.networkFee) is not in it
currencyIdintegerThe currency paid in, written as the currency object under currency (GET /currencies/:id)
txHashstringHash of the transaction in the blockchain
chainstringOptionalThe chain it was paid on: ETH (Ethereum), BASE (Base) or SOL (Solana), the testnet's for a test-mode transfer (currency.test)
explorerUrlstringOptionalIts transaction on the chain's block explorer (the testnet's in test mode). Omitted without a txHash
testbooleanWhether this is test data (testnets) or live data
productNamestringWhat was paid for: the subscription's product name when the bill was paid (the first bill: as it was when the checkout was created). Later product edits don't change it
productDescriptionstringSame, for the product's description. Absent without one
productUuidstringOptionalThe subscription's product
subscriptionUuidstringThe subscription it bills (sub@…)
periodStartstringOptionalThe start of the period the bill paid: its due date (the subscription's start for its first bill). Omitted on bills recorded before it was
periodEndstringOptionalThe end of the period the bill paid: the subscription's next bill. Paid until then. Omitted on bills recorded before it was
confirmedAtstringOptionalWhen the chain confirmed it: its block's time (settlement.transaction.blockTime). Absent only on records made before it was recorded
Errors
The common codes only, as any route (what each means):
- 400validation_failed
- 404not_found
- 429rate_limit_exceeded
- 500internal
- 504timeout
Edge cases
The contract's rules for these routes: Authentication & roles · Ids · Bills (public).
Read all 3
Authentication & roles
GET /:uuid/billsis public (no credential): the management page's bill history; the subscription's id is the secret.- The others are dashboard-only (API keys →
404): the checkout's intent and send (POST /intent,POST "") and the management page's actions, each an intent (…/intent,201) then its send (200):/:uuid/cancel,/:uuid/increase-allowance,/:uuid/update-max-amount,/:uuid/pause,/:uuid/resume; andPOST /:uuid/upgrade-trial(201).
Ids
:uuidis the subscription's id:sub@…or its bare uuid (the same subscription, the same intents: an intent asked with one form is sent with the other). Another kind of id (pay@…) →404; a malformed one →400validation_failedonuuid. The subscription moved from the bodies to the path: the bodies are{ numPeriods }(allowance intent),{ signedTransaction }(the sends),{ signature }(pause, resume) or none.- An unknown or cancelled subscription →
404on every action (its bills stay readable).
Bills (public)
GET /:uuid/billsanswers the subscription's 10 most recent bills, newest first, in one page ({"items": [...], "hasMore": false}; every bill, page by page, is the merchant'sGET /subscriptions/:uuid/bills). A subscription not billed yet (a trial) → no items. An unknown subscription, or another kind of id (refund@…) →404. A cancelled subscription's bills stay readable.- Each bill is a
Bill(Subscriptions and bills § Bills) in its public shape: itscurrencyobject, amounts andproductName, never itswhenAuthfields (userUuid,customerUuid,customer,settlement), even with the merchant's credential.
The codes named here
- 400validation_
failed path/query/body failed binding or validation, or a business rule about one input (a field named in
errors)