Skip to main content
By the end of this guide you’ll have a subscription plan buyers can pay into, a real test subscriber, and you’ll know how to list who’s subscribed and cancel someone who asks. This runs in test mode, so the “buyer” is you, paying with the test card.
There is no subscriptions.create(). A subscription is created by the buyer, not by you. You create a payment link with type: 'subscription', the buyer pays it at the hosted checkout, and that payment is what starts the subscription. This guide walks through exactly that flow.

Before you start

  • An AgentaOS account with a test API key, or the CLI logged in. See Accept your first payment if you haven’t set that up yet.
  • Your account needs to accept card and bank (via Merchant of Record), which is the default for most accounts. Only wallet-only, on-chain accounts can’t create subscription links. Business verification (KYB) is a separate, later requirement for going live; it isn’t needed to build and test subscriptions in test mode. See Going live.
1

Create a subscription payment link

Set type: 'subscription' and a billingInterval. Every other field works the same as a one-time link.
There’s no CLI command for payment links yet, one-time or subscription. agenta pay checkout only creates single, non-recurring checkouts. Create a subscription link from the SDK, the REST API, or the dashboard’s Catalog → Products page.
2

Share checkoutUrl, buyer subscribes

Share plan.checkoutUrl exactly as you would a one-time link. The buyer opens it and pays with a card at the hosted checkout, using the test card in test mode:Behind the scenes, AgentaOS creates a customer and subscription with our card processor, charges the first cycle, and the subscription becomes visible to subscriptions.list().
3

Confirm the subscription is active

Money model exception: every other amount in this API, including this same payment link’s amount: 19.99, is decimal currency units. A subscription’s unitAmountMinor is the one field that breaks that pattern: it’s an integer of the smallest currency unit. 1999 means €19.99, mirroring how our card processor represents recurring prices internally. The field name is the signal, anything ending in Minor is an integer, everything else is already decimal.
4

Cancel the subscription

Defaults to cancel-at-period-end: the subscriber keeps access until currentPeriodEnd, no refund. Pass atPeriodEnd: false to cancel immediately instead.
Cancellation never issues a refund, it only stops future renewals. Calling cancel again on an already-canceled subscription is a no-op, safe to retry.

Verify it worked

  • subscriptions.list() shows your test subscription with status: 'active' and the right unitAmountMinor and billingInterval.
  • After cancelling at period end, status is still active but cancelAtPeriodEnd is true and effectiveCancelDate is set. After cancelling immediately, status becomes canceled right away.
  • The buyer now shows up under Customers, and the first cycle’s charge issued its own invoice.

Next steps

Payment links

The full parameter and response reference, one-time and subscription both.

Webhooks

Get notified the moment a subscription payment lands.

Customers

See everyone subscribed to you, with email, country, and VAT number.

Go live

Take this plan from test mode to real, recurring revenue.