docs: add Stripe session retrieval endpoint to OpenAPI specification#148
docs: add Stripe session retrieval endpoint to OpenAPI specification#148ahmednahima0-beep wants to merge 2 commits intorecoupable:mainfrom
Conversation
Introduced a new endpoint for retrieving a Stripe checkout session by its client reference ID. The OpenAPI specification now includes detailed descriptions of the endpoint, required parameters, and response schemas for successful and error cases. Additionally, updated the documentation to include a new group for Stripe in the navigation structure.
📝 WalkthroughWalkthroughAdds a new API endpoint documentation for retrieving Stripe checkout sessions via Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
api-reference/openapi/accounts.json (1)
3071-3083: AlignGetStripeSessionErrorResponseschema with other error response patterns.
GetStripeSessionErrorResponsedefines{ error: string }while all sibling error schemas (AccountErrorResponse,SubscriptionErrorResponse,OrganizationsErrorResponse) include astatus: "error"field. SinceSubscriptionErrorResponsealready uses theerrorfield (alongsidestatus), consider adding astatusfield toGetStripeSessionErrorResponsefor consistency across the OpenAPI spec, or document why this endpoint diverges from the established error response pattern.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api-reference/openapi/accounts.json` around lines 3071 - 3083, GetStripeSessionErrorResponse currently only defines { error: string } and should be made consistent with other error schemas; update the GetStripeSessionErrorResponse schema to include a "status" property with fixed value "error" (e.g., "type": "string", "enum": ["error"]) and add "status" to the required array so the schema becomes { status: "error", error: string } to match AccountErrorResponse/SubscriptionErrorResponse/OrganizationsErrorResponse patterns.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@api-reference/openapi/accounts.json`:
- Around line 445-454: The parameter accountId on the /api/stripe/sessions
operation claims an "Admin-only override" but the operation lacks a 403 response
and its error schema (GetStripeSessionErrorResponse {error: string}) is
inconsistent with the rest of the spec; either add a 403 response or change the
parameter text to the organization-membership wording, and standardize the error
schema to AccountErrorResponse. Concretely: in the /api/stripe/sessions
operation update the accountId parameter (replace "Admin-only override" with
"Only applicable when the authenticated account has access to multiple accounts
via organization membership" if you prefer the org wording) or add a 403
response object with description "Forbidden - account override not permitted"
and use AccountErrorResponse as the response schema; also replace
GetStripeSessionErrorResponse with AccountErrorResponse (or map its shape to
match AccountErrorResponse) so the endpoint uses the same {status, message}
error format.
In `@api-reference/stripe/sessions-list.mdx`:
- Around line 1-4: The page title and filename misdescribe the endpoint: change
the title in api-reference/stripe/sessions-list.mdx from "List Stripe Sessions"
to "Get Stripe Session" (or "Retrieve Stripe Session"), rename the file/slug
(sessions-list → session-get or session-retrieve) and update any docs.json nav
entry that references the old slug/title so the page reflects that GET
/api/stripe/sessions returns a single GetStripeSessionResponse by referenceId
rather than a list.
---
Nitpick comments:
In `@api-reference/openapi/accounts.json`:
- Around line 3071-3083: GetStripeSessionErrorResponse currently only defines {
error: string } and should be made consistent with other error schemas; update
the GetStripeSessionErrorResponse schema to include a "status" property with
fixed value "error" (e.g., "type": "string", "enum": ["error"]) and add "status"
to the required array so the schema becomes { status: "error", error: string }
to match
AccountErrorResponse/SubscriptionErrorResponse/OrganizationsErrorResponse
patterns.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f6228e24-f5f4-400e-b432-7f3daeb23cde
📒 Files selected for processing (3)
api-reference/openapi/accounts.jsonapi-reference/stripe/sessions-list.mdxdocs.json
There was a problem hiding this comment.
2 issues found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="api-reference/stripe/sessions-list.mdx">
<violation number="1" location="api-reference/stripe/sessions-list.mdx:2">
P3: The title implies a collection endpoint, but this route retrieves a single Stripe session by `referenceId`. Rename the page title to reflect single-resource retrieval.</violation>
</file>
<file name="api-reference/openapi/accounts.json">
<violation number="1" location="api-reference/openapi/accounts.json:448">
P2: The `accountId` description declares an admin-only override, but this operation does not document a `403` forbidden response for unauthorized override attempts. Add `403` or adjust the description to match the actual authorization behavior.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
…tions Replaced the Stripe sessions list endpoint with a new session retrieval endpoint in the documentation. Updated the OpenAPI specification to enhance the description of the `accountId` query parameter, clarifying its applicability for accounts with organization membership. Changed error response references from `GetStripeSessionErrorResponse` to `AccountErrorResponse` for consistency. Removed the obsolete sessions list documentation file.
Introduced a new endpoint for retrieving a Stripe checkout session by its client reference ID. The OpenAPI specification now includes detailed descriptions of the endpoint, required parameters, and response schemas for successful and error cases. Additionally, updated the documentation to include a new group for Stripe in the navigation structure.
Summary by cubic
Added a GET /api/stripe/sessions endpoint to fetch a Stripe Checkout Session by client reference ID. This supports verifying payment status after checkout redirects and is documented under a new Stripe group.
Written for commit 8e3562a. Summary will update on new commits.
Summary by CodeRabbit
New Features
Documentation