Prerequisites
- Agent Checkouts integration — complete the quickstart.
- Browser profile and sign-in — a subscription belongs to the user’s account at the merchant. See Sign In to Stores.
- Server key — a production key with
agent-checkouts.create,agent-checkouts.read,agent-checkouts.update, andagent-checkouts.cancel.
Change a Subscription
1
Write the change in the task
Name the plan and the change. To keep the user in control, tell the checkout to ask before it confirms the change.
constraints.maxCost is required. A cancellation does not pay, so a very low cap makes sure that the checkout cannot buy anything.2
Answer the sign-in and the confirmation
Follow the checkout. It can ask for a sign-in, a one-time code, or your user’s confirmation. Collect passwords and codes with
CrossmintProtectedInput. See Answer Questions.3
Show the result
When the checkout ends, read
result.summary. It says what changed and when the change takes effect. Show it to your user.Subscribe to a Plan
To start a subscription, write the plan and the billing period in the task, for example “Subscribe to the monthly Premium plan”. SetmaxCost to the first charge. Then answer the payment request with an order intent. See Pay for a Checkout.
When a merchant offers a one-time purchase and a subscription for the same product, for example “Subscribe and save”, say in the task which one to choose.
Subscriptions depend on the card rail. Mastercard Agent Pay and the encrypted card support them. Visa Intelligent Commerce does not support subscriptions yet; support is coming.
Common Gotchas
Later charges of a subscription
Later charges of a subscription
The order intent pays the first charge of a new subscription. The merchant charges later renewals with the card details that it keeps. This works with Mastercard Agent Pay and the encrypted card. Visa Intelligent Commerce does not support subscriptions yet, so a renewal on a Visa credential can fail. Before you offer subscriptions, test a renewal at the merchant.
The checkout cannot find the subscription
The checkout cannot find the subscription
The user must be signed in to the account that has the subscription. Attach the same
browser.profileId that the user signed in with, or tell the checkout which account to sign in to.Next Steps
Sign In to Stores
Keep the user signed in at a merchant
Answer Questions
Collect sign-in details and confirmations
Create a Checkout
Review the complete create request schema

