{ "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": { "/addons": { "post": { "tags": [ "Addons" ], "summary": "Create addon", "description": "Use when defining an optional purchasable item (e.g. extra storage or support tier). Ideal for add-ons that customers can attach to a subscription.", "operationId": "createAddon", "requestBody": { "description": "Addon Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAddonRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAddonResponse" } } } }, "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": "addon" } }, "/addons/lookup/{lookup_key}": { "get": { "tags": [ "Addons" ], "summary": "Get addon by lookup key", "description": "Use when resolving an addon by external id (e.g. from your product catalog). Ideal for integrations.", "operationId": "getAddonByLookupKey", "parameters": [ { "name": "lookup_key", "in": "path", "description": "Addon Lookup Key", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddonResponse" } } } }, "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": [] } ] } }, "/addons/search": { "post": { "tags": [ "Addons" ], "summary": "Query addons", "description": "Use when listing or searching addons (e.g. catalog or subscription builder). Returns a paginated list; supports filtering and sorting.", "operationId": "queryAddon", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.AddonFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListAddonsResponse" } } } }, "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" } }, "/addons/{id}": { "get": { "tags": [ "Addons" ], "summary": "Get addon", "description": "Use when you need to load a single addon (e.g. for display or to attach to a subscription).", "operationId": "getAddon", "parameters": [ { "name": "id", "in": "path", "description": "Addon ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddonResponse" } } } }, "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": [] } ] }, "put": { "tags": [ "Addons" ], "summary": "Update addon", "description": "Use when changing addon details (e.g. name, pricing, or metadata).", "operationId": "updateAddon", "parameters": [ { "name": "id", "in": "path", "description": "Addon ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Update Addon Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateAddonRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddonResponse" } } } }, "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": "addon" }, "delete": { "tags": [ "Addons" ], "summary": "Delete addon", "description": "Use when retiring an addon (e.g. end-of-life). Returns 200 with success message.", "operationId": "deleteAddon", "parameters": [ { "name": "id", "in": "path", "description": "Addon 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": [] } ] } }, "/addons/{id}/entitlements": { "get": { "tags": [ "Entitlements" ], "summary": "Get addon entitlements", "description": "Use when checking what features or limits an addon grants (e.g. for display or entitlement logic).", "operationId": "getAddonEntitlements", "parameters": [ { "name": "id", "in": "path", "description": "Addon ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListEntitlementsResponse" } } } }, "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": [] } ] } }, "/alerts/search": { "post": { "tags": [ "Alerts" ], "summary": "Query alert logs", "description": "Use when viewing or searching alert history (e.g. support triage or customer-facing alert log). Returns a paginated list; supports filtering by type, customer, subscription.", "operationId": "queryAlertLog", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.AlertLogFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListAlertLogsResponse" } } } }, "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" } }, "/costs": { "post": { "tags": [ "Costs" ], "summary": "Create costsheet", "description": "Use when setting up a new pricing configuration (e.g. a new product or region). Costsheets group prices and define the default for the environment.", "operationId": "createCostsheet", "requestBody": { "description": "Costsheet configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCostsheetRequest" } } }, "required": true }, "responses": { "201": { "description": "Created costsheet", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCostsheetResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "409": { "description": "Conflict", "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": "costsheet" } }, "/costs/active": { "get": { "tags": [ "Costs" ], "summary": "Get active costsheet", "description": "Use when you need the tenant's default pricing configuration (e.g. for checkout or plan display). Returns the active costsheet for the environment.", "operationId": "getActiveCostsheet", "responses": { "200": { "description": "Active costsheet", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CostsheetResponse" } } } }, "404": { "description": "No active costsheet", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/costs/analytics": { "post": { "tags": [ "Costs" ], "summary": "Get combined revenue and cost analytics", "description": "Use when building dashboards or reports that need revenue vs cost, ROI, and margin over a time period (e.g. finance views or executive summaries).", "operationId": "getDetailedCostAnalytics", "requestBody": { "description": "Combined analytics request (start_time/end_time optional - defaults to last 7 days)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetCostAnalyticsRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetDetailedCostAnalyticsResponse" } } } }, "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" } }, "/costs/analytics-v2": { "post": { "tags": [ "Costs" ], "summary": "Get combined revenue and cost analytics (V2)", "description": "Use when you need the same revenue/cost/ROI analytics but computed from the costsheet usage-tracking pipeline (e.g. for consistency with usage-based cost data).", "operationId": "getDetailedCostAnalyticsV2", "requestBody": { "description": "Combined analytics request (start_time/end_time optional - defaults to last 7 days)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetCostAnalyticsRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetDetailedCostAnalyticsResponse" } } } }, "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" } }, "/costs/search": { "post": { "tags": [ "Costs" ], "summary": "Query costsheets", "description": "Use when listing or searching costsheets (e.g. admin catalog). Returns a paginated list; supports filtering and sorting.", "operationId": "queryCostsheet", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/costsheet.Filter" } } }, "required": true }, "responses": { "200": { "description": "Paginated costsheets", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListCostsheetResponse" } } } }, "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" } }, "/costs/{id}": { "get": { "tags": [ "Costs" ], "summary": "Get costsheet", "description": "Use when you need to load a single costsheet (e.g. for editing or display). Supports optional expand for related prices.", "operationId": "getCostsheet", "parameters": [ { "name": "id", "in": "path", "description": "Costsheet ID", "required": true, "schema": { "type": "string" } }, { "name": "expand", "in": "query", "description": "Comma-separated list of fields to expand (e.g., 'prices')", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Costsheet details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetCostsheetResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Costsheet 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": [] } ] }, "put": { "tags": [ "Costs" ], "summary": "Update costsheet", "description": "Use when changing costsheet name or metadata.", "operationId": "updateCostsheet", "parameters": [ { "name": "id", "in": "path", "description": "Costsheet ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Costsheet configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCostsheetRequest" } } }, "required": true }, "responses": { "200": { "description": "Updated costsheet", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCostsheetResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Costsheet 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": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "costsheet" }, "delete": { "tags": [ "Costs" ], "summary": "Delete costsheet", "description": "Use when retiring a costsheet (e.g. end-of-life product). Soft-deletes; status set to deleted.", "operationId": "deleteCostsheet", "parameters": [ { "name": "id", "in": "path", "description": "Costsheet ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Costsheet deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteCostsheetResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Costsheet 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": [] } ] } }, "/coupons": { "post": { "tags": [ "Coupons" ], "summary": "Create coupon", "description": "Use when creating a discount (e.g. promo code or referral). Ideal for percent or fixed value, with optional validity and usage limits.", "operationId": "createCoupon", "requestBody": { "description": "Coupon request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCouponRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CouponResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "403": { "description": "Forbidden", "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": [] }, { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "coupon" } }, "/coupons/search": { "post": { "tags": [ "Coupons" ], "summary": "Query coupons", "description": "Use when listing or searching coupons (e.g. promo management). Returns a paginated list; supports filtering and sorting.", "operationId": "queryCoupon", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.CouponFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListCouponsResponse" } } } }, "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" } }, "/coupons/{id}": { "get": { "tags": [ "Coupons" ], "summary": "Get coupon", "description": "Use when you need to load a single coupon (e.g. for display or to validate a code).", "operationId": "getCoupon", "parameters": [ { "name": "id", "in": "path", "description": "Coupon ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CouponResponse" } } } }, "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": [] } ] }, "put": { "tags": [ "Coupons" ], "summary": "Update coupon", "description": "Use when changing coupon config (e.g. value, validity, or usage limits).", "operationId": "updateCoupon", "parameters": [ { "name": "id", "in": "path", "description": "Coupon ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Coupon update request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCouponRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CouponResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "403": { "description": "Forbidden", "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": [] }, { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "coupon" }, "delete": { "tags": [ "Coupons" ], "summary": "Delete coupon", "description": "Use when retiring a coupon (e.g. campaign ended). Returns 200 with success message.", "operationId": "deleteCoupon", "parameters": [ { "name": "id", "in": "path", "description": "Coupon ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "403": { "description": "Forbidden", "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": [] }, { "ApiKeyAuth": [] } ] } }, "/creditgrants": { "post": { "tags": [ "Credit Grants" ], "summary": "Create credit grant", "description": "Use when giving a customer or plan credits (e.g. prepaid balance or promotional credits). Scope can be plan or subscription; supports start/end dates.", "operationId": "createCreditGrant", "requestBody": { "description": "Credit Grant configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCreditGrantRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreditGrantResponse" } } } }, "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": "credit_grant" } }, "/creditgrants/{id}": { "get": { "tags": [ "Credit Grants" ], "summary": "Get credit grant", "description": "Use when you need to load a single credit grant (e.g. for display or to check balance).", "operationId": "getCreditGrant", "parameters": [ { "name": "id", "in": "path", "description": "Credit Grant ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreditGrantResponse" } } } }, "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": [] } ] }, "put": { "tags": [ "Credit Grants" ], "summary": "Update credit grant", "description": "Use when changing a credit grant (e.g. amount or end date). Request body contains the fields to update.", "operationId": "updateCreditGrant", "parameters": [ { "name": "id", "in": "path", "description": "Credit Grant ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Credit Grant configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCreditGrantRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreditGrantResponse" } } } }, "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": "credit_grant" }, "delete": { "tags": [ "Credit Grants" ], "summary": "Delete credit grant", "description": "Use when removing or ending a credit grant (e.g. revoke promo or close prepaid). Plan-scoped grants are archived; subscription-scoped supports optional effective_date in body.", "operationId": "deleteCreditGrant", "parameters": [ { "name": "id", "in": "path", "description": "Credit Grant ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Optional: effective_date for subscription-scoped grants", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteCreditGrantRequest" } } }, "required": false }, "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": "body" } }, "/creditnotes": { "post": { "tags": [ "Credit Notes" ], "summary": "Create credit note", "description": "Use when issuing a refund or adjustment (e.g. customer dispute or proration). Links to an invoice; create as draft then finalize.", "operationId": "createCreditNote", "requestBody": { "description": "Credit note request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCreditNoteRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreditNoteResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "403": { "description": "Forbidden", "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": [] }, { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "credit_note" } }, "/creditnotes/{id}": { "get": { "tags": [ "Credit Notes" ], "summary": "Get credit note", "description": "Use when you need to load a single credit note (e.g. for display or reconciliation).", "operationId": "getCreditNote", "parameters": [ { "name": "id", "in": "path", "description": "Credit note ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreditNoteResponse" } } } }, "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\" \"Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/creditnotes/{id}/finalize": { "post": { "tags": [ "Credit Notes" ], "summary": "Finalize credit note", "description": "Use when locking a draft credit note and applying the credit (e.g. after approval). Once finalized, applied per billing provider.", "operationId": "processCreditNote", "parameters": [ { "name": "id", "in": "path", "description": "Credit note ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreditNoteResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "403": { "description": "Forbidden", "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": [] }, { "ApiKeyAuth": [] } ] } }, "/creditnotes/{id}/void": { "post": { "tags": [ "Credit Notes" ], "summary": "Void credit note", "description": "Use when cancelling a draft credit note (e.g. created by mistake). Only draft credit notes can be voided.", "operationId": "voidCreditNote", "parameters": [ { "name": "id", "in": "path", "description": "Credit note ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreditNoteResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "403": { "description": "Forbidden", "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": [] }, { "ApiKeyAuth": [] } ] } }, "/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" }, "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" } }, "/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": [] } ] } }, "/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" } }, "/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": [] } ] } }, "/customers/wallets": { "get": { "tags": [ "Wallets" ], "summary": "Get Customer Wallets", "description": "Use when resolving wallets by external customer id or lookup key (e.g. from your app's user id). Supports optional real-time balance and expand.", "operationId": "getCustomerWallets", "parameters": [ { "name": "-", "in": "query", "description": "populated from x-max-live header, not query param", "schema": { "type": "integer" } }, { "name": "expand", "in": "query", "schema": { "type": "string" } }, { "name": "from_cache", "in": "query", "schema": { "type": "boolean", "default": false } }, { "name": "id", "in": "query", "schema": { "type": "string" } }, { "name": "include_real_time_balance", "in": "query", "schema": { "type": "boolean", "default": false } }, { "name": "lookup_key", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WalletResponse" } } } } }, "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": [] } ] } }, "/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" }, "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": [] } ] } }, "/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": [] } ] } }, "/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": [] } ] } }, "/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": [] } ] } }, "/customers/{id}/wallets": { "get": { "tags": [ "Wallets" ], "summary": "Get wallets by customer ID", "description": "Use when showing a customer's wallets (e.g. balance overview by currency or in a billing portal). Supports optional expand for balance breakdown.", "operationId": "getWalletsByCustomerId", "parameters": [ { "name": "id", "in": "path", "description": "Customer ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/WalletResponse" } } } } }, "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": [] } ] } }, "/entitlements": { "post": { "tags": [ "Entitlements" ], "summary": "Create entitlement", "description": "Use when attaching a feature (and its limit) to a plan or addon (e.g. \"10 seats\" or \"1000 API calls\"). Defines what the plan/addon includes.", "operationId": "createEntitlement", "requestBody": { "description": "Entitlement configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateEntitlementRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EntitlementResponse" } } } }, "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": "entitlement" } }, "/entitlements/bulk": { "post": { "tags": [ "Entitlements" ], "summary": "Create entitlements in bulk", "description": "Use when attaching many features to a plan or addon at once (e.g. initial plan setup or import). Bulk version of create entitlement.", "operationId": "createEntitlementsBulk", "requestBody": { "description": "Bulk entitlement configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBulkEntitlementRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBulkEntitlementResponse" } } } }, "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": "entitlements" } }, "/entitlements/search": { "post": { "tags": [ "Entitlements" ], "summary": "Query entitlements", "description": "Use when listing or searching entitlements (e.g. plan editor or audit). Returns a paginated list; supports filtering by plan, addon, feature.", "operationId": "queryEntitlement", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.EntitlementFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListEntitlementsResponse" } } } }, "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" } }, "/entitlements/{id}": { "get": { "tags": [ "Entitlements" ], "summary": "Get entitlement", "description": "Use when you need to load a single entitlement (e.g. to display or edit a feature limit).", "operationId": "getEntitlement", "parameters": [ { "name": "id", "in": "path", "description": "Entitlement ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EntitlementResponse" } } } }, "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": [] } ] }, "put": { "tags": [ "Entitlements" ], "summary": "Update entitlement", "description": "Use when changing an entitlement (e.g. increasing or decreasing a limit). Request body contains the fields to update.", "operationId": "updateEntitlement", "parameters": [ { "name": "id", "in": "path", "description": "Entitlement ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Entitlement configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateEntitlementRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EntitlementResponse" } } } }, "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": "entitlement" }, "delete": { "tags": [ "Entitlements" ], "summary": "Delete entitlement", "description": "Use when removing a feature from a plan or addon (e.g. deprecating a capability). Returns 200 with success message.", "operationId": "deleteEntitlement", "parameters": [ { "name": "id", "in": "path", "description": "Entitlement 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": [] } ] } }, "/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" } }, "/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" } }, "/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" } }, "/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": [] } ] } }, "/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" } }, "/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" } }, "/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" } }, "/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": [] } ] } }, "/features": { "post": { "tags": [ "Features" ], "summary": "Create feature", "description": "Use when defining a new feature or capability to gate or meter (e.g. feature flags or usage-based limits). Ideal for boolean or usage features.", "operationId": "createFeature", "requestBody": { "description": "Feature to create", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateFeatureRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeatureResponse" } } } }, "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": "feature" } }, "/features/search": { "post": { "tags": [ "Features" ], "summary": "Query features", "description": "Use when listing or searching features (e.g. catalog or entitlement setup). Returns a paginated list; supports filtering and sorting.", "operationId": "queryFeature", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.FeatureFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListFeaturesResponse" } } } }, "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" } }, "/features/{id}": { "put": { "tags": [ "Features" ], "summary": "Update feature", "description": "Use when changing feature definition (e.g. name, type, or meter). Request body contains the fields to update.", "operationId": "updateFeature", "parameters": [ { "name": "id", "in": "path", "description": "Feature ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Feature update data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateFeatureRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeatureResponse" } } } }, "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": "feature" }, "delete": { "tags": [ "Features" ], "summary": "Delete feature", "description": "Use when retiring a feature (e.g. deprecated capability). Returns 200 with success message.", "operationId": "deleteFeature", "parameters": [ { "name": "id", "in": "path", "description": "Feature 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": [] } ] } }, "/groups": { "post": { "tags": [ "Groups" ], "summary": "Create group", "description": "Use when organizing entities into a group (e.g. for filtering prices or plans by product line or region).", "operationId": "createGroup", "requestBody": { "description": "Group", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateGroupRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GroupResponse" } } } }, "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": "group" } }, "/groups/search": { "post": { "tags": [ "Groups" ], "summary": "Query groups", "description": "Use when listing or searching groups (e.g. admin catalog). Returns a paginated list; supports filtering and sorting.", "operationId": "queryGroup", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.GroupFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListGroupsResponse" } } } }, "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" } }, "/groups/{id}": { "get": { "tags": [ "Groups" ], "summary": "Get group", "description": "Use when you need to load a single group (e.g. for display or to assign entities).", "operationId": "getGroup", "parameters": [ { "name": "id", "in": "path", "description": "Group ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GroupResponse" } } } }, "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": [] } ] }, "delete": { "tags": [ "Groups" ], "summary": "Delete group", "description": "Use when removing a group and clearing its entity associations (e.g. retiring a product line). Returns 204 or 200 on success.", "operationId": "deleteGroup", "parameters": [ { "name": "id", "in": "path", "description": "Group 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" } } } }, "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": [] } ] } }, "/integrations/link": { "post": { "tags": [ "Integrations" ], "summary": "Link integration mapping", "description": "Link a FlexPrice entity to provider entity with provider-specific side effects.", "operationId": "linkIntegrationMapping", "requestBody": { "description": "Link mapping request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LinkIntegrationMappingRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LinkIntegrationMappingResponse" } } } }, "400": { "description": "Bad Request", "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-codegen-request-body-name": "request" } }, "/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" } }, "/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" } }, "/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" } }, "/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": [] } ] }, "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" } }, "/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": [] } ] } }, "/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" } }, "/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" } }, "/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": [] } ] } }, "/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": [] } ] } }, "/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": [] } ] } }, "/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": [] } ] } }, "/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": [] } ] } }, "/payments": { "get": { "tags": [ "Payments" ], "summary": "List payments", "description": "Use when listing or searching payments (e.g. reconciliation UI or customer payment history). Returns a paginated list; supports filtering by customer, invoice, status.", "operationId": "listPayments", "parameters": [ { "name": "currency", "in": "query", "schema": { "type": "string" } }, { "name": "destination_id", "in": "query", "schema": { "type": "string" } }, { "name": "destination_type", "in": "query", "schema": { "type": "string" } }, { "name": "end_time", "in": "query", "schema": { "type": "string" } }, { "name": "expand", "in": "query", "schema": { "type": "string" } }, { "name": "gateway_payment_id", "in": "query", "schema": { "type": "string" } }, { "name": "gateway_tracking_id", "in": "query", "description": "For filtering by gateway tracking ID", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "schema": { "maximum": 1000, "minimum": 1, "type": "integer" } }, { "name": "offset", "in": "query", "schema": { "minimum": 0, "type": "integer" } }, { "name": "order", "in": "query", "schema": { "type": "string", "enum": [ "asc", "desc" ] } }, { "name": "payment_gateway", "in": "query", "schema": { "type": "string" } }, { "name": "payment_ids", "in": "query", "style": "form", "explode": false, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "payment_method_type", "in": "query", "schema": { "type": "string" } }, { "name": "payment_status", "in": "query", "schema": { "type": "string" } }, { "name": "sort", "in": "query", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "schema": { "type": "string" } }, { "name": "status", "in": "query", "schema": { "type": "string", "enum": [ "published", "deleted", "archived" ], "x-enum-varnames": [ "StatusPublished", "StatusDeleted", "StatusArchived" ] }, "x-enum-varnames": [ "StatusPublished", "StatusDeleted", "StatusArchived" ] } ], "responses": { "200": { "description": "Paginated payments", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListPaymentsResponse" } } } }, "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": [] } ] }, "post": { "tags": [ "Payments" ], "summary": "Create payment", "description": "Use when recording a payment against an invoice (e.g. after receiving funds via a gateway or manual entry).", "operationId": "createPayment", "requestBody": { "description": "Payment configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePaymentRequest" } } }, "required": true }, "responses": { "201": { "description": "Created payment", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentResponse" } } } }, "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": "payment" } }, "/payments/{id}": { "get": { "tags": [ "Payments" ], "summary": "Get payment", "description": "Use when you need to load a single payment (e.g. for a receipt view or reconciliation).", "operationId": "getPayment", "parameters": [ { "name": "id", "in": "path", "description": "Payment ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Payment details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Payment 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": [] } ] }, "put": { "tags": [ "Payments" ], "summary": "Update payment", "description": "Use when updating payment status or metadata (e.g. after reconciliation or adding a reference).", "operationId": "updatePayment", "parameters": [ { "name": "id", "in": "path", "description": "Payment ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Payment configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePaymentRequest" } } }, "required": true }, "responses": { "200": { "description": "Updated payment", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentResponse" } } } }, "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": "payment" }, "delete": { "tags": [ "Payments" ], "summary": "Delete payment", "description": "Use when removing or voiding a payment record (e.g. correcting erroneous entries). Returns 200 with success message.", "operationId": "deletePayment", "parameters": [ { "name": "id", "in": "path", "description": "Payment ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Payment deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Payment 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": [] } ] } }, "/payments/{id}/process": { "post": { "tags": [ "Payments" ], "summary": "Process payment", "description": "Use when you need to charge or process a payment (e.g. trigger the payment provider to capture funds). Returns updated payment with status.", "operationId": "processPayment", "parameters": [ { "name": "id", "in": "path", "description": "Payment ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Processed payment", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Payment 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": [] } ] } }, "/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" } }, "/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" } }, "/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": [] } ] }, "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" }, "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": [] } ] } }, "/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", "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-codegen-request-body-name": "request" } }, "/plans/{id}/creditgrants": { "get": { "tags": [ "Credit Grants" ], "summary": "Get plan credit grants", "description": "Use when listing credits attached to a plan (e.g. included prepaid or promo credits).", "operationId": "getPlanCreditGrants", "parameters": [ { "name": "id", "in": "path", "description": "Plan ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListCreditGrantsResponse" } } } }, "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": [] } ] } }, "/plans/{id}/entitlements": { "get": { "tags": [ "Entitlements" ], "summary": "Get plan entitlements", "description": "Use when checking what a plan includes (e.g. feature list or limits for display or gating).", "operationId": "getPlanEntitlements", "parameters": [ { "name": "id", "in": "path", "description": "Plan ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListEntitlementsResponse" } } } }, "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": [] } ] } }, "/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": [] } ] } }, "/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" } }, "/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" } }, "/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": [] } ] } }, "/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" } }, "/prices/units": { "get": { "tags": [ "Price Units" ], "summary": "List price units", "description": "Use when listing price units (e.g. in a catalog or when creating prices). Returns a paginated list; supports status, sort, and pagination.", "operationId": "listPriceUnits", "parameters": [ { "name": "status", "in": "query", "description": "Filter by status", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "description": "Limit number of results", "schema": { "maximum": 1000, "minimum": 1, "type": "integer", "default": 50 } }, { "name": "offset", "in": "query", "description": "Offset for pagination", "schema": { "minimum": 0, "type": "integer", "default": 0 } }, { "name": "sort", "in": "query", "description": "Sort field", "schema": { "type": "string" } }, { "name": "order", "in": "query", "description": "Sort order", "schema": { "type": "string", "enum": [ "asc", "desc" ] } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListPriceUnitsResponse" } } } }, "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": [] } ] }, "post": { "tags": [ "Price Units" ], "summary": "Create price unit", "description": "Use when defining a new unit of measure for pricing (e.g. GB, API call, seat). Ideal for metered or usage-based prices.", "operationId": "createPriceUnit", "requestBody": { "description": "Price unit details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePriceUnitRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePriceUnitResponse" } } } }, "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": "body" } }, "/prices/units/code/{code}": { "get": { "tags": [ "Price Units" ], "summary": "Get price unit by code", "description": "Use when resolving a price unit by code (e.g. from an external catalog or config). Ideal for integrations.", "operationId": "getPriceUnitByCode", "parameters": [ { "name": "code", "in": "path", "description": "Price unit code", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriceUnitResponse" } } } }, "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": [] } ] } }, "/prices/units/search": { "post": { "tags": [ "Price Units" ], "summary": "Query price units", "description": "Use when searching or listing price units (e.g. admin catalog). Returns a paginated list; supports filtering and sorting.", "operationId": "queryPriceUnit", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.PriceUnitFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListPriceUnitsResponse" } } } }, "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" } }, "/prices/units/{id}": { "get": { "tags": [ "Price Units" ], "summary": "Get price unit", "description": "Use when you need to load a single price unit (e.g. for display or when creating a price).", "operationId": "getPriceUnit", "parameters": [ { "name": "id", "in": "path", "description": "Price unit ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriceUnitResponse" } } } }, "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" } } } } }, "security": [ { "ApiKeyAuth": [] } ] }, "put": { "tags": [ "Price Units" ], "summary": "Update price unit", "description": "Use when renaming or updating metadata for a price unit. Code is immutable once created.", "operationId": "updatePriceUnit", "parameters": [ { "name": "id", "in": "path", "description": "Price unit ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Price unit details to update", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePriceUnitRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriceUnitResponse" } } } }, "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" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "body" }, "delete": { "tags": [ "Price Units" ], "summary": "Delete price unit", "description": "Use when removing a price unit that is no longer needed. Fails if any price references this unit.", "operationId": "deletePriceUnit", "parameters": [ { "name": "id", "in": "path", "description": "Price unit ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "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" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/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": [] } ] }, "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" }, "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" } }, "/rbac/roles": { "get": { "tags": [ "RBAC" ], "summary": "List all RBAC roles", "description": "Use when building role pickers or permission UIs. Returns all roles with permissions and descriptions.", "operationId": "listRbacRoles", "responses": { "200": { "description": "List of roles", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/rbac/roles/{id}": { "get": { "tags": [ "RBAC" ], "summary": "Get a specific RBAC role", "description": "Use when you need to show or edit a single role (e.g. role detail page). Includes permissions, name, and description.", "operationId": "getRbacRole", "parameters": [ { "name": "id", "in": "path", "description": "Role ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Role details", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true } } } }, "404": { "description": "Role not found", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/secrets/api/keys": { "get": { "tags": [ "Secrets" ], "summary": "List API keys", "description": "Use when listing API keys (e.g. admin view or rotating keys). Returns a paginated list.", "operationId": "listApiKeys", "parameters": [ { "name": "limit", "in": "query", "description": "Limit", "schema": { "type": "integer" } }, { "name": "offset", "in": "query", "description": "Offset", "schema": { "type": "integer" } }, { "name": "status", "in": "query", "description": "Status (published/archived)", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListSecretsResponse" } } } }, "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": [] } ] }, "post": { "tags": [ "Secrets" ], "summary": "Create a new API key", "description": "Use when issuing a new API key (e.g. for a service account or for the current user). Provide service_account_id to create for a service account.", "operationId": "createApiKey", "requestBody": { "description": "API key creation request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAPIKeyRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAPIKeyResponse" } } } }, "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" } }, "/secrets/api/keys/{id}": { "delete": { "tags": [ "Secrets" ], "summary": "Delete an API key", "description": "Use when revoking an API key (e.g. rotation or compromise). Permanently invalidates the key.", "operationId": "deleteApiKey", "parameters": [ { "name": "id", "in": "path", "description": "API key ID", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "No Content", "content": {} }, "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": [] } ] } }, "/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" } }, "/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" }, "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" } }, "/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" }, "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" } }, "/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" } }, "/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" } }, "/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": [] } ] }, "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" } }, "/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" } }, "/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": [] } ] } }, "/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" } }, "/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" } }, "/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" } }, "/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": [] } ] } }, "/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": [] } ] } }, "/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" } }, "/subscriptions/{id}/pause": { "post": { "tags": [ "Subscriptions" ], "summary": "Pause a subscription", "description": "Use when temporarily stopping a subscription (e.g. customer hold or seasonal pause). Billing and access pause; resume when ready.", "operationId": "pauseSubscription", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Pause subscription request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PauseSubscriptionRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionPauseResponse" } } } }, "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" } }, "/subscriptions/{id}/pauses": { "get": { "tags": [ "Subscriptions" ], "summary": "List all pauses for a subscription", "description": "Use when showing pause history for a subscription (e.g. support or audit). Returns all past and future pauses.", "operationId": "listSubscriptionPauses", "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/ListSubscriptionPausesResponse" } } } } }, "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" } } } } } } }, "/subscriptions/{id}/resume": { "post": { "tags": [ "Subscriptions" ], "summary": "Resume a paused subscription", "description": "Use when reactivating a paused subscription (e.g. end of hold). Billing and access resume from the resume date.", "operationId": "resumeSubscription", "parameters": [ { "name": "id", "in": "path", "description": "Subscription ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Resume subscription request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResumeSubscriptionRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionPauseResponse" } } } }, "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" } }, "/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": [] } ] } }, "/tasks": { "get": { "tags": [ "Tasks" ], "summary": "List tasks", "description": "Use when listing or searching async tasks (e.g. admin queue view). Returns list with optional filtering.", "operationId": "listTasks", "parameters": [ { "name": "created_by", "in": "query", "schema": { "type": "string" } }, { "name": "end_time", "in": "query", "schema": { "type": "string" } }, { "name": "entity_type", "in": "query", "schema": { "type": "string", "enum": [ "EVENTS", "PRICES", "CUSTOMERS", "FEATURES" ], "x-enum-varnames": [ "EntityTypeEvents", "EntityTypePrices", "EntityTypeCustomers", "EntityTypeFeatures" ] }, "x-enum-varnames": [ "EntityTypeEvents", "EntityTypePrices", "EntityTypeCustomers", "EntityTypeFeatures" ] }, { "name": "expand", "in": "query", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "schema": { "maximum": 1000, "minimum": 1, "type": "integer" } }, { "name": "offset", "in": "query", "schema": { "minimum": 0, "type": "integer" } }, { "name": "order", "in": "query", "schema": { "type": "string", "enum": [ "asc", "desc" ] } }, { "name": "scheduled_task_id", "in": "query", "schema": { "type": "string" } }, { "name": "sort", "in": "query", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "schema": { "type": "string" } }, { "name": "status", "in": "query", "schema": { "type": "string", "enum": [ "published", "deleted", "archived" ], "x-enum-varnames": [ "StatusPublished", "StatusDeleted", "StatusArchived" ] }, "x-enum-varnames": [ "StatusPublished", "StatusDeleted", "StatusArchived" ] }, { "name": "task_status", "in": "query", "schema": { "type": "string", "enum": [ "PENDING", "PROCESSING", "COMPLETED", "FAILED" ], "x-enum-varnames": [ "TaskStatusPending", "TaskStatusProcessing", "TaskStatusCompleted", "TaskStatusFailed" ] }, "x-enum-varnames": [ "TaskStatusPending", "TaskStatusProcessing", "TaskStatusCompleted", "TaskStatusFailed" ] }, { "name": "task_type", "in": "query", "schema": { "type": "string", "enum": [ "IMPORT", "EXPORT" ], "x-enum-varnames": [ "TaskTypeImport", "TaskTypeExport" ] }, "x-enum-varnames": [ "TaskTypeImport", "TaskTypeExport" ] } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListTasksResponse" } } } }, "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": [] } ] }, "post": { "tags": [ "Tasks" ], "summary": "Create a new task", "description": "Use when submitting a file or job for async processing (e.g. export or import). Returns task ID to poll for status and result.", "operationId": "createTask", "requestBody": { "description": "Task configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTaskRequest" } } }, "required": true }, "responses": { "202": { "description": "Accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskResponse" } } } }, "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": "task" } }, "/tasks/result": { "get": { "tags": [ "Tasks" ], "summary": "Get task processing result", "description": "Use when fetching the outcome of a completed task (e.g. export URL or error message). Call after task status is complete.", "operationId": "getTaskResult", "parameters": [ { "name": "workflow_id", "in": "query", "description": "Workflow ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/models.TemporalWorkflowResult" } } } }, "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": [] } ] } }, "/tasks/scheduled": { "get": { "tags": [ "Scheduled Tasks" ], "summary": "List scheduled tasks", "description": "Use when listing or managing scheduled tasks in an admin UI. Returns a list; supports filtering by status, type, and pagination.", "operationId": "listScheduledTasks", "parameters": [ { "name": "limit", "in": "query", "description": "Limit", "schema": { "type": "integer" } }, { "name": "offset", "in": "query", "description": "Offset", "schema": { "type": "integer" } }, { "name": "connection_id", "in": "query", "description": "Filter by connection ID", "schema": { "type": "string" } }, { "name": "entity_type", "in": "query", "description": "Filter by entity type", "schema": { "type": "string" } }, { "name": "interval", "in": "query", "description": "Filter by interval", "schema": { "type": "string" } }, { "name": "enabled", "in": "query", "description": "Filter by enabled status", "schema": { "type": "boolean" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListScheduledTasksResponse" } } } }, "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": [] } ] }, "post": { "tags": [ "Scheduled Tasks" ], "summary": "Create scheduled task", "description": "Use when setting up recurring data exports or other scheduled jobs. Ideal for report generation or syncing data on a schedule.", "operationId": "createScheduledTask", "requestBody": { "description": "Scheduled Task", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateScheduledTaskRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTaskResponse" } } } }, "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": "scheduled_task" } }, "/tasks/scheduled/schedule-draft-finalization": { "post": { "tags": [ "Scheduled Tasks" ], "summary": "Schedule draft finalization", "description": "Triggers the draft invoice finalization workflow that scans computed draft invoices whose finalization delay has elapsed and finalizes them (assign invoice number, sync to vendors, attempt payment).", "operationId": "scheduleDraftFinalization", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object" } } } }, "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": [] } ] } }, "/tasks/scheduled/schedule-update-billing-period": { "post": { "tags": [ "Scheduled Tasks" ], "summary": "Schedule update billing period", "description": "Use when you need to trigger a billing-period update workflow (e.g. to recalculate or sync billing windows).", "operationId": "scheduleUpdateBillingPeriod", "requestBody": { "description": "Schedule Update Billing Period Request", "content": { "application/json": { "schema": { "type": "object" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object" } } } }, "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" } }, "/tasks/scheduled/{id}": { "get": { "tags": [ "Scheduled Tasks" ], "summary": "Get scheduled task", "description": "Use when you need to load a single scheduled task (e.g. to show details in a UI or check its configuration).", "operationId": "getScheduledTask", "parameters": [ { "name": "id", "in": "path", "description": "Scheduled Task ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTaskResponse" } } } }, "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": [] } ] }, "put": { "tags": [ "Scheduled Tasks" ], "summary": "Update a scheduled task", "description": "Use when pausing or resuming a scheduled task. Only the enabled field can be changed.", "operationId": "updateScheduledTask", "parameters": [ { "name": "id", "in": "path", "description": "Scheduled Task ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Update request (enabled: true/false to pause/resume)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateScheduledTaskRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTaskResponse" } } } }, "400": { "description": "Invalid request or task is archived", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Scheduled task not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Failed to update Temporal schedule", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ], "x-codegen-request-body-name": "scheduled_task" }, "delete": { "tags": [ "Scheduled Tasks" ], "summary": "Delete a scheduled task", "description": "Use when removing a scheduled task from the active roster. Archives the task and removes it from the scheduler (soft delete).", "operationId": "deleteScheduledTask", "parameters": [ { "name": "id", "in": "path", "description": "Scheduled Task ID", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Scheduled task archived successfully", "content": {} }, "400": { "description": "Task already archived", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Scheduled task not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Failed to archive task", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/tasks/scheduled/{id}/run": { "post": { "tags": [ "Scheduled Tasks" ], "summary": "Trigger force run", "description": "Use when you need to run a scheduled export immediately (e.g. on-demand report or catch-up). Supports optional custom time range.", "operationId": "triggerScheduledTaskRun", "parameters": [ { "name": "id", "in": "path", "description": "Scheduled Task ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Optional start and end time for custom range", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerForceRunRequest" } } }, "required": false }, "responses": { "200": { "description": "Returns workflow details and time range", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerForceRunResponse" } } } }, "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" } }, "/tasks/{id}": { "get": { "tags": [ "Tasks" ], "summary": "Get a task", "description": "Use when checking task status or progress (e.g. polling after create). Returns task by ID.", "operationId": "getTask", "parameters": [ { "name": "id", "in": "path", "description": "Task ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskResponse" } } } }, "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": [] } ] } }, "/tasks/{id}/download": { "get": { "tags": [ "Tasks" ], "summary": "Download task export file", "description": "Use when letting a user download an exported file (e.g. report or data export). Returns a presigned URL; supports FlexPrice or customer-owned S3.", "operationId": "downloadTaskExport", "parameters": [ { "name": "id", "in": "path", "description": "Task ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "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": [] } ] } }, "/tasks/{id}/status": { "put": { "tags": [ "Tasks" ], "summary": "Update task status", "description": "Use when updating task status (e.g. marking complete or failed from a worker). Typically called by backend processors.", "operationId": "updateTaskStatus", "parameters": [ { "name": "id", "in": "path", "description": "Task ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Status update", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateTaskStatusRequest" } } }, "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" } } } }, "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": "status" } }, "/taxes/associations": { "get": { "tags": [ "Tax Associations" ], "summary": "List tax associations", "description": "Use when listing tax associations (e.g. tax config or audit). Returns list with optional filtering.", "operationId": "listTaxAssociations", "parameters": [ { "name": "entity_type", "in": "query", "description": "Entity Type", "schema": { "type": "string" } }, { "name": "entity_id", "in": "query", "description": "Entity ID", "schema": { "type": "string" } }, { "name": "external_customer_id", "in": "query", "description": "External Customer ID", "schema": { "type": "string" } }, { "name": "tax_rate_id", "in": "query", "description": "Tax Rate ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListTaxAssociationsResponse" } } } }, "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": [] } ] }, "post": { "tags": [ "Tax Associations" ], "summary": "Create Tax Association", "description": "Use when linking a tax rate to an entity (e.g. customer, product, or region) so that rate applies on invoices.", "operationId": "createTaxAssociation", "requestBody": { "description": "Tax Config Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTaxAssociationRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaxAssociationResponse" } } } }, "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": "tax_config" } }, "/taxes/associations/{id}": { "get": { "tags": [ "Tax Associations" ], "summary": "Get Tax Association", "description": "Use when you need to load a single tax association (e.g. for display or editing).", "operationId": "getTaxAssociation", "parameters": [ { "name": "id", "in": "path", "description": "Tax Config ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaxAssociationResponse" } } } }, "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": [] } ] }, "put": { "tags": [ "Tax Associations" ], "summary": "Update tax association", "description": "Use when changing a tax association (e.g. switch rate or entity). Request body contains the fields to update.", "operationId": "updateTaxAssociation", "parameters": [ { "name": "id", "in": "path", "description": "Tax Config ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Tax Config Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaxAssociationUpdateRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaxAssociationResponse" } } } }, "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": "tax_config" }, "delete": { "tags": [ "Tax Associations" ], "summary": "Delete tax association", "description": "Use when removing a tax association (e.g. entity no longer subject to that rate).", "operationId": "deleteTaxAssociation", "parameters": [ { "name": "id", "in": "path", "description": "Tax Config ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaxAssociationResponse" } } } }, "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": [] } ] } }, "/taxes/rates": { "get": { "tags": [ "Tax Rates" ], "summary": "Get tax rates", "description": "Use when listing tax rates (e.g. tax config UI). Returns tax rates with optional filters.", "operationId": "getTaxRates", "parameters": [ { "name": "end_time", "in": "query", "schema": { "type": "string" } }, { "name": "expand", "in": "query", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "schema": { "maximum": 1000, "minimum": 1, "type": "integer" } }, { "name": "offset", "in": "query", "schema": { "minimum": 0, "type": "integer" } }, { "name": "order", "in": "query", "schema": { "type": "string", "enum": [ "asc", "desc" ] } }, { "name": "scope", "in": "query", "schema": { "type": "string", "enum": [ "INTERNAL", "EXTERNAL", "ONETIME" ], "x-enum-varnames": [ "TaxRateScopeInternal", "TaxRateScopeExternal", "TaxRateScopeOneTime" ] }, "x-enum-varnames": [ "TaxRateScopeInternal", "TaxRateScopeExternal", "TaxRateScopeOneTime" ] }, { "name": "start_time", "in": "query", "schema": { "type": "string" } }, { "name": "status", "in": "query", "schema": { "type": "string", "enum": [ "published", "deleted", "archived" ], "x-enum-varnames": [ "StatusPublished", "StatusDeleted", "StatusArchived" ] }, "x-enum-varnames": [ "StatusPublished", "StatusDeleted", "StatusArchived" ] }, { "name": "taxrate_codes", "in": "query", "style": "form", "explode": false, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "taxrate_ids", "in": "query", "style": "form", "explode": false, "schema": { "type": "array", "items": { "type": "string" } } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/TaxRateResponse" } } } } }, "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": [] } ] }, "post": { "tags": [ "Tax Rates" ], "summary": "Create a tax rate", "description": "Use when defining a new tax rate (e.g. VAT or sales tax) for use in invoices. Attach to customers or products via tax associations.", "operationId": "createTaxRate", "requestBody": { "description": "Tax rate to create", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTaxRateRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaxRateResponse" } } } }, "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": "tax_rate" } }, "/taxes/rates/{id}": { "get": { "tags": [ "Tax Rates" ], "summary": "Get a tax rate", "description": "Use when you need to load a single tax rate (e.g. for display or when creating an association).", "operationId": "getTaxRate", "parameters": [ { "name": "id", "in": "path", "description": "Tax rate ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaxRateResponse" } } } }, "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": [] } ] }, "put": { "tags": [ "Tax Rates" ], "summary": "Update a tax rate", "description": "Use when changing a tax rate (e.g. rate value or name). Request body contains the fields to update.", "operationId": "updateTaxRate", "parameters": [ { "name": "id", "in": "path", "description": "Tax rate ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Tax rate to update", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateTaxRateRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaxRateResponse" } } } }, "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": "tax_rate" }, "delete": { "tags": [ "Tax Rates" ], "summary": "Delete a tax rate", "description": "Use when retiring a tax rate (e.g. no longer applicable). Fails if still referenced by associations.", "operationId": "deleteTaxRate", "parameters": [ { "name": "id", "in": "path", "description": "Tax rate 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": [] } ] } }, "/tenant/billing": { "get": { "tags": [ "Tenants" ], "summary": "Get billing usage for the current tenant", "description": "Use when showing the current tenant's billing usage (e.g. admin billing page or usage caps). Returns subscription and usage for the tenant.", "operationId": "getTenantBillingUsage", "responses": { "200": { "description": "Tenant billing usage", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TenantBillingUsage" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Tenant 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": [] } ] } }, "/tenants/update": { "put": { "tags": [ "Tenants" ], "summary": "Update a tenant", "description": "Use when changing tenant details (e.g. name or billing info). Request body contains the fields to update.", "operationId": "updateTenant", "requestBody": { "description": "Update tenant request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateTenantRequest" } } }, "required": true }, "responses": { "200": { "description": "Updated tenant", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TenantResponse" } } } }, "400": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "404": { "description": "Tenant 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" } }, "/tenants/{id}": { "get": { "tags": [ "Tenants" ], "summary": "Get tenant by ID", "description": "Get tenant by ID", "operationId": "getTenantById", "parameters": [ { "name": "id", "in": "path", "description": "Tenant ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Tenant details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TenantResponse" } } } }, "404": { "description": "Tenant 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": [] } ] } }, "/users": { "post": { "tags": [ "Users" ], "summary": "Create user or service account", "description": "Create a user account (type=user, email required; returns user + password for login) or a service account (type=service_account, roles required) for API/automation access.", "operationId": "createUser", "requestBody": { "description": "Create user (email, type=user) or service account (type=service_account, roles)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateUserRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateUserResponse" } } } }, "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" } }, "/users/me": { "get": { "tags": [ "Users" ], "summary": "Get current user", "description": "Use to show the logged-in user's profile in the UI or to check permissions and roles for the current session.", "operationId": "getUserInfo", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } }, "500": { "description": "Server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/errors.ErrorResponse" } } } } }, "security": [ { "ApiKeyAuth": [] } ] } }, "/users/search": { "post": { "tags": [ "Users" ], "summary": "Query users", "description": "Use when listing or searching service accounts in an admin UI, or when auditing who has API access and which roles they have.", "operationId": "queryUser", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.UserFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListUsersResponse" } } } }, "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" } }, "/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" } } } } } } }, "/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" } } } } } } }, "/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" } }, "/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" } } } } } } }, "/wallets": { "post": { "tags": [ "Wallets" ], "summary": "Create a new wallet", "description": "Use when giving a customer a prepaid or credit balance (e.g. prepaid plans or promotional credits).", "operationId": "createWallet", "requestBody": { "description": "Create wallet request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateWalletRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletResponse" } } } }, "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" } }, "/wallets/search": { "post": { "tags": [ "Wallets" ], "summary": "Query wallets", "description": "Use when listing or searching wallets (e.g. admin view or reporting). Returns a paginated list; supports filtering by customer and status.", "operationId": "queryWallet", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.WalletFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.ListResponse-dto_WalletResponse" } } } }, "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" } }, "/wallets/transactions/search": { "post": { "tags": [ "Wallets" ], "summary": "Query wallet transactions", "description": "Use when searching or reporting on wallet transactions (e.g. cross-wallet history or reconciliation). Returns a paginated list; supports filtering by wallet, customer, type, date range.", "operationId": "queryWalletTransaction", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.WalletTransactionFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWalletTransactionsResponse" } } } }, "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" } }, "/wallets/{id}": { "get": { "tags": [ "Wallets" ], "summary": "Get wallet", "description": "Use when you need to load a single wallet (e.g. for a balance or settings view).", "operationId": "getWallet", "parameters": [ { "name": "id", "in": "path", "description": "Wallet ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletResponse" } } } }, "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": [] } ] }, "put": { "tags": [ "Wallets" ], "summary": "Update a wallet", "description": "Use when changing wallet settings (e.g. enabling or updating auto top-up thresholds).", "operationId": "updateWallet", "parameters": [ { "name": "id", "in": "path", "description": "Wallet ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Update wallet request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateWalletRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletResponse" } } } }, "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" } }, "/wallets/{id}/balance/real-time": { "get": { "tags": [ "Wallets" ], "summary": "Get wallet balance", "description": "Use when displaying or checking current wallet balance (e.g. before charging or in a portal). Supports optional expand for credits breakdown and from_cache.", "operationId": "getWalletBalance", "parameters": [ { "name": "id", "in": "path", "description": "Wallet ID", "required": true, "schema": { "type": "string" } }, { "name": "expand", "in": "query", "description": "Expand fields (e.g., credits_available_breakdown)", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletBalanceResponse" } } } }, "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": [] } ] } }, "/wallets/{id}/terminate": { "post": { "tags": [ "Wallets" ], "summary": "Terminate a wallet", "description": "Use when closing a customer wallet (e.g. churn or migration). Closes the wallet and applies remaining balance per policy (refund or forfeit).", "operationId": "terminateWallet", "parameters": [ { "name": "id", "in": "path", "description": "Wallet ID", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletResponse" } } } }, "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": [] } ] } }, "/wallets/{id}/top-up": { "post": { "tags": [ "Wallets" ], "summary": "Top up wallet", "description": "Use when adding funds to a wallet (e.g. top-up, refund, or manual credit). Supports optional idempotency via reference.", "operationId": "topUpWallet", "parameters": [ { "name": "id", "in": "path", "description": "Wallet ID", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Top up request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TopUpWalletRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TopUpWalletResponse" } } } }, "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" } }, "/wallets/{id}/transactions": { "get": { "tags": [ "Wallets" ], "summary": "Get wallet transactions", "description": "Use when showing transaction history for a wallet (e.g. credit/debit log or audit). Returns a paginated list; supports limit, offset, and filters.", "operationId": "getWalletTransactions", "parameters": [ { "name": "id", "in": "path", "description": "Wallet ID", "required": true, "schema": { "type": "string" } }, { "name": "created_by", "in": "query", "schema": { "type": "string" } }, { "name": "credits_available_gt", "in": "query", "schema": { "type": "number" } }, { "name": "end_time", "in": "query", "schema": { "type": "string" } }, { "name": "expand", "in": "query", "schema": { "type": "string" } }, { "name": "expiry_date_after", "in": "query", "schema": { "type": "string" } }, { "name": "expiry_date_before", "in": "query", "schema": { "type": "string" } }, { "name": "id", "in": "query", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "schema": { "maximum": 1000, "minimum": 1, "type": "integer" } }, { "name": "offset", "in": "query", "schema": { "minimum": 0, "type": "integer" } }, { "name": "order", "in": "query", "schema": { "type": "string", "enum": [ "asc", "desc" ] } }, { "name": "priority", "in": "query", "schema": { "type": "integer" } }, { "name": "reference_id", "in": "query", "schema": { "type": "string" } }, { "name": "reference_type", "in": "query", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "schema": { "type": "string" } }, { "name": "status", "in": "query", "schema": { "type": "string", "enum": [ "published", "deleted", "archived" ], "x-enum-varnames": [ "StatusPublished", "StatusDeleted", "StatusArchived" ] }, "x-enum-varnames": [ "StatusPublished", "StatusDeleted", "StatusArchived" ] }, { "name": "transaction_reason", "in": "query", "schema": { "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-enum-varnames": [ "TransactionReasonInvoicePayment", "TransactionReasonFreeCredit", "TransactionReasonSubscriptionCredit", "TransactionReasonPurchasedCreditInvoiced", "TransactionReasonPurchasedCreditDirect", "TransactionReasonCreditNote", "TransactionReasonCreditExpired", "TransactionReasonWalletTermination", "TransactionReasonManualBalanceDebit", "TransactionReasonCreditAdjustment", "TransactionReasonInvoiceVoidRefund" ] }, { "name": "transaction_status", "in": "query", "schema": { "type": "string", "enum": [ "pending", "completed", "failed" ], "x-enum-varnames": [ "TransactionStatusPending", "TransactionStatusCompleted", "TransactionStatusFailed" ] }, "x-enum-varnames": [ "TransactionStatusPending", "TransactionStatusCompleted", "TransactionStatusFailed" ] }, { "name": "type", "in": "query", "schema": { "type": "string", "enum": [ "credit", "debit" ], "x-enum-varnames": [ "TransactionTypeCredit", "TransactionTypeDebit" ] }, "x-enum-varnames": [ "TransactionTypeCredit", "TransactionTypeDebit" ] } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWalletTransactionsResponse" } } } }, "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": [] } ] } }, "/webhook-events/credit_note.created": { "post": { "tags": [ "Webhook Events" ], "summary": "credit_note.created", "description": "Fired when a new credit note is created. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.CreditNoteWebhookPayload" } } } } } } }, "/webhook-events/credit_note.updated": { "post": { "tags": [ "Webhook Events" ], "summary": "credit_note.updated", "description": "Fired when a credit note is updated. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.CreditNoteWebhookPayload" } } } } } } }, "/webhook-events/customer.created": { "post": { "tags": [ "Webhook Events" ], "summary": "customer.created", "description": "Fired when a new customer is created. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.CustomerWebhookPayload" } } } } } } }, "/webhook-events/customer.deleted": { "post": { "tags": [ "Webhook Events" ], "summary": "customer.deleted", "description": "Fired when a customer is deleted. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.CustomerWebhookPayload" } } } } } } }, "/webhook-events/customer.updated": { "post": { "tags": [ "Webhook Events" ], "summary": "customer.updated", "description": "Fired when a customer is updated. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.CustomerWebhookPayload" } } } } } } }, "/webhook-events/entitlement.created": { "post": { "tags": [ "Webhook Events" ], "summary": "entitlement.created", "description": "Fired when a new entitlement is created. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.EntitlementWebhookPayload" } } } } } } }, "/webhook-events/entitlement.deleted": { "post": { "tags": [ "Webhook Events" ], "summary": "entitlement.deleted", "description": "Fired when an entitlement is deleted. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.EntitlementWebhookPayload" } } } } } } }, "/webhook-events/entitlement.updated": { "post": { "tags": [ "Webhook Events" ], "summary": "entitlement.updated", "description": "Fired when an entitlement is updated. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.EntitlementWebhookPayload" } } } } } } }, "/webhook-events/feature.created": { "post": { "tags": [ "Webhook Events" ], "summary": "feature.created", "description": "Fired when a new feature is created. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.FeatureWebhookPayload" } } } } } } }, "/webhook-events/feature.deleted": { "post": { "tags": [ "Webhook Events" ], "summary": "feature.deleted", "description": "Fired when a feature is deleted. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.FeatureWebhookPayload" } } } } } } }, "/webhook-events/feature.updated": { "post": { "tags": [ "Webhook Events" ], "summary": "feature.updated", "description": "Fired when a feature is updated. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.FeatureWebhookPayload" } } } } } } }, "/webhook-events/feature.wallet_balance.alert": { "post": { "tags": [ "Webhook Events" ], "summary": "feature.wallet_balance.alert", "description": "Fired when a feature's associated wallet balance crosses an alert threshold. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.AlertWebhookPayload" } } } } } } }, "/webhook-events/invoice.communication.triggered": { "post": { "tags": [ "Webhook Events" ], "summary": "invoice.communication.triggered", "description": "Fired when an invoice communication (e.g. email notification) is triggered. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.CommunicationWebhookPayload" } } } } } } }, "/webhook-events/invoice.payment.overdue": { "post": { "tags": [ "Webhook Events" ], "summary": "invoice.payment.overdue", "description": "Fired when an invoice payment is overdue past the due date. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.InvoiceWebhookPayload" } } } } } } }, "/webhook-events/invoice.update": { "post": { "tags": [ "Webhook Events" ], "summary": "invoice.update", "description": "Fired when an invoice is updated. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.InvoiceWebhookPayload" } } } } } } }, "/webhook-events/invoice.update.finalized": { "post": { "tags": [ "Webhook Events" ], "summary": "invoice.update.finalized", "description": "Fired when an invoice is finalized and locked for payment. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.InvoiceWebhookPayload" } } } } } } }, "/webhook-events/invoice.update.payment": { "post": { "tags": [ "Webhook Events" ], "summary": "invoice.update.payment", "description": "Fired when an invoice payment status changes. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.InvoiceWebhookPayload" } } } } } } }, "/webhook-events/invoice.update.voided": { "post": { "tags": [ "Webhook Events" ], "summary": "invoice.update.voided", "description": "Fired when an invoice is voided (e.g. order cancelled or duplicate). Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.InvoiceWebhookPayload" } } } } } } }, "/webhook-events/payment.created": { "post": { "tags": [ "Webhook Events" ], "summary": "payment.created", "description": "Fired when a new payment is created. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.PaymentWebhookPayload" } } } } } } }, "/webhook-events/payment.failed": { "post": { "tags": [ "Webhook Events" ], "summary": "payment.failed", "description": "Fired when a payment fails. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.PaymentWebhookPayload" } } } } } } }, "/webhook-events/payment.pending": { "post": { "tags": [ "Webhook Events" ], "summary": "payment.pending", "description": "Fired when a payment is pending processing. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.PaymentWebhookPayload" } } } } } } }, "/webhook-events/payment.success": { "post": { "tags": [ "Webhook Events" ], "summary": "payment.success", "description": "Fired when a payment succeeds. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.PaymentWebhookPayload" } } } } } } }, "/webhook-events/payment.updated": { "post": { "tags": [ "Webhook Events" ], "summary": "payment.updated", "description": "Fired when a payment is updated. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.PaymentWebhookPayload" } } } } } } }, "/webhook-events/subscription.activated": { "post": { "tags": [ "Webhook Events" ], "summary": "subscription.activated", "description": "Fired when a draft subscription is activated. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload" } } } } } } }, "/webhook-events/subscription.cancelled": { "post": { "tags": [ "Webhook Events" ], "summary": "subscription.cancelled", "description": "Fired when a subscription is cancelled (immediately or end-of-period). Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload" } } } } } } }, "/webhook-events/subscription.created": { "post": { "tags": [ "Webhook Events" ], "summary": "subscription.created", "description": "Fired when a new subscription is created. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload" } } } } } } }, "/webhook-events/subscription.draft.created": { "post": { "tags": [ "Webhook Events" ], "summary": "subscription.draft.created", "description": "Fired when a new draft subscription is created (not yet activated). Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload" } } } } } } }, "/webhook-events/subscription.paused": { "post": { "tags": [ "Webhook Events" ], "summary": "subscription.paused", "description": "Fired when a subscription is paused. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload" } } } } } } }, "/webhook-events/subscription.phase.created": { "post": { "tags": [ "Webhook Events" ], "summary": "subscription.phase.created", "description": "Fired when a new subscription phase is created. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.SubscriptionPhaseWebhookPayload" } } } } } } }, "/webhook-events/subscription.phase.deleted": { "post": { "tags": [ "Webhook Events" ], "summary": "subscription.phase.deleted", "description": "Fired when a subscription phase is deleted. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.SubscriptionPhaseWebhookPayload" } } } } } } }, "/webhook-events/subscription.phase.updated": { "post": { "tags": [ "Webhook Events" ], "summary": "subscription.phase.updated", "description": "Fired when a subscription phase is updated. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.SubscriptionPhaseWebhookPayload" } } } } } } }, "/webhook-events/subscription.renewal.due": { "post": { "tags": [ "Webhook Events" ], "summary": "subscription.renewal.due", "description": "Fired when a subscription renewal is upcoming (cron-driven). Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload" } } } } } } }, "/webhook-events/subscription.resumed": { "post": { "tags": [ "Webhook Events" ], "summary": "subscription.resumed", "description": "Fired when a paused subscription is resumed. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload" } } } } } } }, "/webhook-events/subscription.updated": { "post": { "tags": [ "Webhook Events" ], "summary": "subscription.updated", "description": "Fired when a subscription is updated (e.g. quantity, billing anchor, or metadata changes). Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.SubscriptionWebhookPayload" } } } } } } }, "/webhook-events/wallet.created": { "post": { "tags": [ "Webhook Events" ], "summary": "wallet.created", "description": "Fired when a new wallet is created. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload" } } } } } } }, "/webhook-events/wallet.credit_balance.dropped": { "post": { "tags": [ "Webhook Events" ], "summary": "wallet.credit_balance.dropped", "description": "Fired when a wallet's credit balance drops below an alert threshold. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload" } } } } } } }, "/webhook-events/wallet.credit_balance.recovered": { "post": { "tags": [ "Webhook Events" ], "summary": "wallet.credit_balance.recovered", "description": "Fired when a wallet's credit balance recovers above an alert threshold. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload" } } } } } } }, "/webhook-events/wallet.ongoing_balance.dropped": { "post": { "tags": [ "Webhook Events" ], "summary": "wallet.ongoing_balance.dropped", "description": "Fired when a wallet's ongoing balance drops below an alert threshold. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload" } } } } } } }, "/webhook-events/wallet.ongoing_balance.recovered": { "post": { "tags": [ "Webhook Events" ], "summary": "wallet.ongoing_balance.recovered", "description": "Fired when a wallet's ongoing balance recovers above an alert threshold. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload" } } } } } } }, "/webhook-events/wallet.terminated": { "post": { "tags": [ "Webhook Events" ], "summary": "wallet.terminated", "description": "Fired when a wallet is terminated. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload" } } } } } } }, "/webhook-events/wallet.transaction.created": { "post": { "tags": [ "Webhook Events" ], "summary": "wallet.transaction.created", "description": "Fired when a new wallet transaction is created (top-up, deduction, etc.). Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.TransactionWebhookPayload" } } } } } } }, "/webhook-events/wallet.updated": { "post": { "tags": [ "Webhook Events" ], "summary": "wallet.updated", "description": "Fired when a wallet is updated. Doc-only for parsing.", "responses": { "200": { "description": "Webhook payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhookDto.WalletWebhookPayload" } } } } } } }, "/workflows/search": { "post": { "tags": [ "Workflows" ], "summary": "Query workflows", "description": "Use when listing or auditing workflow runs (e.g. ops dashboard or debugging). Returns a paginated list; supports filtering by workflow type and status.", "operationId": "queryWorkflow", "requestBody": { "description": "Filter", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/types.WorkflowExecutionFilter" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWorkflowsResponse" } } } }, "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" } } }, "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" } } }, "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" } } }, "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/DomainCoupon" }, "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" }, "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 }, "start_date": { "type": "string", "format": "date-time" }, "subscription_id": { "type": "string" } } }, "AddAddonToSubscriptionRequest": { "required": [ "addon_id" ], "type": "object", "properties": { "addon_id": { "type": "string" }, "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 }, "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" }, "type": { "$ref": "#/components/schemas/types.AddonType" }, "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": { "is_enabled": { "type": "boolean" }, "is_soft_limit": { "type": "boolean" }, "static_values": { "type": "array", "description": "For static/SLA features", "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" } } }, "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" } } }, "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 custom date to cancel the subscription.\nRequired when CancellationType is \"scheduled_date\". Must be in the future.", "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" } } }, "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" } } }, "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/DomainCoupon" }, "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" } } }, "CouponResponse": { "type": "object", "properties": { "amount_off": { "type": "string" }, "cadence": { "$ref": "#/components/schemas/types.CouponCadence" }, "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" ], "type": "object", "properties": { "description": { "type": "string" }, "lookup_key": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true }, "name": { "type": "string" }, "type": { "$ref": "#/components/schemas/types.AddonType" } } }, "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" }, "type": { "$ref": "#/components/schemas/types.AddonType" }, "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" } } } }, "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" }, "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)" }, "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" }, "parent_customer_external_id": { "type": "string", "description": "Deprecated: See ParentCustomerID.\nparent_customer_external_id is the external ID of the parent customer from your system.\nExactly one of parent_customer_id or parent_customer_external_id may be provided." }, "parent_customer_id": { "type": "string", "description": "Deprecated: Customer parent hierarchy is deprecated in favor of subscription-level hierarchy.\nThis field is accepted for backward compatibility but no hierarchy validations are enforced.\nparent_customer_id is the internal FlexPrice ID of the parent 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" } } }, "description": "Request object for creating a new customer in the system" }, "CreateEntitlementRequest": { "required": [ "feature_id", "feature_type" ], "type": "object", "properties": { "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" } } }, "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": { "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" } } }, "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\")", "format": "date-time" }, "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" }, "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_cadence", "billing_model", "billing_period", "currency", "entity_id", "entity_type", "invoice_cadence", "price_unit_type", "type" ], "type": "object", "properties": { "amount": { "type": "string" }, "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" }, "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": { "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_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." }, "quantity": { "type": "number" }, "start_date": { "type": "string", "format": "date-time" }, "subscription_phase_id": { "type": "string" } } }, "CreateSubscriptionRequest": { "required": [ "billing_cadence", "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" } }, "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" }, "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", "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." }, "customer_timezone": { "type": "string", "description": "Timezone of the customer.\nIf not set, the default value is UTC." }, "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" }, "invoice_billing": { "$ref": "#/components/schemas/types.InvoiceBilling" }, "invoicing_customer_external_id": { "type": "string", "description": "invoicing_customer_external_id is the external ID of the customer to use for invoicing.\nResolved internally to an internal customer ID via external ID lookup.\nMutually exclusive with invoicing_customer_id." }, "invoicing_customer_id": { "type": "string", "description": "invoicing_customer_id is the FlexPrice customer ID to use for invoicing.\nThis can differ from the subscription customer (e.g., a billing entity invoicing on behalf of another customer).\nMutually exclusive with invoicing_customer_external_id." }, "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" } } }, "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" } }, "parent_subscription_id": { "type": "string", "description": "ParentSubscriptionID is the parent subscription ID for hierarchy (e.g. child subscription under a parent)" }, "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_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" } }, "trial_end": { "type": "string", "format": "date-time" }, "trial_start": { "type": "string", "format": "date-time" } } }, "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" }, "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" }, "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\"" }, "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" }, "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/DomainCustomer" }, "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" } } } }, "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/DomainCustomer" }, "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" }, "parent_customer": { "$ref": "#/components/schemas/CustomerResponse" }, "parent_customer_id": { "type": "string", "description": "Deprecated: Customer parent hierarchy is deprecated in favor of subscription-level hierarchy.\nRetained for backward compatibility; no hierarchy rules are enforced at the service layer.\nParentCustomerID is the parent customer identifier for the customer." }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "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": { "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" } } }, "EntitlementResponse": { "type": "object", "properties": { "addon": { "$ref": "#/components/schemas/AddonResponse" }, "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": { "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" }, "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" } } }, "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": { "required": [ "external_customer_id" ], "type": "object", "properties": { "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" }, "feature_ids": { "type": "array", "items": { "type": "string" } }, "group_by": { "type": "array", "description": "allowed values: \"source\", \"feature_id\", \"properties.\"", "items": { "type": "string" } }, "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" } }, "total_cost": { "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" }, "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_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." }, "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" }, "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" } } }, "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" } } }, "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": { "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" }, "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\")", "format": "date-time" }, "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" }, "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\u2192child 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_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_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" } } }, "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" } } }, "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" } } }, "ListSubscriptionPausesResponse": { "type": "object", "properties": { "items": { "type": "array", "description": "List of subscription pause objects\n@Description Array of subscription pauses", "items": { "$ref": "#/components/schemas/SubscriptionPauseResponse" } }, "total": { "type": "integer", "description": "Total number of pauses\n@Description Total count of subscription pauses in the response" } }, "description": "Response object for listing subscription pauses with total count" }, "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" } } }, "OverrideEntitlementRequest": { "required": [ "entitlement_id" ], "type": "object", "properties": { "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" } } }, "PauseSubscriptionRequest": { "required": [ "pause_mode" ], "type": "object", "properties": { "dry_run": { "type": "boolean", "description": "Whether to perform a dry run\n@Description If true, validates the request and shows impact without actually pausing the subscription\n@Example false" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Additional metadata as key-value pairs\n@Description Optional metadata for storing additional information about the pause\n@Example {\"requested_by\": \"customer\", \"channel\": \"support_ticket\"}" }, "pause_days": { "type": "integer", "description": "Duration of the pause in days\n@Description Number of days to pause the subscription. Cannot be used together with pause_end. Must be greater than 0\n@Example 30" }, "pause_end": { "type": "string", "description": "End date for the subscription pause\n@Description ISO 8601 timestamp when the pause should end. Cannot be used together with pause_days. Must be after pause_start\n@Example \"2024-02-15T00:00:00Z\"", "format": "date-time" }, "pause_mode": { "$ref": "#/components/schemas/types.PauseMode" }, "pause_start": { "type": "string", "description": "Start date for the subscription pause\n@Description ISO 8601 timestamp when the pause should begin. Required when pause_mode is \"scheduled\"\n@Example \"2024-01-15T00:00:00Z\"", "format": "date-time" }, "reason": { "maxLength": 255, "type": "string", "description": "Reason for pausing the subscription\n@Description Optional reason for the pause. Maximum 255 characters\n@Example \"Customer requested temporary suspension\"" } }, "description": "Request object for pausing an active subscription with various pause modes and options" }, "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" } } }, "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" } } }, "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" }, "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": { "type": "integer", "description": "TrialPeriod 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" }, "reason": { "type": "string" } } }, "ResumeSubscriptionRequest": { "required": [ "resume_mode" ], "type": "object", "properties": { "dry_run": { "type": "boolean", "description": "Whether to perform a dry run\n@Description If true, validates the request and shows impact without actually resuming the subscription\n@Example false" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Additional metadata as key-value pairs\n@Description Optional metadata for storing additional information about the resume operation\n@Example {\"resumed_by\": \"admin\", \"reason\": \"issue_resolved\"}" }, "resume_mode": { "$ref": "#/components/schemas/types.ResumeMode" } }, "description": "Request object for resuming a paused subscription" }, "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" } }, "status": { "$ref": "#/components/schemas/types.Status" }, "type": { "$ref": "#/components/schemas/types.SecretType" }, "updated_at": { "type": "string", "format": "date-time" }, "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)" } } }, "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)" }, "SubscriptionEntitlementsResponse": { "type": "object", "properties": { "features": { "type": "array", "items": { "$ref": "#/components/schemas/AggregatedFeature" } }, "plan_id": { "type": "string" }, "subscription_id": { "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": { "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_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" }, "trial_period": { "type": "integer" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "SubscriptionPauseResponse": { "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" } }, "description": "Response object containing subscription pause information" }, "SubscriptionPhaseCreateRequest": { "required": [ "start_date" ], "type": "object", "properties": { "coupons": { "type": "array", "description": "Coupons represents subscription-level coupons to be applied to this phase", "items": { "type": "string" } }, "end_date": { "type": "string", "format": "date-time" }, "line_item_coupons": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } }, "description": "LineItemCoupons represents line item-level coupons (map of line_item_id to coupon IDs)" }, "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" } } }, "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_cadence", "billing_model", "billing_period", "invoice_cadence", "price_unit_type", "type" ], "type": "object", "properties": { "amount": { "type": "string" }, "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": { "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": { "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" }, "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" }, "customer_timezone": { "type": "string" }, "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" }, "tenant_id": { "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" }, "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" }, "customer_timezone": { "type": "string" }, "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" }, "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" }, "tenant_id": { "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" }, "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)" }, "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" } } }, "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": { "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" }, "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" }, "parent_customer_external_id": { "type": "string", "description": "Deprecated: See ParentCustomerID.\nparent_customer_external_id is the external ID of the parent customer from your system.\nExactly one of parent_customer_id or parent_customer_external_id may be provided.\nIf you provide the external ID, the parent customer value will be ignored." }, "parent_customer_id": { "type": "string", "description": "Deprecated: Customer parent hierarchy is deprecated in favor of subscription-level hierarchy.\nThis field is accepted for backward compatibility but no hierarchy validations are enforced.\nparent_customer_id is the internal FlexPrice ID of the parent customer." } }, "description": "Request object for updating an existing customer. All fields are optional - only provided fields will be updated" }, "UpdateEntitlementRequest": { "type": "object", "properties": { "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" }, "succeeded_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" } } }, "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_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" } } }, "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/DomainAddon" }, "aggregation_type": { "$ref": "#/components/schemas/types.AggregationType" }, "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/DomainFeature" }, "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/DomainPlan" }, "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" }, "total_cost": { "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": { "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" }, "event_count": { "type": "integer", "description": "Number of events in this time window" }, "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" }, "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" }, "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.ErrorDetail": { "type": "object", "properties": { "internal_error": { "type": "string" }, "message": { "type": "string" } } }, "DomainAddon": { "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" }, "type": { "$ref": "#/components/schemas/types.AddonType" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "DomainCoupon": { "type": "object", "properties": { "amount_off": { "type": "string" }, "cadence": { "$ref": "#/components/schemas/types.CouponCadence" }, "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" } } }, "DomainCustomer": { "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" }, "parent_customer_id": { "type": "string", "description": "Deprecated: Customer parent hierarchy is deprecated in favor of subscription-level hierarchy.\nRetained for backward compatibility; no hierarchy rules are enforced at the service layer.\nParentCustomerID is the parent customer identifier for the customer." }, "status": { "$ref": "#/components/schemas/types.Status" }, "tenant_id": { "type": "string" }, "updated_at": { "type": "string", "format": "date-time" }, "updated_by": { "type": "string" } } }, "DomainFeature": { "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" } } }, "DomainPlan": { "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": { "error": { "$ref": "#/components/schemas/errors.ErrorDetail" }, "success": { "type": "boolean" } } }, "types.AddonAssociationEntityType": { "type": "string", "enum": [ "subscription", "plan", "addon" ], "x-enum-varnames": [ "AddonAssociationEntityTypeSubscription", "AddonAssociationEntityTypePlan", "AddonAssociationEntityTypeAddon" ], "x-speakeasy-name-override": "AddonAssociationEntityType" }, "types.AddonFilter": { "type": "object", "properties": { "addon_ids": { "type": "array", "items": { "type": "string" } }, "addon_type": { "$ref": "#/components/schemas/types.AddonType" }, "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", "paused" ], "x-enum-varnames": [ "AddonStatusActive", "AddonStatusCancelled", "AddonStatusPaused" ], "x-speakeasy-name-override": "AddonStatus" }, "types.AddonType": { "type": "string", "enum": [ "onetime", "multiple_instance" ], "x-enum-varnames": [ "AddonTypeOnetime", "AddonTypeMultipleInstance" ], "x-speakeasy-name-override": "AddonType" }, "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", "ONETIME" ], "x-enum-varnames": [ "BILLING_CADENCE_RECURRING", "BILLING_CADENCE_ONETIME" ], "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" ], "x-enum-varnames": [ "BILLING_PERIOD_MONTHLY", "BILLING_PERIOD_ANNUAL", "BILLING_PERIOD_WEEKLY", "BILLING_PERIOD_DAILY", "BILLING_PERIOD_QUARTER", "BILLING_PERIOD_HALF_YEAR" ], "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.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_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" }, "offset": { "minimum": 0, "type": "integer" }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "parent_customer_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": "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" ], "x-enum-varnames": [ "DebugTrackerStatusUnprocessed", "DebugTrackerStatusNotFound", "DebugTrackerStatusFound", "DebugTrackerStatusError" ], "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.EntityType": { "type": "string", "enum": [ "EVENTS", "PRICES", "CUSTOMERS", "FEATURES" ], "x-enum-varnames": [ "EntityTypeEvents", "EntityTypePrices", "EntityTypeCustomers", "EntityTypeFeatures" ], "x-speakeasy-name-override": "EntityType" }, "types.EventProcessingStatusType": { "type": "string", "enum": [ "processed", "processing", "failed" ], "x-enum-varnames": [ "EventProcessingStatusTypeProcessed", "EventProcessingStatusTypeProcessing", "EventProcessingStatusTypeFailed" ], "x-speakeasy-name-override": "EventProcessingStatusType" }, "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" ], "x-enum-varnames": [ "FailurePointTypeCustomerLookup", "FailurePointTypeMeterLookup", "FailurePointTypePriceLookup", "FailurePointTypeSubscriptionLineItemLookup" ], "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" ], "x-enum-varnames": [ "FeatureTypeMetered", "FeatureTypeBoolean", "FeatureTypeStatic" ], "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.InvoiceBilling": { "type": "string", "enum": [ "invoice_to_parent", "invoice_to_self" ], "x-enum-varnames": [ "InvoiceBillingInvoiceToParent", "InvoiceBillingInvoiceToSelf" ], "x-speakeasy-name-override": "InvoiceBilling" }, "types.InvoiceBillingReason": { "type": "string", "enum": [ "SUBSCRIPTION_CREATE", "SUBSCRIPTION_CYCLE", "SUBSCRIPTION_UPDATE", "PRORATION", "MANUAL" ], "x-enum-varnames": [ "InvoiceBillingReasonSubscriptionCreate", "InvoiceBillingReasonSubscriptionCycle", "InvoiceBillingReasonSubscriptionUpdate", "InvoiceBillingReasonProration", "InvoiceBillingReasonManual" ], "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" }, "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_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.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" ], "x-enum-varnames": [ "PaymentDestinationTypeInvoice" ], "x-speakeasy-name-override": "PaymentDestinationType" }, "types.PaymentGatewayType": { "type": "string", "enum": [ "stripe", "razorpay", "nomod", "moyasar", "paddle" ], "x-enum-varnames": [ "PaymentGatewayTypeStripe", "PaymentGatewayTypeRazorpay", "PaymentGatewayTypeNomod", "PaymentGatewayTypeMoyasar", "PaymentGatewayTypePaddle" ], "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" ], "x-enum-varnames": [ "PaymentStatusInitiated", "PaymentStatusPending", "PaymentStatusProcessing", "PaymentStatusSucceeded", "PaymentStatusOverpaid", "PaymentStatusFailed", "PaymentStatusRefunded", "PaymentStatusPartiallyRefunded" ], "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" }, "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 }, "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.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)" }, "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 instead of virtual-hosted-style (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" ], "x-enum-varnames": [ "ScheduledTaskEntityTypeEvents", "ScheduledTaskEntityTypeInvoice", "ScheduledTaskEntityTypeCreditTopups", "ScheduledTaskEntityTypeCreditUsage" ], "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", "nomod", "moyasar", "paddle" ], "x-enum-varnames": [ "SecretProviderFlexPrice", "SecretProviderStripe", "SecretProviderS3", "SecretProviderHubSpot", "SecretProviderRazorpay", "SecretProviderChargebee", "SecretProviderQuickBooks", "SecretProviderNomod", "SecretProviderMoyasar", "SecretProviderPaddle" ], "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" }, "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" } }, "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.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.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" ], "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" ], "x-speakeasy-name-override": "WebhookEventName" }, "types.WindowSize": { "type": "string", "enum": [ "MINUTE", "15MIN", "30MIN", "HOUR", "3HOUR", "6HOUR", "12HOUR", "DAY", "WEEK", "MONTH", "MONTH" ], "x-enum-varnames": [ "WindowSizeMinute", "WindowSize15Min", "WindowSize30Min", "WindowSizeHour", "WindowSize3Hour", "WindowSize6Hour", "WindowSize12Hour", "WindowSizeDay", "WindowSizeWeek", "WindowSizeMonth", "DefaultWindowSize" ], "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": { "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" }, "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" }, "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": { "type": "integer", "description": "TrialPeriod 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": { "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_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" }, "trial_period": { "type": "integer" }, "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.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" }, "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" }