docs: subscribe logged-in users (linkId + metadata) - #5
Merged
Conversation
Add a step-by-step guide: plan linkId, checkout per profile with metadata.customerId, webhook or poll, then status, invoices, and cancel. Wire it from the Guides index, sell-a-subscription, and SDK reference. Document subscriptions.invoices() and stop recommending immediate cancel. No secrets: placeholders only (sk_test_..., user.email, Stripe test card).
Rewrite the SaaS subscribe guide in the same ELI5 step style as the other guides. Checkout create still uses linkId only. customerId and subscriptionId are on checkout.session.completed metadata; list() does not copy merchant metadata.
One guide for both paths: share the buyer link, or create a checkout for a logged-in user. Old /guides/saas-subscriptions redirects to this page.
PancheI
added a commit
that referenced
this pull request
Aug 18, 2026
The squash of #5 landed paymentLinkId. Match the SDK and API: same UUID as checkouts.create({ linkId }).
PancheI
added a commit
to AgentaOS/agentaos
that referenced
this pull request
Aug 18, 2026
## Why No open PR covered this. #32 (pay 2.0) is already merged. SaaS integrators need to list a subscription’s invoices and know which plan (`paymentLinkId`) it belongs to. ## What - `subscriptions.invoices(id)` → `GET /gateway/subscriptions/:id/invoices` - `Subscription.paymentLinkId` (same as product **Copy link ID** / `paymentLinks.id`) - `cancelAtPeriodEnd`, `canceledAt`, `effectiveCancelDate` on the type - JSDoc: `checkouts.create({ linkId })` uses that same id - Changeset: `@agentaos/pay` minor - Tests: 25/25 in `resources.test.ts` ## Public-repo check No customer data, keys, or internal ids. Example invoice number is `INV-2026-0001`. Pairs with docs PR: AgentaOS/docs#5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Merchants with a logged-in SaaS could not see how a product (dashboard) maps to
linkId(API) and how to start a subscription per user.What
linkIdcheckouts.create({ linkId, buyerEmail, metadata.customerId })sessionIdsubscriptions.invoices(),paymentLinkId; cancel is period-end onlyPublic-repo check
No customer data, org ids, emails, or keys. Examples use
sk_test_...,user.email, and Stripe test card4242…only.Out of scope
Unrelated local
mor/account-review.mdxedits were not included.