Skip to navigation

Subscriptions

Charge customers on a recurring schedule through plans that a person or an AI agent can subscribe to.
View as Markdown

Subscriptions let your business charge for ongoing access to a product or service on a regular schedule. A plan defines what you sell, its price and how often it is charged, and a subscription connects one subscriber to that plan. Many subscribers can share the same plan, while each subscription keeps its own status, charges and billing history, so one subscriber falling behind never affects another.

Subscribers can be people or AI agents, and both are charged automatically each billing period. Plans are managed under Plans in the Mitu dashboard, or through the API.

What subscriptions provide

  1. Recurring billing without manual work
    Each billing period, the subscriber is charged automatically and a record of the charge is kept against the subscription.
  2. A billing history per subscriber
    Every charge produces an invoice for its period, so any individual charge can be reviewed and reconciled.
  3. Clear signals when payment fails
    A failed charge moves the subscription to past due and notifies your systems, so your product can respond as your policy requires.

Offering a subscription

1

Create a plan

Create a plan for each product and price you offer. In the dashboard, a plan is charged weekly, monthly or yearly. Through the API, a daily interval is also available.

curl --request POST \
--url https://api.mitu.ai/v1/plans \
--header "x-api-key: $MITU_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"name": "Professional",
"description": "Unlimited projects, priority support and advanced reporting",
"amount": 49.00,
"currency": "USD",
"billingInterval": "month",
"features": ["Unlimited projects", "Priority support", "Advanced reporting"]
}'
ParameterDescription
nameThe plan name shown to subscribers.
descriptionWhat the plan includes.
amountThe amount charged each billing period.
currencyThe currency of each charge.
billingIntervalHow often subscribers are charged, either day, week, month or year.
featuresThe benefits of the plan, shown to subscribers.
2

Let customers subscribe

The simplest way to offer a plan is a payment link of type subscription, which a person or an agent can complete to subscribe. You can offer a single plan, or several and let the subscriber choose. The dashboard creates the subscription link for each plan for you.

3

Or subscribe them directly

When your product already knows who is subscribing and to which plan, create the subscription through the API.

curl --request POST \
--url https://api.mitu.ai/v1/subscriptions \
--header "x-api-key: $MITU_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"subscriptionPlanId": "plan_7h2kq9xz",
"paymentMethod": "mpp_crypto",
"subscriberId": "cus_ds9hazr8jd3l",
"subscriberType": "user"
}'

Recurring charges use MPP, because the payment method must permit future charges without the subscriber approving each one. Choose mpp_crypto to charge in USDC or mpp_spt to charge by card. Set subscriberType to user for a person or agent for an AI agent, which is the default.

4

Follow each billing period

Each billing period produces a charge and an invoice for that period. Your systems are notified through events when a subscription is created, each time a charge succeeds, when a charge fails and the subscription becomes past due, and when it is cancelled.

GET /v1/subscriptions?status=past_due&subscription_plan_id=plan_7h2kq9xz
GET /v1/subscriptions/{id}
GET /v1/subscriptions/{id}/invoices
5

Cancel when billing should stop

Cancel a subscription to stop future charges. The subscription and its invoices are retained, so its billing history is never lost.

POST /v1/subscriptions/{id}/cancel

Managing plans

Plans can be listed and filtered by status, and archived or restored from the dashboard. A plan that is paused or archived is no longer offered to new subscribers, while existing subscriptions continue as before. An archived plan can be restored at any time.

Plan stateMeaning
activeOffered to new subscribers.
pausedTemporarily not offered. Existing subscriptions continue.
archivedNo longer offered. Existing subscriptions continue, and the plan can be restored.

Subscription and charge states

Subscription stateMeaning
activeBilling normally.
past_dueThe most recent charge did not complete.
pausedBilling is temporarily paused.
cancelledCancelled, and no further charges are made.
expiredThe subscription has reached its end.
Charge stateMeaning
pendingThe charge has been raised and is being collected.
paidThe charge was collected.
failedThe charge could not be collected, and the subscription becomes past due.
refundedThe charge was collected and later refunded.
voidThe charge was cancelled before it was collected.

Subscription practices

  1. Keep plans stable
    When the price or terms of a plan change materially, create a new plan rather than altering one in use, so each subscriber’s history remains clear.
  2. Decide your past due policy in advance
    Mitu reports a failed charge, while your product decides what follows, such as notifying the subscriber, allowing a grace period or restricting access.
  3. Reconcile each period from its invoice
    Use the invoice produced for each charge to reconcile that period, and the subscription itself to understand the overall relationship.

Subscriptions give your business predictable, recurring revenue from people and agents alike, with every charge recorded, every failure reported and the policies that follow left entirely under your control.