powered by

Create plans and manage subscriptions

Define plans with a price, interval and trial, add subscribers, cancel or resume Stripe subscriptions, and fix a subscription record with the recovery tools.

Last updated

A plan is the product you sell: a name, a price, an interval and a trial length. A subscription is one subscriber's purchase of a plan. This page covers both in the Anythink dashboard, with the CLI and over the API.

If you're setting this up for the first time, Sell a subscription in 15 minutes walks through the same steps end to end. For how subscriptions, providers and access fit together, see How payments and subscriptions work.

Plans

Only project administrators can create, edit or delete plans. Anyone with the anythink_subscription_plans:read permission can list and read them, which is how your app builds a paywall.

In the Anythink dashboard

Open AnythinkPay and choose the Plans tab. It lists every plan with its Plan name, Product name, Amount, Billing and Status, where Status is Active or Retired. Select New plan, or Edit on a plan, to open the form:

Field Notes
Plan name Your own label for the plan, such as Premium Monthly. It identifies the plan in the dashboard.
Type Web or Mobile. Use Web for subscriptions that pay through Stripe Checkout.
Subscription name The customer-facing name, shown at checkout and on invoices.
Description What the plan includes, shown to the subscriber at checkout.
Amount (GBP £) The price for each billing interval, excluding VAT.
Billing period, Bill every The interval. Monthly and 1 bills every month, Monthly and 3 every three months. The periods are Daily, Weekly, Monthly and Annually.
Trial period (days) Free days before the first charge, from 1 to 365. Leave it empty for no trial.
Product name, Product description Optional. What the Stripe product shows if you want it to differ from the subscription name and description.
Reference Optional. Your own tag for bookkeeping. It's never shown to customers.
Apple product ID, Apple subscription group ID Optional. Link the plan to an App Store Connect product. See Verify Apple in-app purchases.
Tier rank Optional. A whole number from 1 to 100 that ranks plans, higher being a better plan. Offer codes use it to limit a code to premium plans.
Active An active plan appears in the Add Subscriber picker. Untick it to retire the plan: existing subscribers keep billing, but nobody can be subscribed to it again.

Select Create plan or Save plan. When Stripe onboarding is complete, a new plan syncs to Stripe straight away. Saving an existing plan whose amount, currency, interval, Bill every, Product name or Product description changed syncs it again. A plan's page shows Synced to Stripe with the Stripe product and price ids, or Not yet synced to Stripe if onboarding isn't done or the sync failed. Save the plan again to retry.

The dashboard form prices new plans in pounds sterling.

With the CLI

There's no anythink pay subcommand for plans, so manage them with fetch against the AnythinkPay API:

bash
anythink fetch /integrations/anythinkpay/subscription-plans
anythink fetch /integrations/anythinkpay/subscription-plans/8
anythink fetch /integrations/anythinkpay/subscription-plans --method POST --body '{ ... }'
anythink fetch /integrations/anythinkpay/subscription-plans/8 --method PUT --body '{ ... }'
anythink fetch /integrations/anythinkpay/subscription-plans/8 --method DELETE

A plan's JSON uses these fields:

Field Notes
plan_name, name, description All three are required.
type web or mobile.
amount, currency The price and a lower-case currency code such as gbp.
billing_interval, interval_count day, week, month or year, and how many of them between charges.
trial_period_days Optional.
product_name, product_description, reference Optional.
is_active true by default.
apple_product_id, apple_subscription_group_id, tier_rank Optional.

PUT replaces every field, so send the whole plan, not just the field you're changing.

Note: anythink plans is a different, unrelated command. It lists Anythink's own hosting plans (storage, users, custom domain) for anythink projects create --plan, not AnythinkPay subscription plans.

With an AI assistant (MCP)

text
List the active AnythinkPay subscription plans on this project.

The assistant runs a fetch request against the plans endpoint through the cli tool, as there's no dedicated plans tool.

The older templates route

/org/{project_id}/integrations/anythinkpay/subscription-templates is kept as an alias of the plans endpoints for existing integrations. Use /subscription-plans for anything new.

Subscriptions

A subscription takes its price, interval and trial length from the plan you add the subscriber to, and it's linked to one or more Anythink users. That link is what lets a user's own sign-in read their subscription and their access.

Stripe subscriptions begin as incomplete and move on when the subscriber pays through Stripe Checkout. Apple subscriptions are created when your app verifies a purchase. See Verify Apple in-app purchases.

In the Anythink dashboard

Open AnythinkPay and choose the Subscriptions tab. It lists every subscription with its Subscription, Customer, Status, Amount, Next Billing, Cancellation and Source. Use the filter to show one status.

