Sell a subscription in 15 minutes
Connect Stripe, create a plan with a seven-day trial, add a test subscriber through checkout, and confirm they have access to your app.
Last updated
You'll connect your Stripe account, create a plan with a seven-day trial, add a test subscriber and check that they have access. This covers the Stripe path end to end. The Apple path needs an App Store Connect app and is covered in Verify Apple in-app purchases. For the model behind these steps, see How payments and subscriptions work.
Before you start
You need:
- To be a project administrator. Connecting Stripe, creating plans and adding subscribers are administrator tasks.
- A Stripe account to connect. Use Stripe's test cards while you try this. Onboarding asks for business details but no live card details.
- A user in your project to subscribe. Any test user will do.
Connect Stripe
In the Anythink dashboard
- Open Settings › Payments and stay on the Stripe tab. On a fresh project, AnythinkPay in the sidebar shows the same setup.
- On Create New Account, leave Account Type as Express (Recommended), choose your Business Type, enter your Email Address and Business Name, and select Create Stripe Connect Account. To use a Stripe account you already have, choose Connect Existing Account and select Connect with Stripe instead.
- Select Complete Account Setup and finish Stripe's onboarding form in the window it opens.
- Back in the dashboard, the Stripe tab shows Fully Onboarded once Stripe confirms it, with Charges and Payouts both Enabled. Select Refresh Status if it still shows Pending Verification.
With the CLI
anythink pay connect
This asks for the business type (individual or company), the country code (default GB) and an email address, creates the Stripe Connect account, and opens the onboarding link in your browser.
anythink pay status
── Stripe Connect Status ─────────────────────────────────────
Account ID: acct_1P...
Onboarding complete: yes
Charges enabled: yes
Payouts enabled: yes
Details submitted: yes
With an AI assistant (MCP)
Note: The AI chat in the Anythink dashboard can't run pay commands. A local anythink-mcp server can, so ask your assistant to run pay connect and pay status and it will call the commands shown above.
Create a plan with a trial
A plan is the product you sell. Its price, interval and trial length are copied onto each subscription you add to it.
In the Anythink dashboard
- Open AnythinkPay, choose the Plans tab and select New plan.
- Enter a Plan name (your own label, for example
Pro monthly) and a Subscription name (the name your subscriber sees at checkout). Leave Type as Web. - Set Amount (GBP £), Billing period and Bill every. For £9.99 each month, enter
9.99, Monthly and1. - Set Trial period (days) to
7. - Leave Active ticked and select Create plan.
- If Stripe onboarding is complete, the plan syncs to Stripe when you save it. Open the plan with Edit to see Synced to Stripe and its Stripe product and price ids. If it shows Not yet synced to Stripe, save the plan again once onboarding finishes.
With the CLI
There's no anythink pay subcommand for plans, so create them with fetch:
anythink fetch /integrations/anythinkpay/subscription-plans --method POST --body \
'{"plan_name":"Pro monthly","name":"Pro monthly","description":"Full access","type":"web","amount":9.99,"currency":"gbp","billing_interval":"month","interval_count":1,"trial_period_days":7,"is_active":true}'
type is web or mobile. Plans for the Stripe checkout flow in this guide use web.
{
"id": 8,
"plan_name": "Pro monthly",
"name": "Pro monthly",
"description": "Full access",
"type": "web",
"amount": 9.99,
"currency": "gbp",
"billing_interval": "month",
"interval_count": 1,
"trial_period_days": 7,
"is_active": true,
"stripe_product_id": null,
"stripe_price_id": null
}
The response is trimmed here. stripe_product_id and stripe_price_id stay null until Stripe onboarding is complete. The plan is still usable, and it syncs the next time you save it after onboarding finishes.
With an AI assistant (MCP)
Create an AnythinkPay subscription plan called "Pro monthly" at £9.99/month
with a 7-day trial.
There's no dedicated plans tool, so the assistant runs a fetch request against the plans endpoint through the cli tool.
Add a test subscriber
A subscription is one subscriber's purchase of a plan. It starts as incomplete and moves on when they pay through Stripe Checkout.
In the Anythink dashboard
- Open AnythinkPay, choose the Subscriptions tab and select Add Subscriber.
- On the User tab, pick your test user. To subscribe a record that isn't a user, use the Other entity tab instead.
- Pick the Plan you just created. Its price, billing interval and trial period come from the plan, and the summary shows them.
- Select Send checkout link. The Subscription created dialog offers Open checkout and a button that copies the link. Complete checkout with a Stripe test card such as
4242 4242 4242 4242.
Only active plans appear in the Plan picker.
With the CLI
Read the plan, then create the subscription with that plan's own values. The subscription copies them from the plan, so don't change them.
anythink fetch /integrations/anythinkpay/subscription-plans/8
anythink fetch /integrations/anythinkpay/subscriptions --method POST --body \
'{"name":"Pro monthly","description":"Full access","type":"web","amount":9.99,"currency":"gbp","billing_interval":"month","interval_count":1,"trial_period_days":7,"subscriber_id":61,"customer_email":"test@user.com"}'
subscriber_id is the Anythink user's id. customer_email is the address Stripe uses for the customer. If a user in your project has that email, the subscription is linked to them, which is what lets their own sign-in read their access.
{
"anythink_pay_id": "4c2f9a1e-0000-0000-0000-000000000000",
"checkout_url": "https://checkout.stripe.com/c/pay/cs_test_...",
"session_id": "cs_test_..."
}
Open checkout_url and pay with a Stripe test card. To send the subscriber back to your own app afterwards, add success_url and cancel_url to the request.
With an AI assistant (MCP)
Note: As with plan creation, this goes through the generic fetch request. There's no dedicated "subscribe a user" tool.
Check it worked
Until checkout completes the subscription is incomplete and gives no access. Once the subscriber completes checkout, Stripe reports it as trialing for a plan with a trial, or active for one without. Both give access.
In the Anythink dashboard
Open AnythinkPay, choose the Subscriptions tab and find the subscription. Its Status reads Trialing or Active.
With the CLI
An administrator can read any user's subscriptions:
anythink fetch /integrations/anythinkpay/subscriptions/by-user/61
The response is a list of that user's subscriptions, each with its status, provider, current_period_ends_at and trial_ends_at.
Your app asks about the signed-in user with one call, made with that user's own token:
GET /org/{project_id}/integrations/anythinkpay/subscriptions/me/entitlement
{
"has_access": true,
"subscription_id": "4c2f9a1e-0000-0000-0000-000000000000",
"provider": "stripe",
"product_id": "Pro monthly",
"status": "trialing",
"expires_at": "2026-10-11T17:49:06Z",
"auto_cancel_at": null,
"cancelled_at": null,
"is_trial": false,
"trial_ends_at": null,
"trial_days_remaining": null,
"trial_length_days": 7,
"trial_base_days": 0,
"trial_bonus_days": 0,
"pending_product_id": null,
"pending_at": null
}
has_access is the only field you need to gate a feature. me/entitlement always reads as the calling user, so the user's role needs the anythink_subscription_plans:read permission. Payments recipes shows how to grant it.
is_trial and the other trial_ fields describe the app's free trial, not the plan's trial, so they stay empty for a subscriber. trial_length_days here is the length of the app's free trial setting, not the plan's trial. See Offer codes, free trials and entitlements.
With an AI assistant (MCP)
Show the AnythinkPay subscriptions for user 61.
The assistant runs the by-user request through the cli tool.