Viewport daemon, relay, and hosted runtime are available in alpha. Surfaces may change.
VIEWPORT
ReferenceAPI reference

Billing

18 operations in the Billing group.

9 of 18 operations on this page are generated contract stubs: the routes are real, the schemas are placeholders pending the owning subsystem's contract pass.

POST /api/billing/checkout-session

Generated contract stub — the route is real and served, but its request/response schema has not been hand-tightened yet.

Operation ID: postApiBillingCheckoutSession

Request bodyapplication/json · object

Responses

StatusDescriptionSchema
200Successful responseGenericApiResponse
201Successful responseGenericApiResponse
401Authentication is requiredErrorEnvelope
403Permission deniedErrorEnvelope
422Validation failedErrorEnvelope
500Server errorErrorEnvelope

POST /api/billing/customer/reconcile

Generated contract stub — the route is real and served, but its request/response schema has not been hand-tightened yet.

Operation ID: postApiBillingCustomerReconcile

Request bodyapplication/json · object

Responses

StatusDescriptionSchema
200Successful responseGenericApiResponse
201Successful responseGenericApiResponse
401Authentication is requiredErrorEnvelope
403Permission deniedErrorEnvelope
422Validation failedErrorEnvelope
500Server errorErrorEnvelope

GET /api/billing/invoices

Generated contract stub — the route is real and served, but its request/response schema has not been hand-tightened yet.

Operation ID: getApiBillingInvoices

Responses

StatusDescriptionSchema
200Successful responseGenericApiResponse
401Authentication is requiredErrorEnvelope
403Permission deniedErrorEnvelope
422Validation failedErrorEnvelope
500Server errorErrorEnvelope

POST /api/billing/invoices/{invoiceId}/reconcile

Generated contract stub — the route is real and served, but its request/response schema has not been hand-tightened yet.

Operation ID: postApiBillingInvoicesInvoiceIdReconcile

Parameters

NameInRequiredTypeDescription
invoiceIdpathyesstring

Request bodyapplication/json · object

Responses

StatusDescriptionSchema
200Successful responseGenericApiResponse
201Successful responseGenericApiResponse
401Authentication is requiredErrorEnvelope
403Permission deniedErrorEnvelope
422Validation failedErrorEnvelope
500Server errorErrorEnvelope

GET /api/billing/payment-method

Generated contract stub — the route is real and served, but its request/response schema has not been hand-tightened yet.

Operation ID: getApiBillingPaymentMethod

Responses

StatusDescriptionSchema
200Successful responseGenericApiResponse
401Authentication is requiredErrorEnvelope
403Permission deniedErrorEnvelope
422Validation failedErrorEnvelope
500Server errorErrorEnvelope

POST /api/billing/portal-session

Generated contract stub — the route is real and served, but its request/response schema has not been hand-tightened yet.

Operation ID: postApiBillingPortalSession

Request bodyapplication/json · object

Responses

StatusDescriptionSchema
200Successful responseGenericApiResponse
201Successful responseGenericApiResponse
401Authentication is requiredErrorEnvelope
403Permission deniedErrorEnvelope
422Validation failedErrorEnvelope
500Server errorErrorEnvelope

GET /api/billing/pricing

Generated contract stub — the route is real and served, but its request/response schema has not been hand-tightened yet.

Operation ID: getApiBillingPricing

Responses

StatusDescriptionSchema
200Successful responseGenericApiResponse
401Authentication is requiredErrorEnvelope
403Permission deniedErrorEnvelope
422Validation failedErrorEnvelope
500Server errorErrorEnvelope

GET /api/billing/summary

Generated contract stub — the route is real and served, but its request/response schema has not been hand-tightened yet.

Operation ID: getApiBillingSummary

Responses

StatusDescriptionSchema
200Successful responseGenericApiResponse
401Authentication is requiredErrorEnvelope
403Permission deniedErrorEnvelope
422Validation failedErrorEnvelope
500Server errorErrorEnvelope

