Skip to main content

Create Subscription Workflow

Goal

A provider publishes a new subscription on-chain so others can subscribe to it.

Who is involved

RoleWhat they do
ProviderThe wallet address passed as from — creates and owns the subscription
Your appBuilds the subscription params and requests unsigned createSubscription calldata
Clocktower APISimulates and returns unsigned transactions
WalletSigns and broadcasts to the selected chain (REST ?chainId=; MCP optional chainId, default Base)

Steps

  1. Prepare create — send amount, token, frequency, due day, and metadata; receive unsigned createSubscription calldata.
  2. Sign — provider wallet signs the transaction.
  3. Broadcast — your app sends it to the chain in unsignedTransactions[].chainId.
  4. Confirm (optional) — poll transaction status.
  5. Fetch new ID — after mining, read the subscription by ID or poll until it appears on-chain.

Flow diagram

Calls by surface

StepRESTMCP toolSDK
1. PreparePOST /prepare/create_subscriptionprepare_create_subscriptioncreateSubscription()
2–3. Sign & broadcastYour wallet + RPCSamewalletClient via viem
5. Fetch IDGET /subscriptions/:id or searchget_subscriptionwaitForSubscription()

Example request body

{
"from": "0xProviderAddress",
"amount": "10",
"token": "0x...",
"details": { "url": "https://example.com/", "description": "Premium" },
"frequency": 1,
"dueDay": 15
}

On REST, pass ?chainId= on prepare and on the follow-up GET /subscriptions/:id so you stay on the same chain. On MCP, pass the same chainId on prepare and get_transaction_status (omitted uses Base). See REST chain selection and MCP chain selection.