Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 101 additions & 1 deletion api-reference/openapi/accounts.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
}
}
},
"/api/subscriptions/sessions": {
"/api/stripe/checkout-sessions": {
"post": {
"description": "Create a checkout session to start a subscription for the authenticated account. Returns a hosted checkout URL that the client should redirect to. The session is pre-configured with a 30-day trial period.",
"security": [
Expand Down Expand Up @@ -410,6 +410,72 @@
}
}
},
"/api/stripe/portal-sessions": {
"post": {
"description": "Create a Stripe billing portal session for the authenticated account's existing Stripe customer. Returns a hosted portal URL that the client should redirect to so the customer can manage their subscription, payment methods, and invoices.",
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"requestBody": {
"description": "Portal session parameters",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreatePortalSessionRequest"
}
}
}
},
"responses": {
"200": {
"description": "Portal session created successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreatePortalSessionResponse"
}
}
}
},
"400": {
"description": "Bad request - missing or invalid parameters",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SubscriptionSessionErrorResponse"
}
}
}
},
"401": {
"description": "Unauthorized - invalid or missing authentication",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SubscriptionSessionErrorResponse"
}
}
}
},
"404": {
"description": "No Stripe customer linked to this account",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SubscriptionSessionErrorResponse"
}
}
}
}
}
}
},
"/api/workspaces": {
"post": {
"description": "Create a new workspace account. Workspaces can optionally be linked to an organization.",
Expand Down Expand Up @@ -2848,6 +2914,40 @@
"example": "successUrl is required"
}
}
},
"CreatePortalSessionRequest": {
"type": "object",
"required": [
"returnUrl"
],
"properties": {
"returnUrl": {
"type": "string",
"format": "uri",
"description": "The URL to redirect the customer to after they exit the billing portal.",
"example": "https://chat.recoupable.com"
}
}
},
"CreatePortalSessionResponse": {
"type": "object",
"required": [
"id",
"url"
],
"properties": {
"id": {
"type": "string",
"description": "The billing portal session ID.",
"example": "bps_test_a1b2c3d4e5f6g7h8i9j0"
},
"url": {
"type": "string",
"format": "uri",
"description": "The hosted billing portal URL. Redirect the customer here to manage their subscription.",
"example": "https://billing.stripe.com/p/session/test_a1b2c3d4e5f6g7h8i9j0"
}
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions api-reference/stripe/checkout-sessions-create.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: 'Create Checkout Session'
openapi: '/api-reference/openapi/accounts.json POST /api/stripe/checkout-sessions'
---
4 changes: 4 additions & 0 deletions api-reference/stripe/portal-sessions-create.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: 'Create Billing Portal Session'
openapi: '/api-reference/openapi/accounts.json POST /api/stripe/portal-sessions'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The OpenAPI route in frontmatter targets /api/stripe/portal-sessions, but this migration is for /api/subscriptions/portal-sessions. Update the route so this page documents the correct endpoint.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At api-reference/stripe/portal-sessions-create.mdx, line 3:

<comment>The OpenAPI route in frontmatter targets `/api/stripe/portal-sessions`, but this migration is for `/api/subscriptions/portal-sessions`. Update the route so this page documents the correct endpoint.</comment>

<file context>
@@ -0,0 +1,4 @@
+---
+title: 'Create Billing Portal Session'
+openapi: '/api-reference/openapi/accounts.json POST /api/stripe/portal-sessions'
+---
</file context>

---
4 changes: 0 additions & 4 deletions api-reference/subscriptions/sessions-create.mdx

This file was deleted.

5 changes: 3 additions & 2 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,10 @@
]
},
{
"group": "Subscriptions",
"group": "Stripe",
"pages": [
"api-reference/subscriptions/sessions-create"
"api-reference/stripe/checkout-sessions-create",
"api-reference/stripe/portal-sessions-create"
]
},
{
Expand Down