openapi: 3.0.3 info: title: Lotus API version: 0.0.1 description: Lotus is an open-core pricing and billing engine. We enable API companies to automate and optimize their custom usage-based pricing for any metric. paths: /api/balance_adjustments/: get: operationId: api_balance_adjustments_list description: A simple ViewSet meant only for creating CustomerBalanceAdjustments. parameters: - in: query name: currency_code schema: type: string minLength: 1 description: Filter to adjustments in a specific currency - in: query name: customer_id schema: type: string minLength: 1 description: The id provided when creating the customer, we suggest matching with your internal customer id in your backend required: true - in: query name: effective_after schema: type: string format: date-time description: Filter to adjustments that are effective after this date - in: query name: effective_before schema: type: string format: date-time description: Filter to adjustments that are effective before this date - in: query name: expires_after schema: type: string format: date-time description: Filter to adjustments that expire after this date - in: query name: expires_before schema: type: string format: date-time description: Filter to adjustments that expire before this date - in: query name: issued_after schema: type: string format: date-time description: Filter to adjustments that were issued after this date - in: query name: issued_before schema: type: string format: date-time description: Filter to adjustments that were issued before this date - in: query name: status schema: type: array items: enum: - active - inactive type: string default: - inactive - active description: Filter to a specific set of adjustment statuses. Defaults to both active and inactive. tags: - api security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/CustomerBalanceAdjustment' description: '' post: operationId: api_balance_adjustments_create description: A simple ViewSet meant only for creating CustomerBalanceAdjustments. tags: - api requestBody: content: application/json: schema: $ref: '#/components/schemas/CustomerBalanceAdjustmentCreateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CustomerBalanceAdjustmentCreateRequest' multipart/form-data: schema: $ref: '#/components/schemas/CustomerBalanceAdjustmentCreateRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/CustomerBalanceAdjustment' description: '' /api/balance_adjustments/{adjustment_id}/update/: post: operationId: api_balance_adjustments_update_create description: A simple ViewSet meant only for creating CustomerBalanceAdjustments. parameters: - in: path name: adjustment_id schema: type: string format: uuid required: true tags: - api requestBody: content: application/json: schema: $ref: '#/components/schemas/CustomerBalanceAdjustmentUpdateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CustomerBalanceAdjustmentUpdateRequest' multipart/form-data: schema: $ref: '#/components/schemas/CustomerBalanceAdjustmentUpdateRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/CustomerBalanceAdjustment' description: '' /api/balance_adjustments/{adjustment_id}/void/: post: operationId: api_balance_adjustments_void_create description: A simple ViewSet meant only for creating CustomerBalanceAdjustments. parameters: - in: path name: adjustment_id schema: type: string format: uuid required: true tags: - api security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/CustomerBalanceAdjustment' description: '' /api/batch_create_customers/: post: operationId: api_batch_create_customers_create tags: - api requestBody: content: application/json: schema: $ref: '#/components/schemas/CustomerBatchCreateRequestRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CustomerBatchCreateRequestRequest' multipart/form-data: schema: $ref: '#/components/schemas/CustomerBatchCreateRequestRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/CustomerBatchCreateSuccess' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/CustomerBatchCreateFailure' description: '' /api/customer_feature_access/: get: operationId: api_customer_feature_access_list parameters: - in: query name: customer_id schema: type: string minLength: 1 description: The customer_id of the customer you want to check access. required: true - in: query name: feature_name schema: type: string minLength: 1 description: Name of the feature to check access for. required: true - in: query name: subscription_filters schema: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilterRequest' description: The subscription filters that are applied to this plan's relationship with the customer. If your billing model does not have the ability multiple plans or subscriptions per customer, this is likely not relevant for you. This must be passed in as a stringified JSON object. tags: - api security: - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/GetFeatureAccess' description: '' /api/customer_metric_access/: get: operationId: api_customer_metric_access_list parameters: - in: query name: customer_id schema: type: string minLength: 1 description: The customer_id of the customer you want to check access. required: true - in: query name: event_name schema: type: string nullable: true minLength: 1 description: The name of the event you are checking access for. - in: query name: metric_id schema: type: string format: uuid nullable: true description: The metric_id of the metric you are checking access for. Please note that you must porovide exactly one of event_name and metric_id are mutually; a validation error will be thrown if both or none are provided. - in: query name: subscription_filters schema: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilterRequest' description: The subscription filters that are applied to this plan's relationship with the customer. If your billing model does not have the ability multiple plans or subscriptions per customer, this is likely not relevant for you. This must be passed in as a stringified JSON object. tags: - api security: - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/GetEventAccess' description: '' /api/customers/: get: operationId: api_customers_list description: A simple ViewSet for viewing and editing Customers. tags: - api security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/Customer' description: '' post: operationId: api_customers_create description: A simple ViewSet for viewing and editing Customers. tags: - api requestBody: content: application/json: schema: $ref: '#/components/schemas/CustomerCreateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CustomerCreateRequest' multipart/form-data: schema: $ref: '#/components/schemas/CustomerCreateRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Customer' description: '' /api/customers/{customer_id}/: get: operationId: api_customers_retrieve description: A simple ViewSet for viewing and editing Customers. parameters: - in: path name: customer_id schema: type: string description: The id provided when creating the customer, we suggest matching with your internal customer id in your backend required: true tags: - api security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Customer' description: '' /api/invoices/: get: operationId: api_invoices_list description: A simple ViewSet for viewing and editing Invoices. parameters: - in: query name: customer_id schema: type: string minLength: 1 description: A filter for invoices for a specific customer - in: query name: payment_status schema: type: array items: enum: - unpaid - paid type: string default: - paid description: A filter for invoices with a specific payment status tags: - api security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/Invoice' description: '' /api/invoices/{invoice_number}/: get: operationId: api_invoices_retrieve description: A simple ViewSet for viewing and editing Invoices. parameters: - in: path name: invoice_number schema: type: string required: true tags: - api security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Invoice' description: '' patch: operationId: api_invoices_partial_update description: A simple ViewSet for viewing and editing Invoices. parameters: - in: path name: invoice_number schema: type: string required: true tags: - api requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedInvoiceUpdateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedInvoiceUpdateRequest' multipart/form-data: schema: $ref: '#/components/schemas/PatchedInvoiceUpdateRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/InvoiceUpdate' description: '' /api/plans/: get: operationId: api_plans_list description: A simple ViewSet for viewing and editing Products. tags: - api security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/Plan' description: '' /api/plans/{plan_id}/: get: operationId: api_plans_retrieve description: A simple ViewSet for viewing and editing Products. parameters: - in: path name: plan_id schema: type: string format: uuid required: true tags: - api security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Plan' description: '' /api/subscriptions/: get: operationId: api_subscriptions_list description: A simple ViewSet for viewing and editing Subscriptions. parameters: - in: query name: customer_id schema: type: string minLength: 1 description: Filter to a specific customer. required: true - in: query name: plan_id schema: type: string format: uuid description: Filter to a specific plan. - in: query name: range_end schema: type: string format: date-time description: If specified, will only return subscriptions with a start date before this date. - in: query name: range_start schema: type: string format: date-time description: If specified, will only return subscriptions with an end date after this date. - in: query name: status schema: type: array items: enum: - active - ended - not_started type: string default: - active description: Filter to a specific set of subscription statuses. Defaults to active. tags: - api security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/SubscriptionRecord' description: '' /api/subscriptions/add/: post: operationId: api_subscriptions_add_create description: A simple ViewSet for viewing and editing Subscriptions. tags: - api requestBody: content: application/json: schema: $ref: '#/components/schemas/SubscriptionRecordCreateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/SubscriptionRecordCreateRequest' multipart/form-data: schema: $ref: '#/components/schemas/SubscriptionRecordCreateRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/SubscriptionRecord' description: '' /api/subscriptions/cancel/: post: operationId: api_subscriptions_cancel_create description: A simple ViewSet for viewing and editing Subscriptions. parameters: - in: query name: customer_id schema: type: string minLength: 1 description: Filter to a specific customer. required: true - in: query name: plan_id schema: type: string format: uuid description: Filter to a specific plan. If not specified, all plans will be included in the cancellation request. - in: query name: subscription_filters schema: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilterRequest' description: Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'. tags: - api requestBody: content: application/json: schema: $ref: '#/components/schemas/SubscriptionRecordCancelRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/SubscriptionRecordCancelRequest' multipart/form-data: schema: $ref: '#/components/schemas/SubscriptionRecordCancelRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/SubscriptionRecord' description: '' /api/subscriptions/update/: post: operationId: api_subscriptions_update_create description: A simple ViewSet for viewing and editing Subscriptions. parameters: - in: query name: customer_id schema: type: string minLength: 1 description: Filter to a specific customer. required: true - in: query name: plan_id schema: type: string format: uuid description: Filter to a specific plan. required: true - in: query name: subscription_filters schema: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilterRequest' description: Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'. tags: - api requestBody: content: application/json: schema: $ref: '#/components/schemas/SubscriptionRecordUpdateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/SubscriptionRecordUpdateRequest' multipart/form-data: schema: $ref: '#/components/schemas/SubscriptionRecordUpdateRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/SubscriptionRecord' description: '' /api/track/: post: operationId: api_track_create tags: - api requestBody: content: application/json: schema: $ref: '#/components/schemas/BatchEventRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/BatchEventRequest' multipart/form-data: schema: $ref: '#/components/schemas/BatchEventRequest' required: true security: - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/TrackEventSuccess' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/TrackEventFailure' description: '' /api/verify_idems_received/: post: operationId: api_verify_idems_received_create tags: - api requestBody: content: application/json: schema: $ref: '#/components/schemas/ConfirmIdemsReceivedRequestRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/ConfirmIdemsReceivedRequestRequest' multipart/form-data: schema: $ref: '#/components/schemas/ConfirmIdemsReceivedRequestRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ConfirmIdemsReceived' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/ConfirmIdemsReceivedFailure' description: '' /app/actions/: get: operationId: app_actions_list description: API endpoint that allows events to be viewed. parameters: - name: c required: false in: query description: The pagination cursor value. schema: type: string - name: page_size required: false in: query description: Number of results to return per page. schema: type: integer tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedActionList' description: '' /app/api_tokens/: get: operationId: app_api_tokens_list description: API endpoint that allows API Tokens to be viewed or edited. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/APIToken' description: '' post: operationId: app_api_tokens_create description: API endpoint that allows API Tokens to be viewed or edited. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/APITokenRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/APITokenRequest' multipart/form-data: schema: $ref: '#/components/schemas/APITokenRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/APITokenCreateResponse' description: '' /app/api_tokens/{prefix}/: delete: operationId: app_api_tokens_destroy description: API endpoint that allows API Tokens to be viewed or edited. parameters: - in: path name: prefix schema: type: string required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '204': description: No response body /app/api_tokens/{prefix}/roll/: post: operationId: app_api_tokens_roll_create description: API endpoint that allows API Tokens to be viewed or edited. parameters: - in: path name: prefix schema: type: string required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/APITokenRollResponse' description: '' /app/backtests/: get: operationId: app_backtests_list description: A simple ViewSet for viewing and editing Backtests. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/BacktestSummary' description: '' post: operationId: app_backtests_create description: A simple ViewSet for viewing and editing Backtests. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/BacktestCreateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/BacktestCreateRequest' multipart/form-data: schema: $ref: '#/components/schemas/BacktestCreateRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/BacktestCreate' description: '' /app/backtests/{backtest_id}/: get: operationId: app_backtests_retrieve description: A simple ViewSet for viewing and editing Backtests. parameters: - in: path name: backtest_id schema: type: string format: uuid required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/BacktestDetail' description: '' /app/balance_adjustments/: get: operationId: app_balance_adjustments_list description: A simple ViewSet meant only for creating CustomerBalanceAdjustments. parameters: - in: query name: currency_code schema: type: string minLength: 1 description: Filter to adjustments in a specific currency - in: query name: customer_id schema: type: string minLength: 1 description: The id provided when creating the customer, we suggest matching with your internal customer id in your backend required: true - in: query name: effective_after schema: type: string format: date-time description: Filter to adjustments that are effective after this date - in: query name: effective_before schema: type: string format: date-time description: Filter to adjustments that are effective before this date - in: query name: expires_after schema: type: string format: date-time description: Filter to adjustments that expire after this date - in: query name: expires_before schema: type: string format: date-time description: Filter to adjustments that expire before this date - in: query name: issued_after schema: type: string format: date-time description: Filter to adjustments that were issued after this date - in: query name: issued_before schema: type: string format: date-time description: Filter to adjustments that were issued before this date - in: query name: status schema: type: array items: enum: - active - inactive type: string default: - inactive - active description: Filter to a specific set of adjustment statuses. Defaults to both active and inactive. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/CustomerBalanceAdjustment' description: '' post: operationId: app_balance_adjustments_create description: A simple ViewSet meant only for creating CustomerBalanceAdjustments. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/CustomerBalanceAdjustmentCreateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CustomerBalanceAdjustmentCreateRequest' multipart/form-data: schema: $ref: '#/components/schemas/CustomerBalanceAdjustmentCreateRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/CustomerBalanceAdjustment' description: '' /app/balance_adjustments/{adjustment_id}/update/: post: operationId: app_balance_adjustments_update_create description: A simple ViewSet meant only for creating CustomerBalanceAdjustments. parameters: - in: path name: adjustment_id schema: type: string format: uuid required: true tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/CustomerBalanceAdjustmentUpdateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CustomerBalanceAdjustmentUpdateRequest' multipart/form-data: schema: $ref: '#/components/schemas/CustomerBalanceAdjustmentUpdateRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/CustomerBalanceAdjustment' description: '' /app/balance_adjustments/{adjustment_id}/void/: post: operationId: app_balance_adjustments_void_create description: A simple ViewSet meant only for creating CustomerBalanceAdjustments. parameters: - in: path name: adjustment_id schema: type: string format: uuid required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/CustomerBalanceAdjustment' description: '' /app/cost_analysis/: get: operationId: app_cost_analysis_retrieve description: Returns the revenue for an organization in a given time period. parameters: - in: query name: customer_id schema: type: string minLength: 1 required: true - in: query name: end_date schema: type: string format: date required: true - in: query name: start_date schema: type: string format: date required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/CostAnalysis' description: '' /app/customer_summary/: get: operationId: app_customer_summary_list description: Get the current settings for the organization. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/CustomerSummary' description: '' /app/customer_totals/: get: operationId: app_customer_totals_list description: Return current usage for a customer during a given billing period. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/CustomerWithRevenue' description: '' /app/customers/: get: operationId: app_customers_list description: A simple ViewSet for viewing and editing Customers. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/Customer' description: '' post: operationId: app_customers_create description: A simple ViewSet for viewing and editing Customers. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/CustomerCreateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CustomerCreateRequest' multipart/form-data: schema: $ref: '#/components/schemas/CustomerCreateRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Customer' description: '' /app/customers/{customer_id}/: get: operationId: app_customers_retrieve description: A simple ViewSet for viewing and editing Customers. parameters: - in: path name: customer_id schema: type: string description: The id provided when creating the customer, we suggest matching with your internal customer id in your backend required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Customer' description: '' patch: operationId: app_customers_partial_update description: A simple ViewSet for viewing and editing Customers. parameters: - in: path name: customer_id schema: type: string description: The id provided when creating the customer, we suggest matching with your internal customer id in your backend required: true tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedCustomerUpdateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedCustomerUpdateRequest' multipart/form-data: schema: $ref: '#/components/schemas/PatchedCustomerUpdateRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/CustomerUpdate' description: '' /app/demo_login/: post: operationId: app_demo_login_create tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/LoginRequestRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/LoginRequestRequest' multipart/form-data: schema: $ref: '#/components/schemas/LoginRequestRequest' required: true security: - basicAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] - {} responses: '200': content: application/json: schema: $ref: '#/components/schemas/LoginSuccess' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/LoginFailure' description: '' /app/demo_register/: post: operationId: app_demo_register_create tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/DemoRegistrationRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/DemoRegistrationRequest' multipart/form-data: schema: $ref: '#/components/schemas/DemoRegistrationRequest' required: true security: - basicAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] - {} responses: '200': content: application/json: schema: $ref: '#/components/schemas/DemoRegistrationSuccess' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/DemoRegistrationFailure' description: '' /app/draft_invoice/: get: operationId: app_draft_invoice_retrieve description: Pagination-enabled endpoint for retrieving an organization's event stream. parameters: - in: query name: customer_id schema: type: string minLength: 1 description: The id provided when creating the customer, we suggest matching with your internal customer id in your backend required: true - in: query name: include_next_period schema: type: boolean default: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/DraftInvoiceResponse' description: '' /app/events/: get: operationId: app_events_list description: API endpoint that allows events to be viewed. parameters: - name: c required: false in: query description: The pagination cursor value. schema: type: string - name: page_size required: false in: query description: Number of results to return per page. schema: type: integer tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedEventList' description: '' /app/external_plan_links/: post: operationId: app_external_plan_links_create description: A simple ViewSet for viewing and editing ExternalPlanLink. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/ExternalPlanLinkRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/ExternalPlanLinkRequest' multipart/form-data: schema: $ref: '#/components/schemas/ExternalPlanLinkRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/ExternalPlanLink' description: '' /app/external_plan_links/{external_plan_id}/: delete: operationId: app_external_plan_links_destroy description: A simple ViewSet for viewing and editing ExternalPlanLink. parameters: - in: path name: external_plan_id schema: type: string required: true - in: query name: source schema: enum: - stripe type: string minLength: 1 required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '204': description: No response body /app/features/: get: operationId: app_features_list description: A simple ViewSet for viewing and editing Features. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/Feature' description: '' post: operationId: app_features_create description: A simple ViewSet for viewing and editing Features. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/FeatureRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/FeatureRequest' multipart/form-data: schema: $ref: '#/components/schemas/FeatureRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/Feature' description: '' /app/import_customers/: post: operationId: app_import_customers_create tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/ImportCustomersRequestRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/ImportCustomersRequestRequest' multipart/form-data: schema: $ref: '#/components/schemas/ImportCustomersRequestRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ImportCustomerSuccess' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/ImportCustomerFailure' description: '' /app/import_payment_objects/: post: operationId: app_import_payment_objects_create tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/ImportPaymentObjectsRequestRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/ImportPaymentObjectsRequestRequest' multipart/form-data: schema: $ref: '#/components/schemas/ImportPaymentObjectsRequestRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ImportPaymentObjectSuccess' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/ImportPaymentObjectFailure' description: '' /app/invoices/: get: operationId: app_invoices_list description: A simple ViewSet for viewing and editing Invoices. parameters: - in: query name: customer_id schema: type: string minLength: 1 description: A filter for invoices for a specific customer - in: query name: payment_status schema: type: array items: enum: - unpaid - paid type: string default: - paid description: A filter for invoices with a specific payment status tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/Invoice' description: '' /app/invoices/{invoice_number}/: get: operationId: app_invoices_retrieve description: A simple ViewSet for viewing and editing Invoices. parameters: - in: path name: invoice_number schema: type: string required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Invoice' description: '' patch: operationId: app_invoices_partial_update description: A simple ViewSet for viewing and editing Invoices. parameters: - in: path name: invoice_number schema: type: string required: true tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedInvoiceUpdateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedInvoiceUpdateRequest' multipart/form-data: schema: $ref: '#/components/schemas/PatchedInvoiceUpdateRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/InvoiceUpdate' description: '' /app/login/: post: operationId: app_login_create tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/LoginRequestRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/LoginRequestRequest' multipart/form-data: schema: $ref: '#/components/schemas/LoginRequestRequest' required: true security: - basicAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] - {} responses: '200': content: application/json: schema: $ref: '#/components/schemas/LoginSuccess' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/LoginFailure' description: '' /app/logout/: post: operationId: app_logout_create tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] - {} responses: '200': content: application/json: schema: $ref: '#/components/schemas/LogoutSuccess' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/LogoutFailure' description: '' /app/metrics/: get: operationId: app_metrics_list description: A simple ViewSet for viewing and editing Billable Metrics. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/Metric' description: '' post: operationId: app_metrics_create description: A simple ViewSet for viewing and editing Billable Metrics. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/MetricCreateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/MetricCreateRequest' multipart/form-data: schema: $ref: '#/components/schemas/MetricCreateRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/Metric' description: '' /app/metrics/{metric_id}/: get: operationId: app_metrics_retrieve description: A simple ViewSet for viewing and editing Billable Metrics. parameters: - in: path name: metric_id schema: type: string format: uuid required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Metric' description: '' patch: operationId: app_metrics_partial_update description: A simple ViewSet for viewing and editing Billable Metrics. parameters: - in: path name: metric_id schema: type: string format: uuid required: true tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedMetricUpdateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedMetricUpdateRequest' multipart/form-data: schema: $ref: '#/components/schemas/PatchedMetricUpdateRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/MetricUpdate' description: '' /app/organization/invite/: post: operationId: app_organization_invite_create tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/InviteRequestRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/InviteRequestRequest' multipart/form-data: schema: $ref: '#/components/schemas/InviteRequestRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/InviteResponse' description: '' /app/organization_settings/: get: operationId: app_organization_settings_list description: A simple ViewSet for viewing and editing OrganizationSettings. parameters: - in: query name: setting_group schema: enum: - stripe - billing type: string minLength: 1 description: Filters organization_settings to a single setting_group. Defaults to returning all settings. - in: query name: setting_name schema: type: array items: enum: - generate_customer_after_creating_in_lotus - subscription_filter_keys - payment_grace_period type: string description: Filters organization_settings by setting_name. Defaults to returning all settings. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/OrganizationSetting' description: '' /app/organization_settings/{setting_id}/: get: operationId: app_organization_settings_retrieve description: A simple ViewSet for viewing and editing OrganizationSettings. parameters: - in: path name: setting_id schema: type: string format: uuid required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/OrganizationSetting' description: '' patch: operationId: app_organization_settings_partial_update description: A simple ViewSet for viewing and editing OrganizationSettings. parameters: - in: path name: setting_id schema: type: string format: uuid required: true tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedOrganizationSettingUpdateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedOrganizationSettingUpdateRequest' multipart/form-data: schema: $ref: '#/components/schemas/PatchedOrganizationSettingUpdateRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/OrganizationSettingUpdate' description: '' /app/organizations/: get: operationId: app_organizations_list description: A simple ViewSet for viewing and editing OrganizationSettings. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/Organization' description: '' post: operationId: app_organizations_create description: A simple ViewSet for viewing and editing OrganizationSettings. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/OrganizationCreateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/OrganizationCreateRequest' multipart/form-data: schema: $ref: '#/components/schemas/OrganizationCreateRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/Organization' description: '' /app/organizations/{organization_id}/: patch: operationId: app_organizations_partial_update description: A simple ViewSet for viewing and editing OrganizationSettings. parameters: - in: path name: organization_id schema: type: string format: uuid required: true tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedOrganizationUpdateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedOrganizationUpdateRequest' multipart/form-data: schema: $ref: '#/components/schemas/PatchedOrganizationUpdateRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Organization' description: '' /app/payment_providers/: get: operationId: app_payment_providers_list tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/SinglePaymentProvider' description: '' post: operationId: app_payment_providers_create tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/PaymentProviderPostRequestRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PaymentProviderPostRequestRequest' multipart/form-data: schema: $ref: '#/components/schemas/PaymentProviderPostRequestRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaymentProviderPostResponse' description: '' /app/period_metric_revenue/: get: operationId: app_period_metric_revenue_retrieve description: Returns the revenue for an organization in a given time period. parameters: - in: query name: period_1_end_date schema: type: string format: date required: true - in: query name: period_1_start_date schema: type: string format: date required: true - in: query name: period_2_end_date schema: type: string format: date required: true - in: query name: period_2_start_date schema: type: string format: date required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PeriodMetricRevenueResponse' description: '' /app/period_metric_usage/: get: operationId: app_period_metric_usage_retrieve description: Return current usage for a customer during a given billing period. parameters: - in: query name: end_date schema: type: string format: date required: true - in: query name: start_date schema: type: string format: date required: true - in: query name: top_n_customers schema: type: integer tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PeriodMetricUsageResponse' description: '' /app/period_subscriptions/: get: operationId: app_period_subscriptions_retrieve parameters: - in: query name: period_1_end_date schema: type: string format: date required: true - in: query name: period_1_start_date schema: type: string format: date required: true - in: query name: period_2_end_date schema: type: string format: date required: true - in: query name: period_2_start_date schema: type: string format: date required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PeriodSubscriptionsResponse' description: '' /app/plan_versions/: post: operationId: app_plan_versions_create description: A simple ViewSet for viewing and editing PlanVersions. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/PlanVersionCreateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PlanVersionCreateRequest' multipart/form-data: schema: $ref: '#/components/schemas/PlanVersionCreateRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/PlanVersionDetail' description: '' /app/plan_versions/{version_id}/: patch: operationId: app_plan_versions_partial_update description: A simple ViewSet for viewing and editing PlanVersions. parameters: - in: path name: version_id schema: type: string format: uuid required: true tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedPlanVersionUpdateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedPlanVersionUpdateRequest' multipart/form-data: schema: $ref: '#/components/schemas/PatchedPlanVersionUpdateRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PlanVersionUpdate' description: '' /app/plans/: get: operationId: app_plans_list description: ViewSet for viewing and editing Plans. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/PlanDetail' description: '' post: operationId: app_plans_create description: ViewSet for viewing and editing Plans. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/PlanCreateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PlanCreateRequest' multipart/form-data: schema: $ref: '#/components/schemas/PlanCreateRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/PlanDetail' description: '' /app/plans/{plan_id}/: get: operationId: app_plans_retrieve description: ViewSet for viewing and editing Plans. parameters: - in: path name: plan_id schema: type: string format: uuid required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PlanDetail' description: '' patch: operationId: app_plans_partial_update description: ViewSet for viewing and editing Plans. parameters: - in: path name: plan_id schema: type: string format: uuid required: true tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedPlanUpdateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedPlanUpdateRequest' multipart/form-data: schema: $ref: '#/components/schemas/PatchedPlanUpdateRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PlanUpdate' description: '' /app/plans_by_customer/: get: operationId: app_plans_by_customer_retrieve tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PlansByNumCustomers' description: '' /app/pricing_units/: get: operationId: app_pricing_units_list description: A simple ViewSet for viewing and editing PricingUnits. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/PricingUnit' description: '' post: operationId: app_pricing_units_create description: A simple ViewSet for viewing and editing PricingUnits. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/PricingUnitRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PricingUnitRequest' multipart/form-data: schema: $ref: '#/components/schemas/PricingUnitRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/PricingUnit' description: '' /app/products/: get: operationId: app_products_list description: A simple ViewSet for viewing and editing Products. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/Product' description: '' post: operationId: app_products_create description: A simple ViewSet for viewing and editing Products. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/ProductRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/ProductRequest' multipart/form-data: schema: $ref: '#/components/schemas/ProductRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/Product' description: '' /app/products/{product_id}/: get: operationId: app_products_retrieve description: A simple ViewSet for viewing and editing Products. parameters: - in: path name: product_id schema: type: string required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/Product' description: '' /app/register/: post: operationId: app_register_create tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/RegistrationRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/RegistrationRequest' multipart/form-data: schema: $ref: '#/components/schemas/RegistrationRequest' required: true security: - basicAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] - {} responses: '200': content: application/json: schema: $ref: '#/components/schemas/RegistrationSuccess' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/RegistrationFailure' description: '' /app/session/: get: operationId: app_session_retrieve tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/SessionSuccess' description: '' /app/subscriptions/: get: operationId: app_subscriptions_list description: A simple ViewSet for viewing and editing Subscriptions. parameters: - in: query name: customer_id schema: type: string minLength: 1 description: Filter to a specific customer. required: true - in: query name: plan_id schema: type: string format: uuid description: Filter to a specific plan. - in: query name: range_end schema: type: string format: date-time description: If specified, will only return subscriptions with a start date before this date. - in: query name: range_start schema: type: string format: date-time description: If specified, will only return subscriptions with an end date after this date. - in: query name: status schema: type: array items: enum: - active - ended - not_started type: string default: - active description: Filter to a specific set of subscription statuses. Defaults to active. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/SubscriptionRecord' description: '' post: operationId: app_subscriptions_create description: A simple ViewSet for viewing and editing Subscriptions. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/SubscriptionRecordRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/SubscriptionRecordRequest' multipart/form-data: schema: $ref: '#/components/schemas/SubscriptionRecordRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/SubscriptionRecord' description: '' /app/subscriptions/add/: post: operationId: app_subscriptions_add_create description: A simple ViewSet for viewing and editing Subscriptions. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/SubscriptionRecordCreateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/SubscriptionRecordCreateRequest' multipart/form-data: schema: $ref: '#/components/schemas/SubscriptionRecordCreateRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/SubscriptionRecord' description: '' /app/subscriptions/cancel/: post: operationId: app_subscriptions_cancel_create description: A simple ViewSet for viewing and editing Subscriptions. parameters: - in: query name: customer_id schema: type: string minLength: 1 description: Filter to a specific customer. required: true - in: query name: plan_id schema: type: string format: uuid description: Filter to a specific plan. If not specified, all plans will be included in the cancellation request. - in: query name: subscription_filters schema: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilterRequest' description: Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/SubscriptionRecordCancelRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/SubscriptionRecordCancelRequest' multipart/form-data: schema: $ref: '#/components/schemas/SubscriptionRecordCancelRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/SubscriptionRecord' description: '' /app/subscriptions/update/: post: operationId: app_subscriptions_update_create description: A simple ViewSet for viewing and editing Subscriptions. parameters: - in: query name: customer_id schema: type: string minLength: 1 description: Filter to a specific customer. required: true - in: query name: plan_id schema: type: string format: uuid description: Filter to a specific plan. required: true - in: query name: subscription_filters schema: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilterRequest' description: Filter to a specific set of subscription filters. If your billing model only allows for one subscription per customer, you very likely do not need this field. Must be formatted as a JSON-encoded + stringified list of dictionaries, where each dictionary has a key of 'property_name' and a key of 'value'. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/SubscriptionRecordUpdateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/SubscriptionRecordUpdateRequest' multipart/form-data: schema: $ref: '#/components/schemas/SubscriptionRecordUpdateRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/SubscriptionRecord' description: '' /app/switch_organization/: post: operationId: app_switch_organization_create description: Get the current settings for the organization. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/ChangeUserOrganizationRequestRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/ChangeUserOrganizationRequestRequest' multipart/form-data: schema: $ref: '#/components/schemas/ChangeUserOrganizationRequestRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': description: No response body /app/transfer_subscriptions/: post: operationId: app_transfer_subscriptions_create tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/TransferSubscriptionsRequestRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/TransferSubscriptionsRequestRequest' multipart/form-data: schema: $ref: '#/components/schemas/TransferSubscriptionsRequestRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/TransferSubscriptionsSuccess' description: '' '400': content: application/json: schema: $ref: '#/components/schemas/TransferSubscriptionsFailure' description: '' /app/usage_alerts/: get: operationId: app_usage_alerts_list description: ViewSet for viewing and editing UsageAlerts. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/UsageAlert' description: '' post: operationId: app_usage_alerts_create description: ViewSet for viewing and editing UsageAlerts. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/UsageAlertCreateRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/UsageAlertCreateRequest' multipart/form-data: schema: $ref: '#/components/schemas/UsageAlertCreateRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/UsageAlertCreate' description: '' /app/usage_alerts/{usage_alert_id}/: get: operationId: app_usage_alerts_retrieve description: ViewSet for viewing and editing UsageAlerts. parameters: - in: path name: usage_alert_id schema: type: string format: uuid required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/UsageAlert' description: '' delete: operationId: app_usage_alerts_destroy description: ViewSet for viewing and editing UsageAlerts. parameters: - in: path name: usage_alert_id schema: type: string format: uuid required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '204': description: No response body /app/user/password/reset/: post: operationId: app_user_password_reset_create description: Verifies the token and resets the password. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/ResetPasswordRequestRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/ResetPasswordRequestRequest' multipart/form-data: schema: $ref: '#/components/schemas/ResetPasswordRequestRequest' required: true security: - OrganizationApiKeyAuth: [] TokenAuth: [] - {} responses: '200': content: application/json: schema: $ref: '#/components/schemas/ResetPasswordSuccess' description: '' /app/user/password/reset/init/: post: operationId: app_user_password_reset_init_create tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/EmailRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/EmailRequest' multipart/form-data: schema: $ref: '#/components/schemas/EmailRequest' required: true security: - OrganizationApiKeyAuth: [] TokenAuth: [] - {} responses: '200': content: application/json: schema: $ref: '#/components/schemas/InitResetPasswordSuccess' description: '' /app/users/: get: operationId: app_users_list description: A simple ViewSet for viewing and editing Users. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/User' description: '' post: operationId: app_users_create description: A simple ViewSet for viewing and editing Users. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/UserRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/UserRequest' multipart/form-data: schema: $ref: '#/components/schemas/UserRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/User' description: '' /app/webhooks/: get: operationId: app_webhooks_list description: API endpoint that allows alerts to be viewed or edited. tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/WebhookEndpoint' description: '' post: operationId: app_webhooks_create description: API endpoint that allows alerts to be viewed or edited. tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/WebhookEndpointRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/WebhookEndpointRequest' multipart/form-data: schema: $ref: '#/components/schemas/WebhookEndpointRequest' required: true security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/WebhookEndpoint' description: '' /app/webhooks/{webhook_endpoint_id}/: get: operationId: app_webhooks_retrieve description: API endpoint that allows alerts to be viewed or edited. parameters: - in: path name: webhook_endpoint_id schema: type: string format: uuid required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/WebhookEndpoint' description: '' patch: operationId: app_webhooks_partial_update description: API endpoint that allows alerts to be viewed or edited. parameters: - in: path name: webhook_endpoint_id schema: type: string format: uuid required: true tags: - app requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedWebhookEndpointRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedWebhookEndpointRequest' multipart/form-data: schema: $ref: '#/components/schemas/PatchedWebhookEndpointRequest' security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/WebhookEndpoint' description: '' delete: operationId: app_webhooks_destroy description: API endpoint that allows alerts to be viewed or edited. parameters: - in: path name: webhook_endpoint_id schema: type: string format: uuid required: true tags: - app security: - knoxTokenAuth: [] - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '204': description: No response body /stripe/webhook/: post: operationId: stripe_webhook_create tags: - stripe security: - OrganizationApiKeyAuth: [] TokenAuth: [] responses: '200': description: No response body components: schemas: APIToken: type: object properties: name: type: string description: A free-form name for the API key. Need not be unique. 50 characters max. maxLength: 50 prefix: type: string readOnly: true expiry_date: type: string format: date-time nullable: true title: Expires description: Once API key expires, clients cannot use it anymore. created: type: string format: date-time readOnly: true required: - created - prefix APITokenCreateResponse: type: object properties: api_key: $ref: '#/components/schemas/APIToken' key: type: string required: - api_key - key APITokenRequest: type: object properties: name: type: string minLength: 1 description: A free-form name for the API key. Need not be unique. 50 characters max. maxLength: 50 expiry_date: type: string format: date-time nullable: true title: Expires description: Once API key expires, clients cannot use it anymore. APITokenRollResponse: type: object properties: api_key: $ref: '#/components/schemas/APIToken' key: type: string required: - api_key - key Action: type: object description: DRF serializer for :class:`~activity.models.Action`. properties: id: type: integer readOnly: true actor: type: string readOnly: true verb: type: string maxLength: 255 action_object: type: string readOnly: true target: type: string readOnly: true public: type: boolean description: type: string nullable: true timestamp: type: string format: date-time required: - action_object - actor - id - target - verb Address: type: object properties: city: type: string description: City, district, suburb, town, or village country: type: string description: ISO 3166-1 alpha-2 country code maxLength: 2 minLength: 2 line1: type: string description: Address line 1 (e.g., street, PO Box, or company name) line2: type: string nullable: true description: Address line 2 (e.g., apartment, suite, unit, or building) postal_code: type: string description: ZIP or postal code state: type: string description: State, county, province, or region required: - city - country - line1 - postal_code - state AddressRequest: type: object properties: city: type: string minLength: 1 description: City, district, suburb, town, or village country: type: string minLength: 2 description: ISO 3166-1 alpha-2 country code maxLength: 2 line1: type: string minLength: 1 description: Address line 1 (e.g., street, PO Box, or company name) line2: type: string nullable: true description: Address line 2 (e.g., apartment, suite, unit, or building) postal_code: type: string minLength: 1 description: ZIP or postal code state: type: string minLength: 1 description: State, county, province, or region required: - city - country - line1 - postal_code - state AllSubstitutionResults: type: object properties: substitution_results: type: array items: $ref: '#/components/schemas/SingleSubstitution' original_plans_revenue: type: number format: double new_plans_revenue: type: number format: double pct_revenue_change: type: number format: double nullable: true BacktestCreate: type: object properties: start_date: type: string format: date end_date: type: string format: date kpis: type: array items: enum: - total_revenue type: string backtest_name: type: string maxLength: 100 required: - backtest_name - end_date - kpis - start_date BacktestCreateRequest: type: object properties: start_date: type: string format: date end_date: type: string format: date substitutions: type: array items: $ref: '#/components/schemas/BacktestSubstitutionMultiRequest' writeOnly: true kpis: type: array items: enum: - total_revenue type: string backtest_name: type: string minLength: 1 maxLength: 100 required: - backtest_name - end_date - kpis - start_date - substitutions BacktestDetail: type: object properties: end_date: type: string format: date time_created: type: string format: date-time status: enum: - running - completed - failed type: string kpis: type: object additionalProperties: {} backtest_name: type: string maxLength: 100 start_date: type: string format: date backtest_id: type: string backtest_substitutions: type: array items: $ref: '#/components/schemas/BacktestSubstitution' backtest_results: $ref: '#/components/schemas/AllSubstitutionResults' required: - backtest_id - backtest_name - backtest_results - backtest_substitutions - end_date - start_date BacktestSubstitution: type: object properties: new_plan: $ref: '#/components/schemas/PlanVersionDetail' original_plan: $ref: '#/components/schemas/PlanVersionDetail' required: - new_plan - original_plan BacktestSubstitutionMulti: type: object properties: new_plan: type: string format: uuid original_plans: type: array items: type: string format: uuid required: - new_plan - original_plans BacktestSubstitutionMultiRequest: type: object properties: new_plan: type: string format: uuid original_plans: type: array items: type: string format: uuid required: - new_plan - original_plans BacktestSummary: type: object properties: backtest_name: type: string maxLength: 100 start_date: type: string format: date end_date: type: string format: date time_created: type: string format: date-time kpis: type: object additionalProperties: {} status: enum: - running - completed - failed type: string backtest_id: type: string required: - backtest_id - backtest_name - end_date - start_date BatchEventRequest: type: object properties: batch: type: array items: $ref: '#/components/schemas/EventRequest' required: - batch CategoricalFilter: type: object properties: property_name: type: string readOnly: true operator: enum: - isin - isnotin type: string readOnly: true comparison_value: type: array items: type: string required: - comparison_value - operator - property_name ChangeUserOrganizationRequestRequest: type: object properties: transfer_to_organization_id: type: string minLength: 1 description: The organization ID to transfer to required: - transfer_to_organization_id ComponentUsage: type: object properties: event_name: type: string description: The name of the event you are checking access for. metric_name: type: string description: The name of the metric. metric_id: type: string description: The metric_id of the metric. This metric_id can be found in the Lotus frontend if you haven't seen it before. metric_usage: type: number format: double description: The current usage of the metric. Keep in mind the current usage of the metric can be different from the billable usage of the metric. metric_free_limit: type: number format: double nullable: true description: If you specified a free tier of usage for this metric, this is the amount of usage that is free. Will be null if you did not specify a free tier for this metric. metric_total_limit: type: number format: double nullable: true description: The total limit of the metric. Will be null if you did not specify a limit for this metric. required: - event_name - metric_free_limit - metric_id - metric_name - metric_total_limit - metric_usage ConfirmIdemsReceived: type: object properties: status: enum: - success type: string ids_not_found: type: array items: type: string required: - ids_not_found - status ConfirmIdemsReceivedFailure: type: object properties: status: enum: - failure type: string error: type: string required: - error - status ConfirmIdemsReceivedRequestRequest: type: object properties: idempotency_ids: type: array items: type: string minLength: 1 number_days_lookback: type: integer default: 30 customer_id: type: string minLength: 1 required: - idempotency_ids CostAnalysis: type: object properties: per_day: type: array items: $ref: '#/components/schemas/SingleDayCostAnalysis' total_cost: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true total_revenue: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true margin: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true required: - margin - per_day - total_cost - total_revenue Customer: type: object properties: customer_id: type: string email: type: string format: email customer_name: type: string invoices: type: array items: $ref: '#/components/schemas/LightweightInvoice' readOnly: true total_amount_due: type: number format: double readOnly: true subscriptions: type: array items: $ref: '#/components/schemas/SubscriptionRecord' readOnly: true integrations: allOf: - $ref: '#/components/schemas/CustomerIntegrations' readOnly: true description: A dictionary containing the customer's integrations. Keys are the integration type, and the value is a dictionary containing the integration's properties, which can vary by integration. default_currency: $ref: '#/components/schemas/PricingUnit' payment_provider: enum: - stripe - null type: string nullable: true has_payment_method: type: boolean readOnly: true address: allOf: - $ref: '#/components/schemas/Address' nullable: true readOnly: true tax_rate: type: number format: double maximum: 999.999900000000025102053768932819366455078125 minimum: 0 nullable: true description: Tax rate as percentage. For example, 10.5 for 10.5% required: - customer_id - customer_name - default_currency - email - has_payment_method - integrations - invoices - payment_provider - subscriptions - total_amount_due CustomerBalanceAdjustment: type: object properties: adjustment_id: type: string customer: allOf: - $ref: '#/components/schemas/LightweightCustomer' readOnly: true amount: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true pricing_unit: allOf: - $ref: '#/components/schemas/PricingUnit' readOnly: true description: type: string nullable: true effective_at: type: string format: date-time expires_at: type: string format: date-time nullable: true status: enum: - active - inactive type: string parent_adjustment_id: type: string format: uuid readOnly: true amount_paid: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true amount_paid_currency: allOf: - $ref: '#/components/schemas/PricingUnit' readOnly: true required: - adjustment_id - amount - amount_paid_currency - customer - parent_adjustment_id - pricing_unit CustomerBalanceAdjustmentCreateRequest: type: object properties: customer_id: type: string minLength: 1 description: The id provided when creating the customer, we suggest matching with your internal customer id in your backend amount: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true writeOnly: true pricing_unit_code: type: string minLength: 1 writeOnly: true description: type: string writeOnly: true nullable: true effective_at: type: string format: date-time writeOnly: true expires_at: type: string format: date-time writeOnly: true nullable: true amount_paid: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true writeOnly: true amount_paid_currency_code: type: string minLength: 1 writeOnly: true required: - amount - customer_id - pricing_unit_code CustomerBalanceAdjustmentUpdateRequest: type: object properties: description: type: string nullable: true expires_at: type: string format: date-time nullable: true CustomerBatchCreateFailure: type: object properties: success: enum: - none type: string failed_customers: type: object additionalProperties: {} required: - failed_customers - success CustomerBatchCreateRequestRequest: type: object properties: customers: type: array items: $ref: '#/components/schemas/CustomerCreateRequest' behavior_on_existing: enum: - merge - ignore - overwrite type: string required: - behavior_on_existing - customers CustomerBatchCreateSuccess: type: object properties: success: enum: - all - some type: string failed_customers: type: object additionalProperties: {} required: - success CustomerCreateRequest: type: object properties: customer_name: type: string nullable: true description: The display name of the customer maxLength: 100 customer_id: type: string minLength: 1 description: The id provided when creating the customer, we suggest matching with your internal customer id in your backend maxLength: 50 pattern: ^[-a-zA-Z0-9_]+$ email: type: string format: email minLength: 1 description: The primary email address of the customer, must be the same as the email address used to create the customer in the payment provider payment_provider: enum: - stripe type: string description: The payment provider this customer is associated with. Currently, only Stripe is supported. payment_provider_id: type: string writeOnly: true nullable: true minLength: 1 description: The customer's ID in the specified payment provider. Please note that payment_provider and payment_provider_id are mutually necessary. properties: type: object additionalProperties: {} nullable: true description: Extra metadata for the customer default_currency_code: type: string minLength: 1 writeOnly: true description: The currency code this customer will be invoiced in. Codes are 3 letters, e.g. 'USD'. address: allOf: - $ref: '#/components/schemas/AddressRequest' nullable: true tax_rate: type: number format: double maximum: 999.999900000000025102053768932819366455078125 minimum: 0 nullable: true description: Tax rate as percentage. For example, 10.5 for 10.5% required: - customer_id - email CustomerIntegrations: type: object properties: stripe: allOf: - $ref: '#/components/schemas/CustomerStripeIntegration' nullable: true CustomerStripeIntegration: type: object properties: stripe_id: type: string has_payment_method: type: boolean required: - has_payment_method - stripe_id CustomerSummary: type: object properties: customer_name: type: string nullable: true description: The display name of the customer maxLength: 100 customer_id: type: string description: The id provided when creating the customer, we suggest matching with your internal customer id in your backend maxLength: 50 pattern: ^[-a-zA-Z0-9_]+$ subscriptions: type: array items: $ref: '#/components/schemas/SubscriptionCustomerSummary' readOnly: true required: - subscriptions CustomerUpdate: type: object properties: default_currency_code: type: string address: allOf: - $ref: '#/components/schemas/Address' nullable: true tax_rate: type: number format: double maximum: 999.999900000000025102053768932819366455078125 minimum: 0 nullable: true description: Tax rate as percentage. For example, 10.5 for 10.5% required: - default_currency_code CustomerWithRevenue: type: object properties: customer_id: type: string description: The id provided when creating the customer, we suggest matching with your internal customer id in your backend maxLength: 50 pattern: ^[-a-zA-Z0-9_]+$ total_amount_due: type: number format: double readOnly: true required: - total_amount_due DayMetricUsage: type: object properties: date: type: string format: date customer_usages: type: object additionalProperties: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true required: - customer_usages - date DemoRegistrationDetailRequest: type: object properties: email: type: string minLength: 1 password: type: string minLength: 1 username: type: string minLength: 1 required: - email - password - username DemoRegistrationFailure: type: object properties: detail: type: string required: - detail DemoRegistrationRequest: type: object properties: register: $ref: '#/components/schemas/DemoRegistrationDetailRequest' required: - register DemoRegistrationSuccess: type: object properties: detail: type: string token: type: string user: $ref: '#/components/schemas/User' required: - detail - token - user DraftInvoice: type: object properties: end_date: type: string format: date readOnly: true issue_date: type: string format: date-time readOnly: true start_date: type: string format: date readOnly: true cost_due: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true line_items: type: array items: $ref: '#/components/schemas/GroupedLineItem' readOnly: true currency: $ref: '#/components/schemas/PricingUnit' due_date: type: string format: date-time readOnly: true nullable: true required: - cost_due - currency - due_date - end_date - issue_date - line_items - start_date DraftInvoiceResponse: type: object properties: invoice: type: array items: $ref: '#/components/schemas/DraftInvoice' EmailRequest: type: object properties: email: type: string format: email minLength: 1 required: - email Event: type: object properties: event_name: type: string description: String name of the event, corresponds to definition in metrics maxLength: 100 properties: type: object additionalProperties: {} description: Extra metadata on the event that can be filtered and queried on in the metrics. All key value pairs should have string keys and values can be either strings or numbers. Place subscription filters in this object to specify which subscription the event should be tracked under time_created: type: string format: date-time description: The time that the event occured, represented as a datetime in ISO 8601 in the UTC timezome. idempotency_id: type: string description: A unique identifier for the specific event being passed in. Passing in a unique id allows Lotus to make sure no double counting occurs. We recommend using a UUID4. You can use the same idempotency_id again after 7 days customer_id: type: string description: The id of the customer that this event is associated with, usually the customer id in your backend required: - customer_id - event_name - idempotency_id - time_created EventRequest: type: object properties: event_name: type: string minLength: 1 description: String name of the event, corresponds to definition in metrics maxLength: 100 properties: type: object additionalProperties: {} description: Extra metadata on the event that can be filtered and queried on in the metrics. All key value pairs should have string keys and values can be either strings or numbers. Place subscription filters in this object to specify which subscription the event should be tracked under time_created: type: string format: date-time description: The time that the event occured, represented as a datetime in ISO 8601 in the UTC timezome. idempotency_id: type: string minLength: 1 description: A unique identifier for the specific event being passed in. Passing in a unique id allows Lotus to make sure no double counting occurs. We recommend using a UUID4. You can use the same idempotency_id again after 7 days customer_id: type: string minLength: 1 description: The id of the customer that this event is associated with, usually the customer id in your backend required: - customer_id - event_name - idempotency_id - time_created ExternalPlanLink: type: object properties: source: enum: - stripe type: string external_plan_id: type: string maxLength: 100 required: - external_plan_id - source ExternalPlanLinkRequest: type: object properties: plan_id: type: string format: uuid writeOnly: true source: enum: - stripe type: string external_plan_id: type: string minLength: 1 maxLength: 100 required: - external_plan_id - plan_id - source Feature: type: object properties: feature_name: type: string maxLength: 50 feature_description: type: string nullable: true required: - feature_description - feature_name FeatureRequest: type: object properties: feature_name: type: string minLength: 1 maxLength: 50 feature_description: type: string nullable: true required: - feature_description - feature_name GetEventAccess: type: object properties: plan_id: type: string description: The plan_id of the plan we are checking that has access to this feature. subscription_filters: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilter' description: The subscription filters that are applied to this plan's relationship with the customer. If your billing model does not have the ability multiple plans or subscriptions per customer, this is likely not relevant for you. usage_per_component: type: array items: $ref: '#/components/schemas/ComponentUsage' description: 'The usage of each component of the plan the customer is on. Only components that match the request will be included: If metric_id is provided, this will be a list of length 1. If event_name is provided, this will be a list of length 1 or more depending on how many components of the customer''s plan use this event.' required: - plan_id - subscription_filters - usage_per_component GetFeatureAccess: type: object properties: feature_name: type: string description: Name of the feature to check access for. plan_id: type: string description: The plan_id of the plan we are checking that has access to this feature. subscription_filters: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilter' description: The subscription filters that are applied to this plan's relationship with the customer. If your billing model does not have the ability multiple plans or subscriptions per customer, this is likely not relevant for you. access: type: boolean description: Whether or not the plan has access to this feature. If your customer can have multiple plans or subscriptions, then you must check the 'access' across all returned plans to determine if the customer can access this feature. required: - access - feature_name - plan_id - subscription_filters GroupedLineItem: type: object properties: plan_name: type: string subscription_filters: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilter' subtotal: type: number format: double maximum: 100000000 minimum: -100000000 exclusiveMaximum: true exclusiveMinimum: true start_date: type: string format: date-time end_date: type: string format: date-time sub_items: type: array items: $ref: '#/components/schemas/LightweightInvoiceLineItem' required: - end_date - plan_name - start_date - sub_items - subscription_filters - subtotal ImportCustomerFailure: type: object properties: status: enum: - error type: string detail: type: string required: - detail - status ImportCustomerSuccess: type: object properties: status: enum: - success type: string detail: type: string required: - detail - status ImportCustomersRequestRequest: type: object properties: source: enum: - stripe type: string required: - source ImportPaymentObjectFailure: type: object properties: status: enum: - error type: string detail: type: string required: - detail - status ImportPaymentObjectSuccess: type: object properties: status: enum: - success type: string detail: type: string required: - detail - status ImportPaymentObjectsRequestRequest: type: object properties: source: enum: - stripe type: string required: - source InitResetPasswordSuccess: type: object properties: email: type: string required: - email InitialExternalPlanLink: type: object properties: source: enum: - stripe type: string external_plan_id: type: string maxLength: 100 required: - external_plan_id - source InitialExternalPlanLinkRequest: type: object properties: source: enum: - stripe type: string external_plan_id: type: string minLength: 1 maxLength: 100 required: - external_plan_id - source InitialPlanVersionRequest: type: object properties: flat_rate: type: number format: double maximum: 10000000000 minimum: 0 exclusiveMaximum: true writeOnly: true flat_fee_billing_type: enum: - in_arrears - in_advance type: string writeOnly: true transition_to_plan_id: type: string format: uuid usage_billing_frequency: enum: - monthly - quarterly - end_of_period - '' - null type: string writeOnly: true nullable: true description: type: string writeOnly: true nullable: true currency_code: type: string minLength: 1 components: type: array items: $ref: '#/components/schemas/PlanComponentRequest' nullable: true price_adjustment: $ref: '#/components/schemas/PriceAdjustmentRequest' month_anchor: type: integer maximum: 12 minimum: 1 writeOnly: true nullable: true features: type: array items: $ref: '#/components/schemas/FeatureRequest' nullable: true day_anchor: type: integer maximum: 31 minimum: 1 writeOnly: true nullable: true required: - flat_fee_billing_type InviteRequestRequest: type: object properties: email: type: string format: email minLength: 1 required: - email InviteResponse: type: object properties: email: type: string format: email required: - email Invoice: type: object properties: invoice_number: type: string readOnly: true cost_due: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true currency: $ref: '#/components/schemas/PricingUnit' issue_date: type: string format: date-time readOnly: true payment_status: enum: - paid - unpaid type: string readOnly: true external_payment_obj_id: type: string readOnly: true nullable: true external_payment_obj_type: enum: - stripe - null type: string nullable: true line_items: type: array items: $ref: '#/components/schemas/InvoiceLineItem' customer: $ref: '#/components/schemas/LightweightCustomerSerializerForInvoice' due_date: type: string format: date-time readOnly: true nullable: true start_date: type: string format: date readOnly: true end_date: type: string format: date readOnly: true seller: $ref: '#/components/schemas/Seller' invoice_pdf: type: string format: uri readOnly: true nullable: true required: - cost_due - currency - customer - due_date - end_date - external_payment_obj_id - external_payment_obj_type - invoice_number - invoice_pdf - issue_date - line_items - payment_status - seller - start_date InvoiceLineItem: type: object properties: name: type: string maxLength: 100 start_date: type: string format: date-time end_date: type: string format: date-time quantity: type: number format: double maximum: 10000000000 minimum: 0 exclusiveMaximum: true nullable: true subtotal: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true billing_type: enum: - in_arrears - in_advance - null type: string nullable: true metadata: type: object additionalProperties: {} nullable: true plan: $ref: '#/components/schemas/LightweightPlanVersion' subscription_filters: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilter' required: - billing_type - end_date - metadata - name - plan - quantity - start_date - subscription_filters - subtotal InvoiceUpdate: type: object properties: payment_status: enum: - paid - unpaid type: string required: - payment_status LightweightCustomer: type: object properties: customer_name: type: string readOnly: true nullable: true description: The display name of the customer email: type: string format: email readOnly: true nullable: true description: The primary email address of the customer, must be the same as the email address used to create the customer in the payment provider customer_id: type: string readOnly: true description: The id provided when creating the customer, we suggest matching with your internal customer id in your backend pattern: ^[-a-zA-Z0-9_]+$ required: - customer_id - customer_name - email LightweightCustomerSerializerForInvoice: type: object properties: customer_name: type: string readOnly: true nullable: true description: The display name of the customer email: type: string format: email readOnly: true nullable: true description: The primary email address of the customer, must be the same as the email address used to create the customer in the payment provider customer_id: type: string readOnly: true description: The id provided when creating the customer, we suggest matching with your internal customer id in your backend pattern: ^[-a-zA-Z0-9_]+$ address: allOf: - $ref: '#/components/schemas/Address' nullable: true readOnly: true required: - customer_id - customer_name - email LightweightInvoice: type: object properties: end_date: type: string format: date readOnly: true issue_date: type: string format: date-time readOnly: true start_date: type: string format: date readOnly: true invoice_number: type: string readOnly: true cost_due: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true currency: $ref: '#/components/schemas/PricingUnit' external_payment_obj_id: type: string readOnly: true nullable: true seller: $ref: '#/components/schemas/Seller' external_payment_obj_type: enum: - stripe - null type: string nullable: true payment_status: enum: - paid - unpaid type: string readOnly: true due_date: type: string format: date-time readOnly: true nullable: true required: - cost_due - currency - due_date - end_date - external_payment_obj_id - invoice_number - issue_date - payment_status - seller - start_date - external_payment_obj_type LightweightInvoiceLineItem: type: object properties: end_date: type: string format: date-time subtotal: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true subscription_filters: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilter' start_date: type: string format: date-time billing_type: enum: - in_arrears - in_advance - null type: string nullable: true quantity: type: number format: double maximum: 10000000000 minimum: 0 exclusiveMaximum: true nullable: true name: type: string maxLength: 100 plan: type: string required: - billing_type - end_date - name - plan - quantity - start_date - subscription_filters - subtotal LightweightOrganization: type: object properties: organization_id: type: string organization_name: type: string maxLength: 100 organization_type: enum: - Production - Development - Demo - Internal Demo type: string readOnly: true current: type: boolean readOnly: true required: - current - organization_id - organization_name - organization_type LightweightPlanVersion: type: object properties: plan_name: type: string plan_id: type: string version: type: integer readOnly: true required: - plan_id - plan_name - version LightweightPlanVersionRequest: type: object properties: plan_name: type: string minLength: 1 plan_id: type: string minLength: 1 required: - plan_id - plan_name LightweightUser: type: object properties: username: type: string description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. pattern: ^[\w.@+-]+$ maxLength: 150 email: type: string format: email maxLength: 254 required: - email - username LoginFailure: type: object properties: detail: type: string required: - detail LoginRequestRequest: type: object properties: username: type: string minLength: 1 password: type: string minLength: 1 required: - password - username LoginSuccess: type: object properties: detail: type: string token: type: string user: $ref: '#/components/schemas/User' required: - detail - token - user LogoutFailure: type: object properties: detail: type: string required: - detail LogoutSuccess: type: object properties: detail: type: string required: - detail Metric: type: object properties: metric_id: type: string event_name: type: string readOnly: true description: Name of the event that this metric is tracking. property_name: type: string readOnly: true nullable: true description: The name of the property of the event that should be used for this metric. Doesn't apply if the metric is of type 'counter' with an aggregation of count. aggregation_type: type: string granularity: enum: - seconds - minutes - hours - days - months - quarters - years - total - null type: string readOnly: true nullable: true description: The granularity of the metric. Only applies to metrics of type 'gauge' or 'rate'. event_type: enum: - delta - total - null type: string readOnly: true nullable: true description: Used only for metrics of type 'gauge'. Please refer to our documentation for an explanation of the different types. metric_type: enum: - counter - rate - custom - gauge type: string readOnly: true description: The type of metric that this is. Please refer to our documentation for an explanation of the different types. metric_name: type: string numeric_filters: type: array items: $ref: '#/components/schemas/NumericFilter' categorical_filters: type: array items: $ref: '#/components/schemas/CategoricalFilter' is_cost_metric: type: boolean readOnly: true description: Whether or not this metric is a cost metric (used to track costs to your business). custom_sql: type: string readOnly: true nullable: true description: A custom SQL query that can be used to define the metric. Please refer to our documentation for more information. proration: enum: - seconds - minutes - hours - days - months - quarters - years - total - null type: string readOnly: true nullable: true description: The proration of the metric. Only applies to metrics of type 'gauge'. required: - aggregation_type - categorical_filters - custom_sql - event_name - event_type - granularity - is_cost_metric - metric_id - metric_name - metric_type - numeric_filters - property_name - proration MetricCreateRequest: type: object properties: event_name: type: string writeOnly: true minLength: 1 description: Name of the event that this metric is tracking. maxLength: 50 property_name: type: string writeOnly: true nullable: true minLength: 1 description: The name of the property of the event that should be used for this metric. Doesn't apply if the metric is of type 'counter' with an aggregation of count. maxLength: 50 usage_aggregation_type: enum: - count - sum - max - unique - latest - average - null type: string writeOnly: true nullable: true description: The type of aggregation that should be used for this metric. Please refer to our documentation for an explanation of the different types. billable_aggregation_type: enum: - count - sum - max - unique - latest - average - null type: string writeOnly: true nullable: true granularity: enum: - seconds - minutes - hours - days - months - quarters - years - total - null type: string writeOnly: true nullable: true description: The granularity of the metric. Only applies to metrics of type 'gauge' or 'rate'. event_type: enum: - delta - total - null type: string writeOnly: true nullable: true description: Used only for metrics of type 'gauge'. Please refer to our documentation for an explanation of the different types. metric_type: enum: - counter - rate - custom - gauge type: string writeOnly: true description: The type of metric that this is. Please refer to our documentation for an explanation of the different types. metric_name: type: string minLength: 1 proration: enum: - seconds - minutes - hours - days - months - quarters - years - total - null type: string writeOnly: true nullable: true description: The proration of the metric. Only applies to metrics of type 'gauge'. properties: type: object additionalProperties: {} writeOnly: true nullable: true is_cost_metric: type: boolean writeOnly: true default: false description: Whether or not this metric is a cost metric (used to track costs to your business). custom_sql: type: string writeOnly: true nullable: true description: A custom SQL query that can be used to define the metric. Please refer to our documentation for more information. required: - metric_name - metric_type MetricRevenue: type: object properties: metric_name: type: string original_plan_revenue: type: number format: double new_plan_revenue: type: number format: double required: - metric_name - new_plan_revenue - original_plan_revenue MetricUpdate: type: object properties: billable_metric_name: type: string nullable: true maxLength: 50 status: enum: - active - archived type: string NumericFilter: type: object properties: property_name: type: string maxLength: 100 operator: enum: - gte - gt - eq - lt - lte type: string comparison_value: type: number format: double required: - comparison_value - operator - property_name Organization: type: object properties: organization_id: type: string organization_name: type: string maxLength: 100 payment_provider_ids: type: object additionalProperties: {} nullable: true users: type: array items: $ref: '#/components/schemas/OrganizationUser' readOnly: true default_currency: $ref: '#/components/schemas/PricingUnit' available_currencies: type: array items: $ref: '#/components/schemas/PricingUnit' readOnly: true plan_tags: type: array items: $ref: '#/components/schemas/Tag' readOnly: true tax_rate: type: number format: double maximum: 999.999900000000025102053768932819366455078125 minimum: 0 nullable: true description: Tax rate as percentage. For example, 10.5 for 10.5% payment_grace_period: type: integer maximum: 365 minimum: 0 nullable: true readOnly: true linked_organizations: type: array items: $ref: '#/components/schemas/LightweightOrganization' readOnly: true current_user: allOf: - $ref: '#/components/schemas/LightweightUser' readOnly: true address: allOf: - $ref: '#/components/schemas/Address' nullable: true readOnly: true team_name: type: string readOnly: true subscription_filter_keys: type: array items: type: string readOnly: true required: - address - available_currencies - current_user - default_currency - linked_organizations - organization_id - organization_name - payment_grace_period - plan_tags - subscription_filter_keys - team_name - users OrganizationCreateRequest: type: object properties: organization_name: type: string minLength: 1 maxLength: 100 default_currency_code: type: string minLength: 1 organization_type: enum: - development - production type: string default: development required: - organization_name OrganizationSetting: type: object properties: setting_id: type: string setting_name: enum: - generate_customer_after_creating_in_lotus - subscription_filter_keys - payment_grace_period type: string setting_values: type: object additionalProperties: {} setting_group: enum: - stripe - billing type: string required: - setting_id - setting_name - setting_values OrganizationSettingUpdate: type: object properties: setting_values: type: object additionalProperties: {} OrganizationUser: type: object properties: username: type: string description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. pattern: ^[\w.@+-]+$ maxLength: 150 email: type: string format: email maxLength: 254 role: type: string readOnly: true status: enum: - Active - Invited type: string default: Active required: - email - role - username PaginatedActionList: type: object properties: next: type: string nullable: true previous: type: string nullable: true results: type: array items: $ref: '#/components/schemas/Action' PaginatedEventList: type: object properties: next: type: string nullable: true previous: type: string nullable: true results: type: array items: $ref: '#/components/schemas/Event' PatchedCustomerUpdateRequest: type: object properties: default_currency_code: type: string minLength: 1 address: allOf: - $ref: '#/components/schemas/AddressRequest' nullable: true tax_rate: type: number format: double maximum: 999.999900000000025102053768932819366455078125 minimum: 0 nullable: true description: Tax rate as percentage. For example, 10.5 for 10.5% PatchedInvoiceUpdateRequest: type: object properties: payment_status: enum: - paid - unpaid type: string PatchedMetricUpdateRequest: type: object properties: billable_metric_name: type: string nullable: true maxLength: 50 status: enum: - active - archived type: string PatchedOrganizationSettingUpdateRequest: type: object properties: setting_values: type: object additionalProperties: {} PatchedOrganizationUpdateRequest: type: object properties: default_currency_code: type: string minLength: 1 address: allOf: - $ref: '#/components/schemas/AddressRequest' nullable: true tax_rate: type: number format: double maximum: 999.999900000000025102053768932819366455078125 minimum: 0 nullable: true description: Tax rate as percentage. For example, 10.5 for 10.5% payment_grace_period: type: integer maximum: 365 minimum: 0 nullable: true plan_tags: type: array items: $ref: '#/components/schemas/TagRequest' subscription_filter_keys: type: array items: type: string minLength: 1 PatchedPlanUpdateRequest: type: object properties: plan_name: type: string minLength: 1 description: Name of the plan maxLength: 100 status: enum: - active - archived type: string tags: type: array items: $ref: '#/components/schemas/TagRequest' PatchedPlanVersionUpdateRequest: type: object properties: description: type: string nullable: true status: enum: - active - archived type: string make_active_type: enum: - replace_immediately - replace_on_active_version_renewal - grandfather_active type: string replace_immediately_type: enum: - end_current_subscription_and_bill - end_current_subscription_dont_bill - change_subscription_plan type: string transition_to_plan_id: type: string format: uuid writeOnly: true PatchedWebhookEndpointRequest: type: object properties: name: type: string nullable: true maxLength: 100 webhook_url: type: string minLength: 1 maxLength: 100 triggers_in: type: array items: enum: - invoice.created - invoice.paid - usage_alert.triggered type: string writeOnly: true PaymentProviderPostDataRequest: type: object properties: payment_processor: enum: - stripe type: string data: type: object additionalProperties: {} required: - data - payment_processor PaymentProviderPostRequestRequest: type: object properties: pp_info: $ref: '#/components/schemas/PaymentProviderPostDataRequest' required: - pp_info PaymentProviderPostResponse: type: object properties: payment_processor: enum: - stripe type: string success: type: boolean details: type: string required: - details - payment_processor - success PeriodMetricRevenueResponse: type: object properties: total_revenue_period_1: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true total_revenue_period_2: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true earned_revenue_period_1: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true earned_revenue_period_2: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true required: - earned_revenue_period_1 - earned_revenue_period_2 - total_revenue_period_1 - total_revenue_period_2 PeriodMetricUsageResponse: type: object properties: metrics: type: object additionalProperties: $ref: '#/components/schemas/PeriodSingleMetricUsage' required: - metrics PeriodSingleMetricUsage: type: object properties: data: type: array items: $ref: '#/components/schemas/DayMetricUsage' total_usage: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true required: - data - total_usage PeriodSubscriptionsResponse: type: object properties: period_1_total_subscriptions: type: integer period_1_new_subscriptions: type: integer period_2_total_subscriptions: type: integer period_2_new_subscriptions: type: integer required: - period_1_new_subscriptions - period_1_total_subscriptions - period_2_new_subscriptions - period_2_total_subscriptions Plan: type: object properties: plan_name: type: string description: Name of the plan maxLength: 100 plan_duration: enum: - monthly - quarterly - yearly type: string description: Duration of the plan status: enum: - active - archived - experimental type: string external_links: type: array items: $ref: '#/components/schemas/InitialExternalPlanLink' description: The external links that this plan has. plan_id: type: string parent_plan: allOf: - $ref: '#/components/schemas/PlanNameAndID' nullable: true target_customer: allOf: - $ref: '#/components/schemas/LightweightCustomer' nullable: true display_version: $ref: '#/components/schemas/PlanVersion' num_versions: type: integer readOnly: true description: The number of versions that this plan has. active_subscriptions: type: integer readOnly: true description: The number of active subscriptions that this plan has across all versions. tags: type: array items: $ref: '#/components/schemas/Tag' readOnly: true description: The tags that this plan has. required: - active_subscriptions - display_version - external_links - num_versions - plan_duration - plan_id - plan_name - status - tags - parent_plan - target_customer PlanComponent: type: object properties: billable_metric: $ref: '#/components/schemas/Metric' tiers: type: array items: $ref: '#/components/schemas/PriceTier' pricing_unit: $ref: '#/components/schemas/PricingUnit' required: - billable_metric - pricing_unit - tiers PlanComponentRequest: type: object properties: tiers: type: array items: $ref: '#/components/schemas/PriceTierCreateRequest' metric_id: type: string format: uuid writeOnly: true required: - metric_id PlanCreateRequest: type: object properties: plan_name: type: string writeOnly: true minLength: 1 description: Name of the plan maxLength: 100 plan_duration: enum: - monthly - quarterly - yearly type: string writeOnly: true description: Duration of the plan status: enum: - active - archived - experimental type: string writeOnly: true initial_external_links: type: array items: $ref: '#/components/schemas/InitialExternalPlanLinkRequest' initial_version: $ref: '#/components/schemas/InitialPlanVersionRequest' parent_plan_id: type: string format: uuid target_customer_id: type: string minLength: 1 description: The id provided when creating the customer, we suggest matching with your internal customer id in your backend tags: type: array items: $ref: '#/components/schemas/TagRequest' required: - initial_version - plan_duration - plan_name PlanDetail: type: object properties: plan_name: type: string description: Name of the plan maxLength: 100 plan_duration: enum: - monthly - quarterly - yearly type: string description: Duration of the plan status: enum: - active - archived - experimental type: string external_links: type: array items: $ref: '#/components/schemas/InitialExternalPlanLink' description: The external links that this plan has. plan_id: type: string parent_plan: allOf: - $ref: '#/components/schemas/PlanNameAndID' nullable: true target_customer: allOf: - $ref: '#/components/schemas/LightweightCustomer' nullable: true display_version: $ref: '#/components/schemas/PlanVersionDetail' num_versions: type: integer readOnly: true description: The number of versions that this plan has. active_subscriptions: type: integer readOnly: true description: The number of active subscriptions that this plan has across all versions. tags: type: array items: $ref: '#/components/schemas/Tag' readOnly: true description: The tags that this plan has. versions: type: array items: $ref: '#/components/schemas/PlanVersionDetail' readOnly: true required: - active_subscriptions - display_version - external_links - num_versions - parent_plan - plan_duration - plan_id - plan_name - status - tags - target_customer - versions PlanNameAndID: type: object properties: plan_name: type: string description: Name of the plan maxLength: 100 plan_id: type: string required: - plan_id - plan_name PlanRepresentation: type: object properties: plan_name: type: string plan_id: type: string plan_revenue: type: number format: double required: - plan_id - plan_name - plan_revenue PlanUpdate: type: object properties: plan_name: type: string description: Name of the plan maxLength: 100 status: enum: - active - archived type: string tags: type: array items: $ref: '#/components/schemas/Tag' PlanVersion: type: object properties: description: type: string readOnly: true nullable: true flat_fee_billing_type: enum: - in_arrears - in_advance type: string readOnly: true flat_rate: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true components: type: array items: $ref: '#/components/schemas/PlanComponent' features: type: array items: $ref: '#/components/schemas/Feature' price_adjustment: allOf: - $ref: '#/components/schemas/PriceAdjustment' nullable: true usage_billing_frequency: enum: - monthly - quarterly - end_of_period - null type: string readOnly: true nullable: true version: type: integer readOnly: true status: enum: - active - retiring - grandfathered - archived - inactive type: string readOnly: true plan_name: type: string currency: $ref: '#/components/schemas/PricingUnit' required: - components - currency - description - features - flat_fee_billing_type - flat_rate - plan_name - price_adjustment - status - usage_billing_frequency - version PlanVersionCreateRequest: type: object properties: description: type: string writeOnly: true nullable: true plan_id: type: string format: uuid flat_fee_billing_type: enum: - in_arrears - in_advance type: string writeOnly: true flat_rate: type: number format: double maximum: 10000000000 minimum: 0 exclusiveMaximum: true writeOnly: true components: type: array items: $ref: '#/components/schemas/PlanComponentRequest' nullable: true features: type: array items: $ref: '#/components/schemas/FeatureRequest' nullable: true price_adjustment: $ref: '#/components/schemas/PriceAdjustmentRequest' usage_billing_frequency: enum: - monthly - quarterly - end_of_period - '' - null type: string writeOnly: true nullable: true day_anchor: type: integer maximum: 31 minimum: 1 writeOnly: true nullable: true month_anchor: type: integer maximum: 12 minimum: 1 writeOnly: true nullable: true make_active: type: boolean make_active_type: enum: - replace_immediately - replace_on_active_version_renewal - grandfather_active type: string replace_immediately_type: enum: - end_current_subscription_and_bill - end_current_subscription_dont_bill - change_subscription_plan type: string transition_to_plan_id: type: string format: uuid currency_code: type: string minLength: 1 required: - flat_fee_billing_type - make_active PlanVersionDetail: type: object properties: description: type: string readOnly: true nullable: true flat_fee_billing_type: enum: - in_arrears - in_advance type: string readOnly: true flat_rate: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true components: type: array items: $ref: '#/components/schemas/PlanComponent' features: type: array items: $ref: '#/components/schemas/Feature' price_adjustment: allOf: - $ref: '#/components/schemas/PriceAdjustment' nullable: true usage_billing_frequency: enum: - monthly - quarterly - end_of_period - null type: string readOnly: true nullable: true version: type: integer readOnly: true status: enum: - active - retiring - grandfathered - archived - inactive type: string readOnly: true plan_name: type: string currency: $ref: '#/components/schemas/PricingUnit' version_id: type: string readOnly: true plan_id: type: string readOnly: true alerts: type: array items: $ref: '#/components/schemas/UsageAlert' readOnly: true required: - alerts - components - currency - description - features - flat_fee_billing_type - flat_rate - plan_id - plan_name - price_adjustment - status - usage_billing_frequency - version - version_id PlanVersionUpdate: type: object properties: description: type: string nullable: true status: enum: - active - archived type: string make_active_type: enum: - replace_immediately - replace_on_active_version_renewal - grandfather_active type: string replace_immediately_type: enum: - end_current_subscription_and_bill - end_current_subscription_dont_bill - change_subscription_plan type: string PlansByNumCustomers: type: object properties: results: type: array items: $ref: '#/components/schemas/SinglePlanNumCustomers' status: enum: - success type: string required: - results - status PriceAdjustment: type: object properties: price_adjustment_name: type: string maxLength: 100 price_adjustment_description: type: string nullable: true price_adjustment_type: enum: - percentage - fixed - price_override type: string price_adjustment_amount: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true required: - price_adjustment_amount - price_adjustment_description - price_adjustment_name - price_adjustment_type PriceAdjustmentRequest: type: object properties: price_adjustment_name: type: string minLength: 1 default: '' price_adjustment_description: type: string nullable: true price_adjustment_type: enum: - percentage - fixed - price_override type: string price_adjustment_amount: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true required: - price_adjustment_amount - price_adjustment_type PriceTier: type: object properties: type: enum: - flat - per_unit - free type: string readOnly: true range_start: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true range_end: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true nullable: true cost_per_batch: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true nullable: true metric_units_per_batch: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true readOnly: true nullable: true batch_rounding_type: enum: - round_up - round_down - round_nearest - no_rounding type: string nullable: true readOnly: true required: - batch_rounding_type - cost_per_batch - metric_units_per_batch - range_end - range_start - type PriceTierCreateRequest: type: object properties: type: enum: - flat - per_unit - free type: string range_start: type: number format: double maximum: 10000000000 minimum: 0 exclusiveMaximum: true range_end: type: number format: double maximum: 10000000000 minimum: 0 exclusiveMaximum: true nullable: true cost_per_batch: type: number format: double maximum: 10000000000 minimum: 0 exclusiveMaximum: true nullable: true metric_units_per_batch: type: number format: double maximum: 10000000000 minimum: 0 exclusiveMaximum: true nullable: true batch_rounding_type: enum: - round_up - round_down - round_nearest - no_rounding type: string required: - range_start - type PricingUnit: type: object properties: code: type: string maxLength: 10 name: type: string maxLength: 100 symbol: type: string maxLength: 10 required: - code - name - symbol PricingUnitRequest: type: object properties: code: type: string minLength: 1 maxLength: 10 name: type: string minLength: 1 maxLength: 100 symbol: type: string minLength: 1 maxLength: 10 required: - code - name - symbol Product: type: object properties: name: type: string maxLength: 100 description: type: string nullable: true product_id: type: string maxLength: 100 pattern: ^[-a-zA-Z0-9_]+$ status: enum: - active - archived type: string required: - name - status ProductRequest: type: object properties: name: type: string minLength: 1 maxLength: 100 description: type: string nullable: true product_id: type: string minLength: 1 maxLength: 100 pattern: ^[-a-zA-Z0-9_]+$ status: enum: - active - archived type: string required: - name - status RegistrationDetailRequest: type: object properties: organization_name: type: string industry: type: string email: type: string minLength: 1 password: type: string minLength: 1 username: type: string minLength: 1 required: - email - industry - organization_name - password - username RegistrationFailure: type: object properties: detail: type: string required: - detail RegistrationRequest: type: object properties: register: $ref: '#/components/schemas/RegistrationDetailRequest' required: - register RegistrationSuccess: type: object properties: detail: type: string token: type: string user: $ref: '#/components/schemas/User' required: - detail - token - user ResetPasswordRequestRequest: type: object properties: userId: type: string minLength: 1 password: type: string minLength: 1 token: type: string minLength: 1 required: - password - token - userId ResetPasswordSuccess: type: object properties: detail: type: string token: type: string required: - detail - token RevenueDate: type: object properties: date: type: string format: date original_plan_revenue: type: number format: double new_plan_revenue: type: number format: double required: - date - new_plan_revenue - original_plan_revenue Seller: type: object properties: name: type: string address: allOf: - $ref: '#/components/schemas/Address' nullable: true readOnly: true phone: type: string nullable: true maxLength: 20 email: type: string format: email nullable: true maxLength: 254 required: - name SessionSuccess: type: object properties: isAuthenticated: type: boolean required: - isAuthenticated SingleCustomerValue: type: object properties: customer_id: type: string customer_name: type: string value: type: number format: double required: - customer_id - customer_name - value SingleDayCostAnalysis: type: object properties: date: type: string format: date cost_data: type: array items: $ref: '#/components/schemas/SingleMetricCost' revenue: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true required: - cost_data - date - revenue SingleMetricCost: type: object properties: metric: $ref: '#/components/schemas/Metric' cost: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true required: - cost - metric SinglePaymentProvider: type: object properties: payment_provider_name: type: string connected: type: boolean redirect_url: type: string format: uri required: - connected - payment_provider_name - redirect_url SinglePlanNumCustomers: type: object properties: plan_name: type: string num_customers: type: integer percent_total: type: number format: double required: - num_customers - percent_total - plan_name SingleSubstitution: type: object properties: substitution_name: type: string original_plan: $ref: '#/components/schemas/PlanRepresentation' new_plan: $ref: '#/components/schemas/PlanRepresentation' pct_revenue_change: type: number format: double nullable: true results: $ref: '#/components/schemas/SingleSubstitutionResults' required: - new_plan - original_plan - pct_revenue_change - results - substitution_name SingleSubstitutionResults: type: object properties: cumulative_revenue: type: array items: $ref: '#/components/schemas/RevenueDate' revenue_by_metric: type: array items: $ref: '#/components/schemas/MetricRevenue' top_customers: $ref: '#/components/schemas/TopCustomers' required: - cumulative_revenue - revenue_by_metric - top_customers SubscriptionCategoricalFilter: type: object properties: value: type: string property_name: type: string description: 'The string name of the property to filter on. Example: ''product_id''' required: - property_name - value SubscriptionCategoricalFilterRequest: type: object properties: value: type: string minLength: 1 property_name: type: string minLength: 1 description: 'The string name of the property to filter on. Example: ''product_id''' required: - property_name - value SubscriptionCustomerSummary: type: object properties: billing_plan_name: type: string plan_version: type: string end_date: type: string format: date-time description: The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time. auto_renew: type: boolean description: Whether the subscription automatically renews. Defaults to true. required: - billing_plan_name - end_date - plan_version SubscriptionRecord: type: object properties: start_date: type: string format: date-time description: The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time. end_date: type: string format: date-time description: The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time. auto_renew: type: boolean description: Whether the subscription automatically renews. Defaults to true. is_new: type: boolean description: Whether this subscription came from a renewal or from a first-time. Defaults to true on creation. subscription_filters: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilter' customer: $ref: '#/components/schemas/LightweightCustomer' billing_plan: $ref: '#/components/schemas/LightweightPlanVersion' fully_billed: type: boolean description: Whether the subscription has been fully billed and finalized. required: - auto_renew - billing_plan - customer - end_date - fully_billed - is_new - start_date - subscription_filters SubscriptionRecordCancelRequest: type: object properties: flat_fee_behavior: enum: - refund - prorate - charge_full type: string default: charge_full description: Can either charge the full amount of the flat fee, regardless of how long the customer has been on the plan, prorate the fflat fee, or charge nothing for the flat fee. If the flat fee has already been invoiced (e.g. in advance payment on last subscription), and the reuslting charge is less than the amount already invoiced, the difference will be refunded as a credit. Defaults to charge full amount. usage_behavior: enum: - bill_full - bill_none type: string default: bill_full description: If bill_full, current usage will be billed on the invoice. If bill_none, current unbilled usage will be dropped from the invoice. Defaults to bill_full. invoicing_behavior: enum: - add_to_next_invoice - invoice_now type: string default: invoice_now description: Whether to invoice now or invoice at the end of the billing period. Defaults to invoice now. SubscriptionRecordCreateRequest: type: object properties: start_date: type: string format: date-time description: The date the subscription starts. This should be a string in YYYY-MM-DD format of the date in UTC time. end_date: type: string format: date-time description: The date the subscription ends. This should be a string in YYYY-MM-DD format of the date in UTC time. If you don’t set it (recommended), we will use the information in the billing plan to automatically calculate this. auto_renew: type: boolean description: Whether the subscription automatically renews. Defaults to true. is_new: type: boolean subscription_filters: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilterRequest' description: Add filter key, value pairs that define which events will be applied to this plan subscription. customer_id: type: string minLength: 1 description: The id provided when creating the customer writeOnly: true plan_id: type: string format: uuid writeOnly: true description: The Lotus plan_id, found in the billing plan object required: - customer_id - plan_id - start_date SubscriptionRecordRequest: type: object properties: start_date: type: string format: date-time description: The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time. end_date: type: string format: date-time description: The time the subscription starts. This will be a string in yyyy-mm-dd HH:mm:ss format in UTC time. auto_renew: type: boolean description: Whether the subscription automatically renews. Defaults to true. is_new: type: boolean description: Whether this subscription came from a renewal or from a first-time. Defaults to true on creation. subscription_filters: type: array items: $ref: '#/components/schemas/SubscriptionCategoricalFilterRequest' billing_plan: $ref: '#/components/schemas/LightweightPlanVersionRequest' fully_billed: type: boolean description: Whether the subscription has been fully billed and finalized. required: - auto_renew - billing_plan - end_date - fully_billed - is_new - start_date - subscription_filters SubscriptionRecordUpdateRequest: type: object properties: replace_plan_id: type: string format: uuid writeOnly: true description: The plan to replace the current plan with invoicing_behavior: enum: - add_to_next_invoice - invoice_now type: string default: invoice_now description: The invoicing behavior to use when replacing the plan. Invoice now will invoice the customer for the prorated difference of the old plan and the new plan, whereas add_to_next_invoice will wait until the end of the subscription to do the calculation. usage_behavior: enum: - transfer_to_new_subscription - keep_separate type: string default: transfer_to_new_subscription description: The usage behavior to use when replacing the plan. Transfer to new subscription will transfer the usage from the old subscription to the new subscription, whereas reset_usage will reset the usage to 0 for the new subscription, while keeping the old usage on the old subscription and charging for that appropriately at the end of the month. turn_off_auto_renew: type: boolean description: Turn off auto renew for the subscription end_date: type: string format: date-time description: Change the end date for the subscription. Tag: type: object properties: tag_name: type: string maxLength: 50 tag_hex: type: string nullable: true maxLength: 7 tag_color: type: string nullable: true maxLength: 20 required: - tag_name TagRequest: type: object properties: tag_name: type: string minLength: 1 maxLength: 50 tag_hex: type: string nullable: true minLength: 1 maxLength: 7 tag_color: type: string nullable: true minLength: 1 maxLength: 20 required: - tag_name TopCustomers: type: object properties: original_plan_revenue: type: array items: $ref: '#/components/schemas/SingleCustomerValue' new_plan_revenue: type: array items: $ref: '#/components/schemas/SingleCustomerValue' biggest_pct_increase: type: array items: $ref: '#/components/schemas/SingleCustomerValue' biggest_pct_decrease: type: array items: $ref: '#/components/schemas/SingleCustomerValue' required: - biggest_pct_decrease - biggest_pct_increase - new_plan_revenue - original_plan_revenue TrackEventFailure: type: object properties: success: enum: - none type: string failed_events: type: object additionalProperties: {} required: - failed_events - success TrackEventSuccess: type: object properties: success: enum: - all - some type: string failed_events: type: object additionalProperties: {} required: - failed_events - success TransferSubscriptionsFailure: type: object properties: status: enum: - error type: string detail: type: string required: - detail - status TransferSubscriptionsRequestRequest: type: object properties: source: enum: - stripe type: string end_now: type: boolean required: - end_now - source TransferSubscriptionsSuccess: type: object properties: status: enum: - success type: string detail: type: string required: - detail - status UsageAlert: type: object properties: usage_alert_id: type: string readOnly: true metric: $ref: '#/components/schemas/Metric' plan_version: $ref: '#/components/schemas/LightweightPlanVersion' threshold: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true required: - metric - plan_version - threshold - usage_alert_id UsageAlertCreate: type: object properties: metric_id: type: string format: uuid plan_version_id: type: string format: uuid threshold: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true required: - metric_id - plan_version_id - threshold UsageAlertCreateRequest: type: object properties: metric_id: type: string format: uuid plan_version_id: type: string format: uuid threshold: type: number format: double maximum: 10000000000 minimum: -10000000000 exclusiveMaximum: true exclusiveMinimum: true required: - metric_id - plan_version_id - threshold User: type: object properties: username: type: string description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. pattern: ^[\w.@+-]+$ maxLength: 150 email: type: string format: email maxLength: 254 organization_name: type: string organization_id: type: string required: - email - organization_id - organization_name - username UserRequest: type: object properties: username: type: string minLength: 1 description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. pattern: ^[\w.@+-]+$ maxLength: 150 email: type: string format: email minLength: 1 maxLength: 254 organization_name: type: string minLength: 1 organization_id: type: string minLength: 1 required: - email - organization_id - organization_name - username WebhookEndpoint: type: object properties: webhook_endpoint_id: type: string readOnly: true name: type: string nullable: true maxLength: 100 webhook_url: type: string maxLength: 100 webhook_secret: type: string readOnly: true triggers: type: array items: $ref: '#/components/schemas/WebhookTrigger' readOnly: true required: - triggers - webhook_endpoint_id - webhook_secret - webhook_url WebhookEndpointRequest: type: object properties: name: type: string nullable: true maxLength: 100 webhook_url: type: string minLength: 1 maxLength: 100 triggers_in: type: array items: enum: - invoice.created - invoice.paid - usage_alert.triggered type: string writeOnly: true required: - triggers_in - webhook_url WebhookTrigger: type: object properties: trigger_name: enum: - invoice.created - invoice.paid - usage_alert.triggered type: string required: - trigger_name WebhookTriggerRequest: type: object properties: trigger_name: enum: - invoice.created - invoice.paid - usage_alert.triggered type: string required: - trigger_name securitySchemes: OrganizationApiKeyAuth: type: apiKey in: header name: X-API-KEY basicAuth: type: http scheme: basic knoxTokenAuth: type: apiKey in: header name: Authorization description: Token-based authentication with required prefix "Token"