Skip to main content

POST /subscriptions/checkout

Initiate a subscription checkout flow. Auth: required.
tier
string
required
One of plus, pro, max.
provider
string
required
One of cryptobot, platega, usdt_bep20.
curl -X POST https://api.agentflow.website/subscriptions/checkout \
  -H "Content-Type: application/json" \
  -H "Cookie: af_session=..." \
  -d '{ "tier": "pro", "provider": "cryptobot" }'
Response
{
  "subscriptionId": "sub_01HQ...",
  "tier": "pro",
  "provider": "cryptobot",
  "checkoutUrl": "https://t.me/CryptoBot?start=invoice-...",
  "expiresAt": "2026-04-25T11:30:00Z"
}
The checkoutUrl is provider-specific. Redirect the user there. Activation happens server-side once the provider’s webhook confirms.

GET /me/subscription

Fetch the current user’s active subscription. Auth: required.
curl https://api.agentflow.website/me/subscription \
  -H "Cookie: af_session=..."
Response
{
  "tier": "pro",
  "status": "active",
  "monthlyGrantFlow": 100,
  "currentGrantRemainingFlow": 73.4,
  "renewsAt": "2026-05-25T11:30:00Z",
  "provider": "cryptobot"
}
status values: active, grace (failed renewal, retrying), canceled, none.

POST /me/payouts/request

Withdraw FLOW. See Payouts for the full flow.
amountFlow
number
required
Amount in FLOW. Must be ≤ withdrawable balance.
rail
string
required
usdt_bep20, cryptobot, or manual.
address
string
Required for usdt_bep20.
curl -X POST https://api.agentflow.website/me/payouts/request \
  -H "Content-Type: application/json" \
  -H "Cookie: af_session=..." \
  -d '{ "amountFlow": 100, "rail": "usdt_bep20", "address": "0x..." }'

GET /me/payouts

List the user’s payouts.
curl https://api.agentflow.website/me/payouts \
  -H "Cookie: af_session=..."
Response: array of payout objects with id, amountFlow, feeFlow, rail, status, createdAt.

GET /me/payouts/:id

Single payout detail, including rail-specific tx hash if sent or confirmed.

POST /me/payouts/:id/cancel

Cancel a pending payout and re-credit the FLOW.

Errors

CodeWhen
tier_unknownBad tier value
provider_unsupportedProvider not enabled in this deployment
subscription_activeNew checkout while one is already active
withdraw_too_lowBelow the rail’s minimum
withdraw_too_highAbove withdrawable balance
address_requiredMissing address for on-chain rail
payout_immutableCancel attempted on sent/confirmed payout