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.- SDK
- cURL
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
- SDK
- CLI
- cURL
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.- SDK
- CLI
- cURL
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 withstatus: 'active'and the rightunitAmountMinorandbillingInterval.- After cancelling at period end,
statusis stillactivebutcancelAtPeriodEndistrueandeffectiveCancelDateis set. After cancelling immediately,statusbecomescanceledright 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.