billingep

package
v1.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BillingSvcConfig

type BillingSvcConfig struct {
	// BillingClient (required) is the billing-service gRPC client.
	BillingClient pb.BillingServiceClient

	// CoreClient (required) is the core-service gRPC client.
	CoreClient corepb.CoreServiceClient
}

type CreateBillingPortalSessionEndpoint

type CreateBillingPortalSessionEndpoint struct{}

Creates a Stripe billing portal session for the account and returns the URL to send an admin to.

The portal is where the account manages payment methods, invoices, and its subscription directly in Stripe. The account must already have a Stripe customer; create one with Ensure Billing Customer first.

type CreateEnterpriseInquiryEndpoint

type CreateEnterpriseInquiryEndpoint struct{}

Asks the OpenMRP sales team to get in touch about an enterprise plan.

The account, its current plan, and the requesting user's name and email are sent to sales for follow-up. Nothing about the account's plan, subscription, or billing changes.

func (*CreateEnterpriseInquiryEndpoint) Materialize

type EnsureBillingCustomerEndpoint

type EnsureBillingCustomerEndpoint struct{}

Ensures a Stripe billing customer exists for the account, creating one if necessary.

A new customer is created from the account's name and the email address of one of its admin users. Calling this repeatedly is safe: an account that already has a Stripe customer gets that customer back untouched.

type GetAccountUsageEndpoint

type GetAccountUsageEndpoint struct{}

Returns the account's resource usage against its plan limits, along with subscription status, plan pricing, and estimated agent spending.

Seats and sandboxes are current totals, while invoices and batches are counted from the start of the current billing period. The plan name and base fee come from the pricing plan configured in Stripe, so they can differ from the name and price the same plan advertises on the pricing page.

type GetPlanChangePreviewEndpoint

type GetPlanChangePreviewEndpoint struct{}

Returns what it would cost to switch the account to a different pricing plan.

The preview covers the prorated amount due now and the estimated recurring monthly bill afterwards. Nothing is charged and the subscription is left unchanged. Amounts are quoted by Stripe where possible; when Stripe cannot quote the change, OpenMRP estimates them and flags the result with `is_estimate`. A switch to the free plan always previews as zero.

type GetPlanProrationRequest

type GetPlanProrationRequest struct {
	// ID of the plan the account would switch to.
	PlanID string `path:"id" validate:"required"`
}

Request to preview the cost of a plan change.

type GetPricingPlansEndpoint

type GetPricingPlansEndpoint struct{}

Returns the pricing plans an account can sign up for, with their limits and marketing copy.

Only publicly listed plans that are currently in effect are returned, so privately negotiated and retired plans never appear here.

type GetSpendingCapEndpoint

type GetSpendingCapEndpoint struct{}

Returns the monthly cap on agent spending for the account.

The cap limits estimated agent LLM spend within a billing month; Get Account Usage reports how much of it has been spent so far.

type SetSpendingCapEndpoint

type SetSpendingCapEndpoint struct{}

Sets or removes the monthly agent spending cap for the account.

When estimated agent spend reaches the cap, new agent runs are blocked and in-progress runs are stopped until the cap is raised, removed, or the next billing month begins.

type SetSpendingCapRequest

type SetSpendingCapRequest struct {
	// Ceiling in cents on estimated agent spending per billing month.
	//
	// Send `null` to remove the cap entirely; omit the field to leave the current cap unchanged.
	CapCents field.Clearable[int64] `json:"cap_cents,omitzero"`
}

Request to set or remove the monthly spending cap.

func (*SetSpendingCapRequest) SchemaExample

func (*SetSpendingCapRequest) SchemaExample() any

type SwitchPlanEndpoint

type SwitchPlanEndpoint struct{}

Switches the account to a different pricing plan, effective immediately.

Free-to-paid, paid-to-free, and paid-to-paid changes are all handled: moving to the free plan cancels the current subscription, while moving to a paid plan subscribes the account at no fewer seats than that plan's seat minimum. A change that owes a prorated amount is charged straight away to the account's payment method on file, so use Preview Plan Change first to see the cost. Moving to a paid plan requires the account to already have a Stripe customer and billing profile.

type SwitchPlanRequest

type SwitchPlanRequest struct {
	// ID of the plan to move the account onto.
	PlanID string `path:"id" validate:"required"`
}

Request to switch pricing plans.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL