Skip to main content

POST /api/v1/apps/:appUuid/payment-providers/stripe/billing-portals

Creates a new billing portals resource.

This endpoint documentation is generated from the current Fastify route implementation and should be treated as the implementation-level contract for this version of the API.

Source route file: src/api/routes/external/private/bearer/apps/payment-providers/stripe/billing-portals/post.ts

Request Method

POST

Base URL

https://api.userdocks.local:5000

Endpoint

/api/v1/apps/:appUuid/payment-providers/stripe/billing-portals

Path Variables

VariableTypeRequiredDescription
appUuidstringtruePath variable from route pattern.

Query Parameters

No query parameters.

HTTP Headers

VariableTypeRequiredDescription
AuthorizationstringtrueBearer token in the form Bearer <jwt>.
Content-TypestringtrueUse application/json for JSON request bodies.

Request Body

Schema reference: createBillingPortalSchema

{
"tenantUuid": "11111111-1111-1111-1111-111111111111",
"defaultReturnUrl": "https://app.example.com/account"
}

Successful Response

Success status code(s): 200.

{
"kind": "billingPortal",
"totalItems": 1,
"itemsLength": 1,
"items": [
{
"nextAction": {
"url": "https://billing.stripe.com/p/session/test_12345"
}
}
]
}

Error Responses

HTTP StatusExample Error
401{"errors":[{"validation":"error","code":"[E4010]","message":"Unauthorized Token"}]}
403{"errors":[{"validation":"error","code":"[E4030]","message":"App Is Disabled"}]}
400{"errors":[{"validation":"error","code":"[E4000]","message":"Bad Request / validation error"}]}
500{"errors":[{"validation":"error","code":"[E0000]","message":"Internal Server Error"}]}

Example

const url = `https://api.userdocks.local:5000/api/v1/apps/appUuid-value/payment-providers/stripe/billing-portals`;

const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: 'Bearer <jwt>',
'Content-Type': 'application/json',
},
body: '{"tenantUuid":"11111111-1111-1111-1111-111111111111","defaultReturnUrl":"https://app.example.com/account"}',
});
const data = await response.json();
console.log(response.status, data);