Resources
Billing
Manage Grantex platform subscriptions and billing sessions with the Go SDK. Platform billing remains separate from an agent’s payment authority.
Last modified on August 29, 2026
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Manage Grantex platform subscriptions and billing sessions with the Go SDK. Platform billing remains separate from an agent’s payment authority.
sub, err := client.Billing.GetSubscription(ctx)
fmt.Printf("Plan: %s, Status: %s\n", sub.Plan, sub.Status)
checkout, err := client.Billing.CreateCheckout(ctx, grantex.CreateCheckoutParams{
Plan: "pro",
SuccessURL: "https://myapp.com/billing/success",
CancelURL: "https://myapp.com/billing/cancel",
})
// Redirect user to checkout.CheckoutURL
portal, err := client.Billing.CreatePortal(ctx, grantex.CreatePortalParams{
ReturnURL: "https://myapp.com/dashboard",
})
// Redirect user to portal.PortalURL
SubscriptionStatus| Field | Type | Description |
|---|---|---|
Plan | string | "free", "pro", "enterprise" |
Status | string | "active", "past_due", "canceled" |
CurrentPeriodEnd | *string | ISO 8601 period end |