{ "openapi": "3.0.1", "info": { "title": "Flexprice API", "description": "Flexprice API Service", "contact": { "name": "API Support" }, "license": { "name": "AGPL-3.0", "url": "https://www.gnu.org/licenses/agpl-3.0.html" }, "version": "1.0" }, "servers": [ { "url": "https://us.api.flexprice.io/v1", "description": "US Region" }, { "url": "https://api.cloud.flexprice.io/v1", "description": "India Region" } ], "paths": { "/customers": { "put": { "tags": [ "Customers" ], "summary": "Update customer", "description": "Use when updating customer details (e.g. name, email, or metadata). Identify by id or external_customer_id.", "operationId": "updateCustomer", "parameters": [ { "name": "id", "in": "query", "description": "Customer ID", "schema": { "type": "string" } }, { "name": "external_customer_id", "in": "query", "description": "Customer External ID", "schema": { "type": "string" } } ], "requestBody": { "description": "Customer", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCustomerRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "customer", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "update-customer" } }, "post": { "tags": [ "Customers" ], "summary": "Create customer", "description": "Use when onboarding a new billing customer (e.g. sign-up or CRM sync). Ideal for linking via external_customer_id to your app's user id.", "operationId": "createCustomer", "requestBody": { "description": "Customer", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCustomerRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-scope": "write", "x-codegen-request-body-name": "customer", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "create-customer" } } }, "/customers/external/{external_id}": { "get": { "tags": [ "Customers" ], "summary": "Get customer by external ID", "description": "Use when resolving a customer by your app's id (e.g. from your user table). Ideal for integrations that key by external id.", "operationId": "getCustomerByExternalId", "parameters": [ { "name": "external_id", "in": "path", "description": "Customer External ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-customer-by-external-id" } } }, "/customers/external/{external_id}/entitlements": { "get": { "tags": [ "Customers" ], "summary": "Get customer entitlements by external ID", "description": "Use when checking entitlements by your app's customer id (e.g. feature gating at the edge). Supports optional filters (feature_ids, subscription_ids).", "operationId": "getCustomerEntitlementsByExternalID", "parameters": [ { "name": "external_id", "in": "path", "description": "Customer External ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerEntitlementsResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-customer-entitlements-by-external-i-d" } } }, "/customers/search": { "post": { "tags": [ "Customers" ], "summary": "Query customers", "description": "Use when listing or searching customers (e.g. admin CRM or reporting). Returns a paginated list; supports filtering and sorting.", "operationId": "queryCustomer", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.CustomerFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListCustomersResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-scope": "read", "x-codegen-request-body-name": "filter", "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "query-customer" } } }, "/customers/usage": { "get": { "tags": [ "Customers" ], "summary": "Get customer usage summary", "description": "Use when showing a customer's usage (e.g. portal or overage alerts). Identify by customer_id or customer_lookup_key; supports filters.", "operationId": "getCustomerUsageSummary", "parameters": [ { "name": "customer_id", "in": "query", "schema": { "type": "string" } }, { "name": "customer_lookup_key", "in": "query", "schema": { "type": "string" } }, { "name": "feature_ids", "in": "query", "style": "form", "explode": false, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "feature_lookup_keys", "in": "query", "style": "form", "explode": false, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "subscription_ids", "in": "query", "style": "form", "explode": false, "schema": { "type": "array", "items": { "type": "string" } } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerUsageSummaryResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-customer-usage-summary" } } }, "/customers/{id}": { "get": { "tags": [ "Customers" ], "summary": "Get customer", "description": "Use when you need to load a single customer (e.g. for a billing portal or to attach a subscription).", "operationId": "getCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Customer ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-scope": "read", "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-customer" } }, "delete": { "tags": [ "Customers" ], "summary": "Delete customer", "description": "Use when removing a customer (e.g. GDPR or churn). Returns 204 No Content on success.", "operationId": "deleteCustomer", "parameters": [ { "name": "id", "in": "path", "description": "Customer ID", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "No Content", "content": {} }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "delete" ], "readOnlyHint": false, "destructiveHint": true, "name": "delete-customer" } } }, "/customers/{id}/entitlements": { "get": { "tags": [ "Customers" ], "summary": "Get customer entitlements", "description": "Use when checking what a customer can access (e.g. feature gating or usage limits). Supports optional filters (feature_ids, subscription_ids).", "operationId": "getCustomerEntitlements", "parameters": [ { "name": "id", "in": "path", "description": "Customer ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerEntitlementsResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-customer-entitlements" } } }, "/customers/{id}/grants/upcoming": { "get": { "tags": [ "Customers" ], "summary": "Get upcoming credit grant applications", "description": "Use when showing upcoming or pending credits for a customer (e.g. in a portal or for forecasting).", "operationId": "getCustomerUpcomingGrants", "parameters": [ { "name": "id", "in": "path", "description": "Customer ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListCreditGrantApplicationsResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-customer-upcoming-grants" } } }, "/customers/{id}/invoices/summary": { "get": { "tags": [ "Invoices" ], "summary": "Get customer invoice summary", "description": "Use when showing a customer's invoice overview (e.g. billing portal or balance summary). Includes totals and multi-currency breakdown.", "operationId": "getCustomerInvoiceSummary", "parameters": [ { "name": "id", "in": "path", "description": "Customer ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerMultiCurrencyInvoiceSummary" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-customer-invoice-summary" } } }, "/events": { "post": { "tags": [ "Events" ], "summary": "Ingest event", "description": "Use when sending a single usage event from your app (e.g. one API call or one GB stored). Events are processed asynchronously; returns 202 with event_id.", "operationId": "ingestEvent", "requestBody": { "description": "Event data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IngestEventRequest" } } }, "required": true }, "responses": { "202": { "description": "message:Event accepted for processing", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "event", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "ingest-event" } } }, "/events/analytics": { "post": { "tags": [ "Events" ], "summary": "Get usage analytics", "description": "Use when building analytics views (e.g. usage by feature or customer over time). Supports filtering, grouping, and time-series breakdown.", "operationId": "getUsageAnalytics", "requestBody": { "description": "Request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetUsageAnalyticsRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetUsageAnalyticsResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "get-usage-analytics" } } }, "/events/bulk": { "post": { "tags": [ "Events" ], "summary": "Bulk ingest events", "description": "Use when batching usage events (e.g. backfill or high-volume ingestion). More efficient than single event calls; returns 202 when accepted.", "operationId": "ingestEventsBulk", "requestBody": { "description": "Event data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BulkIngestEventRequest" } } }, "required": true }, "responses": { "202": { "description": "message:Event accepted for processing", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "event", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "ingest-events-bulk" } } }, "/events/huggingface-inference": { "post": { "tags": [ "Events" ], "summary": "Get Hugging Face inference data", "description": "Use when fetching Hugging Face inference usage or billing data (e.g. for HF-specific reporting or reconciliation).", "operationId": "getHuggingfaceInferenceData", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetHuggingFaceBillingDataResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "get-huggingface-inference-data" } } }, "/events/query": { "post": { "tags": [ "Events" ], "summary": "List raw events", "description": "Use when debugging ingestion or exporting raw event data (e.g. support or audit). Returns a paginated list; supports time range and sorting.", "operationId": "listRawEvents", "requestBody": { "description": "Request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetEventsRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetEventsResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "list-raw-events" } } }, "/events/usage": { "post": { "tags": [ "Events" ], "summary": "Get usage statistics", "description": "Use when building usage reports or dashboards across events. Supports filters and grouping; defaults to last 7 days if no range provided.", "operationId": "getUsageStatistics", "requestBody": { "description": "Request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetUsageRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetUsageResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "get-usage-statistics" } } }, "/events/usage/meter": { "post": { "tags": [ "Events" ], "summary": "Get usage by meter", "description": "Use when showing usage for a specific meter (e.g. dashboard or overage check). Supports time range, filters, and grouping by customer or subscription.", "operationId": "getUsageByMeter", "requestBody": { "description": "Request body", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetUsageByMeterRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetUsageResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "get-usage-by-meter" } } }, "/events/{id}": { "get": { "tags": [ "Events" ], "summary": "Get event", "description": "Use when debugging a specific event (e.g. why it failed or how it was aggregated). Includes processing status and debug info.", "operationId": "getEvent", "parameters": [ { "name": "id", "in": "path", "description": "Event ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetEventByIDResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-event" } } }, "/invoices": { "post": { "tags": [ "Invoices" ], "summary": "Create one-off invoice", "description": "Use when creating a manual or one-off invoice (e.g. custom charge or non-recurring billing). Invoice is created in draft; finalize when ready.", "operationId": "createInvoice", "requestBody": { "description": "Invoice details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateInvoiceRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InvoiceResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "invoice", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "create-invoice" } } }, "/invoices/preview": { "post": { "tags": [ "Invoices" ], "summary": "Get invoice preview", "description": "Use when showing a customer what they will be charged (e.g. preview before checkout or plan change). No invoice is created.", "operationId": "getInvoicePreview", "requestBody": { "description": "Preview Invoice Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetPreviewInvoiceRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InvoiceResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "get-invoice-preview" } } }, "/invoices/search": { "post": { "tags": [ "Invoices" ], "summary": "Query invoices", "description": "Use when listing or searching invoices (e.g. admin view or customer history). Returns a paginated list; supports filtering by customer, status, date range.", "operationId": "queryInvoice", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.InvoiceFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListInvoicesResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "filter", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "query-invoice" } } }, "/invoices/{id}": { "get": { "tags": [ "Invoices" ], "summary": "Get invoice", "description": "Use when loading an invoice for display or editing (e.g. portal or reconciliation). Supports group_by for usage breakdown and force_runtime_recalculation.", "operationId": "getInvoice", "parameters": [ { "name": "id", "in": "path", "description": "Invoice ID", "required": true, "schema": { "type": "string" } }, { "name": "expand_by_source", "in": "query", "description": "Include source-level price breakdown for usage line items (legacy)", "schema": { "type": "boolean" } }, { "name": "group_by", "in": "query", "description": "Group usage breakdown by specified fields (e.g., source, feature_id, properties.org_id)", "style": "form", "explode": false, "schema": { "type": "array", "items": { "type": "string" } } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InvoiceResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-invoice" } }, "put": { "tags": [ "Invoices" ], "summary": "Update invoice", "description": "Use when updating invoice metadata or due date (e.g. PDF URL, net terms). For paid invoices only safe fields can be updated.", "operationId": "updateInvoice", "parameters": [ { "name": "id", "in": "path", "description": "Invoice ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Invoice Update Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateInvoiceRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InvoiceResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "update-invoice" } } }, "/invoices/{id}/comms/trigger": { "post": { "tags": [ "Invoices" ], "summary": "Trigger invoice communication webhook", "description": "Use when sending an invoice to the customer (e.g. trigger email or Slack). Payload includes full invoice details for your integration.", "operationId": "triggerInvoiceCommsWebhook", "parameters": [ { "name": "id", "in": "path", "description": "Invoice ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "trigger-invoice-comms-webhook" } } }, "/invoices/{id}/finalize": { "post": { "tags": [ "Invoices" ], "summary": "Finalize invoice", "description": "Use when locking an invoice for payment (e.g. after review). Once finalized, line items are locked; invoice can be paid or voided.", "operationId": "finalizeInvoice", "parameters": [ { "name": "id", "in": "path", "description": "Invoice ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-scope": "delete", "x-speakeasy-mcp": { "scopes": [ "delete" ], "readOnlyHint": false, "destructiveHint": true, "name": "finalize-invoice" } } }, "/invoices/{id}/payment": { "put": { "tags": [ "Invoices" ], "summary": "Update invoice payment status", "description": "Use when reconciling payment status from an external gateway or manual entry (e.g. mark paid after bank confirmation).", "operationId": "updateInvoicePaymentStatus", "parameters": [ { "name": "id", "in": "path", "description": "Invoice ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Payment Status Update Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePaymentStatusRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InvoiceResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "update-invoice-payment-status" } } }, "/invoices/{id}/payment/attempt": { "post": { "tags": [ "Invoices" ], "summary": "Attempt invoice payment", "description": "Use when paying an invoice with the customer's wallet balance (e.g. prepaid credits or balance applied at checkout).", "operationId": "attemptInvoicePayment", "parameters": [ { "name": "id", "in": "path", "description": "Invoice ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "attempt-invoice-payment" } } }, "/invoices/{id}/pdf": { "get": { "tags": [ "Invoices" ], "summary": "Get invoice PDF", "description": "Use when delivering an invoice PDF to the customer (e.g. email attachment or download). Use url=true for a presigned URL instead of binary. Use force_generate=true to regenerate and re-upload the PDF even if one already exists in S3.", "operationId": "getInvoicePdf", "parameters": [ { "name": "id", "in": "path", "description": "Invoice ID", "required": true, "schema": { "type": "string" } }, { "name": "url", "in": "query", "description": "Return presigned URL from s3 instead of PDF", "schema": { "type": "boolean" } }, { "name": "force_generate", "in": "query", "description": "Force regeneration of the PDF even if one already exists in S3 (default: false). Note: force_generate has no effect if invoice_pdf_url is already set on the invoice.", "schema": { "type": "boolean" } } ], "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { "type": "string", "format": "binary" } } } }, "400": { "description": "Invalid request", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "*/*": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-invoice-pdf" } } }, "/invoices/{id}/recalculate": { "post": { "tags": [ "Invoices" ], "summary": "Recalculate invoice (voided invoice)", "description": "Starts an async workflow that creates a fresh replacement invoice for a voided SUBSCRIPTION invoice (same billing period). Returns workflow_id and run_id; poll workflow status or GET the new invoice via recalculated_invoice_id after completion.", "operationId": "recalculateInvoice", "parameters": [ { "name": "id", "in": "path", "description": "Invoice ID", "required": true, "schema": { "type": "string" } } ], "responses": { "202": { "description": "Accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/models.TemporalWorkflowResult" } } } }, "400": { "description": "Invalid request or invoice already recalculated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Invoice not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "recalculate-invoice" } } }, "/invoices/{id}/recalculate-v2": { "post": { "tags": [ "Invoices" ], "summary": "Recalculate draft invoice (v2)", "description": "Recalculates a draft SUBSCRIPTION invoice in-place (replaces line items, reapplies credits/coupons/taxes). Use when subscription or usage data changed before finalizing.", "operationId": "recalculateInvoiceV2", "parameters": [ { "name": "id", "in": "path", "description": "Invoice ID", "required": true, "schema": { "type": "string" } }, { "name": "finalize", "in": "query", "description": "Whether to finalize the invoice after recalculation (default: true)", "schema": { "type": "boolean" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InvoiceResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "recalculate-invoice-v2" } } }, "/invoices/{id}/void": { "post": { "tags": [ "Invoices" ], "summary": "Void invoice", "description": "Use when cancelling an invoice (e.g. order cancelled or duplicate). Only unpaid invoices can be voided.", "operationId": "voidInvoice", "parameters": [ { "name": "id", "in": "path", "description": "Invoice ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "void-invoice" } } }, "/plans": { "post": { "tags": [ "Plans" ], "summary": "Create plan", "description": "Use when defining a new pricing plan (e.g. Free, Pro, Enterprise). Attach prices and entitlements; customers subscribe to plans.", "operationId": "createPlan", "requestBody": { "description": "Plan configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePlanRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlanResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "plan", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "create-plan" } } }, "/plans/search": { "post": { "tags": [ "Plans" ], "summary": "Query plans", "description": "Use when listing or searching plans (e.g. plan picker or admin catalog). Returns a paginated list; supports filtering and sorting.", "operationId": "queryPlan", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.PlanFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListPlansResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "filter", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "query-plan" } } }, "/plans/{id}": { "get": { "tags": [ "Plans" ], "summary": "Get plan", "description": "Use when you need to load a single plan (e.g. for display or to create a subscription).", "operationId": "getPlan", "parameters": [ { "name": "id", "in": "path", "description": "Plan ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlanResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-plan" } }, "put": { "tags": [ "Plans" ], "summary": "Update plan", "description": "Use when changing plan details (e.g. name, interval, or metadata). Partial update supported.", "operationId": "updatePlan", "parameters": [ { "name": "id", "in": "path", "description": "Plan ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Plan update", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePlanRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlanResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "plan", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "update-plan" } }, "delete": { "tags": [ "Plans" ], "summary": "Delete plan", "description": "Use when retiring a plan (e.g. end-of-life). Existing subscriptions may be affected. Returns 200 with success message.", "operationId": "deletePlan", "parameters": [ { "name": "id", "in": "path", "description": "Plan ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "delete" ], "readOnlyHint": false, "destructiveHint": true, "name": "delete-plan" } } }, "/plans/{id}/clone": { "post": { "tags": [ "Plans" ], "summary": "Clone a plan", "description": "Clone an existing plan, copying its active prices, published entitlements, and published credit grants", "operationId": "clonePlan", "parameters": [ { "name": "id", "in": "path", "description": "Source Plan ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Clone configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClonePlanRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlanResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-scope": "write", "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "clone-plan" } } }, "/plans/{id}/sync/subscriptions": { "post": { "tags": [ "Plans" ], "summary": "Synchronize plan prices", "description": "Use when you have changed plan prices and need to push them to all active subscriptions (e.g. global price update). Returns workflow ID.", "operationId": "syncPlanPrices", "parameters": [ { "name": "id", "in": "path", "description": "Plan ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/models.TemporalWorkflowResult" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "422": { "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "sync-plan-prices" } } }, "/prices": { "post": { "tags": [ "Prices" ], "summary": "Create price", "description": "Use when adding a new price to a plan or catalog (e.g. per-seat, flat, or metered). Ideal for both simple and usage-based pricing.", "operationId": "createPrice", "requestBody": { "description": "Price configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePriceRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriceResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "price", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "create-price" } } }, "/prices/bulk": { "post": { "tags": [ "Prices" ], "summary": "Create prices in bulk", "description": "Use when creating many prices at once (e.g. importing a catalog or setting up a plan with multiple tiers).", "operationId": "createPricesBulk", "requestBody": { "description": "Bulk price configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBulkPriceRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBulkPriceResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "prices", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "create-prices-bulk" } } }, "/prices/lookup/{lookup_key}": { "get": { "tags": [ "Prices" ], "summary": "Get price by lookup key", "description": "Use when resolving a price by external id (e.g. from your catalog or CMS). Ideal for integrations.", "operationId": "getPriceByLookupKey", "parameters": [ { "name": "lookup_key", "in": "path", "description": "Lookup key", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriceResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-price-by-lookup-key" } } }, "/prices/search": { "post": { "tags": [ "Prices" ], "summary": "Query prices", "description": "Use when listing or searching prices (e.g. plan builder or catalog). Returns a paginated list; supports filtering and sorting.", "operationId": "queryPrice", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.PriceFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListPricesResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "filter", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "query-price" } } }, "/prices/{id}": { "get": { "tags": [ "Prices" ], "summary": "Get price", "description": "Use when you need to load a single price (e.g. for display or editing). Response includes expanded meter and price unit when applicable.", "operationId": "getPrice", "parameters": [ { "name": "id", "in": "path", "description": "Price ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriceResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-price" } }, "put": { "tags": [ "Prices" ], "summary": "Update price", "description": "Use when changing price configuration (e.g. amount, billing scheme, or metadata).", "operationId": "updatePrice", "parameters": [ { "name": "id", "in": "path", "description": "Price ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Price configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePriceRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriceResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "price", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "update-price" } }, "delete": { "tags": [ "Prices" ], "summary": "Delete price", "description": "Use when retiring a price (e.g. end-of-life or replacement). Optional effective date or cascade for subscriptions.", "operationId": "deletePrice", "parameters": [ { "name": "id", "in": "path", "description": "Price ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Delete Price Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeletePriceRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "delete" ], "readOnlyHint": false, "destructiveHint": true, "name": "delete-price" } } }, "/subscriptions": { "post": { "tags": [ "Subscriptions" ], "summary": "Create subscription", "description": "Use when onboarding a customer to a plan or starting a new subscription. Ideal for draft subscriptions (activate later) or active from start.", "operationId": "createSubscription", "requestBody": { "description": "Subscription Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateSubscriptionRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "subscription", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "create-subscription" } } }, "/subscriptions/addon": { "post": { "tags": [ "Subscriptions" ], "summary": "Add addon to subscription", "description": "Use when adding an optional product or add-on to an existing subscription (e.g. extra storage or support tier).", "operationId": "addSubscriptionAddon", "requestBody": { "description": "Add Addon Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddAddonRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddonAssociationResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "add-subscription-addon" } }, "delete": { "tags": [ "Subscriptions" ], "summary": "Remove addon from subscription", "description": "Use when removing an add-on from a subscription (e.g. downgrade or opt-out).", "operationId": "removeSubscriptionAddon", "requestBody": { "description": "Remove Addon Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RemoveAddonRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "delete" ], "readOnlyHint": false, "destructiveHint": true, "name": "remove-subscription-addon" } } }, "/subscriptions/lineitems/search": { "post": { "tags": [ "Subscriptions" ], "summary": "Search subscription line items", "description": "List subscription line items with a JSON filter (subscription, customer, price, pagination, expand=prices, etc.).", "operationId": "querySubscriptionLineItems", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.SubscriptionLineItemFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListSubscriptionLineItemsResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-scope": "read", "x-codegen-request-body-name": "filter", "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "query-subscription-line-items" } } }, "/subscriptions/lineitems/{id}": { "put": { "tags": [ "Subscriptions" ], "summary": "Update subscription line item", "description": "Use when changing a subscription line item (e.g. quantity or price). Implemented by ending the current line and creating a new one for clean billing.", "operationId": "updateSubscriptionLineItem", "parameters": [ { "name": "id", "in": "path", "description": "Line Item ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Update Line Item Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateSubscriptionLineItemRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionLineItemResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "update-subscription-line-item" } }, "delete": { "tags": [ "Subscriptions" ], "summary": "Delete subscription line item", "description": "Use when removing a charge or seat from a subscription (e.g. downgrade). Line item ends; retained for history but no longer billed.", "operationId": "deleteSubscriptionLineItem", "parameters": [ { "name": "id", "in": "path", "description": "Line Item ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Delete Line Item Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteSubscriptionLineItemRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionLineItemResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "delete" ], "readOnlyHint": false, "destructiveHint": true, "name": "delete-subscription-line-item" } } }, "/subscriptions/search": { "post": { "tags": [ "Subscriptions" ], "summary": "Query subscriptions", "description": "Use when listing or searching subscriptions (e.g. admin view or customer subscription list). Returns a paginated list; supports filtering by customer, plan, status.", "operationId": "querySubscription", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.SubscriptionFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListSubscriptionsResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "filter", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "query-subscription" } } }, "/subscriptions/usage": { "post": { "tags": [ "Subscriptions" ], "summary": "Get usage by subscription", "description": "Use when showing usage for a subscription (e.g. in a portal or for overage checks). Supports time range and filters.", "operationId": "getSubscriptionUsage", "requestBody": { "description": "Usage request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetUsageBySubscriptionRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetUsageBySubscriptionResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "get-subscription-usage" } } }, "/subscriptions/{id}": { "get": { "tags": [ "Subscriptions" ], "summary": "Get subscription", "description": "Use when you need to load a single subscription (e.g. for a billing portal or to check status).", "operationId": "getSubscription", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-subscription" } }, "put": { "tags": [ "Subscriptions" ], "summary": "Update subscription", "description": "Use when changing subscription details (e.g. quantity, billing anchor, or parent). Supports partial update; send \"\" to clear parent_subscription_id.", "operationId": "updateSubscription", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Update Subscription Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateSubscriptionRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "update-subscription" } } }, "/subscriptions/{id}/activate": { "post": { "tags": [ "Subscriptions" ], "summary": "Activate draft subscription", "description": "Use when turning a draft subscription live (e.g. after collecting payment or completing setup). Once activated, billing and entitlements apply.", "operationId": "activateSubscription", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Activate Draft Subscription Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ActivateDraftSubscriptionRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "activate-subscription" } } }, "/subscriptions/{id}/addons/associations": { "get": { "tags": [ "Subscriptions" ], "summary": "Get active addon associations", "description": "Use when listing which add-ons are currently attached to a subscription (e.g. for display or editing).", "operationId": "getSubscriptionAddonAssociations", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/AddonAssociationResponse" } } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-subscription-addon-associations" } } }, "/subscriptions/{id}/cancel": { "post": { "tags": [ "Subscriptions" ], "summary": "Cancel subscription", "description": "Use when a customer churns or downgrades. Supports immediate or end-of-period cancellation and proration. Ideal for self-serve or support-driven cancellations.", "operationId": "cancelSubscription", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Cancel Subscription Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelSubscriptionRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelSubscriptionResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "cancel-subscription" } } }, "/subscriptions/{id}/change/execute": { "post": { "tags": [ "Subscriptions" ], "summary": "Execute subscription plan change", "description": "Use when applying a plan change (e.g. upgrade or downgrade). Executes proration and generates invoice or credit as needed.", "operationId": "executeSubscriptionChange", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Subscription change request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionChangeRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionChangeExecuteResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "execute-subscription-change" } } }, "/subscriptions/{id}/change/preview": { "post": { "tags": [ "Subscriptions" ], "summary": "Preview subscription plan change", "description": "Use when showing a customer the cost of a plan change before they confirm (e.g. upgrade/downgrade preview with proration).", "operationId": "previewSubscriptionChange", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Subscription change preview request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionChangeRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionChangePreviewResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "preview-subscription-change" } } }, "/subscriptions/{id}/entitlements": { "get": { "tags": [ "Subscriptions" ], "summary": "Get subscription entitlements", "description": "Use when checking what features or limits a subscription has (e.g. entitlement checks or feature gating). Optional feature_ids to filter.", "operationId": "getSubscriptionEntitlements", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } }, { "name": "feature_ids", "in": "query", "description": "Feature IDs to filter by", "style": "form", "explode": false, "schema": { "type": "array", "items": { "type": "string" } } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionEntitlementsResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-subscription-entitlements" } } }, "/subscriptions/{id}/grants/upcoming": { "get": { "tags": [ "Subscriptions" ], "summary": "Get upcoming credit grant applications", "description": "Use when showing upcoming or pending credits for a subscription (e.g. in a portal or for forecasting).", "operationId": "getSubscriptionUpcomingGrants", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListCreditGrantApplicationsResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-subscription-upcoming-grants" } } }, "/subscriptions/{id}/lineitems": { "post": { "tags": [ "Subscriptions" ], "summary": "Create subscription line item", "description": "Use when adding a new charge or seat to a subscription (e.g. extra seat or one-time add). Supports price_id or inline price.", "operationId": "createSubscriptionLineItem", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Create Line Item Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateSubscriptionLineItemRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionLineItemResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "create-subscription-line-item" } } }, "/subscriptions/{id}/modify/execute": { "post": { "tags": [ "Subscriptions" ], "summary": "Execute subscription modification", "description": "Execute a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, or tax).", "operationId": "executeSubscriptionModify", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Modification request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExecuteSubscriptionModifyRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionModifyResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-scope": "write", "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "execute-subscription-modify" } } }, "/subscriptions/{id}/modify/preview": { "post": { "tags": [ "Subscriptions" ], "summary": "Preview subscription modification", "description": "Preview the impact of a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, or tax) without committing changes.", "operationId": "previewSubscriptionModify", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Modification preview request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExecuteSubscriptionModifyRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionModifyResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-scope": "read", "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "preview-subscription-modify" } } }, "/subscriptions/{id}/v2": { "get": { "tags": [ "Subscriptions" ], "summary": "Get subscription (V2)", "description": "Use when you need a subscription with related data (line items, prices, plan). Supports expand for detailed payloads without extra round-trips.", "operationId": "getSubscriptionV2", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } }, { "name": "expand", "in": "query", "description": "Comma-separated list of fields to expand (e.g., 'subscription_line_items,prices,plan')", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionResponseV2" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-subscription-v2" } } }, "/v1/subscription-schedules": { "get": { "tags": [ "Subscriptions" ], "summary": "List all subscription schedules", "description": "Use when listing or searching scheduled changes across subscriptions (e.g. admin view). Returns schedules with optional filtering.", "operationId": "listAllSubscriptionSchedules", "parameters": [ { "name": "pending_only", "in": "query", "description": "Filter to pending schedules only", "schema": { "type": "boolean" } }, { "name": "subscription_id", "in": "query", "description": "Filter by subscription ID", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "description": "Limit results", "schema": { "type": "integer" } }, { "name": "offset", "in": "query", "description": "Offset for pagination", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetPendingSchedulesResponse" } } } } }, "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "list-all-subscription-schedules" } } }, "/v1/subscription-schedules/{id}": { "get": { "tags": [ "Subscriptions" ], "summary": "Get subscription schedule", "description": "Use when you need to load a single scheduled change (e.g. to show when a plan change or renewal takes effect).", "operationId": "getSubscriptionSchedule", "parameters": [ { "name": "id", "in": "path", "description": "Schedule ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionScheduleResponse" } } } } }, "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "get-subscription-schedule" } } }, "/v1/subscriptions/schedules/{schedule_id}/cancel": { "post": { "tags": [ "Subscriptions" ], "summary": "Cancel subscription schedule", "description": "Use when cancelling a scheduled change (e.g. customer changed mind). Identify by schedule ID in path or by subscription ID + schedule type in body.", "operationId": "cancelSubscriptionSchedule", "parameters": [ { "name": "schedule_id", "in": "path", "description": "Schedule ID (optional if using request body)", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Cancel request (optional if using path parameter)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelScheduleRequest" } } }, "required": false }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelScheduleResponse" } } } } }, "x-codegen-request-body-name": "request", "x-speakeasy-mcp": { "scopes": [ "write" ], "readOnlyHint": false, "name": "cancel-subscription-schedule" } } }, "/v1/subscriptions/{subscription_id}/schedules": { "get": { "tags": [ "Subscriptions" ], "summary": "List subscription schedules", "description": "Use when listing scheduled changes for a subscription (e.g. upcoming plan change or renewal). Returns all schedules for that subscription.", "operationId": "listSubscriptionSchedules", "parameters": [ { "name": "subscription_id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetPendingSchedulesResponse" } } } } }, "x-speakeasy-mcp": { "scopes": [ "read" ], "readOnlyHint": true, "name": "list-subscription-schedules" } } } }, "components": { "schemas": { "ListAddonsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/AddonResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListCouponsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/CouponResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListCreditGrantApplicationsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/CreditGrantApplicationResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListCreditGrantsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/CreditGrantResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListCustomersResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/CustomerResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } }, "description": "Response object for listing customers with pagination" }, "ListEntitlementsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/EntitlementResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListFeaturesResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/FeatureResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListGroupsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/GroupResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListInvoicesResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/InvoiceResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListPlansResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/PlanResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListPriceUnitsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/PriceUnitResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListPricesResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/PriceResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListScheduledTasksResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledTaskResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListSubscriptionLineItemsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/SubscriptionLineItemResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListSubscriptionsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/SubscriptionResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListTaxAssociationsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/TaxAssociationResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListUsersResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/UserResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListWalletTransactionsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/WalletTransactionResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListWorkflowsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/WorkflowExecutionDTO" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "checkout.JSONBCheckoutConfiguration": { "type": "object", "properties": { "create_subscription_params": { "$ref": "#/components/schemas/types.CreateSubscriptionParams" } } }, "checkout.JSONBCheckoutProviderResult": { "type": "object", "properties": { "expires_at": { "type": "string", "description": "ExpiresAt is the provider URL expiry. When set and earlier than the session expiry,\nexecuteCheckoutAction tightens the session expiry to match.", "format": "date-time" }, "next_action": { "$ref": "#/components/schemas/types.PaymentAction" }, "provider_metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "ProviderMetadata holds provider-specific data not needed for business logic." }, "provider_payment_intent_id": { "type": "string", "description": "ProviderPaymentIntentID is the provider-side charge/intent ID.\nStripe returns this at link creation (pi_xxx); others populate it from the webhook payload." }, "provider_session_id": { "type": "string", "description": "ProviderSessionID is stored in EntityIntegrationMapping at link creation.\n Stripe: Checkout Session ID (cs_xxx)\n Razorpay: Payment Link ID (plink_xxx)\n Nomod: Payment Link ID (NOTE: webhook uses Charge ID; look up by PaymentLinkID field)\n Moyasar: Payment ID" } } }, "checkout.JSONBCheckoutResult": { "type": "object", "properties": { "create_subscription_result": { "$ref": "#/components/schemas/types.CreateSubscriptionResult" } } }, "costsheet.Filter": { "type": "object", "properties": { "costsheetIDs": { "type": "array", "description": "CostsheetIDs allows filtering by specific costsheet IDs", "items": { "type": "string" } }, "environmentID": { "type": "string", "description": "EnvironmentID filters by specific environment ID" }, "filters": { "type": "array", "description": "Filters contains custom filtering conditions", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "lookupKey": { "type": "string", "description": "LookupKey filters by lookup key" }, "name": { "type": "string", "description": "Name filters by costsheet name" }, "queryFilter": { "$ref": "#/components/schemas/types.QueryFilter" }, "sort": { "type": "array", "description": "Sort specifies result ordering preferences", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenantID": { "type": "string", "description": "TenantID filters by specific tenant ID" }, "timeRangeFilter": { "$ref": "#/components/schemas/types.TimeRangeFilter" } } }, "coupon_application.CouponApplication": { "type": "object", "properties": { "applied_at": { "type": "string", "format": "date-time" }, "coupon_association_id": { "type": "string" }, "coupon_id": { "type": "string" }, "coupon_snapshot": { "type": "object", "additionalProperties": true }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string" }, "discount_percentage": { "type": "string" }, "discount_type": { "$ref": "#/components/schemas/types.CouponType" }, "discounted_amount": { "type": "string" }, "environment_id": { "type": "string" }, "final_price": { "type": "string" }, "id": { "type": "string" }, "invoice_id": { "type": "string" }, "invoice_line_item_id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "original_price": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "coupon_association.CouponAssociation": { "type": "object", "properties": { "coupon": { "$ref": "#/components/schemas/Coupon" }, "coupon_id": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "end_date": { "type": "string", "description": "Optional", "format": "date-time" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "start_date": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string", "description": "Mandatory" }, "subscription_line_item_id": { "type": "string", "description": "Optional" }, "subscription_phase_id": { "type": "string", "description": "Optional" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "creditnote.CreditNoteLineItem": { "type": "object", "properties": { "amount": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "credit_note_id": { "type": "string" }, "currency": { "type": "string" }, "display_name": { "type": "string" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "invoice_line_item_id": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "ActivateDraftSubscriptionRequest": { "required": [ "start_date" ], "type": "object", "properties": { "start_date": { "type": "string", "description": "start_date is the new start date for the subscription when activating", "format": "date-time" } } }, "AddAddonRequest": { "required": [ "addon_id", "subscription_id" ], "type": "object", "properties": { "addon_id": { "type": "string" }, "cadence": { "$ref": "#/components/schemas/types.AddonCadence" }, "line_item_commitments": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/LineItemCommitmentConfig" }, "description": "LineItemCommitments allows setting commitment configuration per addon line item (keyed by price_id)" }, "metadata": { "type": "object", "additionalProperties": true }, "proration_behavior": { "$ref": "#/components/schemas/types.ProrationBehavior" }, "start_date": { "type": "string", "format": "date-time" }, "subscription_id": { "type": "string" } } }, "AddAddonToSubscriptionRequest": { "required": [ "addon_id" ], "type": "object", "properties": { "addon_id": { "type": "string" }, "cadence": { "$ref": "#/components/schemas/types.AddonCadence" }, "line_item_commitments": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/LineItemCommitmentConfig" }, "description": "LineItemCommitments allows setting commitment configuration per addon line item (keyed by price_id)" }, "metadata": { "type": "object", "additionalProperties": true }, "proration_behavior": { "$ref": "#/components/schemas/types.ProrationBehavior" }, "start_date": { "type": "string", "format": "date-time" } } }, "AddonAssociationResponse": { "type": "object", "properties": { "addon": { "$ref": "#/components/schemas/AddonResponse" }, "addon_id": { "type": "string" }, "addon_status": { "$ref": "#/components/schemas/types.AddonStatus" }, "cancellation_reason": { "type": "string" }, "cancelled_at": { "type": "string", "format": "date-time" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "end_date": { "type": "string", "format": "date-time" }, "entity_id": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.AddonAssociationEntityType" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true }, "start_date": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription": { "$ref": "#/components/schemas/SubscriptionResponse" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "AddonResponse": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "description": { "type": "string" }, "entitlements": { "type": "array", "items": { "$ref": "#/components/schemas/EntitlementResponse" } }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "lookup_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true }, "name": { "type": "string" }, "prices": { "type": "array", "description": "Optional expanded fields", "items": { "$ref": "#/components/schemas/PriceResponse" } }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "Address": { "type": "object", "properties": { "address_city": { "maxLength": 100, "type": "string" }, "address_country": { "type": "string" }, "address_line1": { "maxLength": 255, "type": "string" }, "address_line2": { "maxLength": 255, "type": "string" }, "address_postal_code": { "maxLength": 20, "type": "string" }, "address_state": { "maxLength": 100, "type": "string" } } }, "AggregatedEntitlement": { "type": "object", "properties": { "config_values": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "object" } } }, "is_enabled": { "type": "boolean" }, "is_soft_limit": { "type": "boolean" }, "static_values": { "type": "array", "items": { "type": "string" } }, "usage_limit": { "type": "integer" }, "usage_reset_period": { "$ref": "#/components/schemas/types.EntitlementUsageResetPeriod" } } }, "AggregatedFeature": { "type": "object", "properties": { "entitlement": { "$ref": "#/components/schemas/AggregatedEntitlement" }, "feature": { "$ref": "#/components/schemas/FeatureResponse" }, "sources": { "type": "array", "items": { "$ref": "#/components/schemas/EntitlementSource" } } } }, "AlertLogResponse": { "type": "object", "properties": { "alert_info": { "$ref": "#/components/schemas/types.AlertInfo" }, "alert_status": { "$ref": "#/components/schemas/types.AlertState" }, "alert_type": { "$ref": "#/components/schemas/types.AlertType" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "customer": { "$ref": "#/components/schemas/CustomerResponse" }, "customer_id": { "type": "string" }, "entity_id": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.AlertEntityType" }, "environment_id": { "type": "string" }, "feature": { "$ref": "#/components/schemas/FeatureResponse" }, "id": { "type": "string" }, "parent_entity_id": { "type": "string" }, "parent_entity_type": { "type": "string" }, "status": { "type": "string" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" }, "wallet": { "$ref": "#/components/schemas/WalletResponse" } } }, "AttributedToCustomerResult": { "type": "object", "properties": { "error": { "$ref": "#/components/schemas/errors.ErrorResponse" }, "meter_usage": { "$ref": "#/components/schemas/MeterUsageAttribution" }, "status": { "$ref": "#/components/schemas/types.DebugTrackerStatus" } } }, "BillingCycleInfo": { "type": "object", "properties": { "billing_anchor": { "type": "string", "description": "billing_anchor is the new billing anchor", "format": "date-time" }, "billing_cadence": { "$ref": "#/components/schemas/types.BillingCadence" }, "billing_period": { "$ref": "#/components/schemas/types.BillingPeriod" }, "billing_period_count": { "type": "integer", "description": "billing_period_count is the billing period count" }, "period_end": { "type": "string", "description": "period_end is the end of the new billing period", "format": "date-time" }, "period_start": { "type": "string", "description": "period_start is the start of the new billing period", "format": "date-time" } } }, "BillingPeriodInfo": { "type": "object", "properties": { "end_time": { "type": "string", "format": "date-time" }, "period": { "type": "string", "description": "e.g., \"monthly\", \"yearly\"" }, "start_time": { "type": "string", "format": "date-time" } } }, "BucketSummary": { "type": "object", "properties": { "base_charge": { "type": "string" }, "bucket_id": { "type": "string" }, "commitment_type": { "type": "string" }, "commitment_value": { "type": "string" }, "computed_overage": { "type": "string" }, "computed_true_up": { "type": "string" }, "computed_utilized": { "type": "string" }, "end": { "$ref": "#/components/schemas/types.Bucket" }, "price_id": { "type": "string", "description": "PriceID is the bucket's own price (the line item's price for the\nout-of-bucket row)." }, "start": { "$ref": "#/components/schemas/types.Bucket" }, "subscription_line_item_id": { "type": "string", "description": "SubscriptionLineItemID is the line item this bucket is configured on." }, "total_usage": { "type": "string" } } }, "BulkIngestEventRequest": { "required": [ "events" ], "type": "object", "properties": { "events": { "maxItems": 1000, "minItems": 1, "type": "array", "items": { "$ref": "#/components/schemas/IngestEventRequest" } } } }, "CancelScheduleRequest": { "type": "object", "properties": { "schedule_id": { "type": "string", "description": "schedule_id is the ID of the schedule to cancel (optional if subscription_id and schedule_type are provided)" }, "schedule_type": { "$ref": "#/components/schemas/types.SubscriptionScheduleChangeType" }, "subscription_id": { "type": "string", "description": "subscription_id is the ID of the subscription (required if schedule_id is not provided)" } }, "description": "Request to cancel a subscription schedule (supports two modes)" }, "CancelScheduleResponse": { "type": "object", "properties": { "message": { "type": "string", "description": "message is a confirmation message" }, "status": { "$ref": "#/components/schemas/types.ScheduleStatus" } }, "description": "Confirmation of schedule cancellation" }, "CancelSubscriptionRequest": { "required": [ "cancellation_type" ], "type": "object", "properties": { "cancel_at": { "type": "string", "description": "CancelAt is the exact date/time when the subscription should be cancelled.\nRequired for cancellation_type \"scheduled_date\"; optional for \"immediate\" (past dates only — backdated cancellation).\nFor \"scheduled_date\", accepts both future dates (deferred cancellation) and past dates (backdated cancellation).\nFor \"immediate\", accepts past/current dates only; use \"scheduled_date\" for future dates.", "format": "date-time" }, "cancel_immediately_inovice_policy": { "$ref": "#/components/schemas/types.CancelImmediatelyInvoicePolicy" }, "cancellation_type": { "$ref": "#/components/schemas/types.CancellationType" }, "proration_behavior": { "$ref": "#/components/schemas/types.ProrationBehavior" }, "reason": { "type": "string", "description": "Reason for cancellation (for audit and business intelligence)" } } }, "CancelSubscriptionResponse": { "type": "object", "properties": { "cancellation_type": { "$ref": "#/components/schemas/types.CancellationType" }, "effective_date": { "type": "string", "format": "date-time" }, "message": { "type": "string", "description": "Response metadata" }, "processed_at": { "type": "string", "format": "date-time" }, "proration_details": { "type": "array", "items": { "$ref": "#/components/schemas/ProrationDetail" } }, "proration_invoice": { "$ref": "#/components/schemas/InvoiceResponse" }, "reason": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.SubscriptionStatus" }, "subscription_id": { "type": "string", "description": "Basic cancellation info" }, "total_credit_amount": { "type": "string" } } }, "ChangedInvoice": { "type": "object", "properties": { "action": { "$ref": "#/components/schemas/ChangedInvoiceAction" }, "id": { "type": "string" }, "invoice": { "$ref": "#/components/schemas/InvoiceResponse" }, "status": { "$ref": "#/components/schemas/ChangedInvoiceStatus" }, "wallet_transaction": { "$ref": "#/components/schemas/WalletTransactionResponse" } } }, "ChangedInvoiceAction": { "type": "string", "description": "created (proration invoice) | wallet_credit (downgrade credit)", "enum": [ "created", "wallet_credit" ], "x-enum-varnames": [ "ChangedInvoiceActionCreated", "ChangedInvoiceActionWalletCredit" ] }, "ChangedInvoiceStatus": { "type": "string", "description": "preview | issued | INITIATED | PENDING | PROCESSING | SUCCEEDED | OVERPAID | FAILED | REFUNDED | PARTIALLY_REFUNDED", "enum": [ "preview", "issued" ], "x-enum-varnames": [ "ChangedInvoiceStatusPreview", "ChangedInvoiceStatusWalletIssued" ] }, "ChangedLineItem": { "type": "object", "properties": { "change_action": { "$ref": "#/components/schemas/ChangedLineItemAction" }, "end_date": { "type": "string", "format": "date-time" }, "id": { "type": "string" }, "price_id": { "type": "string" }, "quantity": { "type": "string" }, "start_date": { "type": "string", "format": "date-time" } } }, "ChangedLineItemAction": { "type": "string", "description": "created | updated | ended", "enum": [ "created", "updated", "ended" ], "x-enum-varnames": [ "ChangedLineItemActionCreated", "ChangedLineItemActionUpdated", "ChangedLineItemActionEnded" ] }, "ChangedResources": { "type": "object", "properties": { "invoices": { "type": "array", "items": { "$ref": "#/components/schemas/ChangedInvoice" } }, "line_items": { "type": "array", "items": { "$ref": "#/components/schemas/ChangedLineItem" } }, "subscriptions": { "type": "array", "items": { "$ref": "#/components/schemas/ChangedSubscription" } } } }, "ChangedSubscription": { "type": "object", "properties": { "action": { "$ref": "#/components/schemas/ChangedSubscriptionAction" }, "current_period_end": { "type": "string", "format": "date-time" }, "id": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.SubscriptionStatus" }, "trial_end": { "type": "string", "format": "date-time" } } }, "ChangedSubscriptionAction": { "type": "string", "description": "created | updated", "enum": [ "created", "updated" ], "x-enum-varnames": [ "ChangedSubscriptionActionCreated", "ChangedSubscriptionActionUpdated" ] }, "CheckoutSessionResponse": { "type": "object", "properties": { "action": { "$ref": "#/components/schemas/types.CheckoutAction" }, "cancel_url": { "type": "string" }, "cancelled_at": { "type": "string", "format": "date-time" }, "checkout_invoice_id": { "type": "string", "description": "CheckoutInvoiceID and CheckoutPaymentID are set once the apply step\ncreates the corresponding Flexprice entities (completed sessions only)." }, "checkout_payment_id": { "type": "string" }, "checkout_status": { "$ref": "#/components/schemas/types.CheckoutStatus" }, "completed_at": { "type": "string", "format": "date-time" }, "configuration": { "$ref": "#/components/schemas/checkout.JSONBCheckoutConfiguration" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "customer_id": { "type": "string" }, "environment_id": { "type": "string" }, "expires_at": { "type": "string", "description": "ExpiresAt is required. A Temporal timer fires at this time for any\nsession still in initiated|pending, marking it expired. The caller\nmust create a new session after expiry (expire-and-restart model).", "format": "date-time" }, "failure_reason": { "type": "string", "description": "FailureReason is a human-readable string set on failed sessions." }, "failure_url": { "type": "string" }, "id": { "type": "string" }, "idempotency_key": { "type": "string", "description": "IdempotencyKey is caller-supplied. It is unique only while the session\nis active (initiated|pending). The same key may be reused once the\nsession reaches a terminal state (completed|failed|expired)." }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "payment_action": { "$ref": "#/components/schemas/types.PaymentAction" }, "payment_provider": { "$ref": "#/components/schemas/types.CheckoutPaymentProvider" }, "provider_result": { "$ref": "#/components/schemas/checkout.JSONBCheckoutProviderResult" }, "result": { "$ref": "#/components/schemas/checkout.JSONBCheckoutResult" }, "status": { "$ref": "#/components/schemas/types.Status" }, "success_url": { "type": "string", "description": "Redirect URLs sent to the payment provider. The provider redirects the\nuser browser to the appropriate URL after the payment flow completes." }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "CloneEnvironmentRequest": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the new environment (required when target_environment_id is not provided)" }, "target_environment_id": { "type": "string", "description": "TargetEnvironmentID is the ID of an existing environment to clone into (optional).\nWhen provided, Name and Type are ignored. When omitted, Name and Type are required." }, "type": { "$ref": "#/components/schemas/types.EnvironmentType" } } }, "CloneFeatureRequest": { "type": "object", "properties": { "description": { "type": "string", "description": "Description overrides the source feature's description when provided" }, "lookup_key": { "type": "string", "description": "LookupKey is required and must be unique across published features" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string", "description": "Name is required and must be different from the source feature's name" } } }, "ClonePlanRequest": { "type": "object", "properties": { "description": { "type": "string", "description": "Description overrides the source plan's description when provided" }, "display_order": { "type": "integer", "description": "DisplayOrder overrides the source plan's display order when provided" }, "lookup_key": { "type": "string", "description": "LookupKey is required and must be unique across published plans" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string", "description": "Name is required and must be different from the source plan's name" } } }, "CommitmentBucketRequest": { "type": "object", "properties": { "commitment_type": { "$ref": "#/components/schemas/types.CommitmentType" }, "commitment_value": { "type": "string" }, "end": { "$ref": "#/components/schemas/types.Bucket" }, "id": { "type": "string" }, "overage_factor": { "type": "string" }, "price": { "$ref": "#/components/schemas/CreatePriceRequest" }, "start": { "$ref": "#/components/schemas/types.Bucket" }, "true_up_enabled": { "type": "boolean" } } }, "CostAnalyticItem": { "type": "object", "properties": { "cost_by_period": { "type": "array", "description": "Breakdown", "items": { "$ref": "#/components/schemas/CostPoint" } }, "costsheet_id": { "type": "string" }, "currency": { "type": "string", "description": "Metadata" }, "customer_id": { "type": "string" }, "external_customer_id": { "type": "string" }, "meter": { "$ref": "#/components/schemas/meter.Meter" }, "meter_id": { "type": "string" }, "meter_name": { "type": "string" }, "price": { "$ref": "#/components/schemas/price.Price" }, "price_id": { "type": "string" }, "properties": { "type": "object", "additionalProperties": { "type": "string" } }, "source": { "type": "string" }, "total_cost": { "type": "string", "description": "Aggregated metrics" }, "total_events": { "type": "integer" }, "total_quantity": { "type": "string" } } }, "CostPoint": { "type": "object", "properties": { "cost": { "type": "string" }, "event_count": { "type": "integer" }, "quantity": { "type": "string" }, "timestamp": { "type": "string" } } }, "CostsheetResponse": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "description": { "type": "string" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "lookup_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "prices": { "type": "array", "description": "Associated prices", "items": { "$ref": "#/components/schemas/PriceResponse" } }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "CouponApplicationResponse": { "type": "object", "properties": { "applied_at": { "type": "string", "format": "date-time" }, "coupon_association_id": { "type": "string" }, "coupon_id": { "type": "string" }, "coupon_snapshot": { "type": "object", "additionalProperties": true }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string" }, "discount_percentage": { "type": "string" }, "discount_type": { "$ref": "#/components/schemas/types.CouponType" }, "discounted_amount": { "type": "string" }, "environment_id": { "type": "string" }, "final_price": { "type": "string" }, "id": { "type": "string" }, "invoice_id": { "type": "string" }, "invoice_line_item_id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "original_price": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "CouponAssociationResponse": { "type": "object", "properties": { "coupon": { "$ref": "#/components/schemas/CouponResponse" }, "coupon_id": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "end_date": { "type": "string", "description": "Optional", "format": "date-time" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "start_date": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string", "description": "Mandatory" }, "subscription_line_item": { "$ref": "#/components/schemas/SubscriptionLineItemResponse" }, "subscription_line_item_id": { "type": "string", "description": "Optional" }, "subscription_phase_id": { "type": "string", "description": "Optional" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "CouponResponse": { "type": "object", "properties": { "amount_off": { "type": "string" }, "cadence": { "$ref": "#/components/schemas/types.CouponCadence" }, "coupon_code": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string" }, "duration_in_periods": { "type": "integer" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "max_redemptions": { "type": "integer" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "percentage_off": { "type": "string" }, "redeem_after": { "type": "string" }, "redeem_before": { "type": "string" }, "rules": { "type": "object", "additionalProperties": true }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "total_redemptions": { "type": "integer" }, "type": { "$ref": "#/components/schemas/types.CouponType" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "CreateAPIKeyRequest": { "required": [ "name", "type" ], "type": "object", "properties": { "expires_at": { "type": "string", "format": "date-time" }, "name": { "type": "string" }, "service_account_id": { "type": "string" }, "type": { "$ref": "#/components/schemas/types.SecretType" } } }, "CreateAPIKeyResponse": { "type": "object", "properties": { "api_key": { "type": "string" }, "secret": { "$ref": "#/components/schemas/SecretResponse" } } }, "CreateAddonRequest": { "required": [ "lookup_key", "name" ], "type": "object", "properties": { "description": { "type": "string" }, "lookup_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true }, "name": { "type": "string" } } }, "CreateAddonResponse": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "description": { "type": "string" }, "entitlements": { "type": "array", "items": { "$ref": "#/components/schemas/EntitlementResponse" } }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "lookup_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true }, "name": { "type": "string" }, "prices": { "type": "array", "description": "Optional expanded fields", "items": { "$ref": "#/components/schemas/PriceResponse" } }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "CreateBulkEntitlementRequest": { "required": [ "items" ], "type": "object", "properties": { "items": { "maxItems": 100, "minItems": 1, "type": "array", "items": { "$ref": "#/components/schemas/CreateEntitlementRequest" } } } }, "CreateBulkEntitlementResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/EntitlementResponse" } } } }, "CreateBulkPriceRequest": { "required": [ "items" ], "type": "object", "properties": { "items": { "maxItems": 100, "minItems": 1, "type": "array", "items": { "$ref": "#/components/schemas/CreatePriceRequest" } } } }, "CreateBulkPriceResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/PriceResponse" } } } }, "CreateCheckoutSessionRequest": { "required": [ "action", "customer_external_id", "payment_provider" ], "type": "object", "properties": { "action": { "$ref": "#/components/schemas/types.CheckoutAction" }, "cancel_url": { "type": "string" }, "configuration": { "$ref": "#/components/schemas/types.CheckoutConfiguration" }, "customer_external_id": { "type": "string" }, "failure_url": { "type": "string" }, "idempotency_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "payment_provider": { "$ref": "#/components/schemas/types.CheckoutPaymentProvider" }, "success_url": { "type": "string" } } }, "CreateCostsheetRequest": { "required": [ "name" ], "type": "object", "properties": { "description": { "type": "string" }, "lookup_key": { "maxLength": 255, "minLength": 1, "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "maxLength": 255, "minLength": 1, "type": "string" } } }, "CreateCostsheetResponse": { "type": "object", "properties": { "costsheet": { "$ref": "#/components/schemas/CostsheetResponse" } } }, "CreateCouponRequest": { "required": [ "cadence", "name", "type" ], "type": "object", "properties": { "amount_off": { "type": "string" }, "cadence": { "$ref": "#/components/schemas/types.CouponCadence" }, "coupon_code": { "type": "string" }, "currency": { "type": "string" }, "duration_in_periods": { "type": "integer" }, "max_redemptions": { "type": "integer" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "percentage_off": { "type": "string" }, "redeem_after": { "type": "string" }, "redeem_before": { "type": "string" }, "rules": { "type": "object", "additionalProperties": true }, "type": { "$ref": "#/components/schemas/types.CouponType" } } }, "CreateCreditGrantRequest": { "required": [ "cadence", "credits", "name", "scope" ], "type": "object", "properties": { "cadence": { "$ref": "#/components/schemas/types.CreditGrantCadence" }, "conversion_rate": { "type": "string", "description": "amount in the currency = number of credits * conversion_rate\nex if conversion_rate is 1, then 1 USD = 1 credit\nex if conversion_rate is 2, then 1 USD = 0.5 credits\nex if conversion_rate is 0.5, then 1 USD = 2 credits" }, "credits": { "type": "string" }, "end_date": { "type": "string", "format": "date-time" }, "expiration_duration": { "type": "integer" }, "expiration_duration_unit": { "$ref": "#/components/schemas/types.CreditGrantExpiryDurationUnit" }, "expiration_type": { "$ref": "#/components/schemas/types.CreditGrantExpiryType" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" }, "period": { "$ref": "#/components/schemas/types.CreditGrantPeriod" }, "period_count": { "type": "integer" }, "plan_id": { "type": "string" }, "priority": { "type": "integer" }, "scope": { "$ref": "#/components/schemas/types.CreditGrantScope" }, "start_date": { "type": "string", "format": "date-time" }, "subscription_id": { "type": "string" }, "topup_conversion_rate": { "type": "string", "description": "topup_conversion_rate is the conversion rate for the topup to the currency\nex if topup_conversion_rate is 1, then 1 USD = 1 credit\nex if topup_conversion_rate is 2, then 1 USD = 0.5 credits\nex if topup_conversion_rate is 0.5, then 1 USD = 2 credits" } } }, "CreateCreditNoteLineItemRequest": { "required": [ "amount", "invoice_line_item_id" ], "type": "object", "properties": { "amount": { "type": "string", "description": "amount is the monetary amount to be credited for this line item" }, "display_name": { "type": "string", "description": "display_name is an optional human-readable name for this credit note line item" }, "invoice_line_item_id": { "type": "string", "description": "invoice_line_item_id is the unique identifier of the invoice line item being credited" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" } } }, "CreateCreditNoteRequest": { "required": [ "invoice_id", "reason" ], "type": "object", "properties": { "credit_note_number": { "type": "string", "description": "credit_note_number is an optional human-readable identifier for the credit note" }, "idempotency_key": { "type": "string", "description": "idempotency_key is an optional key used to prevent duplicate credit note creation" }, "invoice_id": { "type": "string", "description": "invoice_id is the unique identifier of the invoice this credit note is applied to" }, "line_items": { "type": "array", "description": "line_items contains the individual line items that make up this credit note (minimum 1 required)", "items": { "$ref": "#/components/schemas/CreateCreditNoteLineItemRequest" } }, "memo": { "type": "string", "description": "memo is an optional free-text field for additional notes about the credit note" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "process_credit_note": { "type": "boolean", "description": "process_credit_note is a flag to process the credit note after creation", "default": true }, "reason": { "$ref": "#/components/schemas/types.CreditNoteReason" } } }, "CreateCustomerRequest": { "required": [ "external_id" ], "type": "object", "properties": { "address_city": { "maxLength": 100, "type": "string", "description": "address_city is the city name with maximum 100 characters" }, "address_country": { "type": "string", "description": "address_country is the two-letter ISO 3166-1 alpha-2 country code" }, "address_line1": { "maxLength": 255, "type": "string", "description": "address_line1 is the primary address line with maximum 255 characters" }, "address_line2": { "maxLength": 255, "type": "string", "description": "address_line2 is the secondary address line with maximum 255 characters" }, "address_postal_code": { "maxLength": 20, "type": "string", "description": "address_postal_code is the ZIP code or postal code with maximum 20 characters" }, "address_state": { "maxLength": 100, "type": "string", "description": "address_state is the state, province, or region name with maximum 100 characters" }, "email": { "type": "string", "description": "email is the customer's email address and must be a valid email format if provided" }, "external_id": { "type": "string", "description": "external_id is the unique identifier from your system to reference this customer (required)" }, "integration_entity_mapping": { "type": "array", "description": "integration_entity_mapping contains provider integration mappings for this customer", "items": { "$ref": "#/components/schemas/CreateEntityIntegrationMappingRequest" } }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "metadata contains additional key-value pairs for storing extra information" }, "name": { "type": "string", "description": "name is the full name or company name of the customer" }, "skip_onboarding_workflow": { "type": "boolean", "description": "skip_onboarding_workflow when true, prevents the customer onboarding workflow from being triggered\nThis is used internally when a customer is created via a workflow to prevent infinite loops\nDefault: false" }, "tax_rate_overrides": { "type": "array", "description": "tax_rate_overrides contains tax rate configurations to be linked to this customer", "items": { "$ref": "#/components/schemas/TaxRateOverride" } }, "timezone": { "type": "string", "description": "timezone is the customer's IANA timezone name (e.g. \"Asia/Kolkata\", \"America/New_York\")\nDefaults to \"UTC\" if not provided" } }, "description": "Request object for creating a new customer in the system" }, "CreateEntitlementRequest": { "required": [ "feature_id", "feature_type" ], "type": "object", "properties": { "config_value": { "type": "object", "additionalProperties": true }, "end_date": { "type": "string", "format": "date-time" }, "entity_id": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.EntitlementEntityType" }, "feature_id": { "type": "string" }, "feature_type": { "$ref": "#/components/schemas/types.FeatureType" }, "is_enabled": { "type": "boolean" }, "is_soft_limit": { "type": "boolean" }, "parent_entitlement_id": { "type": "string" }, "plan_id": { "type": "string" }, "start_date": { "type": "string", "format": "date-time" }, "static_value": { "type": "string" }, "usage_limit": { "type": "integer" }, "usage_reset_period": { "$ref": "#/components/schemas/types.EntitlementUsageResetPeriod" } } }, "CreateEntityIntegrationMappingRequest": { "required": [ "entity_id", "entity_type", "provider_entity_id", "provider_type" ], "type": "object", "properties": { "entity_id": { "maxLength": 255, "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.IntegrationEntityType" }, "metadata": { "type": "object", "additionalProperties": true }, "provider_entity_id": { "maxLength": 255, "type": "string" }, "provider_type": { "maxLength": 50, "type": "string" } } }, "CreateFeatureRequest": { "required": [ "name", "type" ], "type": "object", "properties": { "alert_settings": { "$ref": "#/components/schemas/types.AlertSettings" }, "description": { "type": "string" }, "group_id": { "type": "string", "description": "GroupID is the id of the group to add the feature to" }, "lookup_key": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "meter": { "$ref": "#/components/schemas/CreateMeterRequest" }, "meter_id": { "type": "string" }, "name": { "type": "string" }, "reporting_unit": { "$ref": "#/components/schemas/types.ReportingUnit" }, "type": { "$ref": "#/components/schemas/types.FeatureType" }, "unit_plural": { "type": "string" }, "unit_singular": { "type": "string" } } }, "CreateGroupRequest": { "required": [ "entity_type", "lookup_key", "name" ], "type": "object", "properties": { "entity_type": { "type": "string" }, "lookup_key": { "type": "string" }, "name": { "type": "string" } } }, "CreateInvoiceLineItemRequest": { "required": [ "amount", "quantity" ], "type": "object", "properties": { "adjusted_entitlement_quantity": { "type": "string", "description": "adjusted_entitlement_quantity is the entitlement-covered units deducted from raw usage." }, "amount": { "type": "string", "description": "amount is the monetary amount for this line item" }, "commitment_info": { "$ref": "#/components/schemas/types.CommitmentInfo" }, "display_name": { "type": "string", "description": "display_name is the optional human-readable name for this line item" }, "entity_id": { "type": "string", "description": "entity_id is the optional unique identifier of the entity associated with this line item" }, "entity_type": { "type": "string", "description": "entity_type is the optional type of the entity associated with this line item" }, "invoice_level_discount": { "type": "string", "description": "invoice_level_discount is the discount amount in invoice currency applied to all line items on the invoice." }, "line_item_discount": { "type": "string", "description": "line_item_discount is the discount amount in invoice currency applied directly to this line item." }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "meter_display_name": { "type": "string", "description": "meter_display_name is the optional human-readable name of the meter" }, "meter_id": { "type": "string", "description": "meter_id is the optional unique identifier of the meter used for usage tracking" }, "period_end": { "type": "string", "description": "period_end is the optional end date of the period this line item covers", "format": "date-time" }, "period_start": { "type": "string", "description": "period_start is the optional start date of the period this line item covers", "format": "date-time" }, "plan_display_name": { "type": "string", "description": "plan_display_name is the optional human-readable name of the plan" }, "plan_id": { "type": "string", "description": "TODO: !REMOVE after migration\nplan_id is the optional unique identifier of the plan associated with this line item" }, "prepaid_credits_applied": { "type": "string", "description": "prepaid_credits_applied is the amount in invoice currency reduced from this line item due to prepaid credits application." }, "price_id": { "type": "string", "description": "price_id is the optional unique identifier of the price associated with this line item" }, "price_type": { "type": "string", "description": "price_type indicates the type of pricing (fixed, usage, tiered, etc.)" }, "price_unit": { "type": "string", "description": "price_unit is the optional 3-digit ISO code of the price unit associated with this line item" }, "price_unit_amount": { "type": "string", "description": "price_unit_amount is the optional amount converted to the price unit currency" }, "quantity": { "type": "string", "description": "quantity is the quantity of units for this line item" }, "subscription_id": { "type": "string", "description": "subscription_id overrides the invoice's subscription_id for this specific line item.\nUsed for grouped invoicing where child line items belong to child subscriptions." }, "subscription_line_item_id": { "type": "string", "description": "sub_line_item_id links this line item to the subscription_line_item that generated it." } } }, "CreateInvoiceRequest": { "required": [ "amount_due", "currency", "customer_id", "subtotal", "total" ], "type": "object", "properties": { "amount_due": { "type": "string", "description": "amount_due is the total amount that needs to be paid for this invoice" }, "amount_paid": { "type": "string", "description": "amount_paid is the amount that has been paid towards this invoice" }, "billing_period": { "type": "string", "description": "billing_period is the period this invoice covers (e.g., \"monthly\", \"yearly\")" }, "billing_reason": { "$ref": "#/components/schemas/types.InvoiceBillingReason" }, "coupons": { "type": "array", "description": "coupons", "items": { "type": "string" } }, "currency": { "type": "string", "description": "currency is the three-letter ISO currency code (e.g., USD, EUR) for the invoice" }, "customer_id": { "type": "string", "description": "customer_id is the unique identifier of the customer this invoice belongs to" }, "description": { "type": "string", "description": "description is an optional text description of the invoice" }, "due_date": { "type": "string", "description": "due_date is the date by which payment is expected", "format": "date-time" }, "idempotency_key": { "type": "string", "description": "idempotency_key is an optional key used to prevent duplicate invoice creation" }, "invoice_coupons": { "type": "array", "description": "Invoice Coupons", "items": { "$ref": "#/components/schemas/InvoiceCoupon" } }, "invoice_number": { "type": "string", "description": "invoice_number is an optional human-readable identifier for the invoice" }, "invoice_pdf_url": { "type": "string", "description": "invoice_pdf_url is the URL where customers can download the PDF version of this invoice" }, "invoice_status": { "$ref": "#/components/schemas/types.InvoiceStatus" }, "invoice_type": { "$ref": "#/components/schemas/types.InvoiceType" }, "issue_date": { "type": "string", "description": "issue_date overrides the user-facing date of the invoice.\nDefaults to created_at if not provided.", "format": "date-time" }, "line_item_coupons": { "type": "array", "description": "Invoice Line Item Coupons", "items": { "$ref": "#/components/schemas/InvoiceLineItemCoupon" } }, "line_items": { "type": "array", "description": "line_items contains the individual items that make up this invoice", "items": { "$ref": "#/components/schemas/CreateInvoiceLineItemRequest" } }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "payment_status": { "$ref": "#/components/schemas/types.PaymentStatus" }, "period_end": { "type": "string", "description": "period_end is the end date of the billing period", "format": "date-time" }, "period_start": { "type": "string", "description": "period_start is the start date of the billing period", "format": "date-time" }, "prepared_tax_rates": { "type": "array", "description": "prepared_tax_rates contains the tax rates pre-resolved by the caller (e.g., billing service)", "items": { "$ref": "#/components/schemas/TaxRateResponse" } }, "subscription_id": { "type": "string", "description": "subscription_id is the optional unique identifier of the subscription associated with this invoice" }, "subtotal": { "type": "string", "description": "subtotal is the amount before taxes and discounts are applied" }, "tax_rate_overrides": { "type": "array", "description": "tax_rate_overrides is the tax rate overrides to be applied to the invoice", "items": { "$ref": "#/components/schemas/TaxRateOverride" } }, "tax_rates": { "type": "array", "description": "tax_rates", "items": { "type": "string" } }, "total": { "type": "string", "description": "total is the total amount of the invoice including taxes and discounts" }, "total_prepaid_applied": { "type": "string", "description": "total_prepaid_applied is the total amount of prepaid applied to this invoice." } } }, "CreateMeterRequest": { "required": [ "aggregation", "event_name", "name", "reset_usage" ], "type": "object", "properties": { "aggregation": { "$ref": "#/components/schemas/meter.Aggregation" }, "event_name": { "type": "string", "example": "api_request" }, "filters": { "type": "array", "items": { "$ref": "#/components/schemas/meter.Filter" } }, "name": { "type": "string", "example": "API Usage Meter" }, "reset_usage": { "$ref": "#/components/schemas/types.ResetUsage" } } }, "CreatePaymentRequest": { "required": [ "amount", "currency", "destination_id", "destination_type", "payment_method_type" ], "type": "object", "properties": { "amount": { "type": "string" }, "cancel_url": { "type": "string" }, "currency": { "type": "string" }, "destination_id": { "type": "string" }, "destination_type": { "$ref": "#/components/schemas/types.PaymentDestinationType" }, "idempotency_key": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "payment_gateway": { "$ref": "#/components/schemas/types.PaymentGatewayType" }, "payment_method_id": { "type": "string" }, "payment_method_type": { "$ref": "#/components/schemas/types.PaymentMethodType" }, "process_payment": { "type": "boolean", "default": true }, "save_card_and_make_default": { "type": "boolean", "default": false }, "success_url": { "type": "string" } } }, "CreatePlanRequest": { "required": [ "name" ], "type": "object", "properties": { "description": { "type": "string" }, "display_order": { "type": "integer" }, "lookup_key": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" } } }, "CreatePriceRequest": { "required": [ "billing_model", "billing_period", "currency", "entity_id", "entity_type", "invoice_cadence", "price_unit_type", "type" ], "type": "object", "properties": { "amount": { "type": "string" }, "billing_model": { "$ref": "#/components/schemas/types.BillingModel" }, "billing_period": { "$ref": "#/components/schemas/types.BillingPeriod" }, "billing_period_count": { "type": "integer" }, "currency": { "type": "string" }, "description": { "type": "string" }, "display_name": { "type": "string" }, "end_date": { "type": "string", "format": "date-time" }, "entity_id": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.PriceEntityType" }, "filter_values": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "group_id": { "type": "string", "description": "GroupID is the id of the group to add the price to" }, "invoice_cadence": { "$ref": "#/components/schemas/types.InvoiceCadence" }, "lookup_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "meter_id": { "type": "string" }, "min_quantity": { "type": "integer", "description": "MinQuantity is the minimum quantity of the price" }, "price_unit_config": { "$ref": "#/components/schemas/PriceUnitConfig" }, "price_unit_type": { "$ref": "#/components/schemas/types.PriceUnitType" }, "start_date": { "type": "string", "format": "date-time" }, "tier_mode": { "$ref": "#/components/schemas/types.BillingTier" }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/CreatePriceTier" } }, "transform_quantity": { "$ref": "#/components/schemas/price.TransformQuantity" }, "trial_period_days": { "type": "integer" }, "type": { "$ref": "#/components/schemas/types.PriceType" } } }, "CreatePriceTier": { "required": [ "unit_amount" ], "type": "object", "properties": { "flat_amount": { "type": "string", "description": "flat_amount is the flat amount for the given tier (optional)\nApplied on top of unit_amount*quantity. Useful for cases like \"2.7$ + 5c\"" }, "unit_amount": { "type": "string", "description": "unit_amount is the amount per unit for the given tier" }, "up_to": { "type": "integer", "description": "up_to is the quantity up to which this tier applies. It is null for the last tier.\nIMPORTANT: Tier boundaries are INCLUSIVE.\n- If up_to is 1000, then quantity less than or equal to 1000 belongs to this tier\n- This behavior is consistent across both VOLUME and SLAB tier modes" } } }, "CreatePriceUnitRequest": { "required": [ "base_currency", "code", "conversion_rate", "name", "symbol" ], "type": "object", "properties": { "base_currency": { "type": "string", "description": "base_currency is the currency that the price unit is based on" }, "code": { "type": "string" }, "conversion_rate": { "type": "string", "description": "ConversionRate defines the exchange rate from this price unit to the base currency.\nThis rate is used to convert amounts in the custom price unit to the base currency for storage and billing.\n\nConversion formula:\n price_unit_amount * conversion_rate = base_currency_amount\n\nExample:\n If conversion_rate = \"0.01\" and base_currency = \"usd\":\n 100 price_unit tokens * 0.01 = 1.00 USD\n\nNote: Rounding precision is determined by the base currency (e.g., USD uses 2 decimal places, JPY uses 0)." }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" }, "symbol": { "type": "string" } } }, "CreatePriceUnitResponse": { "type": "object", "properties": { "base_currency": { "type": "string" }, "code": { "type": "string" }, "conversion_rate": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "symbol": { "type": "string" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "CreateScheduledTaskRequest": { "required": [ "connection_id", "entity_type", "interval", "job_config" ], "type": "object", "properties": { "connection_id": { "type": "string" }, "enabled": { "type": "boolean" }, "entity_type": { "$ref": "#/components/schemas/types.ScheduledTaskEntityType" }, "interval": { "$ref": "#/components/schemas/types.ScheduledTaskInterval" }, "job_config": { "$ref": "#/components/schemas/types.S3JobConfig" } } }, "CreateSubscriptionLineItemRequest": { "type": "object", "properties": { "commitment_amount": { "type": "number", "description": "Commitment fields" }, "commitment_duration": { "$ref": "#/components/schemas/types.BillingPeriod" }, "commitment_overage_factor": { "type": "number" }, "commitment_quantity": { "type": "number" }, "commitment_time_buckets": { "type": "array", "items": { "$ref": "#/components/schemas/CommitmentBucketRequest" } }, "commitment_true_up_enabled": { "type": "boolean" }, "commitment_type": { "$ref": "#/components/schemas/types.CommitmentType" }, "commitment_windowed": { "type": "boolean" }, "display_name": { "type": "string" }, "end_date": { "type": "string", "format": "date-time" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "price": { "$ref": "#/components/schemas/SubscriptionPriceCreateRequest" }, "price_id": { "type": "string", "description": "PriceID references an existing price (plan, addon, or subscription-scoped). Exactly one of price_id or price must be set." }, "proration_behavior": { "$ref": "#/components/schemas/types.ProrationBehavior" }, "quantity": { "type": "number" }, "start_date": { "type": "string", "format": "date-time" }, "subscription_phase_id": { "type": "string" } } }, "CreateSubscriptionRequest": { "required": [ "billing_period", "currency", "plan_id" ], "type": "object", "properties": { "addons": { "type": "array", "description": "Addons represents addons to be added to the subscription during creation", "items": { "$ref": "#/components/schemas/AddAddonToSubscriptionRequest" } }, "auto_invoice_threshold": { "type": "string", "description": "AutoInvoiceThreshold is the usage amount (in subscription currency) that triggers\nan intermediate invoice mid-period. Set once at creation; cannot be changed later.\nAllowed only when the subscription resolves to type standalone (no parent hierarchy rows).\nPlan line items must be usage-based only (no fixed or other non-usage plan prices).\nNil means auto invoice threshold billing is disabled for this subscription." }, "billing_anchor": { "type": "string", "description": "BillingAnchor overrides the derived billing anchor when billing_cycle is anniversary.\nFor monthly billing, the day-of-month (and time-of-day) define cycle boundaries: if start_date\nis before that day in the month, the first billing period ends on the next occurrence of that\nday in the same month (a shorter first period); subsequent periods follow the usual interval.", "format": "date-time" }, "billing_cycle": { "$ref": "#/components/schemas/types.BillingCycle" }, "billing_period": { "$ref": "#/components/schemas/types.BillingPeriod" }, "billing_period_count": { "type": "integer" }, "collection_method": { "$ref": "#/components/schemas/types.CollectionMethod" }, "commitment_amount": { "type": "string", "description": "CommitmentAmount is the minimum amount a customer commits to paying for a billing period" }, "commitment_duration": { "$ref": "#/components/schemas/types.BillingPeriod" }, "coupons": { "type": "array", "description": "Deprecated: use SubscriptionCoupons instead.", "items": { "type": "string" } }, "credit_grants": { "type": "array", "description": "Credit grants to be applied when subscription is created", "items": { "$ref": "#/components/schemas/CreateCreditGrantRequest" } }, "currency": { "type": "string" }, "customer_id": { "type": "string", "description": "customer_id is the flexprice customer id\nand it is prioritized over external_customer_id in case both are provided." }, "enable_true_up": { "type": "boolean", "description": "Enable Commitment True Up Fee" }, "end_date": { "type": "string", "format": "date-time" }, "external_customer_id": { "type": "string", "description": "external_customer_id is the customer id in your DB\nand must be same as what you provided as external_id while creating the customer in flexprice." }, "gateway_payment_method_id": { "type": "string" }, "inheritance": { "$ref": "#/components/schemas/SubscriptionInheritanceConfig" }, "line_item_commitments": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/LineItemCommitmentConfig" }, "description": "LineItemCommitments allows setting commitment configuration per line item (keyed by price_id)" }, "line_item_coupons": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } }, "description": "Deprecated: use SubscriptionCoupons instead." }, "line_items": { "type": "array", "description": "LineItems are extra line items to add at creation (each with price_id or price), in addition to plan prices", "items": { "$ref": "#/components/schemas/CreateSubscriptionLineItemRequest" } }, "lookup_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "overage_factor": { "type": "string", "description": "OverageFactor is a multiplier applied to usage beyond the commitment amount" }, "override_entitlements": { "type": "array", "description": "OverrideEntitlements allows customizing specific entitlements for this subscription", "items": { "$ref": "#/components/schemas/OverrideEntitlementRequest" } }, "override_line_items": { "type": "array", "description": "OverrideLineItems allows customizing specific prices for this subscription", "items": { "$ref": "#/components/schemas/OverrideLineItemRequest" } }, "payment_behavior": { "$ref": "#/components/schemas/types.PaymentBehavior" }, "payment_terms": { "$ref": "#/components/schemas/types.PaymentTerms" }, "phases": { "type": "array", "description": "Phases represents subscription phases to be created with the subscription", "items": { "$ref": "#/components/schemas/SubscriptionPhaseCreateRequest" } }, "plan_id": { "type": "string" }, "proration_behavior": { "$ref": "#/components/schemas/types.ProrationBehavior" }, "start_date": { "type": "string", "format": "date-time" }, "subscription_coupons": { "type": "array", "description": "SubscriptionCoupons is the preferred way to attach coupons at creation.\nAccepts coupon_code; optionally targets a line item via price_id.", "items": { "$ref": "#/components/schemas/SubscriptionCouponInput" } }, "subscription_status": { "$ref": "#/components/schemas/types.SubscriptionStatus" }, "tax_rate_overrides": { "type": "array", "description": "tax_rate_overrides is the tax rate overrides\tto be applied to the subscription", "items": { "$ref": "#/components/schemas/TaxRateOverride" } }, "timezone": { "type": "string", "description": "Timezone of the customer.\nIf not set, the default value is UTC." }, "trial_period_days": { "type": "integer", "description": "TrialPeriodDays: nil = inherit trial length from plan recurring-fixed prices (must be uniform).\n0 = explicitly no trial (overrides catalog). >0 = override duration in days." } } }, "CreateTaskRequest": { "required": [ "entity_type", "file_type", "file_url", "task_type" ], "type": "object", "properties": { "entity_type": { "$ref": "#/components/schemas/types.EntityType" }, "file_name": { "type": "string" }, "file_type": { "$ref": "#/components/schemas/types.FileType" }, "file_url": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true }, "task_type": { "$ref": "#/components/schemas/types.TaskType" } } }, "CreateTaxAssociationRequest": { "required": [ "tax_rate_code" ], "type": "object", "properties": { "auto_apply": { "type": "boolean" }, "currency": { "type": "string" }, "end_date": { "type": "string", "description": "EndDate sets when this association expires. Must be after StartDate when both are provided.", "format": "date-time" }, "entity_id": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.TaxRateEntityType" }, "external_customer_id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "priority": { "type": "integer" }, "start_date": { "type": "string", "description": "StartDate sets when this association becomes active. Defaults to now if omitted.", "format": "date-time" }, "tax_rate_code": { "type": "string" } } }, "CreateTaxRateRequest": { "required": [ "code", "name" ], "type": "object", "properties": { "code": { "type": "string", "description": "code is the unique alphanumeric case sensitive identifier for the tax rate (required)" }, "description": { "type": "string", "description": "description is an optional text description providing details about the tax rate" }, "fixed_value": { "type": "string", "description": "fixed_value is the fixed monetary amount when tax_rate_type is \"fixed\"" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "metadata contains additional key-value pairs for storing extra information" }, "name": { "type": "string", "description": "name is the human-readable name for the tax rate (required)" }, "percentage_value": { "type": "string", "description": "percentage_value is the percentage value (0-100) when tax_rate_type is \"percentage\"" }, "scope": { "$ref": "#/components/schemas/types.TaxRateScope" }, "tax_rate_type": { "$ref": "#/components/schemas/types.TaxRateType" } } }, "CreateUserRequest": { "required": [ "type" ], "type": "object", "properties": { "email": { "type": "string", "description": "Required when type is \"user\"" }, "name": { "type": "string", "description": "Display name; optional for service accounts" }, "roles": { "type": "array", "description": "Required when type is \"service_account\"", "items": { "type": "string" } }, "type": { "$ref": "#/components/schemas/types.UserType" } } }, "CreateUserResponse": { "type": "object", "properties": { "email": { "type": "string", "description": "Empty for service accounts" }, "id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "password": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "tenant": { "$ref": "#/components/schemas/TenantResponse" }, "type": { "$ref": "#/components/schemas/types.UserType" } } }, "CreateWalletRequest": { "required": [ "currency" ], "type": "object", "properties": { "alert_settings": { "$ref": "#/components/schemas/types.AlertSettings" }, "auto_topup": { "$ref": "#/components/schemas/types.AutoTopup" }, "conversion_rate": { "type": "string", "description": "amount in the currency = number of credits * conversion_rate\nex if conversion_rate is 1, then 1 USD = 1 credit\nex if conversion_rate is 2, then 1 USD = 0.5 credits\nex if conversion_rate is 0.5, then 1 USD = 2 credits", "default": "1" }, "currency": { "type": "string" }, "customer_id": { "type": "string" }, "description": { "type": "string" }, "external_customer_id": { "type": "string", "description": "external_customer_id is the customer id in the external system" }, "initial_credits_expiry_date_utc": { "type": "string", "description": "initial_credits_expiry_date_utc is the expiry date in UTC timezone (optional to set nil means no expiry)\nex 2025-01-01 00:00:00 UTC" }, "initial_credits_to_load": { "type": "string", "description": "initial_credits_to_load is the number of credits to load to the wallet\nif not provided, the wallet will be created with 0 balance\nNOTE: this is not the amount in the currency, but the number of credits", "default": "0" }, "initial_credits_to_load_expiry_date": { "type": "integer", "description": "initial_credits_to_load_expiry_date YYYYMMDD format in UTC timezone (optional to set nil means no expiry)\nfor ex 20250101 means the credits will expire on 2025-01-01 00:00:00 UTC\nhence they will be available for use until 2024-12-31 23:59:59 UTC" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "price_unit": { "type": "string", "description": "price_unit is the code of the price unit to use for wallet creation\nIf provided, the price unit will be used to set the currency and conversion rate of the wallet:\n- currency: set to price unit's base_currency\n- conversion_rate: set to price unit's conversion_rate" }, "topup_conversion_rate": { "type": "string", "description": "topup_conversion_rate is the conversion rate for the topup to the currency\nex if topup_conversion_rate is 1, then 1 USD = 1 credit\nex if topup_conversion_rate is 2, then 1 USD = 0.5 credits\nex if topup_conversion_rate is 0.5, then 1 USD = 2 credits" }, "wallet_type": { "$ref": "#/components/schemas/types.WalletType" } } }, "CreditGrantApplicationResponse": { "type": "object", "properties": { "application_reason": { "$ref": "#/components/schemas/types.CreditGrantApplicationReason" }, "application_status": { "$ref": "#/components/schemas/types.ApplicationStatus" }, "applied_at": { "type": "string", "format": "date-time" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "credit_grant_id": { "type": "string" }, "credits": { "type": "number" }, "environment_id": { "type": "string" }, "failure_reason": { "type": "string" }, "id": { "type": "string" }, "idempotency_key": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "period_end": { "type": "string", "format": "date-time" }, "period_start": { "type": "string", "format": "date-time" }, "retry_count": { "type": "integer" }, "scheduled_for": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string" }, "subscription_status_at_application": { "$ref": "#/components/schemas/types.SubscriptionStatus" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "CreditGrantResponse": { "type": "object", "properties": { "cadence": { "$ref": "#/components/schemas/types.CreditGrantCadence" }, "conversion_rate": { "type": "string", "description": "amount in the currency = number of credits * conversion_rate\nex if conversion_rate is 1, then 1 USD = 1 credit\nex if conversion_rate is 2, then 1 USD = 0.5 credits\nex if conversion_rate is 0.5, then 1 USD = 2 credits" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "credit_grant_anchor": { "type": "string", "format": "date-time" }, "credits": { "type": "string" }, "end_date": { "type": "string", "format": "date-time" }, "environment_id": { "type": "string" }, "expiration_duration": { "type": "integer" }, "expiration_duration_unit": { "$ref": "#/components/schemas/types.CreditGrantExpiryDurationUnit" }, "expiration_type": { "$ref": "#/components/schemas/types.CreditGrantExpiryType" }, "id": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" }, "period": { "$ref": "#/components/schemas/types.CreditGrantPeriod" }, "period_count": { "type": "integer" }, "plan_id": { "type": "string" }, "priority": { "type": "integer" }, "scope": { "$ref": "#/components/schemas/types.CreditGrantScope" }, "start_date": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string" }, "tenant_id": { "type": "string" }, "topup_conversion_rate": { "type": "string", "description": "topup_conversion_rate is the conversion rate for the topup to the currency\nex if topup_conversion_rate is 1, then 1 USD = 1 credit\nex if topup_conversion_rate is 2, then 1 USD = 0.5 credits\nex if topup_conversion_rate is 0.5, then 1 USD = 2 credits" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "CreditNoteResponse": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "credit_note_number": { "type": "string", "description": "credit_note_number is the unique identifier for credit notes" }, "credit_note_status": { "$ref": "#/components/schemas/types.CreditNoteStatus" }, "credit_note_type": { "$ref": "#/components/schemas/types.CreditNoteType" }, "currency": { "type": "string", "description": "currency is the three-letter ISO currency code (e.g., USD, EUR) for the credit note" }, "customer": { "$ref": "#/components/schemas/Customer" }, "customer_id": { "type": "string", "description": "customer_id is the unique identifier of the customer who owns this credit note" }, "environment_id": { "type": "string", "description": "environment_id is the unique identifier of the environment this credit note belongs to" }, "finalized_at": { "type": "string", "description": "finalized_at is the timestamp when the credit note was finalized", "format": "date-time" }, "id": { "type": "string", "description": "id is the unique identifier for the credit note" }, "idempotency_key": { "type": "string", "description": "idempotency_key is an optional key used to prevent duplicate credit note creation" }, "invoice": { "$ref": "#/components/schemas/InvoiceResponse" }, "invoice_id": { "type": "string", "description": "invoice_id is the id of the invoice resource that this credit note is applied to" }, "line_items": { "type": "array", "description": "line_items contains all of the line items associated with this credit note", "items": { "$ref": "#/components/schemas/creditnote.CreditNoteLineItem" } }, "memo": { "type": "string", "description": "memo is an optional memo supplied on the credit note" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "reason": { "$ref": "#/components/schemas/types.CreditNoteReason" }, "refund_status": { "$ref": "#/components/schemas/types.PaymentStatus" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription": { "$ref": "#/components/schemas/SubscriptionResponse" }, "subscription_id": { "type": "string", "description": "subscription_id is the optional unique identifier of the subscription related to this credit note" }, "tenant_id": { "type": "string" }, "total_amount": { "type": "string", "description": "total_amount is the total including creditable invoice-level discounts or minimums, and tax" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" }, "voided_at": { "type": "string", "description": "voided_at is the timestamp when the credit note was voided", "format": "date-time" } } }, "CustomAnalyticItem": { "type": "object", "properties": { "feature_name": { "type": "string", "description": "Name of the feature this applies to" }, "id": { "type": "string" }, "name": { "type": "string", "description": "Calculation name (e.g., \"Revenue per Minute\")" }, "type": { "type": "string", "description": "\"feature\", \"meter\", \"event_name\"" }, "value": { "type": "string" } } }, "CustomerEntitlementsResponse": { "type": "object", "properties": { "customer_id": { "type": "string" }, "features": { "type": "array", "items": { "$ref": "#/components/schemas/AggregatedFeature" } }, "subscriptions": { "type": "array", "items": { "$ref": "#/components/schemas/SubscriptionResponse" } } } }, "CustomerInvoiceSummary": { "type": "object", "properties": { "currency": { "type": "string", "description": "currency is the three-letter ISO currency code for this summary" }, "customer_id": { "type": "string", "description": "customer_id is the unique identifier of the customer" }, "overdue_invoice_count": { "type": "integer", "description": "overdue_invoice_count is the number of overdue invoices for this customer in this currency" }, "total_invoice_count": { "type": "integer", "description": "total_invoice_count is the total number of invoices for this customer in this currency" }, "total_overdue_amount": { "type": "string", "description": "total_overdue_amount is the total amount of overdue invoices in this currency" }, "total_revenue_amount": { "type": "string", "description": "total_revenue_amount is the total revenue generated from this customer in this currency" }, "total_unpaid_amount": { "type": "string", "description": "total_unpaid_amount is the total amount of unpaid invoices in this currency" }, "unpaid_fixed_charges": { "type": "string", "description": "unpaid_fixed_charges is the total amount of unpaid fixed charges in this currency" }, "unpaid_invoice_count": { "type": "integer", "description": "unpaid_invoice_count is the number of unpaid invoices for this customer in this currency" }, "unpaid_usage_charges": { "type": "string", "description": "unpaid_usage_charges is the total amount of unpaid usage-based charges in this currency" } } }, "CustomerLookupResult": { "type": "object", "properties": { "customer": { "$ref": "#/components/schemas/Customer" }, "error": { "$ref": "#/components/schemas/errors.ErrorResponse" }, "status": { "$ref": "#/components/schemas/types.DebugTrackerStatus" } } }, "CustomerMultiCurrencyInvoiceSummary": { "type": "object", "properties": { "customer_id": { "type": "string", "description": "customer_id is the unique identifier of the customer" }, "default_currency": { "type": "string", "description": "default_currency is the primary currency for this customer" }, "summaries": { "type": "array", "description": "summaries contains the invoice summaries for each currency", "items": { "$ref": "#/components/schemas/CustomerInvoiceSummary" } } } }, "CustomerResponse": { "type": "object", "properties": { "address_city": { "type": "string", "description": "AddressCity is the city of the customer's address" }, "address_country": { "type": "string", "description": "AddressCountry is the country of the customer's address (ISO 3166-1 alpha-2)" }, "address_line1": { "type": "string", "description": "AddressLine1 is the first line of the customer's address" }, "address_line2": { "type": "string", "description": "AddressLine2 is the second line of the customer's address" }, "address_postal_code": { "type": "string", "description": "AddressPostalCode is the postal code of the customer's address" }, "address_state": { "type": "string", "description": "AddressState is the state of the customer's address" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "email": { "type": "string", "description": "Email is the email of the customer" }, "environment_id": { "type": "string", "description": "EnvironmentID is the environment identifier for the customer" }, "external_id": { "type": "string", "description": "ExternalID is the external identifier for the customer" }, "id": { "type": "string", "description": "ID is the unique identifier for the customer" }, "integrations": { "type": "array", "items": { "$ref": "#/components/schemas/EntityIntegrationMappingResponse" } }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Metadata" }, "name": { "type": "string", "description": "Name is the name of the customer" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "timezone": { "type": "string", "description": "Timezone is the customer's IANA timezone name (e.g. \"Asia/Kolkata\").\nDefaults to \"UTC\". Inherited by subscriptions at creation time." }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } }, "description": "Customer response object containing all customer information" }, "CustomerUsageSummaryResponse": { "type": "object", "properties": { "customer_id": { "type": "string" }, "features": { "type": "array", "items": { "$ref": "#/components/schemas/FeatureUsageSummary" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" }, "period": { "$ref": "#/components/schemas/BillingPeriodInfo" } } }, "DebugTracker": { "type": "object", "properties": { "attributed_to_customer": { "$ref": "#/components/schemas/AttributedToCustomerResult" }, "customer_lookup": { "$ref": "#/components/schemas/CustomerLookupResult" }, "failure_point": { "$ref": "#/components/schemas/types.FailurePoint" }, "meter_matching": { "$ref": "#/components/schemas/MeterMatchingResult" }, "price_lookup": { "$ref": "#/components/schemas/PriceLookupResult" }, "subscription_line_item_lookup": { "$ref": "#/components/schemas/SubscriptionLineItemLookupResult" } } }, "DeleteCostsheetResponse": { "type": "object", "properties": { "id": { "type": "string" }, "message": { "type": "string" } } }, "DeleteCreditGrantRequest": { "type": "object", "properties": { "effective_date": { "type": "string", "description": "EffectiveDate is optional; when set (subscription scope) the grant end date is set to this time.", "format": "date-time" } } }, "DeletePriceRequest": { "type": "object", "properties": { "end_date": { "type": "string", "format": "date-time" } } }, "DeleteSubscriptionLineItemRequest": { "type": "object", "properties": { "effective_from": { "type": "string" }, "proration_behavior": { "$ref": "#/components/schemas/types.ProrationBehavior" } } }, "DelinkIntegrationMappingRequest": { "required": [ "entity_id", "entity_type", "provider_type" ], "type": "object", "properties": { "entity_id": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.IntegrationEntityType" }, "provider_type": { "type": "string" } } }, "EntitlementResponse": { "type": "object", "properties": { "addon": { "$ref": "#/components/schemas/AddonResponse" }, "config_value": { "type": "object", "additionalProperties": true }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "display_order": { "type": "integer" }, "end_date": { "type": "string", "format": "date-time" }, "entity_id": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.EntitlementEntityType" }, "environment_id": { "type": "string" }, "feature": { "$ref": "#/components/schemas/FeatureResponse" }, "feature_id": { "type": "string" }, "feature_type": { "$ref": "#/components/schemas/types.FeatureType" }, "id": { "type": "string" }, "is_enabled": { "type": "boolean" }, "is_soft_limit": { "type": "boolean" }, "parent_entitlement_id": { "type": "string" }, "plan": { "$ref": "#/components/schemas/PlanResponse" }, "plan_id": { "type": "string", "description": "TODO: Remove this once we have a proper entitlement entity type" }, "start_date": { "type": "string", "format": "date-time" }, "static_value": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" }, "usage_limit": { "type": "integer" }, "usage_reset_period": { "$ref": "#/components/schemas/types.EntitlementUsageResetPeriod" } } }, "EntitlementSource": { "type": "object", "properties": { "config_value": { "type": "object", "additionalProperties": true }, "entitlement_id": { "type": "string" }, "entity_id": { "type": "string" }, "entity_name": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/EntitlementSourceEntityType" }, "is_enabled": { "type": "boolean" }, "quantity": { "type": "integer" }, "static_value": { "type": "string" }, "subscription_id": { "type": "string" }, "usage_limit": { "type": "integer" }, "usage_reset_period": { "$ref": "#/components/schemas/types.BillingPeriod" } } }, "EntitlementSourceEntityType": { "type": "string", "enum": [ "plan", "addon", "subscription" ], "x-enum-varnames": [ "EntitlementSourceEntityTypePlan", "EntitlementSourceEntityTypeAddon", "EntitlementSourceEntityTypeSubscription" ] }, "EntityIntegrationMappingResponse": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "entity_id": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.IntegrationEntityType" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true }, "provider_entity_id": { "type": "string" }, "provider_type": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "Event": { "type": "object", "properties": { "customer_id": { "type": "string" }, "environment_id": { "type": "string" }, "event_name": { "type": "string" }, "external_customer_id": { "type": "string" }, "id": { "type": "string" }, "properties": { "type": "object", "additionalProperties": true }, "source": { "type": "string" }, "timestamp": { "type": "string" } } }, "EventCostInfo": { "type": "object", "properties": { "costNanoUsd": { "type": "string" }, "requestId": { "type": "string" } } }, "ExecuteSubscriptionModifyRequest": { "required": [ "type" ], "type": "object", "properties": { "coupon_params": { "$ref": "#/components/schemas/SubModifyCouponParams" }, "grouped_invoicing_params": { "$ref": "#/components/schemas/SubModifyGroupedInvoicingParams" }, "inheritance_params": { "$ref": "#/components/schemas/SubModifyInheritanceRequest" }, "quantity_change_params": { "$ref": "#/components/schemas/SubModifyQuantityChangeRequest" }, "tax_params": { "$ref": "#/components/schemas/SubModifyTaxParams" }, "trial_end_params": { "$ref": "#/components/schemas/SubModifyTrialEndRequest" }, "type": { "$ref": "#/components/schemas/SubscriptionModifyType" } } }, "FeatureResponse": { "type": "object", "properties": { "alert_settings": { "$ref": "#/components/schemas/types.AlertSettings" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "description": { "type": "string" }, "environment_id": { "type": "string" }, "group": { "$ref": "#/components/schemas/GroupResponse" }, "group_id": { "type": "string" }, "id": { "type": "string" }, "lookup_key": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "meter": { "$ref": "#/components/schemas/MeterResponse" }, "meter_id": { "type": "string" }, "name": { "type": "string" }, "reporting_unit": { "$ref": "#/components/schemas/types.ReportingUnit" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "type": { "$ref": "#/components/schemas/types.FeatureType" }, "unit_plural": { "type": "string" }, "unit_singular": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "FeatureUsageInfo": { "type": "object", "properties": { "customer_id": { "type": "string" }, "feature_id": { "type": "string" }, "meter_id": { "type": "string" }, "price_id": { "type": "string" }, "processed_at": { "type": "string", "format": "date-time" }, "qty_total": { "type": "string" }, "sub_line_item_id": { "type": "string" }, "subscription_id": { "type": "string" } } }, "FeatureUsageSummary": { "type": "object", "properties": { "current_usage": { "type": "string" }, "feature": { "$ref": "#/components/schemas/FeatureResponse" }, "is_enabled": { "type": "boolean" }, "is_soft_limit": { "type": "boolean" }, "is_unlimited": { "type": "boolean" }, "next_usage_reset_at": { "type": "string", "format": "date-time" }, "sources": { "type": "array", "items": { "$ref": "#/components/schemas/EntitlementSource" } }, "total_limit": { "type": "integer" }, "usage_percent": { "type": "string" } } }, "GetCostAnalyticsRequest": { "type": "object", "properties": { "end_time": { "type": "string", "format": "date-time" }, "expand": { "type": "array", "description": "Expand options - specify which entities to expand", "items": { "type": "string" } }, "external_customer_id": { "type": "string", "description": "Optional - for specific customer" }, "feature_ids": { "type": "array", "description": "Additional filters", "items": { "type": "string" } }, "limit": { "type": "integer", "description": "Pagination" }, "offset": { "type": "integer" }, "start_time": { "type": "string", "description": "Time range fields (optional - defaults to last 7 days if not provided)", "format": "date-time" } } }, "GetCostsheetResponse": { "type": "object", "properties": { "costsheet": { "$ref": "#/components/schemas/CostsheetResponse" } } }, "GetDetailedCostAnalyticsResponse": { "type": "object", "properties": { "cost_analytics": { "type": "array", "description": "Cost analytics array (flattened from nested structure)", "items": { "$ref": "#/components/schemas/CostAnalyticItem" } }, "currency": { "type": "string" }, "end_time": { "type": "string", "format": "date-time" }, "margin": { "type": "string", "description": "Revenue - Cost" }, "margin_percent": { "type": "string", "description": "(Margin / Revenue) * 100" }, "roi": { "type": "string", "description": "(Revenue - Cost) / Cost" }, "roi_percent": { "type": "string", "description": "ROI * 100" }, "start_time": { "type": "string", "format": "date-time" }, "total_cost": { "type": "string" }, "total_revenue": { "type": "string", "description": "Derived metrics" } } }, "GetEventByIDResponse": { "type": "object", "properties": { "debug_tracker": { "$ref": "#/components/schemas/DebugTracker" }, "event": { "$ref": "#/components/schemas/Event" }, "processed_events": { "type": "array", "items": { "$ref": "#/components/schemas/FeatureUsageInfo" } }, "status": { "$ref": "#/components/schemas/types.EventProcessingStatusType" } } }, "GetEventsRequest": { "type": "object", "properties": { "end_time": { "type": "string", "description": "End time of the events to be fetched in ISO 8601 format\nDefaults to now if not provided", "example": "2024-12-09T00:00:00Z", "format": "date-time" }, "event_id": { "type": "string", "description": "Event ID is the idempotency key for the event" }, "event_name": { "type": "string", "description": "Event name / Unique identifier for the event in your system" }, "external_customer_id": { "type": "string", "description": "Customer ID in your system that was sent with the event" }, "iter_first_key": { "type": "string", "description": "First key to iterate over the events" }, "iter_last_key": { "type": "string", "description": "Last key to iterate over the events" }, "offset": { "type": "integer", "description": "Offset to fetch the events and is set to 0 by default" }, "order": { "type": "string", "description": "Order by condition. Allowed values (case sensitive): asc, desc (default: desc)", "example": "desc" }, "page_size": { "type": "integer", "description": "Page size to fetch the events and is set to 50 by default" }, "property_filters": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } }, "description": "Property filters to filter the events by the keys in `properties` field of the event" }, "sort": { "type": "string", "description": "Sort by the field. Allowed values (case sensitive): timestamp, event_name (default: timestamp)", "example": "timestamp" }, "source": { "type": "string", "description": "Source to filter the events by the source" }, "start_time": { "type": "string", "description": "Start time of the events to be fetched in ISO 8601 format\nDefaults to last 7 days from now if not provided", "example": "2024-11-09T00:00:00Z", "format": "date-time" } } }, "GetEventsResponse": { "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/components/schemas/Event" } }, "has_more": { "type": "boolean" }, "iter_first_key": { "type": "string" }, "iter_last_key": { "type": "string" }, "offset": { "type": "integer" }, "total_count": { "type": "integer" } } }, "GetHuggingFaceBillingDataResponse": { "type": "object", "properties": { "requests": { "type": "array", "items": { "$ref": "#/components/schemas/EventCostInfo" } } } }, "GetPendingSchedulesResponse": { "type": "object", "properties": { "count": { "type": "integer", "description": "count is the number of pending schedules" }, "schedules": { "type": "array", "description": "schedules is the list of pending schedules", "items": { "$ref": "#/components/schemas/SubscriptionScheduleResponse" } } }, "description": "List of pending schedules for a subscription" }, "GetPreviewInvoiceRequest": { "required": [ "subscription_id" ], "type": "object", "properties": { "hide_zero_charges_line_items": { "type": "boolean", "description": "hide_zero_charges_line_items indicates whether to hide line items with zero cost", "default": false }, "period_end": { "type": "string", "description": "period_end is the optional end date of the period to preview", "format": "date-time" }, "period_start": { "type": "string", "description": "period_start is the optional start date of the period to preview", "format": "date-time" }, "subscription_id": { "type": "string", "description": "subscription_id is the unique identifier of the subscription to preview invoice for" } } }, "GetUsageAnalyticsRequest": { "type": "object", "properties": { "breakdown_bucket": { "type": "boolean", "description": "BreakdownBucket when true augments each time-series point with BucketID/PriceID\nand appends a BucketSummaries rollup to each item. Requires WindowSize to be set\nand the item to be linked to a subscription line item that has CommitmentTimeBuckets.\nDefault: false (opt-in, backward compatible)." }, "end_time": { "type": "string", "format": "date-time" }, "expand": { "type": "array", "description": "allowed values: \"price\", \"meter\", \"feature\", \"subscription_line_item\",\"plan\",\"addon\"", "items": { "type": "string" } }, "external_customer_id": { "type": "string", "description": "ExternalCustomerID is the single external customer ID.\nOptional when ExternalCustomerIDs is provided; required otherwise." }, "feature_ids": { "type": "array", "items": { "type": "string" } }, "group_by": { "type": "array", "description": "allowed values: \"source\", \"feature_id\", \"properties.\"", "items": { "type": "string" } }, "include_children": { "type": "boolean", "description": "IncludeChildren when true folds child customers' usage into the single aggregated total.\nDefault: false." }, "property_filters": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } }, "description": "Property filters to filter the events by the keys in `properties` field of the event" }, "sources": { "type": "array", "items": { "type": "string" } }, "start_time": { "type": "string", "format": "date-time" }, "window_size": { "$ref": "#/components/schemas/types.WindowSize" } } }, "GetUsageAnalyticsResponse": { "type": "object", "properties": { "currency": { "type": "string" }, "custom_analytics": { "type": "array", "items": { "$ref": "#/components/schemas/CustomAnalyticItem" } }, "items": { "type": "array", "items": { "$ref": "#/components/schemas/UsageAnalyticItem" } }, "subtotal": { "type": "string" }, "total_cost": { "type": "string", "description": "TotalCost is the final cost after discount (Subtotal - TotalDiscount)" }, "total_discount": { "type": "string" } } }, "GetUsageByMeterRequest": { "required": [ "meter_id" ], "type": "object", "properties": { "billing_anchor": { "type": "string", "description": "BillingAnchor enables custom monthly billing periods for meter usage aggregation.\n\nUsage guidelines:\n- Only effective when WindowSize = \"MONTH\"\n- For other window sizes (DAY, HOUR, WEEK), this field is ignored\n- When nil, uses standard calendar months (1st to 1st)\n- When provided, creates custom monthly periods (e.g., 5th to 5th)\n\nCommon use cases:\n- Subscription billing periods that don't align with calendar months\n- Customer-specific billing cycles (e.g., signed up on 15th)\n- Multi-tenant systems with different billing anchor dates\n\nExample: If BillingAnchor = \"2024-03-05T14:30:45Z\" and WindowSize = \"MONTH\":\n - March period: 2024-03-05 14:30:45 to 2024-04-05 14:30:45\n - April period: 2024-04-05 14:30:45 to 2024-05-05 14:30:45", "example": "2024-03-05T14:30:45Z", "format": "date-time" }, "bucket_size": { "$ref": "#/components/schemas/types.WindowSize" }, "customer_id": { "type": "string", "example": "customer456" }, "end_time": { "type": "string", "example": "2024-12-09T00:00:00Z", "format": "date-time" }, "external_customer_id": { "type": "string", "example": "user_5" }, "filters": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "meter_id": { "type": "string", "example": "123" }, "start_time": { "type": "string", "example": "2024-11-09T00:00:00Z", "format": "date-time" }, "timezone": { "type": "string" }, "window_size": { "$ref": "#/components/schemas/types.WindowSize" } } }, "GetUsageBySubscriptionRequest": { "required": [ "subscription_id" ], "type": "object", "properties": { "end_time": { "type": "string", "example": "2024-03-20T00:00:00Z", "format": "date-time" }, "lifetime_usage": { "type": "boolean", "example": false }, "start_time": { "type": "string", "example": "2024-03-13T00:00:00Z", "format": "date-time" }, "subscription_id": { "type": "string", "example": "123" } } }, "GetUsageBySubscriptionResponse": { "type": "object", "properties": { "amount": { "type": "number" }, "charges": { "type": "array", "items": { "$ref": "#/components/schemas/SubscriptionUsageByMetersResponse" } }, "commitment_amount": { "type": "number" }, "commitment_utilized": { "type": "number", "description": "Amount of commitment used" }, "currency": { "type": "string" }, "display_amount": { "type": "string" }, "end_time": { "type": "string", "format": "date-time" }, "has_overage": { "type": "boolean", "description": "Whether any usage exceeded commitment" }, "overage_amount": { "type": "number", "description": "Amount charged at overage rate" }, "overage_factor": { "type": "number" }, "start_time": { "type": "string", "format": "date-time" } } }, "GetUsageRequest": { "required": [ "aggregation_type", "event_name" ], "type": "object", "properties": { "aggregation_type": { "$ref": "#/components/schemas/types.AggregationType" }, "billing_anchor": { "type": "string", "description": "BillingAnchor enables custom monthly billing periods for usage aggregation.\n\nWhen to use:\n- WindowSize = \"MONTH\" AND you need custom monthly periods (not calendar months)\n- Subscription billing that doesn't align with calendar months\n- Example: Customer signed up on 15th, so billing periods are 15th to 15th\n\nWhen NOT to use:\n- WindowSize != \"MONTH\" (ignored for DAY, HOUR, WEEK, etc.)\n- Standard calendar-based billing (1st to 1st of each month)\n\nExample values:\n- \"2024-03-05T14:30:45.123456789Z\" (5th of each month at 2:30:45 PM)\n- \"2024-01-15T00:00:00Z\" (15th of each month at midnight)\n- \"2024-02-29T12:00:00Z\" (29th of each month at noon - handles leap years)", "example": "2024-03-05T14:30:45.123456789Z", "format": "date-time" }, "bucket_size": { "$ref": "#/components/schemas/types.WindowSize" }, "customer_id": { "type": "string", "example": "customer456" }, "end_time": { "type": "string", "example": "2024-03-20T00:00:00Z", "format": "date-time" }, "event_name": { "type": "string", "example": "api_request" }, "external_customer_id": { "type": "string", "example": "customer456" }, "filters": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "group_by": { "type": "array", "description": "GroupBy lists the analytics group_by dimensions.\n - \"source\" — group by event source column\n - \"properties.X\" — group by JSON property X", "items": { "type": "string" } }, "group_by_property": { "type": "string", "description": "GroupByProperty is the property name in event.properties to group by before aggregating.\nWhen set, aggregation is applied per unique value of this property within each bucket,\nthen the per-group results are summed to produce the bucket total.\n\nDeprecated: prefer GroupBy []string{\"properties.\"} for parity with\nother analytics endpoints. ToUsageParams translates this field into\nGroupBy when GroupBy is otherwise empty." }, "multiplier": { "type": "string" }, "property_name": { "type": "string", "description": "will be empty/ignored in case of COUNT", "example": "request_size" }, "start_time": { "type": "string", "example": "2024-03-13T00:00:00Z", "format": "date-time" }, "timezone": { "type": "string" }, "window_size": { "$ref": "#/components/schemas/types.WindowSize" } } }, "GetUsageResponse": { "type": "object", "properties": { "event_name": { "type": "string" }, "results": { "type": "array", "items": { "$ref": "#/components/schemas/UsageResult" } }, "type": { "$ref": "#/components/schemas/types.AggregationType" }, "value": { "type": "number" } } }, "GroupResponse": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "entity_ids": { "type": "array", "items": { "type": "string" } }, "entity_type": { "type": "string" }, "id": { "type": "string" }, "lookup_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "status": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" } } }, "GroupedInvoicingAction": { "type": "string", "enum": [ "add", "remove" ], "x-enum-varnames": [ "GroupedInvoicingActionAdd", "GroupedInvoicingActionRemove" ] }, "IngestEventRequest": { "required": [ "event_name", "external_customer_id" ], "type": "object", "properties": { "customer_id": { "type": "string", "example": "customer456" }, "event_id": { "type": "string", "example": "event123" }, "event_name": { "type": "string", "example": "api_request" }, "external_customer_id": { "type": "string", "example": "customer456" }, "properties": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Handled separately for dynamic columns", "example": { "\"response_status\"": "200}", "{\"request_size\"": "100" } }, "source": { "type": "string", "example": "api" }, "timestamp": { "type": "string", "description": "Handled separately due to parsing", "example": "2024-03-20T15:04:05Z" } } }, "InheritanceAction": { "type": "string", "enum": [ "add", "remove" ], "x-enum-varnames": [ "InheritanceActionAdd", "InheritanceActionRemove" ] }, "IntegrationConfigEntry": { "type": "object", "properties": { "base_config": { "$ref": "#/components/schemas/types.SyncConfig" }, "current_config": { "$ref": "#/components/schemas/types.SyncConfig" }, "provider": { "$ref": "#/components/schemas/types.SecretProvider" } } }, "IntegrationConfigResponse": { "type": "object", "properties": { "integrations": { "type": "array", "items": { "$ref": "#/components/schemas/IntegrationConfigEntry" } } } }, "InvoiceCoupon": { "required": [ "coupon_id" ], "type": "object", "properties": { "coupon_association_id": { "type": "string" }, "coupon_id": { "type": "string" } } }, "InvoiceLineItemCoupon": { "required": [ "coupon_id", "line_item_id" ], "type": "object", "properties": { "coupon_association_id": { "type": "string" }, "coupon_id": { "type": "string" }, "line_item_id": { "type": "string", "description": "price_id used to match the line item" } } }, "InvoiceLineItemPreview": { "type": "object", "properties": { "amount": { "type": "string", "description": "amount for this line item" }, "description": { "type": "string", "description": "description of the line item" }, "is_proration": { "type": "boolean", "description": "is_proration indicates if this line item is a proration" }, "period_end": { "type": "string", "description": "period_end for this line item (if applicable)", "format": "date-time" }, "period_start": { "type": "string", "description": "period_start for this line item (if applicable)", "format": "date-time" }, "quantity": { "type": "string", "description": "quantity for this line item" }, "unit_price": { "type": "string", "description": "unit_price for this line item" } } }, "InvoiceLineItemResponse": { "type": "object", "properties": { "adjusted_entitlement_quantity": { "type": "string", "description": "adjusted_entitlement_quantity is the entitlement-covered portion deducted from raw usage.\nNil when no entitlement was applied. Raw usage = Quantity + AdjustedEntitlementQuantity." }, "amount": { "type": "string" }, "commitment_info": { "$ref": "#/components/schemas/types.CommitmentInfo" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string" }, "customer_id": { "type": "string" }, "display_name": { "type": "string" }, "entity_id": { "type": "string" }, "entity_type": { "type": "string" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "invoice_id": { "type": "string" }, "invoice_level_discount": { "type": "string", "description": "invoice_level_discount is the discount amount in invoice currency applied to all line items on the invoice." }, "line_item_discount": { "type": "string", "description": "line_item_discount is the discount amount in invoice currency applied directly to this line item." }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "meter_display_name": { "type": "string" }, "meter_id": { "type": "string" }, "period_end": { "type": "string", "format": "date-time" }, "period_start": { "type": "string", "format": "date-time" }, "plan_display_name": { "type": "string" }, "prepaid_credits_applied": { "type": "string", "description": "prepaid_credits_applied is the amount in invoice currency reduced from this line item due to prepaid credits application." }, "price_id": { "type": "string" }, "price_type": { "type": "string" }, "price_unit": { "type": "string" }, "price_unit_amount": { "type": "string" }, "price_unit_id": { "type": "string" }, "quantity": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string" }, "subscription_line_item_id": { "type": "string", "description": "sub_line_item_id links this invoice line item to the subscription_line_item that generated it." }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" }, "usage_analytics": { "type": "array", "description": "usage_analytics contains usage analytics for this line item (legacy - grouped by source)", "items": { "$ref": "#/components/schemas/SourceUsageItem" } }, "usage_breakdown": { "type": "array", "description": "usage_breakdown contains flexible usage breakdown for this line item (supports any grouping)", "items": { "$ref": "#/components/schemas/UsageBreakdownItem" } } } }, "InvoicePreview": { "type": "object", "properties": { "currency": { "type": "string", "description": "currency is the currency for all amounts" }, "due_date": { "type": "string", "description": "due_date is when the invoice would be due", "format": "date-time" }, "line_items": { "type": "array", "description": "line_items contains preview of line items", "items": { "$ref": "#/components/schemas/InvoiceLineItemPreview" } }, "subtotal": { "type": "string", "description": "subtotal is the subtotal amount before taxes" }, "tax_amount": { "type": "string", "description": "tax_amount is the total tax amount" }, "total": { "type": "string", "description": "total is the total amount including taxes" } } }, "InvoiceResponse": { "type": "object", "properties": { "adjustment_amount": { "type": "string", "description": "adjustment_amount is the total sum of credit notes of type \"adjustment\".\nThese are non-cash reductions applied to the invoice (e.g. goodwill credit, billing correction)." }, "amount_due": { "type": "string", "description": "amount_due is the total amount that needs to be paid for this invoice" }, "amount_paid": { "type": "string", "description": "amount_paid is the amount that has already been paid towards this invoice" }, "amount_remaining": { "type": "string", "description": "amount_remaining is the outstanding amount still owed on this invoice (calculated as amount_due minus amount_paid)" }, "billing_period": { "type": "string", "description": "billing_period describes the billing period this invoice covers (e.g., \"January 2024\", \"Q1 2024\")" }, "billing_reason": { "type": "string", "description": "billing_reason indicates why this invoice was generated (e.g., \"subscription_billing\", \"manual_charge\")" }, "billing_sequence": { "type": "integer", "description": "billing_sequence is the sequential number indicating the billing cycle for subscription invoices" }, "coupon_applications": { "type": "array", "description": "coupon_applications contains the coupon applications associated with this invoice (overrides embedded field)", "items": { "$ref": "#/components/schemas/CouponApplicationResponse" } }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string", "description": "currency is the three-letter ISO currency code (e.g., USD, EUR, GBP) that applies to all monetary amounts on this invoice" }, "customer": { "$ref": "#/components/schemas/CustomerResponse" }, "customer_id": { "type": "string", "description": "customer_id is the ID of the customer who will receive this invoice" }, "description": { "type": "string", "description": "description is an optional description or notes about this invoice" }, "due_date": { "type": "string", "description": "due_date is the date when payment for this invoice is due", "format": "date-time" }, "environment_id": { "type": "string", "description": "environment_id is the ID of the environment this invoice belongs to (for multi-environment setups)" }, "finalized_at": { "type": "string", "description": "finalized_at is the timestamp when this invoice was finalized and made ready for payment", "format": "date-time" }, "id": { "type": "string", "description": "id is the unique identifier for this invoice" }, "idempotency_key": { "type": "string", "description": "idempotency_key is a unique key used to prevent duplicate invoice creation when retrying API calls" }, "invoice_number": { "type": "string", "description": "invoice_number is the human-readable invoice number displayed to customers (e.g., INV-2024-001)" }, "invoice_pdf_url": { "type": "string", "description": "invoice_pdf_url is the URL where customers can download the PDF version of this invoice" }, "invoice_status": { "$ref": "#/components/schemas/types.InvoiceStatus" }, "invoice_type": { "$ref": "#/components/schemas/types.InvoiceType" }, "issue_date": { "type": "string", "description": "issue_date is the user-facing date of the invoice. Defaults to created_at if not set.", "format": "date-time" }, "last_computed_at": { "type": "string", "description": "last_computed_at is the timestamp when this invoice was last computed by ComputeInvoice", "format": "date-time" }, "line_items": { "type": "array", "description": "line_items contains the individual items that make up this invoice (overrides embedded field)", "items": { "$ref": "#/components/schemas/InvoiceLineItemResponse" } }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "overpaid_amount": { "type": "string", "description": "overpaid_amount is the amount overpaid if payment_status is OVERPAID (amount_paid - total)" }, "paid_at": { "type": "string", "description": "paid_at is the timestamp when this invoice was fully paid", "format": "date-time" }, "payment_status": { "$ref": "#/components/schemas/types.PaymentStatus" }, "period_end": { "type": "string", "description": "period_end is the end date of the billing period covered by this invoice", "format": "date-time" }, "period_start": { "type": "string", "description": "period_start is the start date of the billing period covered by this invoice", "format": "date-time" }, "recalculated_invoice_id": { "type": "string", "description": "recalculated_invoice_id is the ID of the replacement invoice created when this invoice was voided and recalculated.\nWhen set, it forms a parent→child link from this (voided) invoice to the new replacement invoice." }, "refunded_amount": { "type": "string", "description": "refunded_amount is the total sum of credit notes of type \"refund\".\nThese are actual refunds issued to the customer." }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription": { "$ref": "#/components/schemas/SubscriptionResponse" }, "subscription_customer_id": { "type": "string", "description": "subscription_customer_id is the subscription owner's customer ID (Subscription.CustomerID).\nIt may differ from customer_id when the subscription uses an invoicing customer. Set internally; nullable in DB." }, "subscription_id": { "type": "string", "description": "subscription_id is the ID of the subscription this invoice is associated with (only present for subscription-based invoices)" }, "subtotal": { "type": "string", "description": "subtotal is the sum of all line items before any taxes, discounts, or additional fees" }, "taxes": { "type": "array", "description": "tax_applied_records contains the tax applied records associated with this invoice", "items": { "$ref": "#/components/schemas/TaxAppliedResponse" } }, "tenant_id": { "type": "string" }, "total": { "type": "string", "description": "total is the final amount including taxes, fees, and discounts" }, "total_discount": { "type": "string", "description": "total_discount is the sum of all coupon discounts applied to the invoice" }, "total_prepaid_credits_applied": { "type": "string", "description": "total_prepaid_credits_applied is the total amount of prepaid credits applied to this invoice." }, "total_tax": { "type": "string", "description": "total_tax is the sum of all taxes combined at the invoice level." }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" }, "version": { "type": "integer", "description": "version is the version number for tracking changes to this invoice" }, "voided_at": { "type": "string", "description": "voided_at is the timestamp when this invoice was voided or cancelled", "format": "date-time" } } }, "LineItemCommitmentConfig": { "type": "object", "properties": { "commitment_amount": { "type": "number", "description": "CommitmentAmount is the minimum amount committed for this line item" }, "commitment_duration": { "$ref": "#/components/schemas/types.BillingPeriod" }, "commitment_quantity": { "type": "number", "description": "CommitmentQuantity is the minimum quantity committed for this line item" }, "commitment_time_buckets": { "type": "array", "description": "CommitmentTimeBuckets defines per-bucket commitment + inline price for\nwindows whose start UTC hour falls within each configured bucket. Each\nbucket carries its own price (materialized by the service). Requires\nIsWindowCommitment=true.", "items": { "$ref": "#/components/schemas/CommitmentBucketRequest" } }, "commitment_type": { "$ref": "#/components/schemas/types.CommitmentType" }, "enable_true_up": { "type": "boolean", "description": "EnableTrueUp determines if true-up fee should be applied when usage is below commitment" }, "is_window_commitment": { "type": "boolean", "description": "IsWindowCommitment determines if commitment is applied per window (e.g., per day) rather than per billing period" }, "overage_factor": { "type": "number", "description": "OverageFactor is a multiplier applied to usage beyond the commitment" } } }, "LineItemQuantityChange": { "required": [ "id", "quantity" ], "type": "object", "properties": { "effective_date": { "type": "string", "description": "EffectiveDate is when the quantity change takes effect.\nIf omitted, the change is effective immediately (now).", "format": "date-time" }, "id": { "type": "string" }, "quantity": { "type": "string" } } }, "LinkIntegrationMappingRequest": { "required": [ "entity_id", "entity_type", "provider_entity_id", "provider_type" ], "type": "object", "properties": { "entity_id": { "maxLength": 255, "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.IntegrationEntityType" }, "metadata": { "type": "object", "additionalProperties": true }, "provider_entity_id": { "maxLength": 255, "type": "string" }, "provider_type": { "maxLength": 50, "type": "string" } } }, "LinkIntegrationMappingResponse": { "type": "object", "properties": { "mapping": { "$ref": "#/components/schemas/EntityIntegrationMappingResponse" } } }, "ListAlertLogsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/AlertLogResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListCostsheetResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/CostsheetResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListCouponAssociationsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/CouponAssociationResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListEntityIntegrationMappingsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/EntityIntegrationMappingResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListPaymentsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/PaymentResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListSecretsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/SecretResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "ListTasksResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/TaskResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } } }, "MatchedMeter": { "type": "object", "properties": { "event_name": { "type": "string" }, "meter": { "$ref": "#/components/schemas/meter.Meter" }, "meter_id": { "type": "string" } } }, "MatchedPrice": { "type": "object", "properties": { "meter_id": { "type": "string" }, "price": { "$ref": "#/components/schemas/price.Price" }, "price_id": { "type": "string" }, "status": { "type": "string" } } }, "MatchedSubscriptionLineItem": { "type": "object", "properties": { "end_date": { "type": "string", "format": "date-time" }, "is_active_for_event": { "type": "boolean" }, "price_id": { "type": "string" }, "start_date": { "type": "string", "format": "date-time" }, "sub_line_item_id": { "type": "string" }, "subscription_id": { "type": "string" }, "subscription_line_item": { "$ref": "#/components/schemas/subscription.SubscriptionLineItem" }, "timestamp_within_range": { "type": "boolean" } } }, "MeterMatchingResult": { "type": "object", "properties": { "error": { "$ref": "#/components/schemas/errors.ErrorResponse" }, "matched_meters": { "type": "array", "items": { "$ref": "#/components/schemas/MatchedMeter" } }, "status": { "$ref": "#/components/schemas/types.DebugTrackerStatus" } } }, "MeterResponse": { "type": "object", "properties": { "aggregation": { "$ref": "#/components/schemas/meter.Aggregation" }, "created_at": { "type": "string", "example": "2024-03-20T15:04:05Z", "format": "date-time" }, "event_name": { "type": "string", "example": "api_request" }, "filters": { "type": "array", "items": { "$ref": "#/components/schemas/meter.Filter" } }, "id": { "type": "string", "example": "550e8400-e29b-41d4-a716-446655440000" }, "name": { "type": "string", "example": "API Usage Meter" }, "reset_usage": { "$ref": "#/components/schemas/types.ResetUsage" }, "status": { "type": "string", "example": "published" }, "tenant_id": { "type": "string", "example": "tenant123" }, "updated_at": { "type": "string", "example": "2024-03-20T15:04:05Z", "format": "date-time" } } }, "MeterUsageAttribution": { "type": "object", "properties": { "external_customer_id": { "type": "string" }, "meter_id": { "type": "string" }, "qty_total": { "type": "string" } } }, "OverrideEntitlementRequest": { "required": [ "entitlement_id" ], "type": "object", "properties": { "config_value": { "type": "object", "additionalProperties": true, "description": "ConfigValue is the config value for config features" }, "entitlement_id": { "type": "string", "description": "EntitlementID references the plan/addon entitlement to override" }, "is_enabled": { "type": "boolean", "description": "IsEnabled determines if the entitlement is enabled or disabled" }, "static_value": { "type": "string", "description": "StaticValue is the static value for static features" }, "usage_limit": { "type": "integer", "description": "UsageLimit is the new usage limit (only these 3 fields can be overridden)\nFor metered features, nil means unlimited usage" } } }, "OverrideLineItemRequest": { "required": [ "price_id" ], "type": "object", "properties": { "amount": { "type": "string", "description": "Amount is the new price amount that overrides the original price (optional)" }, "billing_model": { "$ref": "#/components/schemas/types.BillingModel" }, "price_id": { "type": "string", "description": "PriceID references the plan price to override" }, "price_unit_amount": { "type": "string", "description": "PriceUnitAmount is the amount of the price unit (for CUSTOM type, FLAT_FEE/PACKAGE billing models)" }, "price_unit_tiers": { "type": "array", "description": "PriceUnitTiers are the tiers for the price unit (for CUSTOM type, TIERED billing model)", "items": { "$ref": "#/components/schemas/CreatePriceTier" } }, "quantity": { "type": "string", "description": "Quantity for this line item (optional)" }, "tier_mode": { "$ref": "#/components/schemas/types.BillingTier" }, "tiers": { "type": "array", "description": "Tiers determines the pricing tiers for this line item", "items": { "$ref": "#/components/schemas/CreatePriceTier" } }, "transform_quantity": { "$ref": "#/components/schemas/price.TransformQuantity" } } }, "PaymentAttemptResponse": { "type": "object", "properties": { "attempt_number": { "type": "integer" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "error_message": { "type": "string" }, "id": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "payment_id": { "type": "string" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "PaymentResponse": { "type": "object", "properties": { "amount": { "type": "string" }, "attempts": { "type": "array", "items": { "$ref": "#/components/schemas/PaymentAttemptResponse" } }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string" }, "destination_id": { "type": "string" }, "destination_type": { "$ref": "#/components/schemas/types.PaymentDestinationType" }, "error_message": { "type": "string" }, "failed_at": { "type": "string", "format": "date-time" }, "gateway_metadata": { "$ref": "#/components/schemas/types.Metadata" }, "gateway_payment_id": { "type": "string" }, "gateway_tracking_id": { "type": "string" }, "id": { "type": "string" }, "idempotency_key": { "type": "string" }, "invoice_number": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "payment_gateway": { "type": "string" }, "payment_method_id": { "type": "string" }, "payment_method_type": { "$ref": "#/components/schemas/types.PaymentMethodType" }, "payment_status": { "$ref": "#/components/schemas/types.PaymentStatus" }, "payment_url": { "type": "string" }, "refunded_at": { "type": "string", "format": "date-time" }, "save_card_and_make_default": { "type": "boolean" }, "succeeded_at": { "type": "string", "format": "date-time" }, "tenant_id": { "type": "string" }, "track_attempts": { "type": "boolean" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" }, "voided_at": { "type": "string", "format": "date-time" } } }, "PlanResponse": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "credit_grants": { "type": "array", "items": { "$ref": "#/components/schemas/CreditGrantResponse" } }, "description": { "type": "string" }, "display_order": { "type": "integer" }, "entitlements": { "type": "array", "items": { "$ref": "#/components/schemas/EntitlementResponse" } }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "lookup_key": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" }, "prices": { "type": "array", "description": "TODO: Add inline addons", "items": { "$ref": "#/components/schemas/PriceResponse" } }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "PlanSummary": { "type": "object", "properties": { "description": { "type": "string", "description": "description of the plan" }, "id": { "type": "string", "description": "id of the plan" }, "lookup_key": { "type": "string", "description": "lookup_key of the plan" }, "name": { "type": "string", "description": "name of the plan" } } }, "PointBucket": { "type": "object", "properties": { "bucket_id": { "type": "string" }, "price_id": { "type": "string" } } }, "PriceLookupResult": { "type": "object", "properties": { "error": { "$ref": "#/components/schemas/errors.ErrorResponse" }, "matched_prices": { "type": "array", "items": { "$ref": "#/components/schemas/MatchedPrice" } }, "status": { "$ref": "#/components/schemas/types.DebugTrackerStatus" } } }, "PriceResponse": { "type": "object", "properties": { "addon": { "$ref": "#/components/schemas/AddonResponse" }, "amount": { "type": "string", "description": "Amount stored in main currency units (e.g., dollars, not cents)\nFor USD: 12.50 means $12.50" }, "billing_cadence": { "$ref": "#/components/schemas/types.BillingCadence" }, "billing_model": { "$ref": "#/components/schemas/types.BillingModel" }, "billing_period": { "$ref": "#/components/schemas/types.BillingPeriod" }, "billing_period_count": { "type": "integer", "description": "BillingPeriodCount is the count of the billing period ex 1, 3, 6, 12" }, "conversion_rate": { "type": "string", "description": "ConversionRate is the conversion rate of the price unit to the fiat currency" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string", "description": "Currency 3 digit ISO currency code in lowercase ex usd, eur, gbp" }, "description": { "type": "string", "description": "Description of the price" }, "display_amount": { "type": "string", "description": "DisplayAmount is the formatted amount with currency symbol\nFor USD: $12.50" }, "display_name": { "type": "string", "description": "DisplayName is the name of the price" }, "display_price_unit_amount": { "type": "string", "description": "DisplayPriceUnitAmount is the formatted amount of the price unit" }, "end_date": { "type": "string", "description": "EndDate is the end date of the price", "format": "date-time" }, "entity_id": { "type": "string", "description": "EntityID holds the value of the \"entity_id\" field." }, "entity_type": { "$ref": "#/components/schemas/types.PriceEntityType" }, "environment_id": { "type": "string", "description": "EnvironmentID is the environment identifier for the price" }, "group": { "$ref": "#/components/schemas/GroupResponse" }, "group_id": { "type": "string", "description": "GroupID references the group this price belongs to" }, "id": { "type": "string", "description": "ID uuid identifier for the price" }, "invoice_cadence": { "$ref": "#/components/schemas/types.InvoiceCadence" }, "lookup_key": { "type": "string", "description": "LookupKey used for looking up the price in the database" }, "metadata": { "$ref": "#/components/schemas/price.JSONBMetadata" }, "meter": { "$ref": "#/components/schemas/MeterResponse" }, "meter_id": { "type": "string", "description": "MeterID is the id of the meter for usage based pricing" }, "min_quantity": { "type": "string", "description": "MinQuantity is the minimum quantity of the price", "nullable": true }, "parent_price_id": { "type": "string", "description": "ParentPriceID references the root price (always set for price lineage tracking)" }, "plan": { "$ref": "#/components/schemas/PlanResponse" }, "price_unit": { "type": "string", "description": "PriceUnit is the code of the price unit (e.g., 'btc', 'eth')" }, "price_unit_amount": { "type": "string", "description": "PriceUnitAmount is the amount of the price unit" }, "price_unit_id": { "type": "string", "description": "PriceUnitID is the id of the price unit (for CUSTOM type)" }, "price_unit_tiers": { "type": "array", "description": "PriceUnitTiers are the tiers for the price unit when BillingModel is TIERED", "items": { "$ref": "#/components/schemas/price.PriceTier" } }, "price_unit_type": { "$ref": "#/components/schemas/types.PriceUnitType" }, "pricing_unit": { "$ref": "#/components/schemas/PriceUnitResponse" }, "sequence": { "type": "integer", "description": "Sequence is the monotonic stamp bumped on every state change that\nsubscription line items need to react to. Read by the plan-price sync;\nset by the database (DEFAULT nextval) on create and by the price\nrepository on termination / compatibility-affecting edits." }, "start_date": { "type": "string", "description": "StartDate is the start date of the price", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "tier_mode": { "$ref": "#/components/schemas/types.BillingTier" }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/price.PriceTier" } }, "transform_quantity": { "$ref": "#/components/schemas/price.JSONBTransformQuantity" }, "trial_period_days": { "type": "integer", "description": "TrialPeriodDays is the number of days for the trial period\nNote: This is only applicable for recurring prices (BILLING_CADENCE_RECURRING)" }, "type": { "$ref": "#/components/schemas/types.PriceType" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "PriceUnitConfig": { "required": [ "price_unit" ], "type": "object", "properties": { "amount": { "type": "string" }, "price_unit": { "type": "string" }, "price_unit_tiers": { "type": "array", "items": { "$ref": "#/components/schemas/CreatePriceTier" } } } }, "PriceUnitResponse": { "type": "object", "properties": { "base_currency": { "type": "string" }, "code": { "type": "string" }, "conversion_rate": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "symbol": { "type": "string" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "ProrationDetail": { "type": "object", "properties": { "charge_amount": { "type": "string" }, "credit_amount": { "type": "string" }, "description": { "type": "string" }, "line_item_id": { "type": "string" }, "original_amount": { "type": "string" }, "plan_name": { "type": "string" }, "price_id": { "type": "string" }, "proration_days": { "type": "integer" } } }, "ProrationDetails": { "type": "object", "properties": { "charge_amount": { "type": "string", "description": "charge_amount is the charge amount for the new subscription" }, "charge_description": { "type": "string", "description": "charge_description describes what the charge is for" }, "credit_amount": { "type": "string", "description": "credit_amount is the credit amount from the old subscription" }, "credit_description": { "type": "string", "description": "credit_description describes what the credit is for" }, "currency": { "type": "string", "description": "currency is the currency for all amounts" }, "current_period_end": { "type": "string", "description": "current_period_end is the end of the current billing period", "format": "date-time" }, "current_period_start": { "type": "string", "description": "current_period_start is the start of the current billing period", "format": "date-time" }, "days_remaining": { "type": "integer", "description": "days_remaining is the number of days remaining in the current period" }, "days_used": { "type": "integer", "description": "days_used is the number of days used in the current period" }, "net_amount": { "type": "string", "description": "net_amount is the net amount (charge - credit)" }, "proration_date": { "type": "string", "description": "proration_date is the date used for proration calculations", "format": "date-time" } } }, "RemoveAddonRequest": { "required": [ "addon_association_id" ], "type": "object", "properties": { "addon_association_id": { "type": "string" }, "effective_date": { "type": "string", "description": "EffectiveDate is the date the cancellation takes effect.\nWhen nil the addon is cancelled at the end of the current period.\nWhen provided it must fall within [CurrentPeriodStart, CurrentPeriodEnd]; mid-period\nvalues combined with create_prorations will issue a wallet credit for unused time.", "format": "date-time" }, "proration_behavior": { "$ref": "#/components/schemas/types.ProrationBehavior" }, "reason": { "type": "string" } } }, "ScheduledTaskResponse": { "type": "object", "properties": { "connection_id": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "enabled": { "type": "boolean" }, "entity_type": { "$ref": "#/components/schemas/types.ScheduledTaskEntityType" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "interval": { "$ref": "#/components/schemas/types.ScheduledTaskInterval" }, "job_config": { "$ref": "#/components/schemas/types.S3JobConfig" }, "status": { "type": "string" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" } } }, "SecretResponse": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "display_id": { "type": "string" }, "expires_at": { "type": "string", "format": "date-time" }, "id": { "type": "string" }, "last_used_at": { "type": "string", "format": "date-time" }, "name": { "type": "string" }, "provider": { "$ref": "#/components/schemas/types.SecretProvider" }, "roles": { "type": "array", "description": "RBAC roles", "items": { "type": "string" } }, "service_account_name": { "type": "string", "description": "name of the service account (populated for service_account user_type)" }, "status": { "$ref": "#/components/schemas/types.Status" }, "type": { "$ref": "#/components/schemas/types.SecretType" }, "updated_at": { "type": "string", "format": "date-time" }, "user_id": { "type": "string", "description": "user or service account this key belongs to" }, "user_type": { "$ref": "#/components/schemas/types.UserType" } } }, "SourceUsageItem": { "type": "object", "properties": { "cost": { "type": "string", "description": "cost is the cost attributed to this source for the line item" }, "event_count": { "type": "integer", "description": "event_count is the number of events from this source (optional)" }, "percentage": { "type": "string", "description": "percentage is the percentage of total line item cost from this source (optional)" }, "source": { "type": "string", "description": "source is the name of the event source" }, "usage": { "type": "string", "description": "usage is the total usage amount from this source (optional, for additional context)" } } }, "SubModifyCouponAction": { "type": "string", "enum": [ "add", "remove" ], "x-enum-varnames": [ "SubModifyCouponActionAdd", "SubModifyCouponActionRemove" ] }, "SubModifyCouponParams": { "required": [ "action" ], "type": "object", "properties": { "action": { "$ref": "#/components/schemas/SubModifyCouponAction" }, "coupon_association_id": { "type": "string", "description": "Required when action=\"remove\". ID of the CouponAssociation to soft-delete." }, "coupon_code": { "type": "string", "description": "Required for action=\"add\". Coupon code of the coupon to attach." }, "end_date": { "type": "string", "description": "Optional. When the coupon association ends.", "format": "date-time" }, "start_date": { "type": "string", "description": "Optional. When the coupon association starts; defaults to now.", "format": "date-time" }, "subscription_id": { "type": "string", "description": "Optional. Apply at subscription level. Mutually exclusive with SubscriptionLineItemID." }, "subscription_line_item_id": { "type": "string", "description": "Optional. Apply at a specific line item. Mutually exclusive with SubscriptionID." } } }, "SubModifyGroupedInvoicingParams": { "required": [ "action" ], "type": "object", "properties": { "action": { "$ref": "#/components/schemas/GroupedInvoicingAction" }, "child_subscription_ids": { "type": "array", "items": { "type": "string" } }, "parent_subscription_id": { "type": "string", "description": "ParentSubscriptionID is required for action 'add'." } } }, "SubModifyInheritanceRequest": { "type": "object", "properties": { "action": { "$ref": "#/components/schemas/InheritanceAction" }, "external_customer_ids_to_inherit_subscription": { "type": "array", "description": "ExternalCustomerIDsToInheritSubscription is used for action=\"add\".", "items": { "type": "string" } }, "external_customer_ids_to_remove": { "type": "array", "description": "ExternalCustomerIDsToRemove is used for action=\"remove\".", "items": { "type": "string" } } } }, "SubModifyQuantityChangeRequest": { "required": [ "line_items" ], "type": "object", "properties": { "line_items": { "minItems": 1, "type": "array", "items": { "$ref": "#/components/schemas/LineItemQuantityChange" } } } }, "SubModifyTaxAction": { "type": "string", "enum": [ "add", "remove" ], "x-enum-varnames": [ "SubModifyTaxActionAdd", "SubModifyTaxActionRemove" ] }, "SubModifyTaxParams": { "required": [ "action" ], "type": "object", "properties": { "action": { "$ref": "#/components/schemas/SubModifyTaxAction" }, "effective_date": { "type": "string", "description": "Optional. When to apply the change; defaults to now if omitted.", "format": "date-time" }, "tax_association_id": { "type": "string", "description": "Required when action=\"remove\". ID of the TaxAssociation to soft-delete." }, "tax_rate_id": { "type": "string", "description": "Required when action=\"add\". ID of the active tax rate to attach." } } }, "SubModifyTrialEndRequest": { "required": [ "action" ], "type": "object", "properties": { "action": { "$ref": "#/components/schemas/TrialEndAction" }, "new_trial_end": { "type": "string", "description": "NewTrialEnd is the new trial end date. Required when action is \"scheduled_date\".", "format": "date-time" } } }, "SubscriptionChangeExecuteResponse": { "type": "object", "properties": { "change_type": { "$ref": "#/components/schemas/types.SubscriptionChangeType" }, "credit_grants": { "type": "array", "description": "credit_grants contains any credit grants created for proration credits", "items": { "$ref": "#/components/schemas/CreditGrantResponse" } }, "effective_date": { "type": "string", "description": "effective_date is when the change took effect", "format": "date-time" }, "invoice": { "$ref": "#/components/schemas/InvoiceResponse" }, "is_scheduled": { "type": "boolean", "description": "is_scheduled indicates if the change was scheduled or executed immediately" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "metadata from the request" }, "new_subscription": { "$ref": "#/components/schemas/SubscriptionSummary" }, "old_subscription": { "$ref": "#/components/schemas/SubscriptionSummary" }, "proration_applied": { "$ref": "#/components/schemas/ProrationDetails" }, "schedule_id": { "type": "string", "description": "schedule_id is the ID of the created schedule (only if is_scheduled=true)" }, "scheduled_at": { "type": "string", "description": "scheduled_at is when the change will execute (only if is_scheduled=true)", "format": "date-time" } }, "description": "Response after successfully executing a subscription plan change" }, "SubscriptionChangePreviewResponse": { "type": "object", "properties": { "change_type": { "$ref": "#/components/schemas/types.SubscriptionChangeType" }, "current_plan": { "$ref": "#/components/schemas/PlanSummary" }, "effective_date": { "type": "string", "description": "effective_date is when the change would take effect", "format": "date-time" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "metadata from the request" }, "new_billing_cycle": { "$ref": "#/components/schemas/BillingCycleInfo" }, "next_invoice_preview": { "$ref": "#/components/schemas/InvoicePreview" }, "proration_details": { "$ref": "#/components/schemas/ProrationDetails" }, "subscription_id": { "type": "string", "description": "subscription_id is the ID of the subscription being changed" }, "target_plan": { "$ref": "#/components/schemas/PlanSummary" }, "warnings": { "type": "array", "description": "warnings contains any warnings about the change", "items": { "type": "string" } } }, "description": "Response showing the financial impact of a subscription plan change" }, "SubscriptionChangeRequest": { "required": [ "billing_cadence", "billing_cycle", "billing_period", "proration_behavior", "target_plan_id" ], "type": "object", "properties": { "billing_cadence": { "$ref": "#/components/schemas/types.BillingCadence" }, "billing_cycle": { "$ref": "#/components/schemas/types.BillingCycle" }, "billing_period": { "$ref": "#/components/schemas/types.BillingPeriod" }, "billing_period_count": { "type": "integer", "description": "billing_period_count is the billing period count for the new subscription" }, "change_at": { "$ref": "#/components/schemas/types.ScheduleType" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "metadata contains additional key-value pairs for storing extra information" }, "proration_behavior": { "$ref": "#/components/schemas/types.ProrationBehavior" }, "target_plan_id": { "type": "string", "description": "target_plan_id is the ID of the new plan to change to (required)" } }, "description": "Request object for changing a subscription plan (upgrade/downgrade)" }, "SubscriptionCouponInput": { "required": [ "coupon_code" ], "type": "object", "properties": { "coupon_code": { "type": "string", "description": "CouponCode is the coupon's human-readable code (case-insensitive). Required." }, "end_date": { "type": "string", "description": "EndDate is when the coupon ends; overrides duration_in_periods calculation.", "format": "date-time" }, "price_id": { "type": "string", "description": "PriceID is the price ID of the line item to target; omit for subscription-level." }, "start_date": { "type": "string", "description": "StartDate is when the coupon starts; defaults to subscription/phase StartDate.", "format": "date-time" } } }, "SubscriptionEntitlementsResponse": { "type": "object", "properties": { "features": { "type": "array", "items": { "$ref": "#/components/schemas/AggregatedFeature" } }, "plan_id": { "type": "string" }, "subscription_id": { "type": "string" } } }, "SubscriptionInheritanceConfig": { "type": "object", "properties": { "external_customer_ids_to_inherit_subscription": { "type": "array", "description": "ExternalCustomerIDsToInheritSubscription: child customer external IDs for which\ninherited skeleton subscriptions will be created. Only valid for parent behavior.", "items": { "type": "string" } }, "invoicing_customer_external_id": { "type": "string", "description": "InvoicingCustomerExternalID sets a different billing recipient (external ID).\nRequired for delegated; rejected for inherited; optional for others." }, "parent_subscription_id": { "type": "string", "description": "ParentSubscriptionID links this subscription to an existing parent.\nRequired for inherited and grouped_invoicing; rejected for standalone, delegated, parent." }, "subscriptions_ids_for_grouped_invoicing": { "type": "array", "description": "SubscriptionsIDsForGroupedInvoicing: existing standalone subscription IDs to convert to\ngrouped_invoicing under this parent at creation time. Only valid for parent behavior.", "items": { "type": "string" } } } }, "SubscriptionLineItemLookupResult": { "type": "object", "properties": { "error": { "$ref": "#/components/schemas/errors.ErrorResponse" }, "matched_line_items": { "type": "array", "items": { "$ref": "#/components/schemas/MatchedSubscriptionLineItem" } }, "status": { "$ref": "#/components/schemas/types.DebugTrackerStatus" } } }, "SubscriptionLineItemResponse": { "type": "object", "properties": { "addon_association_id": { "type": "string" }, "billing_period": { "$ref": "#/components/schemas/types.BillingPeriod" }, "billing_period_count": { "type": "integer", "description": "from price at create; default 1" }, "commitment_amount": { "type": "string", "description": "Commitment fields" }, "commitment_duration": { "$ref": "#/components/schemas/types.BillingPeriod" }, "commitment_overage_factor": { "type": "string" }, "commitment_quantity": { "type": "string" }, "commitment_time_buckets": { "type": "array", "items": { "$ref": "#/components/schemas/types.TimeOfDayBucket" } }, "commitment_true_up_enabled": { "type": "boolean" }, "commitment_type": { "$ref": "#/components/schemas/types.CommitmentType" }, "commitment_windowed": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string" }, "customer_id": { "type": "string" }, "display_name": { "type": "string" }, "end_date": { "type": "string", "format": "date-time" }, "entity_id": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.SubscriptionLineItemEntityType" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "invoice_cadence": { "$ref": "#/components/schemas/types.InvoiceCadence" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "meter_display_name": { "type": "string" }, "meter_id": { "type": "string" }, "plan_display_name": { "type": "string" }, "price": { "$ref": "#/components/schemas/PriceResponse" }, "price_id": { "type": "string" }, "price_type": { "$ref": "#/components/schemas/types.PriceType" }, "price_unit": { "type": "string" }, "price_unit_id": { "type": "string" }, "quantity": { "type": "string" }, "start_date": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string" }, "subscription_phase_id": { "type": "string" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "SubscriptionModifyResponse": { "type": "object", "properties": { "changed_resources": { "$ref": "#/components/schemas/ChangedResources" }, "subscription": { "$ref": "#/components/schemas/SubscriptionResponse" } } }, "SubscriptionModifyType": { "type": "string", "enum": [ "inheritance", "quantity_change", "grouped_invoicing", "trial_end", "coupon", "tax" ], "x-enum-varnames": [ "SubscriptionModifyTypeInheritance", "SubscriptionModifyTypeQuantityChange", "SubscriptionModifyTypeGroupedInvoicing", "SubscriptionModifyTypeTrialEnd", "SubscriptionModifyTypeCoupon", "SubscriptionModifyTypeTax" ] }, "SubscriptionPhaseCreateRequest": { "required": [ "start_date" ], "type": "object", "properties": { "coupons": { "type": "array", "description": "Deprecated: use SubscriptionCoupons instead.", "items": { "type": "string" } }, "end_date": { "type": "string", "format": "date-time" }, "line_item_coupons": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } }, "description": "Deprecated: use SubscriptionCoupons instead." }, "line_items": { "type": "array", "description": "LineItems are extra line items to add during this phase, primarily one-time charges.\nEach item's start_date defaults to the phase's start_date when not provided.", "items": { "$ref": "#/components/schemas/CreateSubscriptionLineItemRequest" } }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "override_line_items": { "type": "array", "description": "OverrideLineItems allows customizing specific prices for this phase\nIf not provided, phase will use the same line items as the subscription (plan prices)", "items": { "$ref": "#/components/schemas/OverrideLineItemRequest" } }, "start_date": { "type": "string", "format": "date-time" }, "subscription_coupons": { "type": "array", "description": "SubscriptionCoupons is the preferred way to attach coupons to this phase.", "items": { "$ref": "#/components/schemas/SubscriptionCouponInput" } } } }, "SubscriptionPhaseResponse": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "end_date": { "type": "string", "description": "EndDate is when the phase ends (nil if phase is still active or indefinite)", "format": "date-time" }, "environment_id": { "type": "string", "description": "EnvironmentID is the environment identifier for the phase" }, "id": { "type": "string", "description": "ID is the unique identifier for the subscription phase" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "start_date": { "type": "string", "description": "StartDate is when the phase starts", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string", "description": "SubscriptionID is the identifier for the subscription" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "SubscriptionPriceCreateRequest": { "required": [ "billing_model", "billing_period", "invoice_cadence", "price_unit_type", "type" ], "type": "object", "properties": { "amount": { "type": "string" }, "billing_model": { "$ref": "#/components/schemas/types.BillingModel" }, "billing_period": { "$ref": "#/components/schemas/types.BillingPeriod" }, "billing_period_count": { "type": "integer" }, "description": { "type": "string" }, "display_name": { "type": "string" }, "end_date": { "type": "string", "format": "date-time" }, "filter_values": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "invoice_cadence": { "$ref": "#/components/schemas/types.InvoiceCadence" }, "lookup_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "meter_id": { "type": "string" }, "min_quantity": { "type": "integer" }, "price_unit_config": { "$ref": "#/components/schemas/PriceUnitConfig" }, "price_unit_type": { "$ref": "#/components/schemas/types.PriceUnitType" }, "start_date": { "type": "string", "format": "date-time" }, "tier_mode": { "$ref": "#/components/schemas/types.BillingTier" }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/CreatePriceTier" } }, "transform_quantity": { "$ref": "#/components/schemas/price.TransformQuantity" }, "trial_period_days": { "type": "integer" }, "type": { "$ref": "#/components/schemas/types.PriceType" } } }, "SubscriptionResponse": { "type": "object", "properties": { "active_pause_id": { "type": "string", "description": "ActivePauseID references the current active pause configuration\nThis will be null if no pause is active or scheduled" }, "auto_invoice_threshold": { "type": "string", "description": "AutoInvoiceThreshold is the usage amount (in subscription currency) that triggers\nan intermediate invoice. Overrides the plan-level threshold when set.\nNil means: inherit from the plan's threshold (which may also be nil = disabled)." }, "billing_anchor": { "type": "string", "description": "BillingAnchor is the reference point that aligns future billing cycle dates.\nIt sets the day of week for week intervals, the day of month for month and year intervals,\nand the month of year for year intervals. The timestamp is in UTC format.", "format": "date-time" }, "billing_cadence": { "$ref": "#/components/schemas/types.BillingCadence" }, "billing_cycle": { "$ref": "#/components/schemas/types.BillingCycle" }, "billing_period": { "$ref": "#/components/schemas/types.BillingPeriod" }, "billing_period_count": { "type": "integer", "description": "BillingPeriodCount is the total number units of the billing period." }, "cancel_at": { "type": "string", "description": "CancelAt is the date the subscription will be canceled", "format": "date-time" }, "cancel_at_period_end": { "type": "boolean", "description": "CancelAtPeriodEnd is whether the subscription was canceled at the end of the current period" }, "cancelled_at": { "type": "string", "description": "CanceledAt is the date the subscription was canceled", "format": "date-time" }, "collection_method": { "type": "string", "description": "CollectionMethod determines how invoices are collected" }, "commitment_amount": { "type": "string", "description": "CommitmentAmount is the minimum amount a customer commits to paying for a billing period" }, "commitment_duration": { "$ref": "#/components/schemas/types.BillingPeriod" }, "coupon_associations": { "type": "array", "description": "CouponAssociations are the coupon associations for this subscription", "items": { "$ref": "#/components/schemas/CouponAssociationResponse" } }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "credit_grants": { "type": "array", "description": "Credit grants are the credit grants for this subscription", "items": { "$ref": "#/components/schemas/CreditGrantResponse" } }, "currency": { "type": "string", "description": "Currency is the currency of the subscription in lowercase 3 digit ISO codes" }, "current_period_end": { "type": "string", "description": "CurrentPeriodEnd is the end of the current period that the subscription has been invoiced for.\nAt the end of this period, a new invoice will be created.", "format": "date-time" }, "current_period_start": { "type": "string", "description": "CurrentPeriodStart is the end of the current period that the subscription has been invoiced for.\nAt the end of this period, a new invoice will be created.", "format": "date-time" }, "customer": { "$ref": "#/components/schemas/CustomerResponse" }, "customer_id": { "type": "string", "description": "CustomerID is the identifier for the customer in our system" }, "enable_true_up": { "type": "boolean" }, "end_date": { "type": "string", "description": "EndDate is the end date of the subscription", "format": "date-time" }, "environment_id": { "type": "string", "description": "EnvironmentID is the environment identifier for the subscription" }, "gateway_payment_method_id": { "type": "string", "description": "GatewayPaymentMethodID is the gateway payment method ID for this subscription" }, "id": { "type": "string", "description": "ID is the unique identifier for the subscription" }, "invoicing_customer_id": { "type": "string", "description": "InvoicingCustomerID is the customer ID to use for invoicing\nThis can differ from the subscription customer (e.g., parent company invoicing for child company)" }, "latest_invoice": { "$ref": "#/components/schemas/InvoiceResponse" }, "line_items": { "type": "array", "items": { "$ref": "#/components/schemas/subscription.SubscriptionLineItem" } }, "lookup_key": { "type": "string", "description": "LookupKey is the key used to lookup the subscription in our system" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "overage_factor": { "type": "string", "description": "OverageFactor is a multiplier applied to usage beyond the commitment amount" }, "parent_subscription_id": { "type": "string", "description": "ParentSubscriptionID is the parent subscription ID for hierarchy (e.g. child subscription under a parent)" }, "pause_status": { "$ref": "#/components/schemas/types.PauseStatus" }, "pauses": { "type": "array", "items": { "$ref": "#/components/schemas/subscription.SubscriptionPause" } }, "payment_behavior": { "type": "string", "description": "PaymentBehavior determines how subscription payments are handled" }, "payment_terms": { "$ref": "#/components/schemas/types.PaymentTerms" }, "phases": { "type": "array", "description": "Phases are the subscription phases for this subscription", "items": { "$ref": "#/components/schemas/SubscriptionPhaseResponse" } }, "plan": { "$ref": "#/components/schemas/PlanResponse" }, "plan_id": { "type": "string", "description": "PlanID is the identifier for the plan in our system" }, "proration_behavior": { "$ref": "#/components/schemas/types.ProrationBehavior" }, "start_date": { "type": "string", "description": "StartDate is the start date of the subscription", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_status": { "$ref": "#/components/schemas/types.SubscriptionStatus" }, "subscription_type": { "$ref": "#/components/schemas/types.SubscriptionType" }, "synced_price_sequence": { "type": "integer", "description": "SyncedPriceSequence is the plan-price sequence up to which this\nsubscription's line items have been reconciled. Bumped by the\nplan-price sync after a successful pass." }, "tenant_id": { "type": "string" }, "timezone": { "type": "string" }, "trial_end": { "type": "string", "description": "TrialEnd is the end date of the trial period", "format": "date-time" }, "trial_start": { "type": "string", "description": "TrialStart is the start date of the trial period", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" }, "version": { "type": "integer", "description": "Version is used for optimistic locking" } } }, "SubscriptionResponseV2": { "type": "object", "properties": { "active_pause_id": { "type": "string", "description": "ActivePauseID references the current active pause configuration\nThis will be null if no pause is active or scheduled" }, "auto_invoice_threshold": { "type": "string", "description": "AutoInvoiceThreshold is the usage amount (in subscription currency) that triggers\nan intermediate invoice. Overrides the plan-level threshold when set.\nNil means: inherit from the plan's threshold (which may also be nil = disabled)." }, "billing_anchor": { "type": "string", "description": "BillingAnchor is the reference point that aligns future billing cycle dates.\nIt sets the day of week for week intervals, the day of month for month and year intervals,\nand the month of year for year intervals. The timestamp is in UTC format.", "format": "date-time" }, "billing_cadence": { "$ref": "#/components/schemas/types.BillingCadence" }, "billing_cycle": { "$ref": "#/components/schemas/types.BillingCycle" }, "billing_period": { "$ref": "#/components/schemas/types.BillingPeriod" }, "billing_period_count": { "type": "integer", "description": "BillingPeriodCount is the total number units of the billing period." }, "cancel_at": { "type": "string", "description": "CancelAt is the date the subscription will be canceled", "format": "date-time" }, "cancel_at_period_end": { "type": "boolean", "description": "CancelAtPeriodEnd is whether the subscription was canceled at the end of the current period" }, "cancelled_at": { "type": "string", "description": "CanceledAt is the date the subscription was canceled", "format": "date-time" }, "collection_method": { "type": "string", "description": "CollectionMethod determines how invoices are collected" }, "commitment_amount": { "type": "string", "description": "CommitmentAmount is the minimum amount a customer commits to paying for a billing period" }, "commitment_duration": { "$ref": "#/components/schemas/types.BillingPeriod" }, "coupon_associations": { "type": "array", "description": "CouponAssociations are included when \"coupon_associations\" is in expand parameter", "items": { "$ref": "#/components/schemas/CouponAssociationResponse" } }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "credit_grants": { "type": "array", "description": "CreditGrants are included when \"credit_grants\" is in expand parameter", "items": { "$ref": "#/components/schemas/CreditGrantResponse" } }, "currency": { "type": "string", "description": "Currency is the currency of the subscription in lowercase 3 digit ISO codes" }, "current_period_end": { "type": "string", "description": "CurrentPeriodEnd is the end of the current period that the subscription has been invoiced for.\nAt the end of this period, a new invoice will be created.", "format": "date-time" }, "current_period_start": { "type": "string", "description": "CurrentPeriodStart is the end of the current period that the subscription has been invoiced for.\nAt the end of this period, a new invoice will be created.", "format": "date-time" }, "customer": { "$ref": "#/components/schemas/CustomerResponse" }, "customer_id": { "type": "string", "description": "CustomerID is the identifier for the customer in our system" }, "enable_true_up": { "type": "boolean" }, "end_date": { "type": "string", "description": "EndDate is the end date of the subscription", "format": "date-time" }, "environment_id": { "type": "string", "description": "EnvironmentID is the environment identifier for the subscription" }, "gateway_payment_method_id": { "type": "string", "description": "GatewayPaymentMethodID is the gateway payment method ID for this subscription" }, "id": { "type": "string", "description": "ID is the unique identifier for the subscription" }, "invoicing_customer_id": { "type": "string", "description": "InvoicingCustomerID is the customer ID to use for invoicing\nThis can differ from the subscription customer (e.g., parent company invoicing for child company)" }, "line_items": { "type": "array", "description": "LineItems is expanded only if \"subscription_line_items\" is in expand parameter\nEach line item can optionally include expanded price data", "items": { "$ref": "#/components/schemas/SubscriptionLineItemResponse" } }, "lookup_key": { "type": "string", "description": "LookupKey is the key used to lookup the subscription in our system" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "overage_factor": { "type": "string", "description": "OverageFactor is a multiplier applied to usage beyond the commitment amount" }, "parent_subscription_id": { "type": "string", "description": "ParentSubscriptionID is the parent subscription ID for hierarchy (e.g. child subscription under a parent)" }, "pause_status": { "$ref": "#/components/schemas/types.PauseStatus" }, "pauses": { "type": "array", "description": "Pauses are included when subscription has pause status", "items": { "$ref": "#/components/schemas/subscription.SubscriptionPause" } }, "payment_behavior": { "type": "string", "description": "PaymentBehavior determines how subscription payments are handled" }, "payment_terms": { "$ref": "#/components/schemas/types.PaymentTerms" }, "phases": { "type": "array", "description": "Phases are included when \"phases\" is in expand parameter", "items": { "$ref": "#/components/schemas/SubscriptionPhaseResponse" } }, "plan": { "$ref": "#/components/schemas/PlanResponse" }, "plan_id": { "type": "string", "description": "PlanID is the identifier for the plan in our system" }, "plan_prices_out_of_sync": { "type": "boolean", "description": "PlanPricesOutOfSync is true when the subscription's synced_price_sequence\nis behind the plan's current max prices.sequence — i.e. plan-price\nchanges have not yet been reconciled into this subscription's line items." }, "proration_behavior": { "$ref": "#/components/schemas/types.ProrationBehavior" }, "start_date": { "type": "string", "description": "StartDate is the start date of the subscription", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_status": { "$ref": "#/components/schemas/types.SubscriptionStatus" }, "subscription_type": { "$ref": "#/components/schemas/types.SubscriptionType" }, "synced_price_sequence": { "type": "integer", "description": "SyncedPriceSequence is the plan-price sequence up to which this\nsubscription's line items have been reconciled. Bumped by the\nplan-price sync after a successful pass." }, "tenant_id": { "type": "string" }, "timezone": { "type": "string" }, "trial_end": { "type": "string", "description": "TrialEnd is the end date of the trial period", "format": "date-time" }, "trial_start": { "type": "string", "description": "TrialStart is the start date of the trial period", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" }, "version": { "type": "integer", "description": "Version is used for optimistic locking" } } }, "SubscriptionScheduleResponse": { "type": "object", "properties": { "can_be_cancelled": { "type": "boolean", "description": "can_be_cancelled indicates if the schedule can be cancelled" }, "cancelled_at": { "type": "string", "description": "cancelled_at is when the schedule was cancelled", "format": "date-time" }, "configuration": { "type": "object", "description": "configuration contains type-specific configuration (e.g., target_plan_id for plan changes)" }, "created_at": { "type": "string", "description": "created_at timestamp", "format": "date-time" }, "days_until_execution": { "type": "integer", "description": "days_until_execution is the number of days until execution" }, "error_message": { "type": "string", "description": "error_message contains the error if execution failed" }, "executed_at": { "type": "string", "description": "executed_at is when the schedule was executed", "format": "date-time" }, "execution_result": { "type": "object", "description": "execution_result contains type-specific execution result" }, "id": { "type": "string", "description": "id of the schedule" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "metadata from the schedule" }, "schedule_type": { "$ref": "#/components/schemas/types.SubscriptionScheduleChangeType" }, "scheduled_at": { "type": "string", "description": "scheduled_at is when the schedule will execute", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.ScheduleStatus" }, "subscription_id": { "type": "string", "description": "subscription_id is the ID of the subscription" }, "updated_at": { "type": "string", "description": "updated_at timestamp", "format": "date-time" } }, "description": "Full details of a subscription schedule" }, "SubscriptionSummary": { "type": "object", "properties": { "archived_at": { "type": "string", "description": "archived_at timestamp (for old subscriptions)", "format": "date-time" }, "billing_anchor": { "type": "string", "description": "billing_anchor of the subscription", "format": "date-time" }, "created_at": { "type": "string", "description": "created_at timestamp", "format": "date-time" }, "current_period_end": { "type": "string", "description": "current_period_end of the subscription", "format": "date-time" }, "current_period_start": { "type": "string", "description": "current_period_start of the subscription", "format": "date-time" }, "id": { "type": "string", "description": "id of the subscription" }, "plan_id": { "type": "string", "description": "plan_id of the subscription" }, "status": { "$ref": "#/components/schemas/types.SubscriptionStatus" } } }, "SubscriptionUsageByMetersResponse": { "type": "object", "properties": { "amount": { "type": "number" }, "currency": { "type": "string" }, "display_amount": { "type": "string" }, "filter_values": { "$ref": "#/components/schemas/price.JSONBFilters" }, "is_overage": { "type": "boolean", "description": "Whether this charge is at overage rate" }, "meter_display_name": { "type": "string" }, "meter_id": { "type": "string" }, "overage_factor": { "type": "number", "description": "Factor applied to this charge if in overage" }, "price": { "$ref": "#/components/schemas/price.Price" }, "quantity": { "type": "number" }, "subscription_line_item_id": { "type": "string", "description": "For feature_usage: direct match by sub_line_item_id" } } }, "SuccessResponse": { "type": "object", "properties": { "message": { "type": "string" } } }, "TaskResponse": { "type": "object", "properties": { "completed_at": { "type": "string", "format": "date-time" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.EntityType" }, "environment_id": { "type": "string" }, "error_summary": { "type": "string" }, "failed_at": { "type": "string", "format": "date-time" }, "failed_records": { "type": "integer" }, "file_name": { "type": "string" }, "file_type": { "$ref": "#/components/schemas/types.FileType" }, "file_url": { "type": "string" }, "id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true }, "processed_records": { "type": "integer" }, "scheduled_task_id": { "type": "string" }, "started_at": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "successful_records": { "type": "integer" }, "task_status": { "$ref": "#/components/schemas/types.TaskStatus" }, "task_type": { "$ref": "#/components/schemas/types.TaskType" }, "tenant_id": { "type": "string" }, "total_records": { "type": "integer" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" }, "workflow_id": { "type": "string" } } }, "TaxAppliedResponse": { "type": "object", "properties": { "applied_at": { "type": "string", "format": "date-time" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string" }, "entity_id": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.TaxRateEntityType" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "idempotency_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "status": { "$ref": "#/components/schemas/types.Status" }, "tax_amount": { "type": "string" }, "tax_association_id": { "type": "string" }, "tax_rate": { "$ref": "#/components/schemas/TaxRateResponse" }, "tax_rate_id": { "type": "string" }, "taxable_amount": { "type": "string" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "TaxAssociationResponse": { "type": "object", "properties": { "auto_apply": { "type": "boolean", "description": "Whether this tax should be automatically applied" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string", "description": "Currency" }, "end_date": { "type": "string", "description": "EndDate is the optional date until which this association is active", "format": "date-time" }, "entity_id": { "type": "string", "description": "ID of the entity this tax rate applies to" }, "entity_type": { "$ref": "#/components/schemas/types.TaxRateEntityType" }, "environment_id": { "type": "string", "description": "EnvironmentID is the ID of the environment this tax rate config belongs to" }, "id": { "type": "string", "description": "ID of the ent." }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Metadata holds the value of the \"metadata\" field." }, "priority": { "type": "integer", "description": "Priority for tax resolution (lower number = higher priority)" }, "start_date": { "type": "string", "description": "StartDate is the date from which this association is active", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tax_rate": { "$ref": "#/components/schemas/TaxRateResponse" }, "tax_rate_id": { "type": "string", "description": "Reference to the TaxRate entity" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "TaxAssociationUpdateRequest": { "type": "object", "properties": { "auto_apply": { "type": "boolean" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "priority": { "type": "integer" } } }, "TaxRateOverride": { "required": [ "currency", "tax_rate_code" ], "type": "object", "properties": { "auto_apply": { "type": "boolean", "default": true }, "currency": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "priority": { "type": "integer" }, "tax_rate_code": { "type": "string" } } }, "TaxRateResponse": { "type": "object", "properties": { "code": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "description": { "type": "string" }, "environment_id": { "type": "string" }, "fixed_value": { "type": "string" }, "id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "percentage_value": { "type": "string" }, "scope": { "$ref": "#/components/schemas/types.TaxRateScope" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tax_rate_status": { "$ref": "#/components/schemas/types.TaxRateStatus" }, "tax_rate_type": { "$ref": "#/components/schemas/types.TaxRateType" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "TenantBillingDetails": { "type": "object", "properties": { "address": { "$ref": "#/components/schemas/Address" }, "email": { "type": "string" }, "help_email": { "type": "string" }, "phone": { "type": "string" } } }, "TenantBillingUsage": { "type": "object", "properties": { "subscriptions": { "type": "array", "items": { "$ref": "#/components/schemas/SubscriptionResponse" } }, "usage": { "$ref": "#/components/schemas/CustomerUsageSummaryResponse" } } }, "TenantResponse": { "type": "object", "properties": { "billing_details": { "$ref": "#/components/schemas/TenantBillingDetails" }, "created_at": { "type": "string", "format": "date-time" }, "id": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" }, "status": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" } } }, "TopUpWalletRequest": { "required": [ "transaction_reason" ], "type": "object", "properties": { "amount": { "type": "string", "description": "amount is the amount in the currency of the wallet to be added\nNOTE: this is not the number of credits to add, but the amount in the currency\namount = credits_to_add * conversion_rate\nif both amount and credits_to_add are provided, amount will be ignored\nex if the wallet has a conversion_rate of 2 then adding an amount of\n10 USD in the wallet wil add 5 credits in the wallet" }, "credits_to_add": { "type": "string", "description": "credits_to_add is the number of credits to add to the wallet" }, "description": { "type": "string", "description": "description to add any specific details about the transaction" }, "expiry_date_utc": { "type": "string", "description": "expiry_date_utc is the expiry date in UTC timezone\nex 2025-01-01 00:00:00 UTC" }, "idempotency_key": { "type": "string", "description": "idempotency_key is a unique key for the transaction" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "priority": { "type": "integer", "description": "priority is the priority of the transaction\nlower number means higher priority\ndefault is nil which means no priority at all" }, "transaction_reason": { "$ref": "#/components/schemas/types.TransactionReason" } } }, "TopUpWalletResponse": { "type": "object", "properties": { "invoice_id": { "type": "string", "description": "Invoice ID if an invoice was created (only for PURCHASED_CREDIT_INVOICED)" }, "wallet": { "$ref": "#/components/schemas/WalletResponse" }, "wallet_transaction": { "$ref": "#/components/schemas/WalletTransactionResponse" } } }, "TrialEndAction": { "type": "string", "enum": [ "immediate", "scheduled_date" ], "x-enum-varnames": [ "TrialEndActionImmediate", "TrialEndActionScheduledDate" ] }, "TriggerForceRunRequest": { "type": "object", "properties": { "end_time": { "type": "string", "format": "date-time" }, "start_time": { "type": "string", "format": "date-time" } } }, "TriggerForceRunResponse": { "type": "object", "properties": { "end_time": { "type": "string", "format": "date-time" }, "message": { "type": "string" }, "mode": { "type": "string", "description": "\"custom\" or \"automatic\"" }, "start_time": { "type": "string", "format": "date-time" }, "workflow_id": { "type": "string" } } }, "UpdateAddonRequest": { "type": "object", "properties": { "description": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true }, "name": { "type": "string" } } }, "UpdateCostsheetRequest": { "type": "object", "properties": { "description": { "type": "string" }, "lookup_key": { "maxLength": 255, "minLength": 1, "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "maxLength": 255, "minLength": 1, "type": "string" } } }, "UpdateCostsheetResponse": { "type": "object", "properties": { "costsheet": { "$ref": "#/components/schemas/CostsheetResponse" } } }, "UpdateCouponRequest": { "type": "object", "properties": { "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" } } }, "UpdateCreditGrantRequest": { "type": "object", "properties": { "end_date": { "type": "string", "format": "date-time" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" } } }, "UpdateCustomerRequest": { "type": "object", "properties": { "address_city": { "maxLength": 100, "type": "string", "description": "address_city is the updated city name with maximum 100 characters" }, "address_country": { "type": "string", "description": "address_country is the updated two-letter ISO 3166-1 alpha-2 country code" }, "address_line1": { "maxLength": 255, "type": "string", "description": "address_line1 is the updated primary address line with maximum 255 characters" }, "address_line2": { "maxLength": 255, "type": "string", "description": "address_line2 is the updated secondary address line with maximum 255 characters" }, "address_postal_code": { "maxLength": 20, "type": "string", "description": "address_postal_code is the updated postal code with maximum 20 characters" }, "address_state": { "maxLength": 100, "type": "string", "description": "address_state is the updated state, province, or region name with maximum 100 characters" }, "email": { "type": "string", "description": "email is the updated email address and must be a valid email format if provided" }, "external_id": { "type": "string", "description": "external_id is the updated external identifier for the customer" }, "integration_entity_mapping": { "type": "array", "description": "integration_entity_mapping contains provider integration mappings for this customer", "items": { "$ref": "#/components/schemas/CreateEntityIntegrationMappingRequest" } }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "metadata contains updated key-value pairs that will replace existing metadata" }, "name": { "type": "string", "description": "name is the updated name or company name for the customer" }, "timezone": { "type": "string", "description": "timezone is the updated IANA timezone name for the customer (e.g. \"Asia/Kolkata\", \"America/New_York\")" } }, "description": "Request object for updating an existing customer. All fields are optional - only provided fields will be updated" }, "UpdateEntitlementRequest": { "type": "object", "properties": { "config_value": { "type": "object", "additionalProperties": true }, "is_enabled": { "type": "boolean" }, "is_soft_limit": { "type": "boolean" }, "static_value": { "type": "string" }, "usage_limit": { "type": "integer" }, "usage_reset_period": { "$ref": "#/components/schemas/types.EntitlementUsageResetPeriod" } } }, "UpdateFeatureRequest": { "type": "object", "properties": { "alert_settings": { "$ref": "#/components/schemas/types.AlertSettings" }, "description": { "type": "string" }, "filters": { "type": "array", "items": { "$ref": "#/components/schemas/meter.Filter" } }, "group_id": { "type": "string", "description": "GroupID is the id of the group to assign the feature to. Pass empty string to clear." }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" }, "reporting_unit": { "$ref": "#/components/schemas/types.ReportingUnit" }, "unit_plural": { "type": "string" }, "unit_singular": { "type": "string" } } }, "UpdateInvoiceRequest": { "type": "object", "properties": { "due_date": { "type": "string", "format": "date-time" }, "invoice_pdf_url": { "type": "string", "description": "invoice_pdf_url is the URL where customers can download the PDF version of this invoice" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" } } }, "UpdatePaymentRequest": { "type": "object", "properties": { "error_message": { "type": "string" }, "failed_at": { "type": "string", "format": "date-time" }, "gateway_payment_id": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "payment_gateway": { "type": "string" }, "payment_method_id": { "type": "string" }, "payment_status": { "type": "string" }, "refunded_at": { "type": "string", "format": "date-time" }, "succeeded_at": { "type": "string", "format": "date-time" }, "voided_at": { "type": "string", "format": "date-time" } } }, "UpdatePaymentStatusRequest": { "required": [ "payment_status" ], "type": "object", "properties": { "amount": { "type": "string", "description": "amount is the optional payment amount to record" }, "payment_status": { "$ref": "#/components/schemas/types.PaymentStatus" } } }, "UpdatePlanRequest": { "type": "object", "properties": { "description": { "type": "string" }, "display_order": { "type": "integer" }, "lookup_key": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" } } }, "UpdatePriceRequest": { "type": "object", "properties": { "amount": { "type": "string", "description": "Amount is the new price amount that overrides the original price (optional)" }, "billing_model": { "$ref": "#/components/schemas/types.BillingModel" }, "description": { "type": "string" }, "display_name": { "type": "string" }, "effective_from": { "type": "string" }, "group_id": { "type": "string", "description": "GroupID is the id of the group to update the price in.\nIf not provided (nil), the group will not be changed\nIf provided as empty string (\"\"), the group will be removed (price will be ungrouped)\nIf provided as a group ID, the price will be assigned to that group (must exist and be published)" }, "lookup_key": { "type": "string", "description": "All price fields that can be updated\nNon-critical fields (can be updated directly)" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "price_unit_amount": { "type": "string", "description": "PriceUnitAmount is the price unit amount (for CUSTOM price unit type, FLAT_FEE/PACKAGE billing models)" }, "price_unit_tiers": { "type": "array", "description": "PriceUnitTiers are the price unit tiers (for CUSTOM price unit type, TIERED billing model)", "items": { "$ref": "#/components/schemas/CreatePriceTier" } }, "tier_mode": { "$ref": "#/components/schemas/types.BillingTier" }, "tiers": { "type": "array", "description": "Tiers determines the pricing tiers for this line item", "items": { "$ref": "#/components/schemas/CreatePriceTier" } }, "transform_quantity": { "$ref": "#/components/schemas/price.TransformQuantity" } } }, "UpdatePriceUnitRequest": { "type": "object", "properties": { "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" } } }, "UpdateScheduledTaskRequest": { "required": [ "enabled" ], "type": "object", "properties": { "enabled": { "type": "boolean" } } }, "UpdateServiceAccountRequest": { "required": [ "name" ], "type": "object", "properties": { "name": { "type": "string" } } }, "UpdateServiceAccountResponse": { "type": "object", "properties": { "email": { "type": "string", "description": "Empty for service accounts" }, "id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "tenant": { "$ref": "#/components/schemas/TenantResponse" }, "type": { "$ref": "#/components/schemas/types.UserType" } } }, "UpdateSubscriptionLineItemRequest": { "type": "object", "properties": { "amount": { "type": "string", "description": "Amount is the new price amount that overrides the original price" }, "billing_model": { "$ref": "#/components/schemas/types.BillingModel" }, "commitment_amount": { "type": "number", "description": "Commitment fields" }, "commitment_duration": { "$ref": "#/components/schemas/types.BillingPeriod" }, "commitment_overage_factor": { "type": "number" }, "commitment_quantity": { "type": "number" }, "commitment_time_buckets": { "type": "array", "description": "Pointer so an explicit empty array can clear existing buckets (omission keeps them).", "items": { "$ref": "#/components/schemas/CommitmentBucketRequest" } }, "commitment_true_up_enabled": { "type": "boolean" }, "commitment_type": { "$ref": "#/components/schemas/types.CommitmentType" }, "commitment_windowed": { "type": "boolean" }, "effective_from": { "type": "string", "description": "EffectiveFrom for the existing line item (if not provided, defaults to now)" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Metadata for the new line item" }, "tier_mode": { "$ref": "#/components/schemas/types.BillingTier" }, "tiers": { "type": "array", "description": "Tiers determines the pricing tiers for this line item", "items": { "$ref": "#/components/schemas/CreatePriceTier" } }, "transform_quantity": { "$ref": "#/components/schemas/price.TransformQuantity" } } }, "UpdateSubscriptionRequest": { "type": "object", "properties": { "cancel_at": { "type": "string", "format": "date-time" }, "cancel_at_period_end": { "type": "boolean" }, "parent_subscription_id": { "type": "string", "description": "ParentSubscriptionID sets or clears the parent subscription. Omit to leave unchanged; send \"\" to clear." }, "status": { "$ref": "#/components/schemas/types.SubscriptionStatus" } } }, "UpdateTaskStatusRequest": { "required": [ "task_status" ], "type": "object", "properties": { "task_status": { "$ref": "#/components/schemas/types.TaskStatus" } } }, "UpdateTaxRateRequest": { "type": "object", "properties": { "code": { "type": "string", "description": "code is the updated unique alphanumeric identifier for the tax rate" }, "description": { "type": "string", "description": "description is the updated text description for the tax rate" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "metadata contains updated key-value pairs that will replace existing metadata" }, "name": { "type": "string", "description": "name is the updated human-readable name for the tax rate" }, "tax_rate_status": { "$ref": "#/components/schemas/types.TaxRateStatus" } } }, "UpdateTenantRequest": { "type": "object", "properties": { "billing_details": { "$ref": "#/components/schemas/TenantBillingDetails" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" } } }, "UpdateUserRequest": { "type": "object", "properties": { "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" } } }, "UpdateUserResponse": { "type": "object", "properties": { "email": { "type": "string", "description": "Empty for service accounts" }, "id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "tenant": { "$ref": "#/components/schemas/TenantResponse" }, "type": { "$ref": "#/components/schemas/types.UserType" } } }, "UpdateWalletRequest": { "type": "object", "properties": { "alert_settings": { "$ref": "#/components/schemas/types.AlertSettings" }, "auto_topup": { "$ref": "#/components/schemas/types.AutoTopup" }, "config": { "$ref": "#/components/schemas/types.WalletConfig" }, "description": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" } } }, "UsageAnalyticItem": { "type": "object", "properties": { "add_on_id": { "type": "string" }, "addon": { "$ref": "#/components/schemas/Addon" }, "aggregation_type": { "$ref": "#/components/schemas/types.AggregationType" }, "bucket_summaries": { "type": "array", "description": "BucketSummaries is populated only when BreakdownBucket=true. Contains one\nentry per defined CommitmentTimeBucket plus one for out-of-bucket usage.", "items": { "$ref": "#/components/schemas/BucketSummary" } }, "commitment_info": { "$ref": "#/components/schemas/types.CommitmentInfo" }, "currency": { "type": "string" }, "event_count": { "type": "integer", "description": "Number of events that contributed to this aggregation" }, "event_name": { "type": "string" }, "feature": { "$ref": "#/components/schemas/Feature" }, "feature_id": { "type": "string" }, "group": { "$ref": "#/components/schemas/group.Group" }, "meter": { "$ref": "#/components/schemas/meter.Meter" }, "meter_id": { "type": "string", "description": "Meter ID" }, "name": { "type": "string" }, "plan": { "$ref": "#/components/schemas/Plan" }, "plan_id": { "type": "string" }, "points": { "type": "array", "items": { "$ref": "#/components/schemas/UsageAnalyticPoint" } }, "price": { "$ref": "#/components/schemas/PriceResponse" }, "price_id": { "type": "string", "description": "Price ID used for this usage" }, "properties": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Stores property values for flexible grouping (e.g., org_id -> \"org123\")" }, "reporting_unit": { "$ref": "#/components/schemas/types.ReportingUnit" }, "source": { "type": "string" }, "sources": { "type": "array", "description": "List of sources when not grouping by source", "items": { "type": "string" } }, "sub_line_item_id": { "type": "string", "description": "Subscription line item ID" }, "subscription_id": { "type": "string", "description": "Subscription ID" }, "subscription_line_item": { "$ref": "#/components/schemas/subscription.SubscriptionLineItem" }, "subtotal": { "type": "string" }, "total_cost": { "type": "string", "description": "TotalCost is the final cost after discount (Subtotal - TotalDiscount)" }, "total_discount": { "type": "string" }, "total_usage": { "type": "string" }, "total_usage_display": { "type": "string", "description": "Empty string when feature has no reporting unit; otherwise the value in reporting units" }, "unit": { "type": "string" }, "unit_plural": { "type": "string" }, "window_size": { "$ref": "#/components/schemas/types.WindowSize" } } }, "UsageAnalyticPoint": { "type": "object", "properties": { "buckets": { "type": "array", "description": "Buckets lists every commitment bucket this (possibly rolled-up) window\noverlaps — only populated when BreakdownBucket=true and the line item has\nCommitmentTimeBuckets. A coarse window can overlap more than one bucket, and\nonly partially, so this is a list. Empty when the window touches no bucket.\nIt is an informational HINT only: the point's single cost/computed_* totals\nmix all overlapped buckets and out-of-bucket time and CANNOT be split per\nbucket — read bucket_summaries for exact per-bucket cost.", "items": { "$ref": "#/components/schemas/PointBucket" } }, "computed_commitment_utilized_amount": { "type": "string", "description": "Commitment breakdown (only populated for windowed commitments)" }, "computed_overage_amount": { "type": "string" }, "computed_true_up_amount": { "type": "string" }, "cost": { "type": "string", "description": "Cost is the final cost after discount (Subtotal - Discount)" }, "discount": { "type": "string" }, "event_count": { "type": "integer", "description": "Number of events in this time window" }, "subtotal": { "type": "string" }, "timestamp": { "type": "string" }, "usage": { "type": "string" } } }, "UsageBreakdownItem": { "type": "object", "properties": { "cost": { "type": "string", "description": "cost is the cost attributed to this group for the line item" }, "event_count": { "type": "integer", "description": "event_count is the number of events from this group (optional)" }, "grouped_by": { "type": "object", "additionalProperties": { "type": "string" }, "description": "grouped_by contains the grouping field values (e.g., {\"source\": \"api\", \"org_id\": \"org123\"})" }, "percentage": { "type": "string", "description": "percentage is the percentage of total line item cost from this group (optional)" }, "usage": { "type": "string", "description": "usage is the total usage amount from this group (optional, for additional context)" } } }, "UsageResult": { "type": "object", "properties": { "value": { "type": "number" }, "window_size": { "type": "string" } } }, "UserResponse": { "type": "object", "properties": { "email": { "type": "string", "description": "Empty for service accounts" }, "id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "roles": { "type": "array", "items": { "type": "string" } }, "tenant": { "$ref": "#/components/schemas/TenantResponse" }, "type": { "$ref": "#/components/schemas/types.UserType" } } }, "WalletBalanceResponse": { "type": "object", "properties": { "alert_settings": { "$ref": "#/components/schemas/types.AlertSettings" }, "alert_state": { "$ref": "#/components/schemas/types.AlertState" }, "auto_topup": { "$ref": "#/components/schemas/types.AutoTopup" }, "balance": { "type": "string" }, "balance_updated_at": { "type": "string", "format": "date-time" }, "config": { "$ref": "#/components/schemas/types.WalletConfig" }, "conversion_rate": { "type": "string", "description": "amount in the currency = number of credits * conversion_rate\nex if conversion_rate is 1, then 1 USD = 1 credit\nex if conversion_rate is 2, then 1 USD = 0.5 credits\nex if conversion_rate is 0.5, then 1 USD = 2 credits" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "credit_balance": { "type": "string" }, "credits_available_breakdown": { "$ref": "#/components/schemas/types.CreditBreakdown" }, "currency": { "type": "string" }, "current_period_usage": { "type": "string" }, "customer_id": { "type": "string" }, "description": { "type": "string" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "is_cached_fallback": { "type": "boolean", "description": "IsCachedFallback is true whenever the response is sourced from cache:\neither an explicit cache request, or fallback after a real-time failure.\nClients should treat the absence of this field as if it were true and\nonly trust freshness when the server explicitly emits false." }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" }, "real_time_balance": { "type": "string" }, "real_time_credit_balance": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "topup_conversion_rate": { "type": "string", "description": "topup_conversion_rate is the conversion rate for the topup to the currency\nex if topup_conversion_rate is 1, then 1 USD = 1 credit\nex if topup_conversion_rate is 2, then 1 USD = 0.5 credits\nex if topup_conversion_rate is 0.5, then 1 USD = 2 credits" }, "unpaid_invoices_amount": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" }, "wallet_status": { "$ref": "#/components/schemas/types.WalletStatus" }, "wallet_type": { "$ref": "#/components/schemas/types.WalletType" } } }, "WalletResponse": { "type": "object", "properties": { "alert_settings": { "$ref": "#/components/schemas/types.AlertSettings" }, "alert_state": { "$ref": "#/components/schemas/types.AlertState" }, "auto_topup": { "$ref": "#/components/schemas/types.AutoTopup" }, "balance": { "type": "string" }, "config": { "$ref": "#/components/schemas/types.WalletConfig" }, "conversion_rate": { "type": "string", "description": "amount in the currency = number of credits * conversion_rate\nex if conversion_rate is 1, then 1 USD = 1 credit\nex if conversion_rate is 2, then 1 USD = 0.5 credits\nex if conversion_rate is 0.5, then 1 USD = 2 credits" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "credit_balance": { "type": "string" }, "credits_available_breakdown": { "$ref": "#/components/schemas/types.CreditBreakdown" }, "currency": { "type": "string" }, "customer_id": { "type": "string" }, "description": { "type": "string" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "topup_conversion_rate": { "type": "string", "description": "topup_conversion_rate is the conversion rate for the topup to the currency\nex if topup_conversion_rate is 1, then 1 USD = 1 credit\nex if topup_conversion_rate is 2, then 1 USD = 0.5 credits\nex if topup_conversion_rate is 0.5, then 1 USD = 2 credits" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" }, "wallet_status": { "$ref": "#/components/schemas/types.WalletStatus" }, "wallet_type": { "$ref": "#/components/schemas/types.WalletType" } } }, "WalletTransactionResponse": { "type": "object", "properties": { "amount": { "type": "string" }, "conversion_rate": { "type": "string", "description": "conversion_rate is the conversion rate for the transaction to the currency" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "created_by_user": { "$ref": "#/components/schemas/UserResponse" }, "credit_amount": { "type": "string" }, "credit_balance_after": { "type": "string" }, "credit_balance_before": { "type": "string" }, "credits_available": { "type": "string" }, "currency": { "type": "string" }, "customer": { "$ref": "#/components/schemas/CustomerResponse" }, "customer_id": { "type": "string" }, "description": { "type": "string" }, "environment_id": { "type": "string" }, "expiry_date": { "type": "string", "format": "date-time" }, "id": { "type": "string" }, "idempotency_key": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "priority": { "type": "integer" }, "reference_id": { "type": "string" }, "reference_type": { "$ref": "#/components/schemas/types.WalletTxReferenceType" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "topup_conversion_rate": { "type": "string", "description": "topup_conversion_rate is the conversion rate for the topup to the currency" }, "transaction_reason": { "$ref": "#/components/schemas/types.TransactionReason" }, "transaction_status": { "$ref": "#/components/schemas/types.TransactionStatus" }, "type": { "$ref": "#/components/schemas/types.TransactionType" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" }, "wallet": { "$ref": "#/components/schemas/WalletResponse" }, "wallet_id": { "type": "string" } } }, "WorkflowExecutionDTO": { "type": "object", "properties": { "close_time": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "duration_ms": { "type": "integer" }, "entity": { "type": "string", "description": "e.g. plan, invoice, subscription" }, "entity_id": { "type": "string", "description": "e.g. plan ID, invoice ID" }, "run_id": { "type": "string" }, "start_time": { "type": "string", "format": "date-time" }, "status": { "type": "string" }, "task_queue": { "type": "string" }, "total_duration": { "type": "string" }, "workflow_id": { "type": "string" }, "workflow_type": { "type": "string" } } }, "errors.ErrorCode": { "type": "string", "enum": [ "http_client_error", "system_error", "internal_error", "not_found", "already_exists", "version_conflict", "validation_error", "invalid_operation", "permission_denied", "database_error", "service_unavailable", "too_many_requests" ], "x-enum-varnames": [ "ErrCodeHTTPClient", "ErrCodeSystemError", "ErrCodeInternalError", "ErrCodeNotFound", "ErrCodeAlreadyExists", "ErrCodeVersionConflict", "ErrCodeValidation", "ErrCodeInvalidOperation", "ErrCodePermissionDenied", "ErrCodeDatabase", "ErrCodeServiceUnavailable", "ErrCodeTooManyRequests" ], "x-speakeasy-name-override": "ErrorCode" }, "Addon": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "description": { "type": "string" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "lookup_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true }, "name": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "Coupon": { "type": "object", "properties": { "amount_off": { "type": "string" }, "cadence": { "$ref": "#/components/schemas/types.CouponCadence" }, "coupon_code": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string" }, "duration_in_periods": { "type": "integer" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "max_redemptions": { "type": "integer" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "percentage_off": { "type": "string" }, "redeem_after": { "type": "string" }, "redeem_before": { "type": "string" }, "rules": { "type": "object", "additionalProperties": true }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "total_redemptions": { "type": "integer" }, "type": { "$ref": "#/components/schemas/types.CouponType" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "Customer": { "type": "object", "properties": { "address_city": { "type": "string", "description": "AddressCity is the city of the customer's address" }, "address_country": { "type": "string", "description": "AddressCountry is the country of the customer's address (ISO 3166-1 alpha-2)" }, "address_line1": { "type": "string", "description": "AddressLine1 is the first line of the customer's address" }, "address_line2": { "type": "string", "description": "AddressLine2 is the second line of the customer's address" }, "address_postal_code": { "type": "string", "description": "AddressPostalCode is the postal code of the customer's address" }, "address_state": { "type": "string", "description": "AddressState is the state of the customer's address" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "email": { "type": "string", "description": "Email is the email of the customer" }, "environment_id": { "type": "string", "description": "EnvironmentID is the environment identifier for the customer" }, "external_id": { "type": "string", "description": "ExternalID is the external identifier for the customer" }, "id": { "type": "string", "description": "ID is the unique identifier for the customer" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Metadata" }, "name": { "type": "string", "description": "Name is the name of the customer" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "timezone": { "type": "string", "description": "Timezone is the customer's IANA timezone name (e.g. \"Asia/Kolkata\").\nDefaults to \"UTC\". Inherited by subscriptions at creation time." }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "Feature": { "type": "object", "properties": { "alert_settings": { "$ref": "#/components/schemas/types.AlertSettings" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "description": { "type": "string" }, "environment_id": { "type": "string" }, "group": { "$ref": "#/components/schemas/group.Group" }, "group_id": { "type": "string" }, "id": { "type": "string" }, "lookup_key": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "meter_id": { "type": "string" }, "name": { "type": "string" }, "reporting_unit": { "$ref": "#/components/schemas/types.ReportingUnit" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "type": { "$ref": "#/components/schemas/types.FeatureType" }, "unit_plural": { "type": "string" }, "unit_singular": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "Plan": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "description": { "type": "string" }, "display_order": { "type": "integer" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "lookup_key": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "name": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "errors.ErrorResponse": { "type": "object", "properties": { "code": { "$ref": "#/components/schemas/errors.ErrorCode" }, "http_status_code": { "type": "integer" }, "message": { "type": "string" } }, "x-speakeasy-name-override": "ErrorResponse" }, "types.AddonAssociationEntityType": { "type": "string", "enum": [ "subscription", "plan", "addon" ], "x-enum-varnames": [ "AddonAssociationEntityTypeSubscription", "AddonAssociationEntityTypePlan", "AddonAssociationEntityTypeAddon" ], "x-speakeasy-name-override": "AddonAssociationEntityType" }, "types.AddonCadence": { "type": "string", "enum": [ "onetime", "recurring" ], "x-enum-varnames": [ "AddonCadenceOnetime", "AddonCadenceRecurring" ], "x-speakeasy-name-override": "AddonCadence" }, "types.AddonFilter": { "type": "object", "properties": { "addon_ids": { "type": "array", "items": { "type": "string" } }, "end_time": { "type": "string", "format": "date-time" }, "expand": { "type": "string" }, "filters": { "type": "array", "description": "filters allows complex filtering based on multiple fields", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "lookup_keys": { "type": "array", "items": { "type": "string" } }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" } }, "x-speakeasy-name-override": "AddonFilter" }, "types.AddonStatus": { "type": "string", "enum": [ "active", "cancelled", "pending" ], "x-enum-varnames": [ "AddonStatusActive", "AddonStatusCancelled", "AddonStatusPending" ], "x-speakeasy-name-override": "AddonStatus" }, "types.AggregationType": { "type": "string", "enum": [ "COUNT", "SUM", "AVG", "COUNT_UNIQUE", "LATEST", "SUM_WITH_MULTIPLIER", "MAX", "WEIGHTED_SUM" ], "x-enum-comments": { "AggregationSumWithMultiplier": "Sum with a multiplier - [sum(value) * multiplier]" }, "x-enum-varnames": [ "AggregationCount", "AggregationSum", "AggregationAvg", "AggregationCountUnique", "AggregationLatest", "AggregationSumWithMultiplier", "AggregationMax", "AggregationWeightedSum" ], "x-speakeasy-name-override": "AggregationType" }, "types.AlertCondition": { "type": "string", "enum": [ "above", "below" ], "x-enum-varnames": [ "AlertConditionAbove", "AlertConditionBelow" ], "x-speakeasy-name-override": "AlertCondition" }, "types.AlertEntityType": { "type": "string", "enum": [ "wallet", "feature" ], "x-enum-varnames": [ "AlertEntityTypeWallet", "AlertEntityTypeFeature" ], "x-speakeasy-name-override": "AlertEntityType" }, "types.AlertInfo": { "type": "object", "properties": { "alert_settings": { "$ref": "#/components/schemas/types.AlertSettings" }, "timestamp": { "type": "string" }, "value_at_time": { "type": "number" } }, "x-speakeasy-name-override": "AlertInfo" }, "types.AlertLogFilter": { "type": "object", "properties": { "alert_status": { "$ref": "#/components/schemas/types.AlertState" }, "alert_type": { "$ref": "#/components/schemas/types.AlertType" }, "customer_id": { "type": "string" }, "end_time": { "type": "string", "format": "date-time" }, "entity_id": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.AlertEntityType" }, "expand": { "type": "string" }, "filters": { "type": "array", "description": "filters allows complex filtering based on multiple fields", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" } }, "x-speakeasy-name-override": "AlertLogFilter" }, "types.AlertSettings": { "type": "object", "properties": { "alert_enabled": { "type": "boolean" }, "critical": { "$ref": "#/components/schemas/types.AlertThreshold" }, "info": { "$ref": "#/components/schemas/types.AlertThreshold" }, "warning": { "$ref": "#/components/schemas/types.AlertThreshold" } }, "x-speakeasy-name-override": "AlertSettings" }, "types.AlertState": { "type": "string", "enum": [ "ok", "info", "warning", "in_alarm" ], "x-enum-varnames": [ "AlertStateOk", "AlertStateInfo", "AlertStateWarning", "AlertStateInAlarm" ], "x-speakeasy-name-override": "AlertState" }, "types.AlertThreshold": { "type": "object", "properties": { "condition": { "$ref": "#/components/schemas/types.AlertCondition" }, "threshold": { "type": "number" } }, "x-speakeasy-name-override": "AlertThreshold" }, "types.AlertType": { "type": "string", "enum": [ "low_ongoing_balance", "low_credit_balance", "feature_wallet_balance" ], "x-enum-varnames": [ "AlertTypeLowOngoingBalance", "AlertTypeLowCreditBalance", "AlertTypeFeatureWalletBalance" ], "x-speakeasy-name-override": "AlertType" }, "types.ApplicationStatus": { "type": "string", "enum": [ "applied", "failed", "pending", "skipped", "cancelled" ], "x-enum-varnames": [ "ApplicationStatusApplied", "ApplicationStatusFailed", "ApplicationStatusPending", "ApplicationStatusSkipped", "ApplicationStatusCancelled" ], "x-speakeasy-name-override": "ApplicationStatus" }, "types.AutoTopup": { "type": "object", "properties": { "amount": { "type": "number" }, "enabled": { "type": "boolean" }, "invoicing": { "type": "boolean" }, "threshold": { "type": "number" } }, "x-speakeasy-name-override": "AutoTopup" }, "types.BillingCadence": { "type": "string", "enum": [ "RECURRING" ], "x-enum-varnames": [ "BILLING_CADENCE_RECURRING" ], "x-speakeasy-name-override": "BillingCadence" }, "types.BillingCycle": { "type": "string", "enum": [ "anniversary", "calendar" ], "x-enum-varnames": [ "BillingCycleAnniversary", "BillingCycleCalendar" ], "x-speakeasy-name-override": "BillingCycle" }, "types.BillingModel": { "type": "string", "enum": [ "FLAT_FEE", "PACKAGE", "TIERED" ], "x-enum-varnames": [ "BILLING_MODEL_FLAT_FEE", "BILLING_MODEL_PACKAGE", "BILLING_MODEL_TIERED" ], "x-speakeasy-name-override": "BillingModel" }, "types.BillingPeriod": { "type": "string", "enum": [ "MONTHLY", "ANNUAL", "WEEKLY", "DAILY", "QUARTERLY", "HALF_YEARLY", "ONETIME" ], "x-enum-varnames": [ "BILLING_PERIOD_MONTHLY", "BILLING_PERIOD_ANNUAL", "BILLING_PERIOD_WEEKLY", "BILLING_PERIOD_DAILY", "BILLING_PERIOD_QUARTER", "BILLING_PERIOD_HALF_YEAR", "BILLING_PERIOD_ONETIME" ], "x-speakeasy-name-override": "BillingPeriod" }, "types.BillingTier": { "type": "string", "enum": [ "VOLUME", "SLAB" ], "x-enum-varnames": [ "BILLING_TIER_VOLUME", "BILLING_TIER_SLAB" ], "x-speakeasy-name-override": "BillingTier" }, "types.Bucket": { "type": "object", "properties": { "hour": { "maximum": 24, "minimum": 0, "type": "integer" }, "minute": { "maximum": 59, "minimum": 0, "type": "integer" } }, "x-speakeasy-name-override": "Bucket" }, "types.CancelImmediatelyInvoicePolicy": { "type": "string", "enum": [ "generate_invoice", "skip" ], "x-enum-varnames": [ "CancelImmediatelyInvoicePolicyGenerateInvoice", "CancelImmediatelyInvoicePolicySkip" ], "x-speakeasy-name-override": "CancelImmediatelyInvoicePolicy" }, "types.CancellationType": { "type": "string", "enum": [ "immediate", "end_of_period", "scheduled_date" ], "x-enum-varnames": [ "CancellationTypeImmediate", "CancellationTypeEndOfPeriod", "CancellationTypeScheduledDate" ], "x-speakeasy-name-override": "CancellationType" }, "types.CollectionMethod": { "type": "string", "enum": [ "charge_automatically", "send_invoice" ], "x-enum-varnames": [ "CollectionMethodChargeAutomatically", "CollectionMethodSendInvoice" ], "x-speakeasy-name-override": "CollectionMethod" }, "types.CommitmentInfo": { "type": "object", "properties": { "amount": { "type": "string" }, "computed_commitment_utilized_amount": { "type": "string" }, "computed_overage_amount": { "type": "string" }, "computed_true_up_amount": { "type": "string", "description": "total_cost = computed_commitment_utilized_amount + computed_overage_amount + computed_true_up_amount" }, "duration": { "$ref": "#/components/schemas/types.BillingPeriod" }, "is_windowed": { "type": "boolean" }, "overage_factor": { "type": "string" }, "quantity": { "type": "string", "description": "Only used for quantity-based commitments" }, "true_up_enabled": { "type": "boolean" }, "type": { "$ref": "#/components/schemas/types.CommitmentType" } }, "x-speakeasy-name-override": "CommitmentInfo" }, "types.CommitmentType": { "type": "string", "enum": [ "amount", "quantity" ], "x-enum-varnames": [ "COMMITMENT_TYPE_AMOUNT", "COMMITMENT_TYPE_QUANTITY" ], "x-speakeasy-name-override": "CommitmentType" }, "types.CouponCadence": { "type": "string", "enum": [ "once", "repeated", "forever" ], "x-enum-varnames": [ "CouponCadenceOnce", "CouponCadenceRepeated", "CouponCadenceForever" ], "x-speakeasy-name-override": "CouponCadence" }, "types.CouponFilter": { "type": "object", "properties": { "coupon_codes": { "type": "array", "items": { "type": "string" } }, "coupon_ids": { "type": "array", "items": { "type": "string" } }, "expand": { "type": "string" }, "filters": { "type": "array", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "status": { "$ref": "#/components/schemas/types.Status" } }, "x-speakeasy-name-override": "CouponFilter" }, "types.CouponType": { "type": "string", "enum": [ "fixed", "percentage" ], "x-enum-varnames": [ "CouponTypeFixed", "CouponTypePercentage" ], "x-speakeasy-name-override": "CouponType" }, "types.CreditBreakdown": { "type": "object", "properties": { "free": { "type": "string" }, "purchased": { "type": "string" } }, "x-speakeasy-name-override": "CreditBreakdown" }, "types.CreditGrantApplicationReason": { "type": "string", "enum": [ "first_time_recurring_credit_grant", "recurring_credit_grant", "onetime_credit_grant" ], "x-enum-varnames": [ "ApplicationReasonFirstTimeRecurringCreditGrant", "ApplicationReasonRecurringCreditGrant", "ApplicationReasonOnetimeCreditGrant" ], "x-speakeasy-name-override": "CreditGrantApplicationReason" }, "types.CreditGrantCadence": { "type": "string", "enum": [ "ONETIME", "RECURRING" ], "x-enum-varnames": [ "CreditGrantCadenceOneTime", "CreditGrantCadenceRecurring" ], "x-speakeasy-name-override": "CreditGrantCadence" }, "types.CreditGrantExpiryDurationUnit": { "type": "string", "enum": [ "DAY", "WEEK", "MONTH", "YEAR" ], "x-enum-varnames": [ "CreditGrantExpiryDurationUnitDays", "CreditGrantExpiryDurationUnitWeeks", "CreditGrantExpiryDurationUnitMonths", "CreditGrantExpiryDurationUnitYears" ], "x-speakeasy-name-override": "CreditGrantExpiryDurationUnit" }, "types.CreditGrantExpiryType": { "type": "string", "enum": [ "NEVER", "DURATION", "BILLING_CYCLE" ], "x-enum-varnames": [ "CreditGrantExpiryTypeNever", "CreditGrantExpiryTypeDuration", "CreditGrantExpiryTypeBillingCycle" ], "x-speakeasy-name-override": "CreditGrantExpiryType" }, "types.CreditGrantPeriod": { "type": "string", "enum": [ "DAILY", "WEEKLY", "MONTHLY", "ANNUAL", "QUARTERLY", "HALF_YEARLY" ], "x-enum-varnames": [ "CREDIT_GRANT_PERIOD_DAILY", "CREDIT_GRANT_PERIOD_WEEKLY", "CREDIT_GRANT_PERIOD_MONTHLY", "CREDIT_GRANT_PERIOD_ANNUAL", "CREDIT_GRANT_PERIOD_QUARTER", "CREDIT_GRANT_PERIOD_HALF_YEARLY" ], "x-speakeasy-name-override": "CreditGrantPeriod" }, "types.CreditGrantScope": { "type": "string", "enum": [ "PLAN", "SUBSCRIPTION" ], "x-enum-varnames": [ "CreditGrantScopePlan", "CreditGrantScopeSubscription" ], "x-speakeasy-name-override": "CreditGrantScope" }, "types.CreditNoteReason": { "type": "string", "enum": [ "DUPLICATE", "FRAUDULENT", "ORDER_CHANGE", "UNSATISFACTORY", "SERVICE_ISSUE", "BILLING_ERROR", "SUBSCRIPTION_CANCELLATION" ], "x-enum-varnames": [ "CreditNoteReasonDuplicate", "CreditNoteReasonFraudulent", "CreditNoteReasonOrderChange", "CreditNoteReasonUnsatisfactory", "CreditNoteReasonService", "CreditNoteReasonBillingError", "CreditNoteReasonSubscriptionCancellation" ], "x-speakeasy-name-override": "CreditNoteReason" }, "types.CreditNoteStatus": { "type": "string", "enum": [ "DRAFT", "FINALIZED", "VOIDED" ], "x-enum-varnames": [ "CreditNoteStatusDraft", "CreditNoteStatusFinalized", "CreditNoteStatusVoided" ], "x-speakeasy-name-override": "CreditNoteStatus" }, "types.CreditNoteType": { "type": "string", "enum": [ "ADJUSTMENT", "REFUND" ], "x-enum-varnames": [ "CreditNoteTypeAdjustment", "CreditNoteTypeRefund" ], "x-speakeasy-name-override": "CreditNoteType" }, "types.CustomerFilter": { "type": "object", "properties": { "customer_ids": { "type": "array", "items": { "type": "string" } }, "email": { "type": "string" }, "end_time": { "type": "string", "format": "date-time" }, "expand": { "type": "string" }, "external_id": { "type": "string" }, "external_ids": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "array", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" } }, "x-speakeasy-name-override": "CustomerFilter" }, "types.DataType": { "type": "string", "enum": [ "string", "number", "date", "array" ], "x-enum-varnames": [ "DataTypeString", "DataTypeNumber", "DataTypeDate", "DataTypeArray" ], "x-speakeasy-name-override": "DataType" }, "types.DebugTrackerStatus": { "type": "string", "enum": [ "unprocessed", "not_found", "found", "error", "processing", "attributed" ], "x-enum-varnames": [ "DebugTrackerStatusUnprocessed", "DebugTrackerStatusNotFound", "DebugTrackerStatusFound", "DebugTrackerStatusError", "DebugTrackerStatusProcessing", "DebugTrackerStatusAttributed" ], "x-speakeasy-name-override": "DebugTrackerStatus" }, "types.EntitlementEntityType": { "type": "string", "enum": [ "PLAN", "SUBSCRIPTION", "ADDON" ], "x-enum-varnames": [ "ENTITLEMENT_ENTITY_TYPE_PLAN", "ENTITLEMENT_ENTITY_TYPE_SUBSCRIPTION", "ENTITLEMENT_ENTITY_TYPE_ADDON" ], "x-speakeasy-name-override": "EntitlementEntityType" }, "types.EntitlementFilter": { "type": "object", "properties": { "end_time": { "type": "string", "format": "date-time" }, "entity_ids": { "type": "array", "items": { "type": "string" } }, "entity_type": { "$ref": "#/components/schemas/types.EntitlementEntityType" }, "expand": { "type": "string" }, "feature_ids": { "type": "array", "items": { "type": "string" } }, "feature_type": { "$ref": "#/components/schemas/types.FeatureType" }, "filters": { "type": "array", "description": "Specific filters for entitlements", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "is_enabled": { "type": "boolean" }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "plan_ids": { "type": "array", "items": { "type": "string" } }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" } }, "x-speakeasy-name-override": "EntitlementFilter" }, "types.EntitlementUsageResetPeriod": { "type": "string", "enum": [ "MONTHLY", "ANNUAL", "WEEKLY", "DAILY", "QUARTERLY", "HALF_YEARLY", "NEVER" ], "x-enum-varnames": [ "ENTITLEMENT_USAGE_RESET_PERIOD_MONTHLY", "ENTITLEMENT_USAGE_RESET_PERIOD_ANNUAL", "ENTITLEMENT_USAGE_RESET_PERIOD_WEEKLY", "ENTITLEMENT_USAGE_RESET_PERIOD_DAILY", "ENTITLEMENT_USAGE_RESET_PERIOD_QUARTER", "ENTITLEMENT_USAGE_RESET_PERIOD_HALF_YEAR", "ENTITLEMENT_USAGE_RESET_PERIOD_NEVER" ], "x-speakeasy-name-override": "EntitlementUsageResetPeriod" }, "types.EntitySyncConfig": { "type": "object", "properties": { "inbound": { "type": "boolean", "description": "Inbound from external provider to FlexPrice" }, "outbound": { "type": "boolean", "description": "Outbound from FlexPrice to external provider" } }, "x-speakeasy-name-override": "EntitySyncConfig" }, "types.EntityType": { "type": "string", "enum": [ "EVENTS", "PRICES", "CUSTOMERS", "FEATURES" ], "x-enum-varnames": [ "EntityTypeEvents", "EntityTypePrices", "EntityTypeCustomers", "EntityTypeFeatures" ], "x-speakeasy-name-override": "EntityType" }, "types.EnvironmentType": { "type": "string", "enum": [ "development", "production" ], "x-enum-varnames": [ "EnvironmentDevelopment", "EnvironmentProduction" ], "x-speakeasy-name-override": "EnvironmentType" }, "types.EventProcessingStatusType": { "type": "string", "enum": [ "processed", "processing", "failed" ], "x-enum-varnames": [ "EventProcessingStatusTypeProcessed", "EventProcessingStatusTypeProcessing", "EventProcessingStatusTypeFailed" ], "x-speakeasy-name-override": "EventProcessingStatusType" }, "types.ExportMetadataEntityType": { "type": "string", "enum": [ "customer", "wallet" ], "x-enum-varnames": [ "ExportMetadataEntityTypeCustomer", "ExportMetadataEntityTypeWallet" ], "x-speakeasy-name-override": "ExportMetadataEntityType" }, "types.ExportMetadataField": { "required": [ "entity_type", "field_key" ], "type": "object", "properties": { "column_name": { "type": "string", "description": "CSV column header to be shown in the exported file" }, "entity_type": { "$ref": "#/components/schemas/types.ExportMetadataEntityType" }, "field_key": { "type": "string", "description": "metadata key to look up" } }, "x-speakeasy-name-override": "ExportMetadataField" }, "types.FailurePoint": { "type": "object", "properties": { "error": { "$ref": "#/components/schemas/errors.ErrorResponse" }, "failure_point_type": { "$ref": "#/components/schemas/types.FailurePointType" } }, "x-speakeasy-name-override": "FailurePoint" }, "types.FailurePointType": { "type": "string", "enum": [ "customer_lookup", "meter_lookup", "price_lookup", "subscription_line_item_lookup", "attributed_to_customer" ], "x-enum-varnames": [ "FailurePointTypeCustomerLookup", "FailurePointTypeMeterLookup", "FailurePointTypePriceLookup", "FailurePointTypeSubscriptionLineItemLookup", "FailurePointTypeAttributedToCustomer" ], "x-speakeasy-name-override": "FailurePointType" }, "types.FeatureFilter": { "type": "object", "properties": { "end_time": { "type": "string", "format": "date-time" }, "expand": { "type": "string" }, "feature_ids": { "type": "array", "description": "Feature specific filters", "items": { "type": "string" } }, "filters": { "type": "array", "description": "filters allows complex filtering based on multiple fields", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "lookup_key": { "type": "string" }, "lookup_keys": { "type": "array", "items": { "type": "string" } }, "meter_ids": { "type": "array", "items": { "type": "string" } }, "name_contains": { "type": "string" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" } }, "x-speakeasy-name-override": "FeatureFilter" }, "types.FeatureType": { "type": "string", "enum": [ "metered", "boolean", "static", "config" ], "x-enum-varnames": [ "FeatureTypeMetered", "FeatureTypeBoolean", "FeatureTypeStatic", "FeatureTypeConfig" ], "x-speakeasy-name-override": "FeatureType" }, "types.FileType": { "type": "string", "enum": [ "CSV", "JSON" ], "x-enum-varnames": [ "FileTypeCSV", "FileTypeJSON" ], "x-speakeasy-name-override": "FileType" }, "types.FilterCondition": { "type": "object", "properties": { "data_type": { "$ref": "#/components/schemas/types.DataType" }, "field": { "type": "string" }, "operator": { "$ref": "#/components/schemas/types.FilterOperatorType" }, "value": { "$ref": "#/components/schemas/types.Value" } }, "x-speakeasy-name-override": "FilterCondition" }, "types.FilterOperatorType": { "type": "string", "enum": [ "eq", "contains", "not_contains", "gt", "lt", "in", "not_in", "before", "after" ], "x-enum-varnames": [ "EQUAL", "CONTAINS", "NOT_CONTAINS", "GREATER_THAN", "LESS_THAN", "IN", "NOT_IN", "BEFORE", "AFTER" ], "x-speakeasy-name-override": "FilterOperatorType" }, "types.GroupEntityType": { "type": "string", "enum": [ "price", "feature" ], "x-enum-varnames": [ "GroupEntityTypePrice", "GroupEntityTypeFeature" ], "x-speakeasy-name-override": "GroupEntityType" }, "types.GroupFilter": { "type": "object", "properties": { "end_time": { "type": "string", "format": "date-time" }, "entity_type": { "type": "string" }, "expand": { "type": "string" }, "filters": { "type": "array", "description": "filters allows complex filtering based on multiple fields", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "group_ids": { "type": "array", "description": "Group specific filters", "items": { "type": "string" } }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "lookup_key": { "type": "string" }, "name": { "type": "string" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" } }, "x-speakeasy-name-override": "GroupFilter" }, "types.IntegrationEntityType": { "type": "string", "enum": [ "customer", "plan", "invoice", "subscription", "payment", "credit_note", "addon", "item", "item_price", "price" ], "x-enum-varnames": [ "IntegrationEntityTypeCustomer", "IntegrationEntityTypePlan", "IntegrationEntityTypeInvoice", "IntegrationEntityTypeSubscription", "IntegrationEntityTypePayment", "IntegrationEntityTypeCreditNote", "IntegrationEntityTypeAddon", "IntegrationEntityTypeItem", "IntegrationEntityTypeItemPrice", "IntegrationEntityTypePrice" ], "x-speakeasy-name-override": "IntegrationEntityType" }, "types.InvoiceBillingReason": { "type": "string", "enum": [ "SUBSCRIPTION_CREATE", "SUBSCRIPTION_CYCLE", "SUBSCRIPTION_UPDATE", "SUBSCRIPTION_TRIAL_END", "SUBSCRIPTION_TRIAL_START", "PRORATION", "MANUAL", "AUTO_INVOICE_THRESHOLD", "WALLET_AUTO_TOPUP" ], "x-enum-varnames": [ "InvoiceBillingReasonSubscriptionCreate", "InvoiceBillingReasonSubscriptionCycle", "InvoiceBillingReasonSubscriptionUpdate", "InvoiceBillingReasonSubscriptionTrialEnd", "InvoiceBillingReasonSubscriptionTrialStart", "InvoiceBillingReasonProration", "InvoiceBillingReasonManual", "InvoiceBillingReasonAutoInvoiceThreshold", "InvoiceBillingReasonWalletAutoTopup" ], "x-speakeasy-name-override": "InvoiceBillingReason" }, "types.InvoiceCadence": { "type": "string", "enum": [ "ARREAR", "ADVANCE" ], "x-enum-varnames": [ "InvoiceCadenceArrear", "InvoiceCadenceAdvance" ], "x-speakeasy-name-override": "InvoiceCadence" }, "types.InvoiceFilter": { "type": "object", "properties": { "amount_due_gt": { "type": "number", "description": "amount_due_gt filters invoices with a total amount due greater than the specified value\nUseful for finding invoices above a certain threshold or identifying high-value invoices" }, "amount_remaining_gt": { "type": "number", "description": "amount_remaining_gt filters invoices with an outstanding balance greater than the specified value\nUseful for finding invoices that still have significant unpaid amounts" }, "billing_reason": { "$ref": "#/components/schemas/types.InvoiceBillingReason" }, "currency": { "type": "string", "description": "currency filters invoices by their currency (ISO 4217 code, e.g. \"usd\", \"eur\").\nMatches on the invoices.currency column exactly." }, "customer_id": { "type": "string", "description": "customer_id filters invoices for a specific customer using FlexPrice's internal customer ID\nThis is the ID returned by FlexPrice when creating or retrieving customers" }, "end_time": { "type": "string", "format": "date-time" }, "expand": { "type": "string" }, "external_customer_id": { "type": "string", "description": "external_customer_id filters invoices for a customer using your system's customer identifier\nThis is the ID you provided when creating the customer in FlexPrice" }, "filters": { "type": "array", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "invoice_ids": { "type": "array", "description": "invoice_ids restricts results to invoices with the specified IDs\nUse this to retrieve specific invoices when you know their exact identifiers", "items": { "type": "string" } }, "invoice_status": { "type": "array", "description": "invoice_status filters by the current state of invoices in their lifecycle\nMultiple statuses can be specified to include invoices in any of the listed states", "items": { "$ref": "#/components/schemas/types.InvoiceStatus" } }, "invoice_type": { "$ref": "#/components/schemas/types.InvoiceType" }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "payment_status": { "type": "array", "description": "payment_status filters by the payment state of invoices\nMultiple statuses can be specified to include invoices with any of the listed payment states", "items": { "$ref": "#/components/schemas/types.PaymentStatus" } }, "period_end_gte": { "type": "string", "description": "period_end_gte filters invoices with period_end >= value" }, "period_end_lte": { "type": "string", "description": "period_end_lte filters invoices with period_end <= value" }, "period_start_gte": { "type": "string", "description": "period_start_gte filters invoices with period_start >= value" }, "period_start_lte": { "type": "string", "description": "period_start_lte filters invoices with period_start <= value" }, "skip_line_items": { "type": "boolean", "description": "SkipLineItems if true, will not include line items in the response" }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_customer_id": { "type": "array", "description": "subscription_customer_id filters invoices by the subscription owner's customer ID", "items": { "type": "string" } }, "subscription_id": { "type": "string", "description": "subscription_id filters invoices generated for a specific subscription\nOnly returns invoices that were created as part of the specified subscription's billing" } }, "x-speakeasy-name-override": "InvoiceFilter" }, "types.InvoiceStatus": { "type": "string", "enum": [ "DRAFT", "FINALIZED", "VOIDED", "SKIPPED" ], "x-enum-varnames": [ "InvoiceStatusDraft", "InvoiceStatusFinalized", "InvoiceStatusVoided", "InvoiceStatusSkipped" ], "x-speakeasy-name-override": "InvoiceStatus" }, "types.InvoiceSyncSettings": { "type": "object", "properties": { "normalize_fixed_to": { "$ref": "#/components/schemas/types.BillingPeriod" } }, "x-speakeasy-name-override": "InvoiceSyncSettings" }, "types.InvoiceType": { "type": "string", "enum": [ "SUBSCRIPTION", "ONE_OFF", "CREDIT" ], "x-enum-varnames": [ "InvoiceTypeSubscription", "InvoiceTypeOneOff", "InvoiceTypeCredit" ], "x-speakeasy-name-override": "InvoiceType" }, "types.PaginationResponse": { "type": "object", "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "total": { "type": "integer" } }, "x-speakeasy-name-override": "PaginationResponse" }, "types.PauseMode": { "type": "string", "enum": [ "immediate", "scheduled", "period_end" ], "x-enum-varnames": [ "PauseModeImmediate", "PauseModeScheduled", "PauseModePeriodEnd" ], "x-speakeasy-name-override": "PauseMode" }, "types.PauseStatus": { "type": "string", "enum": [ "none", "active", "scheduled", "completed", "cancelled" ], "x-enum-varnames": [ "PauseStatusNone", "PauseStatusActive", "PauseStatusScheduled", "PauseStatusCompleted", "PauseStatusCancelled" ], "x-speakeasy-name-override": "PauseStatus" }, "types.PaymentBehavior": { "type": "string", "enum": [ "allow_incomplete", "default_incomplete", "error_if_incomplete", "default_active" ], "x-enum-varnames": [ "PaymentBehaviorAllowIncomplete", "PaymentBehaviorDefaultIncomplete", "PaymentBehaviorErrorIfIncomplete", "PaymentBehaviorDefaultActive" ], "x-speakeasy-name-override": "PaymentBehavior" }, "types.PaymentDestinationType": { "type": "string", "enum": [ "INVOICE", "CUSTOMER" ], "x-enum-varnames": [ "PaymentDestinationTypeInvoice", "PaymentDestinationTypeCustomer" ], "x-speakeasy-name-override": "PaymentDestinationType" }, "types.PaymentGatewayType": { "type": "string", "enum": [ "stripe", "razorpay", "nomod", "moyasar", "paddle", "whop" ], "x-enum-varnames": [ "PaymentGatewayTypeStripe", "PaymentGatewayTypeRazorpay", "PaymentGatewayTypeNomod", "PaymentGatewayTypeMoyasar", "PaymentGatewayTypePaddle", "PaymentGatewayTypeWhop" ], "x-speakeasy-name-override": "PaymentGatewayType" }, "types.PaymentMethodType": { "type": "string", "enum": [ "CARD", "ACH", "OFFLINE", "CREDITS", "PAYMENT_LINK" ], "x-enum-varnames": [ "PaymentMethodTypeCard", "PaymentMethodTypeACH", "PaymentMethodTypeOffline", "PaymentMethodTypeCredits", "PaymentMethodTypePaymentLink" ], "x-speakeasy-name-override": "PaymentMethodType" }, "types.PaymentStatus": { "type": "string", "enum": [ "INITIATED", "PENDING", "PROCESSING", "SUCCEEDED", "OVERPAID", "FAILED", "REFUNDED", "PARTIALLY_REFUNDED", "VOIDED" ], "x-enum-varnames": [ "PaymentStatusInitiated", "PaymentStatusPending", "PaymentStatusProcessing", "PaymentStatusSucceeded", "PaymentStatusOverpaid", "PaymentStatusFailed", "PaymentStatusRefunded", "PaymentStatusPartiallyRefunded", "PaymentStatusVoided" ], "x-speakeasy-name-override": "PaymentStatus" }, "types.PaymentTerms": { "type": "string", "enum": [ "15 NET", "30 NET", "45 NET", "60 NET", "75 NET", "90 NET" ], "x-enum-varnames": [ "PaymentTerms15Net", "PaymentTerms30Net", "PaymentTerms45Net", "PaymentTerms60Net", "PaymentTerms75Net", "PaymentTerms90Net" ], "x-speakeasy-name-override": "PaymentTerms" }, "types.PlanFilter": { "type": "object", "properties": { "end_time": { "type": "string", "format": "date-time" }, "expand": { "type": "string" }, "filters": { "type": "array", "description": "filters allows complex filtering based on multiple fields", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "lookup_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "plan_ids": { "type": "array", "items": { "type": "string" } }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" } }, "x-speakeasy-name-override": "PlanFilter" }, "types.PriceEntityType": { "type": "string", "enum": [ "PLAN", "SUBSCRIPTION", "ADDON", "PRICE", "COSTSHEET" ], "x-enum-varnames": [ "PRICE_ENTITY_TYPE_PLAN", "PRICE_ENTITY_TYPE_SUBSCRIPTION", "PRICE_ENTITY_TYPE_ADDON", "PRICE_ENTITY_TYPE_PRICE", "PRICE_ENTITY_TYPE_COSTSHEET" ], "x-speakeasy-name-override": "PriceEntityType" }, "types.PriceFilter": { "type": "object", "properties": { "allow_expired_prices": { "type": "boolean", "default": false }, "billing_periods": { "type": "array", "items": { "$ref": "#/components/schemas/types.BillingPeriod" } }, "end_time": { "type": "string", "format": "date-time" }, "entity_ids": { "type": "array", "items": { "type": "string" } }, "entity_type": { "$ref": "#/components/schemas/types.PriceEntityType" }, "expand": { "type": "string" }, "filters": { "type": "array", "description": "DSL filters", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "meter_ids": { "type": "array", "items": { "type": "string" } }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "parent_price_id": { "type": "string" }, "plan_ids": { "type": "array", "description": "Price override filtering fields", "items": { "type": "string" } }, "price_ids": { "type": "array", "items": { "type": "string" } }, "sort": { "type": "string" }, "start_date_lt": { "type": "string" }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string" } }, "x-speakeasy-name-override": "PriceFilter" }, "types.PriceType": { "type": "string", "enum": [ "USAGE", "FIXED" ], "x-enum-varnames": [ "PRICE_TYPE_USAGE", "PRICE_TYPE_FIXED" ], "x-speakeasy-name-override": "PriceType" }, "types.PriceUnitFilter": { "type": "object", "properties": { "end_time": { "type": "string", "format": "date-time" }, "expand": { "type": "string" }, "filters": { "type": "array", "description": "filters allows complex filtering based on multiple fields", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "price_unit_ids": { "type": "array", "items": { "type": "string" } }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" } }, "x-speakeasy-name-override": "PriceUnitFilter" }, "types.PriceUnitType": { "type": "string", "enum": [ "FIAT", "CUSTOM" ], "x-enum-varnames": [ "PRICE_UNIT_TYPE_FIAT", "PRICE_UNIT_TYPE_CUSTOM" ], "x-speakeasy-name-override": "PriceUnitType" }, "types.ProrationBehavior": { "type": "string", "enum": [ "create_prorations", "none" ], "x-enum-comments": { "ProrationBehaviorCreateProrations": "Default: Create credits/charges on invoice", "ProrationBehaviorNone": "Calculate but don't apply (e.g., for previews)" }, "x-enum-varnames": [ "ProrationBehaviorCreateProrations", "ProrationBehaviorNone" ], "x-speakeasy-name-override": "ProrationBehavior" }, "types.QueryFilter": { "type": "object", "properties": { "expand": { "type": "string" }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "sort": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" } }, "x-speakeasy-name-override": "QueryFilter" }, "types.ReportingUnit": { "type": "object", "properties": { "conversion_rate": { "type": "number", "description": "Multiplier: reporting_unit_value = unit_value * conversion_rate; must be > 0" }, "unit_plural": { "type": "string", "description": "Display unit label, plural (e.g. \"seconds\")" }, "unit_singular": { "type": "string", "description": "Display unit label, singular (e.g. \"second\")" } }, "x-speakeasy-name-override": "ReportingUnit" }, "types.ResetUsage": { "type": "string", "enum": [ "BILLING_PERIOD", "NEVER" ], "x-enum-varnames": [ "ResetUsageBillingPeriod", "ResetUsageNever" ], "x-speakeasy-name-override": "ResetUsage" }, "types.ResumeMode": { "type": "string", "enum": [ "immediate", "scheduled", "auto" ], "x-enum-varnames": [ "ResumeModeImmediate", "ResumeModeScheduled", "ResumeModeAuto" ], "x-speakeasy-name-override": "ResumeMode" }, "types.RoundType": { "type": "string", "enum": [ "up", "down" ], "x-enum-varnames": [ "ROUND_UP", "ROUND_DOWN" ], "x-speakeasy-name-override": "RoundType" }, "types.S3CompressionType": { "type": "string", "enum": [ "none", "gzip" ], "x-enum-varnames": [ "S3CompressionTypeNone", "S3CompressionTypeGzip" ], "x-speakeasy-name-override": "S3CompressionType" }, "types.S3EncryptionType": { "type": "string", "enum": [ "AES256", "aws:kms", "aws:kms:dsse" ], "x-enum-varnames": [ "S3EncryptionTypeAES256", "S3EncryptionTypeAwsKms", "S3EncryptionTypeAwsKmsDsse" ], "x-speakeasy-name-override": "S3EncryptionType" }, "types.S3ExportConfig": { "type": "object", "properties": { "bucket": { "type": "string", "description": "S3 bucket name" }, "compression": { "$ref": "#/components/schemas/types.S3CompressionType" }, "encryption": { "$ref": "#/components/schemas/types.S3EncryptionType" }, "is_flexprice_managed": { "type": "boolean", "description": "If true, use Flexprice-managed S3 credentials instead of user-provided" }, "key_prefix": { "type": "string", "description": "Optional prefix for S3 keys (e.g., \"flexprice-exports/\")" }, "region": { "type": "string", "description": "AWS region (e.g., \"us-west-2\")" } }, "x-speakeasy-name-override": "S3ExportConfig" }, "types.S3JobConfig": { "type": "object", "properties": { "bucket": { "type": "string", "description": "S3 bucket name" }, "compression": { "$ref": "#/components/schemas/types.S3CompressionType" }, "encryption": { "$ref": "#/components/schemas/types.S3EncryptionType" }, "endpoint_url": { "type": "string", "description": "Custom S3 endpoint URL (e.g., \"http://minio:9000\" for MinIO)" }, "export_metadata_fields": { "type": "array", "description": "Optional user-selected metadata columns", "items": { "$ref": "#/components/schemas/types.ExportMetadataField" } }, "key_prefix": { "type": "string", "description": "Optional prefix for S3 keys (e.g., \"flexprice-exports/\")" }, "region": { "type": "string", "description": "AWS region (e.g., \"us-west-2\")" }, "use_path_style": { "type": "boolean", "description": "Use path-style addressing (required for MinIO)" } }, "x-speakeasy-name-override": "S3JobConfig" }, "types.ScheduleStatus": { "type": "string", "enum": [ "pending", "executing", "executed", "cancelled", "failed" ], "x-enum-varnames": [ "ScheduleStatusPending", "ScheduleStatusExecuting", "ScheduleStatusExecuted", "ScheduleStatusCancelled", "ScheduleStatusFailed" ], "x-speakeasy-name-override": "ScheduleStatus" }, "types.ScheduleType": { "type": "string", "enum": [ "immediate", "end_of_period" ], "x-enum-varnames": [ "ScheduleTypeImmediate", "ScheduleTypePeriodEnd" ], "x-speakeasy-name-override": "ScheduleType" }, "types.ScheduledTaskEntityType": { "type": "string", "enum": [ "events", "invoice", "credit_topups", "credit_usage", "usage_analytics" ], "x-enum-varnames": [ "ScheduledTaskEntityTypeEvents", "ScheduledTaskEntityTypeInvoice", "ScheduledTaskEntityTypeCreditTopups", "ScheduledTaskEntityTypeCreditUsage", "ScheduledTaskEntityTypeUsageAnalytics" ], "x-speakeasy-name-override": "ScheduledTaskEntityType" }, "types.ScheduledTaskInterval": { "type": "string", "enum": [ "15MIN", "30MIN", "custom", "hourly", "daily" ], "x-enum-comments": { "ScheduledTaskIntervalCustom": "10 minutes for testing" }, "x-enum-varnames": [ "ScheduledTaskIntervalEvery15Minutes", "ScheduledTaskIntervalEvery30Minutes", "ScheduledTaskIntervalCustom", "ScheduledTaskIntervalHourly", "ScheduledTaskIntervalDaily" ], "x-speakeasy-name-override": "ScheduledTaskInterval" }, "types.SecretProvider": { "type": "string", "enum": [ "flexprice", "stripe", "s3", "hubspot", "razorpay", "chargebee", "quickbooks", "zoho_books", "nomod", "moyasar", "paddle", "whop" ], "x-enum-comments": { "SecretProviderS3": "supports multiple connections per environment" }, "x-enum-varnames": [ "SecretProviderFlexPrice", "SecretProviderStripe", "SecretProviderS3", "SecretProviderHubSpot", "SecretProviderRazorpay", "SecretProviderChargebee", "SecretProviderQuickBooks", "SecretProviderZohoBooks", "SecretProviderNomod", "SecretProviderMoyasar", "SecretProviderPaddle", "SecretProviderWhop" ], "x-speakeasy-name-override": "SecretProvider" }, "types.SecretType": { "type": "string", "enum": [ "private_key", "publishable_key", "integration" ], "x-enum-varnames": [ "SecretTypePrivateKey", "SecretTypePublishableKey", "SecretTypeIntegration" ], "x-speakeasy-name-override": "SecretType" }, "types.SortCondition": { "type": "object", "properties": { "direction": { "$ref": "#/components/schemas/types.SortDirection" }, "field": { "type": "string" } }, "x-speakeasy-name-override": "SortCondition" }, "types.SortDirection": { "type": "string", "enum": [ "asc", "desc" ], "x-enum-varnames": [ "SortDirectionAsc", "SortDirectionDesc" ], "x-speakeasy-name-override": "SortDirection" }, "types.Status": { "type": "string", "enum": [ "published", "deleted", "archived" ], "x-enum-varnames": [ "StatusPublished", "StatusDeleted", "StatusArchived" ], "x-speakeasy-name-override": "Status" }, "types.SubscriptionChangeType": { "type": "string", "enum": [ "upgrade", "downgrade", "lateral" ], "x-enum-varnames": [ "SubscriptionChangeTypeUpgrade", "SubscriptionChangeTypeDowngrade", "SubscriptionChangeTypeLateral" ], "x-speakeasy-name-override": "SubscriptionChangeType" }, "types.SubscriptionFilter": { "type": "object", "properties": { "active_at": { "type": "string", "description": "ActiveAt filters subscriptions that are active at the given time", "format": "date-time" }, "billing_cadence": { "type": "array", "description": "BillingCadence filters by billing cadence", "items": { "$ref": "#/components/schemas/types.BillingCadence" } }, "billing_period": { "type": "array", "description": "BillingPeriod filters by billing period", "items": { "$ref": "#/components/schemas/types.BillingPeriod" } }, "customer_id": { "type": "string", "description": "CustomerID filters by customer ID" }, "customer_ids": { "type": "array", "description": "CustomerIDs filters by customer IDs", "items": { "type": "string" } }, "effective_date_for_update": { "type": "string", "description": "EffectiveDateForUpdate selects subscriptions that need a billing-period pass on or before this time:\ncurrent_period_end <= date OR (cancel_at IS NOT NULL AND cancel_at <= date).\nWhen nil, period/cancel cutoff logic is not applied by this field (see TimeRangeFilter for legacy period-end filtering)." }, "end_time": { "type": "string", "format": "date-time" }, "expand": { "type": "string" }, "external_customer_id": { "type": "string", "description": "ExternalCustomerID filters by external customer ID" }, "filters": { "type": "array", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "invoicing_customer_ids": { "type": "array", "description": "InvoicingCustomerIDs filters by invoicing customer ID", "items": { "type": "string" } }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "parent_subscription_ids": { "type": "array", "description": "ParentSubscriptionIDs filters by parent subscription IDs", "items": { "type": "string" } }, "plan_id": { "type": "string", "description": "PlanID filters by plan ID" }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_ids": { "type": "array", "items": { "type": "string" } }, "subscription_status": { "type": "array", "description": "SubscriptionStatus filters by subscription status", "items": { "$ref": "#/components/schemas/types.SubscriptionStatus" } }, "subscription_type": { "type": "array", "description": "SubscriptionType filters by subscription type", "items": { "$ref": "#/components/schemas/types.SubscriptionType" } }, "trial_end_due_lte": { "type": "string", "description": "TrialEndDueLTE, when set, restricts to subscriptions with trial_end not nil and trial_end <= trial_end_due_lte.\nUse with subscription_status trialing for trial-end cron processing.", "format": "date-time" }, "with_line_items": { "type": "boolean", "description": "WithLineItems includes line items in the response" } }, "x-speakeasy-name-override": "SubscriptionFilter" }, "types.SubscriptionLineItemEntityType": { "type": "string", "enum": [ "plan", "addon", "subscription" ], "x-enum-varnames": [ "SubscriptionLineItemEntityTypePlan", "SubscriptionLineItemEntityTypeAddon", "SubscriptionLineItemEntityTypeSubscription" ], "x-speakeasy-name-override": "SubscriptionLineItemEntityType" }, "types.SubscriptionLineItemFilter": { "type": "object", "properties": { "active_filter": { "type": "boolean", "default": true }, "addon_association_ids": { "type": "array", "items": { "type": "string" } }, "billing_periods": { "type": "array", "items": { "type": "string" } }, "currencies": { "type": "array", "items": { "type": "string" } }, "current_period_start": { "type": "string", "format": "date-time" }, "customer_ids": { "type": "array", "items": { "type": "string" } }, "end_time": { "type": "string", "format": "date-time" }, "entity_ids": { "type": "array", "items": { "type": "string" } }, "entity_type": { "$ref": "#/components/schemas/types.SubscriptionLineItemEntityType" }, "expand": { "type": "string" }, "filters": { "type": "array", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "meter_ids": { "type": "array", "items": { "type": "string" } }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "price_ids": { "type": "array", "items": { "type": "string" } }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_ids": { "type": "array", "items": { "type": "string" } }, "subscription_line_item_ids": { "type": "array", "description": "Specific filters", "items": { "type": "string" } } }, "x-speakeasy-name-override": "SubscriptionLineItemFilter" }, "types.SubscriptionScheduleChangeType": { "type": "string", "enum": [ "plan_change", "cancellation" ], "x-enum-varnames": [ "SubscriptionScheduleChangeTypePlanChange", "SubscriptionScheduleChangeTypeCancellation" ], "x-speakeasy-name-override": "SubscriptionScheduleChangeType" }, "types.SubscriptionStatus": { "type": "string", "enum": [ "active", "paused", "cancelled", "incomplete", "trialing", "draft" ], "x-enum-varnames": [ "SubscriptionStatusActive", "SubscriptionStatusPaused", "SubscriptionStatusCancelled", "SubscriptionStatusIncomplete", "SubscriptionStatusTrialing", "SubscriptionStatusDraft" ], "x-speakeasy-name-override": "SubscriptionStatus" }, "types.SubscriptionType": { "type": "string", "enum": [ "standalone", "delegated_invoicing", "parent", "inherited", "grouped_invoicing" ], "x-enum-varnames": [ "SubscriptionTypeStandalone", "SubscriptionTypeDelegatedInvoicing", "SubscriptionTypeParent", "SubscriptionTypeInherited", "SubscriptionTypeGroupedInvoicing" ], "x-speakeasy-name-override": "SubscriptionType" }, "types.SyncConfig": { "type": "object", "properties": { "customer": { "$ref": "#/components/schemas/types.EntitySyncConfig" }, "deal": { "$ref": "#/components/schemas/types.EntitySyncConfig" }, "invoice": { "$ref": "#/components/schemas/types.EntitySyncConfig" }, "invoice_sync_settings": { "$ref": "#/components/schemas/types.InvoiceSyncSettings" }, "payment": { "$ref": "#/components/schemas/types.EntitySyncConfig" }, "plan": { "$ref": "#/components/schemas/types.EntitySyncConfig" }, "quote": { "$ref": "#/components/schemas/types.EntitySyncConfig" }, "s3": { "$ref": "#/components/schemas/types.S3ExportConfig" }, "subscription": { "$ref": "#/components/schemas/types.EntitySyncConfig" } }, "x-speakeasy-name-override": "SyncConfig" }, "types.TaskStatus": { "type": "string", "enum": [ "PENDING", "PROCESSING", "COMPLETED", "FAILED" ], "x-enum-varnames": [ "TaskStatusPending", "TaskStatusProcessing", "TaskStatusCompleted", "TaskStatusFailed" ], "x-speakeasy-name-override": "TaskStatus" }, "types.TaskType": { "type": "string", "enum": [ "IMPORT", "EXPORT" ], "x-enum-varnames": [ "TaskTypeImport", "TaskTypeExport" ], "x-speakeasy-name-override": "TaskType" }, "types.TaxRateEntityType": { "type": "string", "enum": [ "customer", "subscription", "invoice", "tenant" ], "x-enum-varnames": [ "TaxRateEntityTypeCustomer", "TaxRateEntityTypeSubscription", "TaxRateEntityTypeInvoice", "TaxRateEntityTypeTenant" ], "x-speakeasy-name-override": "TaxRateEntityType" }, "types.TaxRateScope": { "type": "string", "enum": [ "INTERNAL", "EXTERNAL", "ONETIME" ], "x-enum-varnames": [ "TaxRateScopeInternal", "TaxRateScopeExternal", "TaxRateScopeOneTime" ], "x-speakeasy-name-override": "TaxRateScope" }, "types.TaxRateStatus": { "type": "string", "enum": [ "ACTIVE", "INACTIVE" ], "x-enum-varnames": [ "TaxRateStatusActive", "TaxRateStatusInactive" ], "x-speakeasy-name-override": "TaxRateStatus" }, "types.TaxRateType": { "type": "string", "enum": [ "percentage", "fixed" ], "x-enum-varnames": [ "TaxRateTypePercentage", "TaxRateTypeFixed" ], "x-speakeasy-name-override": "TaxRateType" }, "types.TimeRangeFilter": { "type": "object", "properties": { "end_time": { "type": "string", "format": "date-time" }, "start_time": { "type": "string", "format": "date-time" } }, "x-speakeasy-name-override": "TimeRangeFilter" }, "types.TransactionReason": { "type": "string", "enum": [ "INVOICE_PAYMENT", "FREE_CREDIT_GRANT", "SUBSCRIPTION_CREDIT_GRANT", "PURCHASED_CREDIT_INVOICED", "PURCHASED_CREDIT_DIRECT", "CREDIT_NOTE", "CREDIT_EXPIRED", "WALLET_TERMINATION", "MANUAL_BALANCE_DEBIT", "CREDIT_ADJUSTMENT", "INVOICE_VOID_REFUND" ], "x-enum-varnames": [ "TransactionReasonInvoicePayment", "TransactionReasonFreeCredit", "TransactionReasonSubscriptionCredit", "TransactionReasonPurchasedCreditInvoiced", "TransactionReasonPurchasedCreditDirect", "TransactionReasonCreditNote", "TransactionReasonCreditExpired", "TransactionReasonWalletTermination", "TransactionReasonManualBalanceDebit", "TransactionReasonCreditAdjustment", "TransactionReasonInvoiceVoidRefund" ], "x-speakeasy-name-override": "TransactionReason" }, "types.TransactionStatus": { "type": "string", "enum": [ "pending", "completed", "failed" ], "x-enum-varnames": [ "TransactionStatusPending", "TransactionStatusCompleted", "TransactionStatusFailed" ], "x-speakeasy-name-override": "TransactionStatus" }, "types.TransactionType": { "type": "string", "enum": [ "credit", "debit" ], "x-enum-varnames": [ "TransactionTypeCredit", "TransactionTypeDebit" ], "x-speakeasy-name-override": "TransactionType" }, "types.UserFilter": { "type": "object", "properties": { "end_time": { "type": "string", "format": "date-time" }, "expand": { "type": "string" }, "filters": { "type": "array", "description": "filters allows complex filtering based on multiple fields", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "roles": { "type": "array", "items": { "type": "string" } }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "type": { "$ref": "#/components/schemas/types.UserType" }, "user_ids": { "type": "array", "description": "Specific filters for users", "items": { "type": "string" } } }, "x-speakeasy-name-override": "UserFilter" }, "types.UserType": { "type": "string", "enum": [ "user", "service_account" ], "x-enum-varnames": [ "UserTypeUser", "UserTypeServiceAccount" ], "x-speakeasy-name-override": "UserType" }, "types.Value": { "type": "object", "properties": { "array": { "type": "array", "items": { "type": "string" } }, "boolean": { "type": "boolean" }, "date": { "type": "string" }, "number": { "type": "number" }, "string": { "type": "string" } }, "x-speakeasy-name-override": "Value" }, "types.WalletConfig": { "type": "object", "properties": { "allowed_price_types": { "type": "array", "description": "AllowedPriceTypes is a list of price types that are allowed for the wallet\nnil means all price types are allowed", "items": { "$ref": "#/components/schemas/types.WalletConfigPriceType" } } }, "x-speakeasy-name-override": "WalletConfig" }, "types.WalletConfigPriceType": { "type": "string", "enum": [ "ALL", "USAGE", "FIXED" ], "x-enum-varnames": [ "WalletConfigPriceTypeAll", "WalletConfigPriceTypeUsage", "WalletConfigPriceTypeFixed" ], "x-speakeasy-name-override": "WalletConfigPriceType" }, "types.WalletFilter": { "type": "object", "properties": { "alert_enabled": { "type": "boolean" }, "expand": { "type": "string" }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "sort": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.WalletStatus" }, "wallet_ids": { "type": "array", "items": { "type": "string" } } }, "x-speakeasy-name-override": "WalletFilter" }, "types.WalletStatus": { "type": "string", "enum": [ "active", "frozen", "closed" ], "x-enum-varnames": [ "WalletStatusActive", "WalletStatusFrozen", "WalletStatusClosed" ], "x-speakeasy-name-override": "WalletStatus" }, "types.WalletTransactionFilter": { "type": "object", "properties": { "created_by": { "type": "string" }, "credits_available_gt": { "type": "number" }, "end_time": { "type": "string", "format": "date-time" }, "expand": { "type": "string" }, "expiry_date_after": { "type": "string" }, "expiry_date_before": { "type": "string" }, "filters": { "type": "array", "description": "filters allows complex filtering based on multiple fields", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "id": { "type": "string" }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "priority": { "type": "integer" }, "reference_id": { "type": "string" }, "reference_type": { "type": "string" }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "transaction_reason": { "$ref": "#/components/schemas/types.TransactionReason" }, "transaction_status": { "$ref": "#/components/schemas/types.TransactionStatus" }, "type": { "$ref": "#/components/schemas/types.TransactionType" } }, "x-speakeasy-name-override": "WalletTransactionFilter" }, "types.WalletTxReferenceType": { "type": "string", "enum": [ "PAYMENT", "EXTERNAL", "REQUEST", "INVOICE" ], "x-enum-varnames": [ "WalletTxReferenceTypePayment", "WalletTxReferenceTypeExternal", "WalletTxReferenceTypeRequest", "WalletTxReferenceTypeInvoice" ], "x-speakeasy-name-override": "WalletTxReferenceType" }, "types.WalletType": { "type": "string", "enum": [ "PRE_PAID", "POST_PAID" ], "x-enum-varnames": [ "WalletTypePrePaid", "WalletTypePostPaid" ], "x-speakeasy-name-override": "WalletType" }, "types.WebhookEventName": { "type": "string", "enum": [ "subscription.created", "subscription.draft.created", "subscription.activated", "subscription.updated", "subscription.paused", "subscription.cancelled", "subscription.resumed", "subscription.phase.created", "subscription.phase.updated", "subscription.phase.deleted", "feature.created", "feature.updated", "feature.deleted", "feature.wallet_balance.alert", "entitlement.created", "entitlement.updated", "entitlement.deleted", "wallet.created", "wallet.updated", "wallet.terminated", "wallet.transaction.created", "payment.created", "payment.updated", "payment.failed", "payment.success", "payment.pending", "customer.created", "customer.updated", "customer.deleted", "invoice.update.finalized", "invoice.update.payment", "invoice.update.voided", "invoice.update", "invoice.payment.overdue", "wallet.credit_balance.dropped", "wallet.credit_balance.recovered", "wallet.ongoing_balance.dropped", "wallet.ongoing_balance.recovered", "subscription.renewal.due", "invoice.communication.triggered", "credit_note.created", "credit_note.updated", "checkout.session.initiated", "checkout.session.completed", "checkout.session.failed", "checkout.session.expired" ], "x-enum-varnames": [ "WebhookEventSubscriptionCreated", "WebhookEventSubscriptionDraftCreated", "WebhookEventSubscriptionActivated", "WebhookEventSubscriptionUpdated", "WebhookEventSubscriptionPaused", "WebhookEventSubscriptionCancelled", "WebhookEventSubscriptionResumed", "WebhookEventSubscriptionPhaseCreated", "WebhookEventSubscriptionPhaseUpdated", "WebhookEventSubscriptionPhaseDeleted", "WebhookEventFeatureCreated", "WebhookEventFeatureUpdated", "WebhookEventFeatureDeleted", "WebhookEventFeatureWalletBalanceAlert", "WebhookEventEntitlementCreated", "WebhookEventEntitlementUpdated", "WebhookEventEntitlementDeleted", "WebhookEventWalletCreated", "WebhookEventWalletUpdated", "WebhookEventWalletTerminated", "WebhookEventWalletTransactionCreated", "WebhookEventPaymentCreated", "WebhookEventPaymentUpdated", "WebhookEventPaymentFailed", "WebhookEventPaymentSuccess", "WebhookEventPaymentPending", "WebhookEventCustomerCreated", "WebhookEventCustomerUpdated", "WebhookEventCustomerDeleted", "WebhookEventInvoiceUpdateFinalized", "WebhookEventInvoiceUpdatePayment", "WebhookEventInvoiceUpdateVoided", "WebhookEventInvoiceUpdate", "WebhookEventInvoicePaymentOverdue", "WebhookEventWalletCreditBalanceDropped", "WebhookEventWalletCreditBalanceRecovered", "WebhookEventWalletOngoingBalanceDropped", "WebhookEventWalletOngoingBalanceRecovered", "WebhookEventSubscriptionRenewalDue", "WebhookEventInvoiceCommunicationTriggered", "WebhookEventCreditNoteCreated", "WebhookEventCreditNoteUpdated", "WebhookEventCheckoutSessionInitiated", "WebhookEventCheckoutSessionCompleted", "WebhookEventCheckoutSessionFailed", "WebhookEventCheckoutSessionExpired" ], "x-speakeasy-name-override": "WebhookEventName" }, "types.WindowSize": { "type": "string", "enum": [ "MINUTE", "15MIN", "30MIN", "HOUR", "3HOUR", "6HOUR", "12HOUR", "DAY", "WEEK", "MONTH" ], "x-enum-varnames": [ "WindowSizeMinute", "WindowSize15Min", "WindowSize30Min", "WindowSizeHour", "WindowSize3Hour", "WindowSize6Hour", "WindowSize12Hour", "WindowSizeDay", "WindowSizeWeek", "WindowSizeMonth" ], "x-speakeasy-name-override": "WindowSize" }, "types.WorkflowExecutionFilter": { "type": "object", "properties": { "end_time": { "type": "string", "format": "date-time" }, "entity": { "type": "string", "description": "e.g. plan, invoice, subscription" }, "entity_id": { "type": "string", "description": "e.g. plan_01ABC123" }, "expand": { "type": "string" }, "filters": { "type": "array", "description": "filters allows complex filtering based on multiple fields (same as FeatureFilter)", "items": { "$ref": "#/components/schemas/types.FilterCondition" } }, "limit": { "maximum": 1000, "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "sort": { "type": "array", "items": { "$ref": "#/components/schemas/types.SortCondition" } }, "start_time": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "task_queue": { "type": "string" }, "workflow_id": { "type": "string", "description": "Workflow-specific filters" }, "workflow_status": { "type": "string", "description": "e.g. Running, Completed, Failed" }, "workflow_type": { "type": "string" } }, "x-speakeasy-name-override": "WorkflowExecutionFilter" }, "group.Group": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.GroupEntityType" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "lookup_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "invoice.InvoiceLineItem": { "type": "object", "properties": { "adjusted_entitlement_quantity": { "type": "string", "description": "adjusted_entitlement_quantity is the entitlement-covered portion deducted from raw usage.\nNil when no entitlement was applied. Raw usage = Quantity + AdjustedEntitlementQuantity." }, "amount": { "type": "string" }, "commitment_info": { "$ref": "#/components/schemas/types.CommitmentInfo" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string" }, "customer_id": { "type": "string" }, "display_name": { "type": "string" }, "entity_id": { "type": "string" }, "entity_type": { "type": "string" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "invoice_id": { "type": "string" }, "invoice_level_discount": { "type": "string", "description": "invoice_level_discount is the discount amount in invoice currency applied to all line items on the invoice." }, "line_item_discount": { "type": "string", "description": "line_item_discount is the discount amount in invoice currency applied directly to this line item." }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "meter_display_name": { "type": "string" }, "meter_id": { "type": "string" }, "period_end": { "type": "string", "format": "date-time" }, "period_start": { "type": "string", "format": "date-time" }, "plan_display_name": { "type": "string" }, "prepaid_credits_applied": { "type": "string", "description": "prepaid_credits_applied is the amount in invoice currency reduced from this line item due to prepaid credits application." }, "price_id": { "type": "string" }, "price_type": { "type": "string" }, "price_unit": { "type": "string" }, "price_unit_amount": { "type": "string" }, "price_unit_id": { "type": "string" }, "quantity": { "type": "string" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string" }, "subscription_line_item_id": { "type": "string", "description": "sub_line_item_id links this invoice line item to the subscription_line_item that generated it." }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "meter.Aggregation": { "type": "object", "properties": { "bucket_size": { "$ref": "#/components/schemas/types.WindowSize" }, "expression": { "type": "string", "description": "Expression is an optional CEL expression to compute per-event quantity from event.properties.\nWhen set, it replaces Field-based extraction. Property names are used directly (e.g., token * duration * pixel)." }, "field": { "type": "string", "description": "Field is the key in $event.properties on which the aggregation is to be applied\nFor ex if the aggregation type is sum for API usage, the field could be \"duration_ms\"\nIgnored when Expression is set." }, "group_by": { "type": "string", "description": "GroupBy is the property name in event.properties to group by before aggregating.\nCurrently only supported for MAX aggregation with bucket_size.\nWhen set, aggregation is applied per unique value of this property within each bucket,\nthen the per-group results are summed to produce the bucket total." }, "multiplier": { "type": "string", "description": "Multiplier is the multiplier for the aggregation\nFor ex if the aggregation type is sum_with_multiplier for API usage, the multiplier could be 1000\nto scale up by a factor of 1000. If not provided, it will be null." }, "type": { "$ref": "#/components/schemas/types.AggregationType" } } }, "meter.Filter": { "type": "object", "properties": { "key": { "type": "string", "description": "Key is the key for the filter from $event.properties\nCurrently we support only first level keys in the properties and not nested keys" }, "values": { "type": "array", "description": "Values are the possible values for the filter to be considered for the meter\nFor ex \"model_name\" could have values \"o1-mini\", \"gpt-4o\" etc", "items": { "type": "string" } } } }, "meter.Meter": { "type": "object", "properties": { "aggregation": { "$ref": "#/components/schemas/meter.Aggregation" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "environment_id": { "type": "string", "description": "EnvironmentID is the environment identifier for the meter" }, "event_name": { "type": "string", "description": "EventName is the unique identifier for the event that this meter is tracking\nIt is a mandatory field in the events table and hence being used as the primary matching field\nWe can have multiple meters tracking the same event but with different filters and aggregation" }, "filters": { "type": "array", "description": "Filters define the criteria for the meter to be applied on the events before aggregation\nIt also defines the possible values on which later the charges will be applied", "items": { "$ref": "#/components/schemas/meter.Filter" } }, "id": { "type": "string", "description": "ID is the unique identifier for the meter" }, "name": { "type": "string", "description": "Name is the display name of the meter" }, "reset_usage": { "$ref": "#/components/schemas/types.ResetUsage" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "models.TemporalWorkflowResult": { "type": "object", "properties": { "message": { "type": "string" }, "run_id": { "type": "string" }, "workflow_id": { "type": "string" } } }, "price.JSONBFilters": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "price.JSONBMetadata": { "type": "object", "additionalProperties": { "type": "string" } }, "price.JSONBTransformQuantity": { "type": "object", "properties": { "divide_by": { "type": "integer", "description": "Divide quantity by this number" }, "round": { "$ref": "#/components/schemas/types.RoundType" } } }, "price.Price": { "type": "object", "properties": { "amount": { "type": "string", "description": "Amount stored in main currency units (e.g., dollars, not cents)\nFor USD: 12.50 means $12.50" }, "billing_cadence": { "$ref": "#/components/schemas/types.BillingCadence" }, "billing_model": { "$ref": "#/components/schemas/types.BillingModel" }, "billing_period": { "$ref": "#/components/schemas/types.BillingPeriod" }, "billing_period_count": { "type": "integer", "description": "BillingPeriodCount is the count of the billing period ex 1, 3, 6, 12" }, "conversion_rate": { "type": "string", "description": "ConversionRate is the conversion rate of the price unit to the fiat currency" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string", "description": "Currency 3 digit ISO currency code in lowercase ex usd, eur, gbp" }, "description": { "type": "string", "description": "Description of the price" }, "display_amount": { "type": "string", "description": "DisplayAmount is the formatted amount with currency symbol\nFor USD: $12.50" }, "display_name": { "type": "string", "description": "DisplayName is the name of the price" }, "display_price_unit_amount": { "type": "string", "description": "DisplayPriceUnitAmount is the formatted amount of the price unit" }, "end_date": { "type": "string", "description": "EndDate is the end date of the price", "format": "date-time" }, "entity_id": { "type": "string", "description": "EntityID holds the value of the \"entity_id\" field." }, "entity_type": { "$ref": "#/components/schemas/types.PriceEntityType" }, "environment_id": { "type": "string", "description": "EnvironmentID is the environment identifier for the price" }, "group_id": { "type": "string", "description": "GroupID references the group this price belongs to" }, "id": { "type": "string", "description": "ID uuid identifier for the price" }, "invoice_cadence": { "$ref": "#/components/schemas/types.InvoiceCadence" }, "lookup_key": { "type": "string", "description": "LookupKey used for looking up the price in the database" }, "metadata": { "$ref": "#/components/schemas/price.JSONBMetadata" }, "meter_id": { "type": "string", "description": "MeterID is the id of the meter for usage based pricing" }, "min_quantity": { "type": "string", "description": "MinQuantity is the minimum quantity of the price", "nullable": true }, "parent_price_id": { "type": "string", "description": "ParentPriceID references the root price (always set for price lineage tracking)" }, "price_unit": { "type": "string", "description": "PriceUnit is the code of the price unit (e.g., 'btc', 'eth')" }, "price_unit_amount": { "type": "string", "description": "PriceUnitAmount is the amount of the price unit" }, "price_unit_id": { "type": "string", "description": "PriceUnitID is the id of the price unit (for CUSTOM type)" }, "price_unit_tiers": { "type": "array", "description": "PriceUnitTiers are the tiers for the price unit when BillingModel is TIERED", "items": { "$ref": "#/components/schemas/price.PriceTier" } }, "price_unit_type": { "$ref": "#/components/schemas/types.PriceUnitType" }, "sequence": { "type": "integer", "description": "Sequence is the monotonic stamp bumped on every state change that\nsubscription line items need to react to. Read by the plan-price sync;\nset by the database (DEFAULT nextval) on create and by the price\nrepository on termination / compatibility-affecting edits." }, "start_date": { "type": "string", "description": "StartDate is the start date of the price", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "tier_mode": { "$ref": "#/components/schemas/types.BillingTier" }, "tiers": { "type": "array", "items": { "$ref": "#/components/schemas/price.PriceTier" } }, "transform_quantity": { "$ref": "#/components/schemas/price.JSONBTransformQuantity" }, "trial_period_days": { "type": "integer", "description": "TrialPeriodDays is the number of days for the trial period\nNote: This is only applicable for recurring prices (BILLING_CADENCE_RECURRING)" }, "type": { "$ref": "#/components/schemas/types.PriceType" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "price.PriceTier": { "type": "object", "properties": { "flat_amount": { "type": "string", "description": "flat_amount is the flat amount for the given tier (optional)\nApplied on top of unit_amount*quantity. Useful for cases like \"2.7$ + 5c\"" }, "unit_amount": { "type": "string", "description": "unit_amount is the amount per unit for the given tier" }, "up_to": { "type": "integer", "description": "up_to is the quantity up to which this tier applies. It is null for the last tier.\nIMPORTANT: Tier boundaries are INCLUSIVE.\n- If up_to is 1000, then quantity less than or equal to 1000 belongs to this tier\n- This behavior is consistent across both VOLUME and SLAB tier modes" } } }, "price.TransformQuantity": { "type": "object", "properties": { "divide_by": { "type": "integer", "description": "Divide quantity by this number" }, "round": { "$ref": "#/components/schemas/types.RoundType" } } }, "subscription.SubscriptionLineItem": { "type": "object", "properties": { "addon_association_id": { "type": "string" }, "billing_period": { "$ref": "#/components/schemas/types.BillingPeriod" }, "billing_period_count": { "type": "integer", "description": "from price at create; default 1" }, "commitment_amount": { "type": "string", "description": "Commitment fields" }, "commitment_duration": { "$ref": "#/components/schemas/types.BillingPeriod" }, "commitment_overage_factor": { "type": "string" }, "commitment_quantity": { "type": "string" }, "commitment_time_buckets": { "type": "array", "items": { "$ref": "#/components/schemas/types.TimeOfDayBucket" } }, "commitment_true_up_enabled": { "type": "boolean" }, "commitment_type": { "$ref": "#/components/schemas/types.CommitmentType" }, "commitment_windowed": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "currency": { "type": "string" }, "customer_id": { "type": "string" }, "display_name": { "type": "string" }, "end_date": { "type": "string", "format": "date-time" }, "entity_id": { "type": "string" }, "entity_type": { "$ref": "#/components/schemas/types.SubscriptionLineItemEntityType" }, "environment_id": { "type": "string" }, "id": { "type": "string" }, "invoice_cadence": { "$ref": "#/components/schemas/types.InvoiceCadence" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "meter_display_name": { "type": "string" }, "meter_id": { "type": "string" }, "plan_display_name": { "type": "string" }, "price": { "$ref": "#/components/schemas/price.Price" }, "price_id": { "type": "string" }, "price_type": { "$ref": "#/components/schemas/types.PriceType" }, "price_unit": { "type": "string" }, "price_unit_id": { "type": "string" }, "quantity": { "type": "string" }, "start_date": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string" }, "subscription_phase_id": { "type": "string" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "subscription.SubscriptionPause": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "environment_id": { "type": "string", "description": "EnvironmentID is the environment identifier for the pause" }, "id": { "type": "string", "description": "ID is the unique identifier for the subscription pause" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "original_period_end": { "type": "string", "description": "OriginalPeriodEnd is the end of the billing period when the pause was created", "format": "date-time" }, "original_period_start": { "type": "string", "description": "OriginalPeriodStart is the start of the billing period when the pause was created", "format": "date-time" }, "pause_end": { "type": "string", "description": "PauseEnd is when the pause will end (null for indefinite)", "format": "date-time" }, "pause_mode": { "$ref": "#/components/schemas/types.PauseMode" }, "pause_start": { "type": "string", "description": "PauseStart is when the pause actually started", "format": "date-time" }, "pause_status": { "$ref": "#/components/schemas/types.PauseStatus" }, "reason": { "type": "string", "description": "Reason is the reason for pausing" }, "resume_mode": { "$ref": "#/components/schemas/types.ResumeMode" }, "resumed_at": { "type": "string", "description": "ResumedAt is when the pause was actually ended (if manually resumed)", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string", "description": "SubscriptionID is the identifier for the subscription" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "subscription.SubscriptionPhase": { "type": "object", "properties": { "created_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "end_date": { "type": "string", "description": "EndDate is when the phase ends (nil if phase is still active or indefinite)", "format": "date-time" }, "environment_id": { "type": "string", "description": "EnvironmentID is the environment identifier for the phase" }, "id": { "type": "string", "description": "ID is the unique identifier for the subscription phase" }, "metadata": { "$ref": "#/components/schemas/types.Metadata" }, "start_date": { "type": "string", "description": "StartDate is when the phase starts", "format": "date-time" }, "status": { "$ref": "#/components/schemas/types.Status" }, "subscription_id": { "type": "string", "description": "SubscriptionID is the identifier for the subscription" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "types.CheckoutAction": { "type": "string", "enum": [ "create_subscription" ], "x-enum-varnames": [ "CheckoutActionCreateSubscription" ], "x-speakeasy-name-override": "CheckoutAction" }, "types.CheckoutConfiguration": { "type": "object", "properties": { "create_subscription_params": { "$ref": "#/components/schemas/types.CreateSubscriptionParams" } }, "x-speakeasy-name-override": "CheckoutConfiguration" }, "types.CheckoutPaymentProvider": { "type": "string", "enum": [ "razorpay" ], "x-enum-varnames": [ "CheckoutPaymentProviderRazorpay" ], "x-speakeasy-name-override": "CheckoutPaymentProvider" }, "types.CheckoutStatus": { "type": "string", "enum": [ "initiated", "pending", "completed", "failed", "expired" ], "x-enum-varnames": [ "CheckoutStatusInitiated", "CheckoutStatusPending", "CheckoutStatusCompleted", "CheckoutStatusFailed", "CheckoutStatusExpired" ], "x-speakeasy-name-override": "CheckoutStatus" }, "types.CreateSubscriptionParams": { "type": "object", "properties": { "billing_period": { "$ref": "#/components/schemas/types.BillingPeriod" }, "currency": { "type": "string" }, "end_date": { "type": "string", "format": "date-time" }, "lookup_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "plan_id": { "type": "string" }, "start_date": { "type": "string", "format": "date-time" } }, "x-speakeasy-name-override": "CreateSubscriptionParams" }, "types.CreateSubscriptionResult": { "type": "object", "properties": { "invoice_id": { "type": "string" }, "payment_id": { "type": "string" }, "subscription_id": { "type": "string" } }, "x-speakeasy-name-override": "CreateSubscriptionResult" }, "types.ListResponse-dto_WalletResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/WalletResponse" } }, "pagination": { "$ref": "#/components/schemas/types.PaginationResponse" } }, "x-speakeasy-name-override": "ListResponse-dto_WalletResponse" }, "types.Metadata": { "type": "object", "additionalProperties": { "type": "string" }, "x-speakeasy-name-override": "Metadata" }, "types.PaymentAction": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/types.PaymentActionType" }, "url": { "type": "string" } }, "x-speakeasy-name-override": "PaymentAction" }, "types.PaymentActionType": { "type": "string", "enum": [ "checkout_url", "payment_link" ], "x-enum-varnames": [ "PaymentActionTypeCheckoutURL", "PaymentActionTypePaymentLink" ], "x-speakeasy-name-override": "PaymentActionType" }, "types.TimeOfDayBucket": { "type": "object", "properties": { "commitment_type": { "$ref": "#/components/schemas/types.CommitmentType" }, "commitment_value": { "type": "string" }, "end": { "$ref": "#/components/schemas/types.Bucket" }, "id": { "type": "string", "description": "ID is server-assigned. Stable for the lifetime of the line item;\ninvoice breakdown and analytics responses reference this ID." }, "overage_factor": { "type": "number" }, "price_id": { "type": "string", "description": "PriceID is the SUBSCRIPTION-scoped price created at bucket-creation time.\nImmutable post-create; changing pricing requires a successor line item." }, "start": { "$ref": "#/components/schemas/types.Bucket" }, "true_up_enabled": { "type": "boolean" } }, "x-speakeasy-name-override": "TimeOfDayBucket" }, "webhookDto.AlertWebhookPayload": { "type": "object", "properties": { "alert_status": { "type": "string" }, "alert_type": { "type": "string" }, "customer": { "$ref": "#/components/schemas/CustomerResponse" }, "event_type": { "$ref": "#/components/schemas/types.WebhookEventName" }, "feature": { "$ref": "#/components/schemas/FeatureResponse" }, "wallet": { "$ref": "#/components/schemas/WalletResponse" } } }, "webhookDto.CommunicationWebhookPayload": { "type": "object", "properties": { "event_type": { "$ref": "#/components/schemas/types.WebhookEventName" }, "invoice": { "$ref": "#/components/schemas/InvoiceResponse" } } }, "webhookDto.CreditNoteWebhookPayload": { "type": "object", "properties": { "credit_note": { "$ref": "#/components/schemas/CreditNoteResponse" }, "event_type": { "$ref": "#/components/schemas/types.WebhookEventName" } } }, "webhookDto.CustomerWebhookPayload": { "type": "object", "properties": { "customer": { "$ref": "#/components/schemas/CustomerResponse" }, "event_type": { "$ref": "#/components/schemas/types.WebhookEventName" } } }, "webhookDto.EntitlementWebhookPayload": { "type": "object", "properties": { "entitlement": { "$ref": "#/components/schemas/EntitlementResponse" }, "event_type": { "$ref": "#/components/schemas/types.WebhookEventName" } } }, "webhookDto.FeatureWebhookPayload": { "type": "object", "properties": { "event_type": { "$ref": "#/components/schemas/types.WebhookEventName" }, "feature": { "$ref": "#/components/schemas/FeatureResponse" } } }, "webhookDto.InvoiceWebhookPayload": { "type": "object", "properties": { "event_type": { "$ref": "#/components/schemas/types.WebhookEventName" }, "invoice": { "$ref": "#/components/schemas/InvoiceResponse" } } }, "webhookDto.PaymentWebhookPayload": { "type": "object", "properties": { "event_type": { "$ref": "#/components/schemas/types.WebhookEventName" }, "payment": { "$ref": "#/components/schemas/PaymentResponse" } } }, "webhookDto.SubscriptionPhaseWebhookPayload": { "type": "object", "properties": { "event_type": { "$ref": "#/components/schemas/types.WebhookEventName" }, "phase": { "$ref": "#/components/schemas/SubscriptionPhaseResponse" } } }, "webhookDto.SubscriptionWebhookPayload": { "type": "object", "properties": { "event_type": { "$ref": "#/components/schemas/types.WebhookEventName" }, "subscription": { "$ref": "#/components/schemas/SubscriptionResponse" } } }, "webhookDto.TransactionWebhookPayload": { "type": "object", "properties": { "event_type": { "$ref": "#/components/schemas/types.WebhookEventName" }, "transaction": { "$ref": "#/components/schemas/WalletTransactionResponse" }, "wallet": { "$ref": "#/components/schemas/WalletResponse" } } }, "webhookDto.WalletAlertInfo": { "type": "object", "properties": { "alert_settings": { "$ref": "#/components/schemas/types.AlertSettings" }, "alert_type": { "type": "string" }, "credit_balance": { "type": "number" }, "current_balance": { "type": "number" }, "state": { "type": "string" } } }, "webhookDto.WalletWebhookPayload": { "type": "object", "properties": { "alert": { "$ref": "#/components/schemas/webhookDto.WalletAlertInfo" }, "customer": { "$ref": "#/components/schemas/CustomerResponse" }, "event_type": { "$ref": "#/components/schemas/types.WebhookEventName" }, "wallet": { "$ref": "#/components/schemas/WalletResponse" } } } }, "securitySchemes": { "ApiKeyAuth": { "type": "apiKey", "description": "Enter your API key in the format *x-api-key <api-key>**", "name": "x-api-key", "in": "header" } } }, "x-original-swagger-version": "2.0" }