Skip to content

Open the Ownrecord billing portal

The platform_billing.portal_sessions.create operation: POST /api/v1/platform_billing/portal_sessions in the REST API and the platform_billing_portal_sessions_create tool in the MCP server.

POST/api/v1/platform_billing/portal_sessions

Makes a one-time sign-in link (15 minutes) to Ownrecord's billing portal for the organization: payment methods, billing details (the organization is a customer of Ownrecord's entity: legal name, address, VAT ID), invoices from Ownrecord as PDF, and the upcoming invoice. It is the same customer portal subscribers give their own customers. Only an org_owner or billing_admin can open it; opening it is recorded in the audit log.

At a glance

  • REST: POST /api/v1/platform_billing/portal_sessions
  • MCP tool: platform_billing_portal_sessions_create
  • Operation ID: platform_billing.portal_sessions.create
  • Scope: Organization
  • Permission: platform_plan:admin
  • Risk tier: security
  • Dry run: Not supported
  • Idempotency: Idempotency-Key required
  • Modes: Test and live
  • Authentication: API key with the platform_plan:admin scope
  • Since: M12

Request

Body

This operation takes no body.

Response

201 Created with a JSON object:

FieldTypeDescription
object"platform_portal_session"
orgIdstring
urlstring
expiresAtdate-time

Examples

HTTP
POST /api/v1/platform_billing/portal_sessions
Authorization: Bearer or_test_…
Idempotency-Key: 3f1c9a52-7d0e-4b8f-9a61-0c2d5e8b7f14

Response (201):

JSON
{
  "object": "platform_portal_session",
  "orgId": "org_01jbz3m4k5n6p7q8r9s0t1v2w3",
  "url": "https://ownrecord.io/portal/ownrecord/login/verify?session=psess_…&token=…",
  "expiresAt": "2026-10-26T12:15:00.000Z"
}

Errors

CodeHTTP statusWhenWhat to do
platform_billing_unavailable409Ownrecord's plans aren't set up on this installation yet.A platform admin runs pnpm platform:bootstrap, which creates the plans, prices and features of data/platform/plans.yaml. Try again afterwards.
platform_customer_missing409The organization has no billing account (the platform organization isn't billed).Wait a few seconds and reload the billing page. If it persists, contact support.
permission_denied403Only an org_owner or billing_admin opens the billing portal.Ask an organization owner or admin for a role or scope that allows this action.

It can also return these common errors: validation_failed, api_version_unsupported, invalid_json, unsupported_media_type, authentication_required, api_key_invalid, resource_not_found, idempotency_key_required, idempotency_key_reused, idempotency_in_progress, dry_run_not_supported, approval_required, approval_rejected, approval_expired, stale_approval, approval_policy_denied, rate_limited, internal_error.