GET /api/billing/webhooks

Generated contract stub — the route is real and served, but its request/response schema has not been hand-tightened yet.

Operation ID: getApiBillingWebhooks

Responses

StatusDescriptionSchema
200Successful responseGenericApiResponse
401Authentication is requiredErrorEnvelope
403Permission deniedErrorEnvelope
422Validation failedErrorEnvelope
500Server errorErrorEnvelope

POST /api/resources/{workspace}/billing/checkout-session

Operation ID: createBillingCheckoutSession

Parameters

NameInRequiredTypeDescription
workspacepathyesstring

Request bodyapplication/json · BillingCheckoutSessionRequest

FieldTypeRequired
success_urlstringno
cancel_urlstringno

Responses

StatusDescriptionSchema
200Creates a Stripe Checkout redirect for workspace billing setup. Stripe customer, session, subscription, and payment data are never returned.BillingCheckoutSessionResponse

POST /api/resources/{workspace}/billing/customer/reconcile

Operation ID: reconcileBillingCustomer

Parameters

NameInRequiredTypeDescription
workspacepathyesstring

Responses

StatusDescriptionSchema
200Workspace-scoped customer/subscription drift repair. The workspace customer reference is read from existing usage reports before any Stripe lookup.BillingCustomerReconciliationResponse

GET /api/resources/{workspace}/billing/invoices

Operation ID: listBillingInvoices

Parameters

NameInRequiredTypeDescription
workspacepathyesstring

Responses

StatusDescriptionSchema
200Safe billing invoice history from Stripe usage reports.BillingInvoiceCollectionResponse

POST /api/resources/{workspace}/billing/invoices/{invoiceId}/reconcile

Operation ID: reconcileBillingInvoice

Parameters

NameInRequiredTypeDescription
workspacepathyesstring
invoiceIdpathyesstring

Responses

StatusDescriptionSchema
200Workspace-scoped invoice drift repair. The workspace invoice report is checked before any Stripe lookup.BillingInvoiceReconciliationResponse

GET /api/resources/{workspace}/billing/payment-method

Operation ID: getBillingPaymentMethod

Parameters

NameInRequiredTypeDescription
workspacepathyesstring

Responses

StatusDescriptionSchema
200Safe payment method posture. Only card brand and last four are ever returned.BillingPaymentMethodResponse

POST /api/resources/{workspace}/billing/portal-session

Operation ID: createBillingPortalSession

Parameters

NameInRequiredTypeDescription
workspacepathyesstring

Request bodyapplication/json · BillingPortalSessionRequest

FieldTypeRequired
return_urlstringno

Responses

StatusDescriptionSchema
200Creates a Stripe Billing Portal redirect for a workspace-owned customer. Stripe customer, portal session, and payment data are never returned.BillingPortalSessionResponse
404No Stripe customer has been reconciled for this workspace yet.BillingPortalSessionResponse

GET /api/resources/{workspace}/billing/pricing

Operation ID: getBillingPricingCatalog

Parameters

NameInRequiredTypeDescription
workspacepathyesstring

Responses

StatusDescriptionSchema
200Backend-owned billing mode, billable unit, and pass-through admission catalog. Does not expose Stripe price ids, meter event names, or secrets.BillingPricingCatalogResponse

GET /api/resources/{workspace}/billing/summary

Operation ID: getBillingSummary

Parameters

NameInRequiredTypeDescription
workspacepathyesstring
period_startquerynostring
period_endquerynostring

Responses

StatusDescriptionSchema
200Billing summary for the current usage period.BillingSummaryResponse

GET /api/resources/{workspace}/billing/webhooks

Operation ID: getStripeWebhookStatus

Parameters

NameInRequiredTypeDescription
workspacepathyesstring

Responses

StatusDescriptionSchema
200Stripe webhook configuration and dedupe status for billing operations.StripeWebhookStatusResponse

On this page