To add a subscriber, select Add Subscriber:

  1. On the User tab, pick an existing user. On the Other entity tab, pick any entity and the record to subscribe, then enter the Customer email. That suits a subscriber who isn't a user, such as a workspace or a team.
  2. Pick the Plan. Its price, billing interval and trial period come from the plan.
  3. Optionally add a Customer phone, then select Send checkout link.
  4. In the Subscription created dialog, select Open checkout, or copy the link and send it to the subscriber.

Open a subscription to see its Status, its Events timeline (created, renewed, cancelled, refunded, plan changes) and the users it's linked to.

On an active Stripe subscription, Cancel Subscription stops auto-renewal. The subscriber keeps access until the current period ends. Apple subscribers manage their subscription in the App Store, so Cancel isn't offered for them.

With the CLI

bash
anythink fetch /integrations/anythinkpay/subscriptions
anythink fetch /integrations/anythinkpay/subscriptions/{id}
anythink fetch /integrations/anythinkpay/subscriptions/{id}/cancel --method POST
anythink fetch /integrations/anythinkpay/subscriptions/{id}/resume --method POST
anythink fetch /integrations/anythinkpay/subscriptions/{id}/events
anythink fetch /integrations/anythinkpay/subscriptions/by-user/61

cancel switches off auto-renewal on a Stripe subscription. Its status stays active, auto_cancel_at is set, and the subscriber keeps access until the period ends. resume switches auto-renewal back on while the period is still running. When Stripe ends the subscription its status becomes canceled.

To add a subscriber from the CLI, read the plan and send its own values. See Sell a subscription in 15 minutes. The {id} in these paths is the subscription's id, a UUID.

events returns the timeline. Each entry has an event_type, a source (user, verify, assn, admin or system), a summary, the prior_status and new_status, and occurred_at.

With an AI assistant (MCP)

text
Show the events for subscription 4c2f9a1e-0000-0000-0000-000000000000.

Subscription statuses

Status Meaning Grants access?
incomplete Created, waiting for the first payment No
trialing In its trial period Yes
active Paying, current period in progress Yes
grace_period An Apple renewal failed and Apple is still retrying Yes
past_due, in_billing_retry A renewal payment failed and the provider is retrying Yes, until the current period ends
canceled (Stripe), cancelled (Apple) Auto-renew is off Yes, until the current period ends
revoked Refunded or ended by the provider No
expired The period ended with no renewal No
unpaid Stripe gave up retrying No
superseded Replaced by a newer subscription for the same Apple product No. Read the newer subscription instead.

Any status not in this table never grants access. This is the rule me/entitlement applies, so your app reads has_access rather than checking statuses itself. See How payments and subscriptions work and Offer codes, free trials and entitlements.

Sharing a subscription

A subscription's user list controls who can read it and, for a link that isn't read-only, who can cancel or resume it. This is Anythink access control, not a seat count on the billing provider.

http
GET    /org/{project_id}/integrations/anythinkpay/subscriptions/{id}/users
PUT    /org/{project_id}/integrations/anythinkpay/subscriptions/{id}/users
{ "user_id": 61, "readonly": true }

DELETE /org/{project_id}/integrations/anythinkpay/subscriptions/{id}/users/61

Only project administrators can change the user list. A subscriber can read their own subscriptions and any others they're linked to without administrator rights.

Limit: This isn't team or per-seat billing. One Stripe or Apple purchase still has one payer. The user list shares read access to an existing subscription, such as a household plan. It doesn't bill several users under one subscription.

Recovery tools

Project administrators can repair a subscription record without editing the database, which is useful after a support case. In the dashboard, open the Recovery actions menu on a subscription's row in the Subscriptions tab.

Dashboard action API What it does
Re-sync from provider POST .../subscriptions/{id}/admin/resync Pulls the live status from Stripe. Stripe subscriptions only. Apple subscriptions return a 400.
Relink / manage users POST .../subscriptions/{id}/admin/relink with { "user_id": 61 } Reassigns the subscription to a different user, which fixes a wrong-user link.
Force-expire POST .../subscriptions/{id}/admin/status with { "status": "expired", "clear_period": true } Marks the subscription expired and ends access now. The record stays for history.
Delete subscription DELETE .../subscriptions/{id}/admin Removes the Anythink record and its user links.

Delete doesn't cancel anything at Stripe or Apple. Use it to clear a stuck or duplicate record, not to end a live subscription.

Permissions

To You need
List and read plans anythink_subscription_plans:read
Create, edit or delete plans Project administrator
List and read subscriptions Standard user access. A user sees the subscriptions they're linked to, and an administrator sees all of them.
Create a subscription Standard user access
Cancel or resume a subscription Project administrator, or a user linked to it without the read-only flag
Change a subscription's user list Project administrator
Recovery tools Project administrator

Next steps