openapi: 3.0.3
info:
  version: '1.0'
  title: Togai Apis
  contact:
    email: engg@togai.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  description: APIs for Togai App
servers:
  - description: Api endpoint
    url: https://api.togai.com/
  - description: Sandbox api endpoint
    url: https://sandbox-api.togai.com/
externalDocs:
  description: Find out more about Togai
  url: https://docs.togai.com/docs
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: Customer level calls
  - name: Accounts
    description: Account level calls
  - name: Event Schemas
    description: Event Schema level calls
  - name: Usage Meters
    description: Usage Meter level calls
  - name: Price Plans
    description: (DEPRECATED) Price Plan level calls
  - name: PricePlanV2
    description: Price Plan V2 level calls
  - name: Schedules
    description: Account Schedule level calls
  - name: Pricing Rules
    description: Pricing Rules level calls
  - name: Settings
    description: Settings
  - name: Price Experimentation
    description: Price Experimentation apis
  - name: InvoiceGroups
    description: Invoice Group level calls
  - name: Organization
    description: Organization level calls
  - name: FileStorage
    description: File Storage level calls
  - name: Aliases
    description: Alias level calls
  - name: Reports
    description: Report level calls
  - name: ReportTemplates
    description: Report Template level calls
  - name: Customer Portal
    description: Portal level calls
  - name: Alerts
    description: Alert level calls
  - name: Event Management
    description: APIs for getting events ingested in Togai
    externalDocs:
      description: docs
      url: https://togai.com/docs/billing/events
  - name: Metrics
    description: APIs for getting Togai metrics
    externalDocs:
      description: docs
      url: https://togai.com/docs/metrics
  - name: Licenses
    description: APIs for getting or updating license records in Togai
  - name: Entitlements
    description: APIs related to entitlements
  - name: Invoices
    description: Invoices API
  - name: Credits
    description: Credits API
  - name: Wallet
    description: Wallet API
  - name: InvoiceTemplates
    description: InvoiceTemplates API
  - name: InvoiceSequence
    description: InvoiceSequence API
  - name: Payments
    description: Payments API
  - name: Authentication
    description: Authentication API
paths:
  /customers:
    post:
      tags:
        - Customers
      summary: Create a customer
      description: This API let’s you to create customers and corresponding accounts.
      operationId: createCustomer
      requestBody:
        $ref: '#/components/requestBodies/CreateCustomerRequest'
      responses:
        '201':
          $ref: '#/components/responses/CreateCustomerResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Customers
      summary: List customers
      description: Returns a list of customers with pagination and sort.
      operationId: getCustomers
      parameters:
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
      responses:
        '200':
          $ref: '#/components/responses/CustomerPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /customers/{customer_id}:
    get:
      tags:
        - Customers
      summary: Get a customer
      description: Get customer information using customer_id.
      operationId: getCustomer
      parameters:
        - $ref: '#/components/parameters/customer_id'
      responses:
        '200':
          $ref: '#/components/responses/CustomerResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    patch:
      tags:
        - Customers
      summary: Update a customer
      description: This API let’s you to update a customer’s information using customer_id.
      operationId: updateCustomer
      parameters:
        - $ref: '#/components/parameters/customer_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateCustomerRequest'
      responses:
        '200':
          $ref: '#/components/responses/CustomerResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    delete:
      tags:
        - Customers
      summary: Delete a customer
      description: This API let’s you to delete a customer using customer_id.
      operationId: deleteCustomer
      parameters:
        - $ref: '#/components/parameters/customer_id'
      responses:
        '200':
          $ref: '#/components/responses/BaseSuccessResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /customers/{customer_id}/contacts:
    post:
      tags:
        - Customers
      summary: Create a contact for the customer
      description: This API let’s you to create a contact for the customer
      operationId: createCustomerContact
      parameters:
        - $ref: '#/components/parameters/customer_id'
      requestBody:
        $ref: '#/components/requestBodies/CreateCustomerContactRequest'
      responses:
        '201':
          $ref: '#/components/responses/CreateCustomerContactResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts:
    post:
      tags:
        - Accounts
      summary: Create an account
      description: This API let’s you to create an account for a customer using customer_id.
      operationId: createAccount
      requestBody:
        $ref: '#/components/requestBodies/CreateAccountRequest'
      responses:
        '201':
          $ref: '#/components/responses/AccountResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Accounts
      summary: List accounts of customer
      description: Returns a list of accounts of a customer with pagination and sort.
      operationId: getAccounts
      parameters:
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
      responses:
        '200':
          $ref: '#/components/responses/AccountPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}:
    get:
      tags:
        - Accounts
      summary: Get an account
      description: Get account information using customer_id and account_id.
      operationId: getAccount
      parameters:
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/effectiveOn'
        - $ref: '#/components/parameters/includeGroupDetails'
      responses:
        '200':
          $ref: '#/components/responses/AccountResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    patch:
      tags:
        - Accounts
      summary: Update an account
      description: This API let’s you to update an account’s information using customer_id and account_id.
      operationId: updateAccount
      parameters:
        - $ref: '#/components/parameters/account_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateAccountRequest'
      responses:
        '200':
          $ref: '#/components/responses/AccountResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    delete:
      tags:
        - Accounts
      summary: Delete an account
      description: This API let’s you to delete a customer using customer_id and account_id.
      operationId: deleteAccount
      parameters:
        - $ref: '#/components/parameters/account_id'
      responses:
        '200':
          $ref: '#/components/responses/BaseSuccessResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/add_aliases:
    post:
      tags:
        - Accounts
      summary: Add Aliases to account
      description: Add aliases to an account using customer_id and account_id.
      operationId: addAliases
      parameters:
        - $ref: '#/components/parameters/account_id'
      requestBody:
        $ref: '#/components/requestBodies/AddAccountAliasesRequest'
      responses:
        '200':
          $ref: '#/components/responses/AccountResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/account_aliases:
    get:
      tags:
        - Accounts
      summary: Get all aliases of an account
      description: Get all aliases of an account using account_id
      operationId: listAccountAliases
      parameters:
        - $ref: '#/components/parameters/account_id'
      responses:
        '200':
          $ref: '#/components/responses/AccountAliasesPaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/remove_aliases:
    post:
      tags:
        - Accounts
      summary: Remove Aliases to account
      description: Remove existing aliases tagged to an account using this API
      operationId: removeAliases
      parameters:
        - $ref: '#/components/parameters/account_id'
      requestBody:
        $ref: '#/components/requestBodies/RemoveAccountAliasesRequest'
      responses:
        '200':
          $ref: '#/components/responses/AccountResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/price_plans:
    post:
      tags:
        - Accounts
      summary: (DEPRECATED) Dissociate or associate a price plan with an account
      description: This API let’s you to detach or attach a price plan with an existing account
      operationId: updatePricingSchedule
      parameters:
        - $ref: '#/components/parameters/account_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdatePricingScheduleRequestWithActions'
      responses:
        '200':
          $ref: '#/components/responses/UpdatePricingScheduleResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/purchases:
    post:
      tags:
        - Accounts
      summary: (DEPRECATED) Initiate a purchase
      description: This API let’s you to initiate a purchase for an account
      operationId: initiateOneTimeEntitlementPlan
      parameters:
        - $ref: '#/components/parameters/account_id'
      requestBody:
        $ref: '#/components/requestBodies/CreatePurchaseRequest'
      responses:
        '200':
          $ref: '#/components/responses/CreatePurchaseResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Accounts
      summary: (DEPRECATED) Get all purchases for an account
      description: Get Purchase information for an account using account_id and price_plan_id
      operationId: listAccountPurchases
      parameters:
        - $ref: '#/components/parameters/account_id'
      responses:
        '200':
          $ref: '#/components/responses/PurchasePaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /aliases:
    get:
      tags:
        - Aliases
      summary: List all aliases
      description: Returns a list of aliases with pagination and sort.
      operationId: listAliases
      parameters:
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
      responses:
        '200':
          $ref: '#/components/responses/AliasPaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    post:
      tags:
        - Aliases
      summary: Create an alias
      description: This API let’s you to create an alias
      operationId: createAlias
      requestBody:
        $ref: '#/components/requestBodies/CreateBulkAliasRequest'
      responses:
        '201':
          $ref: '#/components/responses/AliasPaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /aliases/{alias}:
    get:
      tags:
        - Aliases
      summary: Get an alias
      description: Get alias information using alias.
      operationId: getAlias
      parameters:
        - $ref: '#/components/parameters/alias'
      responses:
        '200':
          $ref: '#/components/responses/AliasResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    delete:
      tags:
        - Aliases
      summary: Delete an alias
      description: This API let’s you to delete an alias using alias.
      operationId: deleteAlias
      parameters:
        - $ref: '#/components/parameters/alias'
      responses:
        '200':
          $ref: '#/components/responses/BaseSuccessResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /purchases/{purchase_id}:
    get:
      tags:
        - Accounts
      summary: (DEPRECATED) Get a specific purchase of an account
      description: Get purchase information of an account for a specific plan using account_id and price_plan_id
      operationId: getPurchase
      parameters:
        - $ref: '#/components/parameters/purchase_id'
      responses:
        '200':
          $ref: '#/components/responses/GetPurchaseResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/purchase_proposals:
    post:
      tags:
        - Accounts
      summary: (DEPRECATED) Propose a purchase of a plan
      description: This API let’s you to create a proposal of a billing/entitlement plan for an account
      operationId: createProposal
      parameters:
        - $ref: '#/components/parameters/account_id'
      requestBody:
        $ref: '#/components/requestBodies/CreateProposalRequest'
      responses:
        '200':
          $ref: '#/components/responses/CreateProposalResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Accounts
      summary: (DEPRECATED) List all proposals of an account
      description: List all proposals of an account
      operationId: listAccountProposals
      parameters:
        - $ref: '#/components/parameters/account_id'
      responses:
        '200':
          $ref: '#/components/responses/ProposalsPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /purchase_proposals/{purchase_proposal_id}:
    get:
      tags:
        - Accounts
      summary: (DEPRECATED) Get proposal information
      description: Get proposal information
      operationId: getProposal
      parameters:
        - $ref: '#/components/parameters/purchase_proposal_id'
      responses:
        '200':
          $ref: '#/components/responses/GetProposalResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/edit_schedules:
    post:
      tags:
        - Accounts
      summary: (DEPRECATED) Edit schedules of an account.
      description: This API let’s you to detach/attach one or more price plans from/to an existing account
      operationId: updatePricingScheduleBatch
      parameters:
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/dry_run'
      requestBody:
        $ref: '#/components/requestBodies/EditPricingScheduleRequest'
      responses:
        '200':
          $ref: '#/components/responses/EditPricingScheduleResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/pricing_schedules:
    get:
      tags:
        - Accounts
      summary: (DEPRECATED) List pricing schedules of an account
      description: Returns a list of pricing schedules of an account with pagination and sort.
      operationId: getPricingSchedules
      parameters:
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/start_date'
        - $ref: '#/components/parameters/end_date'
        - $ref: '#/components/parameters/include_price_plan_info'
        - $ref: '#/components/parameters/compact'
      responses:
        '200':
          $ref: '#/components/responses/PricingSchedulePaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /purchase_proposals/{purchase_proposal_id}/update_status:
    post:
      tags:
        - Accounts
      summary: (DEPRECATED) Approve or decline a purchase of a billing plan
      description: This API let’s you to approve or decline a proposal of a billing plan for an account
      operationId: updateProposalStatus
      parameters:
        - $ref: '#/components/parameters/purchase_proposal_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateProposalStatus'
      responses:
        '200':
          $ref: '#/components/responses/UpdateProposalResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /invoice_groups:
    post:
      tags:
        - InvoiceGroups
      summary: Create an invoice group
      description: This API let’s you to create an invoice group
      operationId: createInvoiceGroup
      requestBody:
        $ref: '#/components/requestBodies/CreateInvoiceGroupRequest'
      responses:
        '200':
          $ref: '#/components/responses/InvoiceGroupResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - InvoiceGroups
      summary: List Invoice Groups
      description: This API let’s you to list invoice groups
      operationId: listInvoiceGroups
      responses:
        '200':
          $ref: '#/components/responses/InvoiceGroupPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /invoice_groups/{invoice_group_id}:
    get:
      tags:
        - InvoiceGroups
      summary: Get information of an invoice group
      description: This API let’s you to get information of an invoice group
      operationId: getInvoiceGroup
      parameters:
        - $ref: '#/components/parameters/invoice_group_id'
      responses:
        '200':
          $ref: '#/components/responses/InvoiceGroupAccountsPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /invoice_groups/{invoice_group_id}/add_accounts:
    post:
      tags:
        - InvoiceGroups
      summary: Add accounts to an invoice group
      description: This API let’s you to add accounts to an invoice group
      operationId: AddInvoiceGroupAccounts
      parameters:
        - $ref: '#/components/parameters/invoice_group_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateInvoiceGroupAccounts'
      responses:
        '200':
          $ref: '#/components/responses/InvoiceGroupResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /invoice_groups/{invoice_group_id}/remove_accounts:
    post:
      tags:
        - InvoiceGroups
      summary: Remove accounts from an invoice group. Removing all accounts will also delete the invoice group
      description: This API let’s you to remove accounts from an invoice group. Removing all accounts will also delete the invoice group
      operationId: RemoveInvoiceGroupAccounts
      parameters:
        - $ref: '#/components/parameters/invoice_group_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateInvoiceGroupAccounts'
      responses:
        '200':
          $ref: '#/components/responses/BaseSuccessResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /event_schema:
    post:
      tags:
        - Event Schemas
      summary: Create an event schema
      description: Create an event schema with attributes and dimensions to process events.
      operationId: createEventSchema
      requestBody:
        $ref: '#/components/requestBodies/CreateEventSchemaRequest'
      responses:
        '201':
          $ref: '#/components/responses/EventSchemaResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Event Schemas
      summary: List event schemas
      description: Returns a list of event schema with pagination.
      operationId: listEventSchemas
      parameters:
        - name: status
          description: Filter by provided status
          in: query
          required: false
          schema:
            type: string
            enum:
              - ACTIVE
              - INACTIVE
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
      responses:
        '200':
          $ref: '#/components/responses/EventSchemaListPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /event_schema/{event_schema_name}:
    patch:
      tags:
        - Event Schemas
      summary: Update an event schema
      description: |
        Update an event schema and add new attributes and dimensions

        Once an event schema is activated, you cannot update or delete existing attributes and dimensions however you can add new attributes and dimensions and update event schema description.
            operationId: updateEventSchema
      parameters:
        - $ref: '#/components/parameters/event_schema_name'
      requestBody:
        $ref: '#/components/requestBodies/UpdateEventSchemaRequest'
      responses:
        '200':
          $ref: '#/components/responses/EventSchemaResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Event Schemas
      summary: Get an event schema
      description: Get an event schema
      operationId: getEventSchema
      parameters:
        - $ref: '#/components/parameters/event_schema_name'
        - $ref: '#/components/parameters/version_query'
      responses:
        '200':
          $ref: '#/components/responses/EventSchemaResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    delete:
      tags:
        - Event Schemas
      summary: Delete an event schema
      description: To delete(archive) an event schema, you’re required to archive associated active usage meters if any.
      operationId: deleteEventSchema
      parameters:
        - $ref: '#/components/parameters/event_schema_name'
      responses:
        '200':
          $ref: '#/components/responses/BaseSuccessResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /event_schema/{event_schema_name}/versions:
    get:
      tags:
        - Event Schemas
      summary: List all event schema versions
      description: Get a list of all the versions of an event schema
      operationId: listEventSchemaVersions
      parameters:
        - $ref: '#/components/parameters/event_schema_name'
      responses:
        '200':
          $ref: '#/components/responses/EventSchemaVersionsResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /event_schema/{event_schema_name}/activate:
    post:
      tags:
        - Event Schemas
      summary: Activate an event schema
      description: Activate an event schema
      operationId: activateEventSchema
      parameters:
        - $ref: '#/components/parameters/event_schema_name'
      responses:
        '200':
          $ref: '#/components/responses/EventSchemaResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /event_schema/{event_schema_name}/deactivate:
    post:
      tags:
        - Event Schemas
      summary: Deactivate an event schema
      description: |
        You can deactivate an event schema using this API. In case you have an activate usage meter associated with the event schema, you will need to deactivate it first and then try deactivating the event schema.
      operationId: deactivateEventSchema
      parameters:
        - $ref: '#/components/parameters/event_schema_name'
      responses:
        '200':
          $ref: '#/components/responses/EventSchemaResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /usage_meters:
    post:
      tags:
        - Usage Meters
      summary: Create an usage meter
      description: Create an usage meter and associate with an event schema
      operationId: createUsageMeter
      requestBody:
        $ref: '#/components/requestBodies/CreateUsageMeterRequest'
      responses:
        '201':
          $ref: '#/components/responses/UsageMeterResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Usage Meters
      summary: List usage meters for event schema
      description: Get a list of usage meters associated with an event schema
      operationId: getUsageMetersForEventSchema
      parameters:
        - name: status
          description: |
            Filter by status
          in: query
          required: false
          schema:
            type: string
            enum:
              - ACTIVE
              - INACTIVE
        - name: aggregations
          description: |
            Filter by aggregations
          in: query
          required: false
          schema:
            type: string
            enum:
              - COUNT
              - SUM
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
      responses:
        '200':
          $ref: '#/components/responses/UsageMeterPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /usage_meters/{usage_meter_id}:
    get:
      tags:
        - Usage Meters
      summary: Get usage meter
      description: Get an usage meter using event schema name and usage meter id.
      operationId: getUsageMeter
      parameters:
        - $ref: '#/components/parameters/usage_meter_id'
        - $ref: '#/components/parameters/includeSchema'
      responses:
        '200':
          $ref: '#/components/responses/UsageMeterResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    patch:
      tags:
        - Usage Meters
      summary: Update an usage meter
      description: This API lets you update an existing usage meter.
      operationId: updateUsageMeter
      parameters:
        - $ref: '#/components/parameters/usage_meter_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateUsageMeterRequest'
      responses:
        '200':
          $ref: '#/components/responses/UsageMeterResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    delete:
      tags:
        - Usage Meters
      summary: Delete an Usage Meter
      description: Delete an Usage Meter
      operationId: deleteUsageMeter
      parameters:
        - $ref: '#/components/parameters/usage_meter_id'
      responses:
        '200':
          $ref: '#/components/responses/BaseSuccessResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /usage_meters/{usage_meter_id}/activate:
    post:
      tags:
        - Usage Meters
      summary: Activate usage meter
      description: Activate usage meter
      operationId: activateUsageMeter
      parameters:
        - $ref: '#/components/parameters/usage_meter_id'
      responses:
        '200':
          $ref: '#/components/responses/UsageMeterResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /usage_meters/{usage_meter_id}/deactivate:
    post:
      tags:
        - Usage Meters
      summary: Deactivate usage meter
      description: |
        Make an existing active usage meter to be inactive
        Active Usage Meters with active Pricing Plan attached can also be deactivated.
      operationId: deactivateUsageMeter
      parameters:
        - $ref: '#/components/parameters/usage_meter_id'
      responses:
        '200':
          $ref: '#/components/responses/UsageMeterResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /price_plans:
    post:
      tags:
        - Price Plans
      summary: (DEPRECATED) Create a price plan
      description: |
        This API let's you create and price plan
        Learn more about [Price Plans](https://docs.togai.com/docs/priceplan)
      operationId: createPricePlan
      parameters:
        - $ref: '#/components/parameters/dry_run'
      requestBody:
        $ref: '#/components/requestBodies/CreatePricePlanRequest'
      responses:
        '200':
          $ref: '#/components/responses/PricePlanResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Price Plans
      summary: (DEPRECATED) List price plans
      description: Get a list of price plans
      operationId: getPricePlans
      parameters:
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
      responses:
        '200':
          $ref: '#/components/responses/PricePlanPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /price_plans/{price_plan_id}:
    patch:
      tags:
        - Price Plans
      summary: (DEPRECATED) Update a price plan
      description: |
        Update an existing price plan
        Price Plans with status as DRAFT alone can be updated . Learn more about [Price plans](https://docs.togai.com/docs/priceplan) from our Guides
      operationId: updatePricePlan
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdatePricePlanRequest'
      responses:
        '200':
          $ref: '#/components/responses/PricePlanResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Price Plans
      summary: (DEPRECATED) Get a price plan
      description: Get a price plan details using price plan id
      operationId: getPricePlan
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
        - $ref: '#/components/parameters/version_query'
      responses:
        '200':
          $ref: '#/components/responses/PricePlanResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    delete:
      tags:
        - Price Plans
      summary: (DEPRECATED) Archive a price plan
      description: Archive a price plan
      operationId: archivePricePlan
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
      responses:
        '200':
          $ref: '#/components/responses/BaseSuccessResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /price_plans/{price_plan_id}/activate:
    post:
      tags:
        - Price Plans
      summary: (DEPRECATED) Activate a price plan
      description: Activate a price plan details using price plan id
      operationId: activatePricePlan
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
      requestBody:
        $ref: '#/components/requestBodies/ActivatePricePlanRequest'
      responses:
        '200':
          $ref: '#/components/responses/PricePlanResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /price_plans/{price_plan_id}/pricing_schedules/{pricing_schedule_id}/pricing_rules:
    get:
      tags:
        - Pricing Rules
      summary: (DEPRECATED) List pricing rules by price plan id and pricing schedule id
      description: Get a list of pricing rules using price plan id and pricing schedule id
      operationId: listPricingRulesByScheduleId
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
        - $ref: '#/components/parameters/pricing_schedule_id'
        - $ref: '#/components/parameters/invoice_timing'
      responses:
        '200':
          $ref: '#/components/responses/PricingRulesPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /price_plans/migration:
    post:
      tags:
        - Price Plans
      summary: (DEPRECATED) Create a price plan migration
      description: |
        Migrates accounts across price plans. This is an asynchronous process functioning on top of Togai's Jobs 
        framework. Status of the created migrations can be obtained using the [Jobs APIs](https://docs.togai.com/api-reference/jobs/get-the-status-of-a-job)
      operationId: pricePlanMigration
      requestBody:
        $ref: '#/components/requestBodies/CreatePricePlanMigrationRequest'
      responses:
        '201':
          $ref: '#/components/responses/BaseSuccessResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /addons:
    post:
      tags:
        - AddOns
      summary: Create an AddOn
      description: Create an AddOn
      operationId: createAddOn
      requestBody:
        $ref: '#/components/requestBodies/CreateAddOnRequest'
      responses:
        '200':
          $ref: '#/components/responses/AddOnResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - AddOns
      summary: List addOns
      description: Get a list of add-ons
      operationId: getAddOns
      parameters:
        - name: status
          description: |
            Filter by status
          in: query
          required: false
          schema:
            type: string
            enum:
              - ACTIVE
              - ARCHIVED
            example: ACTIVE
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
      responses:
        '200':
          $ref: '#/components/responses/AddOnPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /addons/{addon_id}:
    patch:
      tags:
        - AddOns
      summary: Update an addon
      description: |
        Update an existing addon
      operationId: updateAddOn
      parameters:
        - $ref: '#/components/parameters/addon_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateAddOnRequest'
      responses:
        '200':
          $ref: '#/components/responses/AddOnResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - AddOns
      summary: Get an addon
      description: Get details of an addon
      operationId: getAddOn
      parameters:
        - $ref: '#/components/parameters/addon_id'
      responses:
        '200':
          $ref: '#/components/responses/AddOnResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    delete:
      tags:
        - AddOns
      summary: Delete an addon
      description: Archive an addOn
      operationId: deleteAddOn
      parameters:
        - $ref: '#/components/parameters/addon_id'
      responses:
        '200':
          $ref: '#/components/responses/BaseSuccessResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /features:
    post:
      tags:
        - Feature
      summary: Create a Feature and optionally associate with one or more event_schemas
      description: Create a Feature optionally associate with one or more event_schemas
      operationId: createFeature
      requestBody:
        $ref: '#/components/requestBodies/CreateFeatureRequest'
      responses:
        '200':
          $ref: '#/components/responses/FeatureResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Feature
      summary: List Feature
      description: Get a list of features along with its associations
      operationId: getFeatures
      parameters:
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
      responses:
        '200':
          $ref: '#/components/responses/FeaturePaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /features/{feature_id}:
    patch:
      tags:
        - Feature
      summary: Update a Feature
      description: |
        Update an existing feature and its eventSchema associations
      operationId: updateFeature
      parameters:
        - $ref: '#/components/parameters/feature_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateFeatureRequest'
      responses:
        '200':
          $ref: '#/components/responses/FeatureResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Feature
      summary: Get a Feature
      description: Get details of a Feature
      operationId: getFeature
      parameters:
        - $ref: '#/components/parameters/feature_id'
      responses:
        '200':
          $ref: '#/components/responses/FeatureResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /settings:
    post:
      tags:
        - Settings
      summary: Create a setting
      description: Create a setting
      operationId: insertSetting
      requestBody:
        $ref: '#/components/requestBodies/CreateSettingRequest'
      responses:
        '201':
          $ref: '#/components/responses/SettingResponse'
        '204':
          $ref: '#/components/responses/SettingResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Settings
      summary: Lists settings
      description: List settings
      operationId: listSetting
      parameters:
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
        - $ref: '#/components/parameters/settings_entity_type'
        - $ref: '#/components/parameters/settings_entity_id'
        - $ref: '#/components/parameters/settings_setting_id'
        - $ref: '#/components/parameters/settings_namespace'
      responses:
        '200':
          $ref: '#/components/responses/SettingPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /settings/{setting_id_str}:
    get:
      tags:
        - Settings
      summary: Get a setting
      description: Get a setting
      operationId: getSetting
      parameters:
        - $ref: '#/components/parameters/settings_full_setting_id'
      responses:
        '200':
          $ref: '#/components/responses/SettingResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    patch:
      tags:
        - Settings
      summary: Update a setting
      description: Update a setting
      operationId: updateSetting
      parameters:
        - $ref: '#/components/parameters/settings_full_setting_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateSettingRequest'
      responses:
        '201':
          $ref: '#/components/responses/SettingResponse'
        '204':
          $ref: '#/components/responses/SettingResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /revenue_calculator:
    post:
      tags:
        - Price Experimentation
      summary: (DEPRECATED) Calculate and return the revenue for a existing or new price plan
      description: Calculate and return the revenue for a existing or new price plan
      operationId: calculateRevenue
      requestBody:
        $ref: '#/components/requestBodies/CalculateRevenueRequest'
      responses:
        '200':
          $ref: '#/components/responses/CalculateRevenueResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /jobs/{job_id}:
    get:
      tags:
        - Jobs
      summary: Get the status of a job
      description: Get the status of a job
      operationId: getJobStatus
      parameters:
        - $ref: '#/components/parameters/job_id'
      responses:
        '200':
          $ref: '#/components/responses/GetJobResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /jobs:
    get:
      tags:
        - Jobs
      summary: List jobs
      description: Returns a list of jobs with pagination and sort.
      operationId: getJobs
      parameters:
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
      responses:
        '200':
          $ref: '#/components/responses/JobsPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /jobs/{job_id}/confirm:
    post:
      tags:
        - Jobs
      summary: Confirm a job
      description: Confirm a job
      operationId: confirmJob
      parameters:
        - $ref: '#/components/parameters/job_id'
      responses:
        '200':
          $ref: '#/components/responses/GetJobResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /jobs/{job_id}/reject:
    post:
      tags:
        - Jobs
      summary: Reject a job
      description: Reject a job
      operationId: rejectJob
      parameters:
        - $ref: '#/components/parameters/job_id'
      responses:
        '200':
          $ref: '#/components/responses/GetJobResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /jobs/{job_id}/entries:
    get:
      tags:
        - Jobs
      summary: List job entries
      description: List individual job entries and current state of processing
      operationId: getJobEntries
      parameters:
        - $ref: '#/components/parameters/job_id'
      responses:
        '200':
          $ref: '#/components/responses/JobEntriesPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /files/{file_id}:
    get:
      tags:
        - File Storage
      summary: Get a file
      description: Get a file
      operationId: getFile
      parameters:
        - $ref: '#/components/parameters/file_id'
      responses:
        '302':
          description: Redirects to the file url
          headers:
            Location:
              schema:
                type: string
                format: uri
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /files/{file_id}/download_url:
    get:
      tags:
        - File Storage
      summary: Get a download url for a file
      description: Get a download url for a file
      operationId: getDownloadUrl
      parameters:
        - $ref: '#/components/parameters/file_id'
        - $ref: '#/components/parameters/expiry_in_sec'
      responses:
        '200':
          $ref: '#/components/responses/FileDownloadUrlResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /alert_templates:
    get:
      tags:
        - Alerts
      summary: List alert templates
      description: Returns a list of alert templates with pagination and sort.
      operationId: getAlertTemplates
      responses:
        '200':
          $ref: '#/components/responses/AlertTemplatesPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /alert_templates/{alert_template_id}:
    get:
      tags:
        - Alerts
      summary: Get an alert template
      description: Get an alert template
      operationId: getAlertTemplate
      parameters:
        - $ref: '#/components/parameters/alert_template_id'
      responses:
        '200':
          $ref: '#/components/responses/AlertTemplateResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /alerts:
    post:
      tags:
        - Alerts
      summary: Create an alert
      description: Create an alert
      operationId: createAlert
      requestBody:
        $ref: '#/components/requestBodies/CreateAlertRequest'
      responses:
        '200':
          $ref: '#/components/responses/AlertResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Alerts
      summary: List alerts
      description: Returns a list of alerts with pagination and sort.
      operationId: listAlerts
      responses:
        '200':
          $ref: '#/components/responses/AlertsPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /alerts/{alert_id}:
    patch:
      tags:
        - Alerts
      summary: Update an alert
      description: Update an alert
      operationId: updateAlert
      parameters:
        - $ref: '#/components/parameters/alert_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateAlertRequest'
      responses:
        '200':
          $ref: '#/components/responses/AlertResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /incidents:
    get:
      tags:
        - Alerts
      summary: List incidents
      description: Returns a list of incidents with pagination and sort.
      operationId: getIncidents
      responses:
        '200':
          $ref: '#/components/responses/IncidentsPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /incidents/{incident_id}:
    get:
      tags:
        - Alerts
      summary: Get an incident
      description: Get an incident
      operationId: getIncident
      parameters:
        - $ref: '#/components/parameters/incident_id'
      responses:
        '200':
          $ref: '#/components/responses/IncidentResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /incidents/{incident_id}/status:
    put:
      tags:
        - Alerts
      summary: Update an incident status
      description: Update an incident status
      operationId: updateIncidentStatus
      parameters:
        - $ref: '#/components/parameters/incident_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateIncidentStatusRequest'
      responses:
        '200':
          $ref: '#/components/responses/IncidentResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /reports:
    get:
      tags:
        - Reports
      summary: List reports
      description: List reports
      operationId: listReports
      parameters:
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
        - $ref: '#/components/parameters/fetch_for'
      responses:
        '200':
          $ref: '#/components/responses/ReportsPaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /portal/token:
    post:
      tags:
        - Customer Portal
      summary: Get delegate token for customer portal
      description: Get delegate token for customer portal
      operationId: getCustomerPortalDelegateToken
      requestBody:
        $ref: '#/components/requestBodies/GetCustomerPortalDelegateTokenRequest'
      responses:
        '200':
          $ref: '#/components/responses/TokenResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/price_plans:
    post:
      tags:
        - PricePlanV2
      summary: Create a price plan
      description: Create a price plan
      operationId: createPricePlanV2
      requestBody:
        $ref: '#/components/requestBodies/CreatePricePlanV2Request'
      responses:
        '200':
          $ref: '#/components/responses/PricePlanV2'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - PricePlanV2
      summary: List price plans
      description: List price plans
      operationId: listPricePlansV2
      parameters:
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
      responses:
        '200':
          $ref: '#/components/responses/PricePlanV2PaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/price_plans/{price_plan_id}:
    get:
      tags:
        - PricePlanV2
      summary: Get a price plan
      description: Get a price plan
      operationId: getPricePlanV2
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
        - $ref: '#/components/parameters/price_plan_version'
      responses:
        '200':
          $ref: '#/components/responses/PricePlanV2'
        default:
          $ref: '#/components/responses/ErrorResponse'
    patch:
      tags:
        - PricePlanV2
      summary: Update a price plan
      description: Update a price plan
      operationId: updatePricePlanV2
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdatePricePlanV2Request'
      responses:
        '200':
          $ref: '#/components/responses/PricePlanV2'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/price_plans/{price_plan_id}/discard:
    delete:
      tags:
        - PricePlanV2
      summary: Discard a price plan
      description: Discard a price plan
      operationId: discardPricePlan
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
      responses:
        '200':
          $ref: '#/components/responses/BaseSuccessResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/price_plans/{price_plan_id}/finalize:
    post:
      tags:
        - PricePlanV2
      summary: Finalize a price plan
      description: Finalize a price plan
      operationId: finalizePricePlan
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
      requestBody:
        $ref: '#/components/requestBodies/FinalizePricePlanRequest'
      responses:
        '200':
          $ref: '#/components/responses/BaseSuccessResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/price_plans/{price_plan_id}/rate_cards:
    post:
      tags:
        - PricePlanV2
      summary: Bulk rate card operations of a price plan
      description: Bulk rate card operations of a price plan
      operationId: bulkPricePlanRateCardOperations
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
      requestBody:
        $ref: '#/components/requestBodies/BulkRateCardOperationsRequest'
      responses:
        '200':
          $ref: '#/components/responses/BulkRateCardOperationsResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - PricePlanV2
      summary: List rate cards of a price plan
      description: List rate cards of a price plan
      operationId: listPricePlanRateCards
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
      responses:
        '200':
          $ref: '#/components/responses/RateCardPaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/price_plans/{price_plan_id}/pricing_rules:
    put:
      tags:
        - PricePlanV2
      summary: Update pricing rules of a price plan
      description: Update pricing rules of a price plan
      operationId: updatePricePlanPricingRules
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdatePricingRulesRequest'
      responses:
        '200':
          $ref: '#/components/responses/PricingRulesPaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - PricePlanV2
      summary: List pricing rules of a price plan
      description: List pricing rules of a price plan
      operationId: listPricePlanPricingRules
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
        - $ref: '#/components/parameters/price_plan_version'
      responses:
        '200':
          $ref: '#/components/responses/PricingRulesPaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/price_plans/{price_plan_id}/errors:
    get:
      tags:
        - PricePlanV2
      summary: Get list of errors of a price plan
      description: Get list of errors of a price plan
      operationId: listPricePlanErrors
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
      responses:
        '200':
          $ref: '#/components/responses/ValidatedEntityErrorsPaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/price_plans/{price_plan_id}/versions:
    get:
      tags:
        - PricePlanV2
      summary: List price plan versions
      description: List price plan versions
      operationId: listPricePlanVersions
      parameters:
        - $ref: '#/components/parameters/price_plan_id'
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
      responses:
        '200':
          $ref: '#/components/responses/PricePlanV2PaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/price_plans/migration:
    post:
      tags:
        - PricePlanV2
      summary: Create a price plan v2 migration
      description: |
        Migrates accounts across price plans. This is an asynchronous process functioning on top of Togai's Jobs 
        framework. Status of the created migrations can be obtained using the [Jobs APIs](https://docs.togai.com/api-reference/jobs/get-the-status-of-a-job)
      operationId: pricePlanMigrationV2
      requestBody:
        $ref: '#/components/requestBodies/CreatePricePlanMigrationRequest'
      responses:
        '201':
          $ref: '#/components/responses/BaseSuccessResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/schedules/{schedule_id}/rate_cards:
    post:
      tags:
        - Schedules
      summary: Bulk rate card operations on a schedule
      description: Bulk rate card operations on a schedule
      operationId: bulkRateCardOperationsOnSchedule
      parameters:
        - $ref: '#/components/parameters/schedule_id'
      requestBody:
        $ref: '#/components/requestBodies/BulkRateCardOperationsRequest'
      responses:
        '200':
          $ref: '#/components/responses/BulkRateCardOperationsResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Schedules
      summary: List rate cards
      description: List rate cards
      operationId: listScheduleRateCards
      parameters:
        - $ref: '#/components/parameters/schedule_id'
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
        - $ref: '#/components/parameters/rate_card_mode'
      responses:
        '200':
          $ref: '#/components/responses/RateCardPaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/accounts/{account_id}/edit_schedules:
    post:
      tags:
        - Schedules
      summary: Bulk edit schedules of an account
      description: Bulk edit schedules of an account
      operationId: bulkEditSchedules
      parameters:
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/discard'
      requestBody:
        $ref: '#/components/requestBodies/EditAccountScheduleRequest'
      responses:
        '200':
          $ref: '#/components/responses/UpdatePricingScheduleResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/accounts/{account_id}/schedules:
    get:
      tags:
        - Schedules
      summary: List pricing schedules of an account
      description: List pricing schedules of an account
      operationId: listaccountSchedules
      parameters:
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/rate_card_mode'
        - $ref: '#/components/parameters/next_token'
        - $ref: '#/components/parameters/page_size'
      responses:
        '200':
          $ref: '#/components/responses/SchedulesPaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/schedules/{schedule_id}/errors:
    get:
      tags:
        - Schedules
      summary: Get list of errors of a acc schedule
      description: Get list of errors of a acc schedule
      operationId: listScheduleErrors
      parameters:
        - $ref: '#/components/parameters/schedule_id'
      responses:
        '200':
          $ref: '#/components/responses/ValidatedEntityErrorsPaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/accounts/{account_id}/discard_schedules:
    delete:
      tags:
        - Schedules
      summary: Discard schedules of an account
      description: Discard schedules of an account
      operationId: discardAccountSchedules
      parameters:
        - $ref: '#/components/parameters/account_id'
      responses:
        '200':
          $ref: '#/components/responses/BaseSuccessResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/accounts/{account_id}/finalize_schedules:
    post:
      tags:
        - Schedules
      summary: Finalize schedules of an account
      description: Finalize schedules of an account
      operationId: finalizeAccountSchedules
      parameters:
        - $ref: '#/components/parameters/account_id'
      requestBody:
        $ref: '#/components/requestBodies/FinalizeAccountSchedules'
      responses:
        '200':
          $ref: '#/components/responses/SchedulesPaginatedResponse'
  /v2/schedules/{schedule_id}/pricing_rules:
    put:
      tags:
        - Schedules
      summary: Update pricing rules of a account schedule
      description: Update pricing rules of a account schedule
      operationId: updatePricingRules
      parameters:
        - $ref: '#/components/parameters/schedule_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdatePricingRulesRequest'
      responses:
        '200':
          $ref: '#/components/responses/PricingRulesPaginatedResponse'
    get:
      tags:
        - Schedules
      summary: List pricing rules of a account schedule
      description: List pricing rules of a account schedule
      operationId: listPricingRules
      parameters:
        - $ref: '#/components/parameters/schedule_id'
        - $ref: '#/components/parameters/rate_card_mode'
      responses:
        '200':
          $ref: '#/components/responses/PricingRulesPaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /v2/revenue_calculator:
    post:
      tags:
        - Price Experimentation
      summary: Calculate and return the revenue for a existing or new price plan v2
      description: Calculate and return the revenue for a existing or new price plan v2
      operationId: calculateRevenueV2
      requestBody:
        $ref: '#/components/requestBodies/CalculateRevenueRequest'
      responses:
        '200':
          $ref: '#/components/responses/CalculateRevenueResponseV2'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /ingest:
    post:
      tags:
        - Event Ingestion
      summary: Ingest events to Togai
      description: |
        This API let’s you to ingest events to your Togai account.
        Events ingested using this API will be processed via associated usage meters and further via associated price plans to generate final billable value to invoice the customer
        Read more about [Event Ingestion](https://docs.togai.com/docs/event-ingestion)
      operationId: ingest
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestEventRequest'
            examples:
              IngestEventRequest:
                $ref: '#/components/examples/IngestEventRequest'
              NamedLicenseEventRequest:
                $ref: '#/components/examples/NamedLicenseEventRequest'
              UsageEventRequest:
                $ref: '#/components/examples/UsageEventRequest'
        description: Request body to ingest events to Togai usage and billing management service.
        required: true
      responses:
        '202':
          description: Successfully accepted to process all the events from payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestEventResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential "x-api-key" is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unable to process the events as the size of the event payload is above the supported limit. Please check our docs for the api limits - https://togai.com/docs/limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service is currently unavailable to process the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /ingestBatch:
    post:
      tags:
        - Event Ingestion
      summary: Ingest events to Togai in batch
      description: |-
        This API let’s you to ingest events in batch upto 500 events.
        Ingest large amounts of events up to 500 in batches in an array using this API.
      operationId: ingestBatch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestBatchEventRequest'
            examples:
              IngestEventBatchRequest:
                $ref: '#/components/examples/IngestEventBatchRequest'
        description: Request body to ingest events in batch to Togai usage and billing management service.
        required: true
      responses:
        '202':
          description: Successfully accepted to process all the events from payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestEventResponse'
              example:
                success: true
        '207':
          description: Partial failure. Few events from request were not accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestEventResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential "x-api-key" is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unable to process the events as the size of the event payload is above the supported limit. Please check our docs for the api limits - https://togai.com/docs/limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service is currently unavailable to process the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /events:
    get:
      tags:
        - Event Management
      summary: Get a list of usage events with multiple query options
      description: This API let’s you to fetch a list of events with multiple query parameters
      parameters:
        - $ref: '#/components/parameters/filter_next_page_token'
        - $ref: '#/components/parameters/filter_status'
        - $ref: '#/components/parameters/filter_account_id'
        - $ref: '#/components/parameters/filter_schema_name'
        - $ref: '#/components/parameters/filter_page_size'
      operationId: getEvents
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventsResponse'
              examples:
                GetEventsResponse:
                  $ref: '#/components/examples/GetEventsResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to list events.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unable to process the query parameters provided. Please check our docs for the api limits - https://togai.io/docs/limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /events/{event_id}:
    get:
      tags:
        - Event Management
      summary: Get an event using event id
      description: Fetch details of a particular event using the event ID.
      operationId: getSingleEvent
      parameters:
        - $ref: '#/components/parameters/event_id'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventResponse'
              examples:
                GetEventResponse:
                  $ref: '#/components/examples/GetEventResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to get events.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /events/correction:
    post:
      tags:
        - Event Management
      summary: Correct an ingested event
      description: |
        #### This API lets you to correct events. Available in both synchronous and asynchronous mode
        - **Usages**: Reduction of all usages associated with this event
        - **Revenue**: Reduction of all revenues associated with this event
        - **Entitlements**: Entitlements(Feature Credits) consumed by this event are granted back to the account.

        ### Possible Actions:
        - UNDO: Undo all usages, revenue and entitlements associated with an event
        - REDO: Performs UNDO and re-ingests the same event
        - REDO_EVENT: Performs UNDO and re-ingests the correction payload of the event
      operationId: eventCorrection
      parameters:
        - $ref: '#/components/parameters/event_correction_action'
        - $ref: '#/components/parameters/require_confirmation'
      requestBody:
        $ref: '#/components/requestBodies/EventCorrectionRequest'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventsCorrectionResponse'
              examples:
                EventsCorrectionResponse:
                  $ref: '#/components/examples/EventsCorrectionResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to get events.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /metrics:
    post:
      tags:
        - Metrics
      summary: Get Togai Metrics
      description: |
        Togai Metrics API allows you to fetch different metrics from Events, Usage Meters and PricePlans with multiple queryable options.
        A single request can query up to five metrics. 
        Single response can contain a maximum of 300 data points.
      operationId: getMetrics
      requestBody:
        $ref: '#/components/requestBodies/GetMetricsRequest'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMetricsResponse'
              examples:
                GetMetricsResponse:
                  $ref: '#/components/examples/GetMetricsResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to get metrics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /license_updates:
    get:
      tags:
        - Licenses
      summary: Get a list of licenses updates
      description: This API let’s you to fetch a list of licenses updates with multiple query parameters
      operationId: getLicenseUpdates
      parameters:
        - $ref: '#/components/parameters/filter_next_page_token'
        - $ref: '#/components/parameters/filter_account_id'
        - $ref: '#/components/parameters/filter_page_size'
        - $ref: '#/components/parameters/filter_license_id'
        - $ref: '#/components/parameters/filter_effective_from'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLicenseUpdatesResponse'
              examples:
                GetLicenseUpdatesResponse:
                  $ref: '#/components/examples/GetLicenseUpdatesResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to list licenses updates.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unable to process the query parameters provided. Please check our docs for the api limits - https://togai.io/docs/limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    post:
      tags:
        - Licenses
      summary: Update a license entry
      description: This API let’s you to add a license entry
      operationId: addLicenseUpdateEntry
      requestBody:
        $ref: '#/components/requestBodies/LicenseUpdateRequest'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseUpdateResponse'
              examples:
                LicenseUpdateResponse:
                  $ref: '#/components/examples/LicenseUpdateResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to add a license entry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unable to process the query parameters provided. Please check our docs for the api limits - https://togai.io/docs/limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /license_updates/{license_id}:
    patch:
      tags:
        - Licenses
      summary: Update a license entry details
      description: This API let’s you to update metadata of a license entry
      operationId: updateLicenseEntryDetails
      parameters:
        - $ref: '#/components/parameters/filter_license_id'
      requestBody:
        $ref: '#/components/requestBodies/LicenseEntryDetailsUpdateRequest'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseUpdateResponse'
              examples:
                LicenseUpdateResponse:
                  $ref: '#/components/examples/LicenseUpdateResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to update a license entry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /named_license_updates:
    get:
      tags:
        - Licenses
      summary: Get a list of named licenses updates
      description: This API let’s you to fetch a list of named licenses updates with multiple query parameters
      operationId: getNamedLicenseUpdates
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NamedLicenseUpdatesPaginatedResponse'
              examples:
                NamedLicenseUpdatesPaginatedResponse:
                  $ref: '#/components/examples/NamedLicenseUpdatesPaginatedResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /entitled:
    post:
      tags:
        - Entitlements
      summary: Ingest event if a user is entitled to a feature
      description: This API let’s you to ingest an event if a user is entitled to a feature
      operationId: ingestEntitledEvent
      requestBody:
        $ref: '#/components/requestBodies/IngestEventRequest'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseSuccessResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to add a license entry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Duplicate Id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unable to process the query parameters provided. Please check our docs for the api limits - https://togai.io/docs/limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/features/{feature_id}/entries:
    get:
      tags:
        - Entitlements
      summary: List feature credits entries of a feature for an account
      description: This API let’s you to list the feature credits entries of a feature for an account
      operationId: listFeatureCreditEntries
      parameters:
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/feature_id'
        - $ref: '#/components/parameters/filter_page_size'
        - $ref: '#/components/parameters/filter_next_page_token'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetFeatureCreditEntriesPaginatedResponse'
              examples:
                GetFeatureCreditEntriesPaginatedResponse:
                  $ref: '#/components/examples/GetFeatureCreditEntriesPaginatedResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to add a license entry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unable to process the query parameters provided. Please check our docs for the api limits - https://togai.io/docs/limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/features/{feature_id}/entries/{entry_id}:
    patch:
      tags:
        - Entitlements
      summary: Update a feature credits entry
      description: |
        #### This API let's you to update the following attributes: `effectiveUntil` and `granted`

        - **effectiveUntil**: must be in future
        - **granted**: must be greater than the existing usage (previous granted - current balance)
      operationId: UpdateFeatureCreditEntry
      parameters:
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/feature_id'
        - $ref: '#/components/parameters/entry_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateFeatureCreditsRequest'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeatureCreditEntry'
              examples:
                FeatureCreditEntry:
                  $ref: '#/components/examples/FeatureCreditEntry'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to update a feature credit entry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Entry not found. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/features/{feature_id}/entries/{entry_id}/void:
    post:
      tags:
        - Entitlements
      summary: Void a feature credits entry of a feature for an account
      description: This API let’s you to void the feature credits entries of a feature for an account
      operationId: VoidFeatureCreditEntry
      parameters:
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/feature_id'
        - $ref: '#/components/parameters/entry_id'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseSuccessResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to void a feature credit entry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Entry not found. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/features/{feature_id}:
    get:
      tags:
        - Entitlements
      summary: Get Feature credits balance
      description: This API let’s you to get the feature credits balance
      operationId: getFeatureCredits
      parameters:
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/feature_id'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetFeatureCreditsResponse'
              examples:
                GetFeatureCreditsResponse:
                  $ref: '#/components/examples/GetFeatureCreditsResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to add a license entry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unable to process the query parameters provided. Please check our docs for the api limits - https://togai.io/docs/limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/entitlements/{feature_id}:
    get:
      tags:
        - Entitlements
      summary: Get entitlement value for a account
      description: This API let’s you to get the entitlement value for a account
      operationId: getEntitlementValue
      parameters:
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/feature_id'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEntitlementValuesResponse'
              examples:
                GetEntitlementValuesResponse:
                  $ref: '#/components/examples/GetEntitlementValuesResponse'
    post:
      tags:
        - Entitlements
      summary: Check entitlement value for a account
      description: This API let’s you to validate the entitlement value for a account
      operationId: validateEntitlementValue
      parameters:
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/feature_id'
      requestBody:
        $ref: '#/components/requestBodies/ValidateEntitlementValueRequest'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseSuccessResponse'
  /accounts/{account_id}/entitlements:
    get:
      tags:
        - Entitlements
      summary: Get entitlements for a account
      description: This API let’s you to get the entitlements for a account
      operationId: getEntitlements
      parameters:
        - $ref: '#/components/parameters/account_id'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEntitlementValuesResponse'
              examples:
                GetEntitlementValuesResponse:
                  $ref: '#/components/examples/GetEntitlementValuesResponse'
  /invoices:
    get:
      tags:
        - Invoices
      summary: List invoices
      description: List invoices
      operationId: listInvoices
      parameters:
        - $ref: '#/components/parameters/filter_next_page_token'
        - $ref: '#/components/parameters/filter_status'
        - $ref: '#/components/parameters/filter_owner_id'
        - $ref: '#/components/parameters/filter_customer_id'
        - $ref: '#/components/parameters/filter_page_size'
        - $ref: '#/components/parameters/filter_start_time'
        - $ref: '#/components/parameters/filter_end_time'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListInvoicesResponse'
              examples:
                ListInvoicesResponse:
                  $ref: '#/components/examples/ListInvoicesResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Credential is not valid. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unable to process the query parameters provided. Please check our docs for the api limits - https://togai.io/docs/limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request throttled. Please check the response message on the failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    post:
      tags:
        - Invoices
      summary: Create a custom invoice for an account
      description: Create a custom invoice for an account.
      operationId: createCustomInvoice
      requestBody:
        $ref: '#/components/requestBodies/CreateCustomInvoiceRequest'
      responses:
        '201':
          $ref: '#/components/responses/InvoiceResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /invoices/{invoice_id}:
    get:
      tags:
        - Invoices
      summary: Get an invoice
      description: Get invoice
      operationId: getInvoice
      parameters:
        - $ref: '#/components/parameters/invoice_id'
      responses:
        '200':
          $ref: '#/components/responses/InvoiceResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    patch:
      tags:
        - Invoices
      summary: Update an invoice
      description: Update an invoice[Only CUSTOM invoices in DRAFT state support updating of all fields]. Updating status can be done for all invoice.
      operationId: updateInvoice
      parameters:
        - $ref: '#/components/parameters/invoice_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateInvoiceRequest'
      responses:
        '200':
          $ref: '#/components/responses/InvoiceResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    delete:
      tags:
        - Invoices
      summary: Delete a custom invoice in DRAFT state
      description: Delete a custom invoice in DRAFT state.
      operationId: deleteCustomInvoice
      parameters:
        - $ref: '#/components/parameters/invoice_id'
      responses:
        '200':
          $ref: '#/components/responses/BaseSuccessResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /invoices/bill_runs:
    post:
      tags:
        - Invoices
      summary: Create a bill run job request
      description: Create a bill run job request
      operationId: createInvoiceBillRun
      parameters:
        - $ref: '#/components/parameters/require_confirmation'
      responses:
        '200':
          $ref: '#/components/responses/BaseSuccessResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    get:
      tags:
        - Invoices
      summary: List invoices eligible for bill run
      description: List invoices eligible for bill run
      operationId: listInvoicesForBillRun
      parameters:
        - $ref: '#/components/parameters/filter_next_page_token'
        - $ref: '#/components/parameters/filter_status'
        - $ref: '#/components/parameters/filter_owner_id'
        - $ref: '#/components/parameters/filter_customer_id'
        - $ref: '#/components/parameters/filter_page_size'
        - $ref: '#/components/parameters/filter_start_time'
        - $ref: '#/components/parameters/filter_end_time'
      responses:
        '200':
          $ref: '#/components/responses/ListInvoicesResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /invoices/{invoice_id}/miscellaneous_charges:
    put:
      tags:
        - Invoices
      summary: Add or update miscellaneous charges in Invoice
      description: Add or update miscellaneous charges in Invoice
      operationId: manageMiscellaneousChargesInInvoice
      parameters:
        - $ref: '#/components/parameters/invoice_id'
      requestBody:
        $ref: '#/components/requestBodies/ManageMiscellaneousChargesRequest'
      responses:
        '200':
          $ref: '#/components/responses/MiscellaneousChargesResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/miscellaneous_charges:
    put:
      tags:
        - Invoices
      summary: Add or update miscellaneous charges in upcoming Invoice for a account
      description: Add or update miscellaneous charges in upcoming Invoice for a account
      operationId: manageMiscellaneousChargesInAccount
      parameters:
        - $ref: '#/components/parameters/account_id'
      requestBody:
        $ref: '#/components/requestBodies/ManageMiscellaneousChargesRequest'
      responses:
        '200':
          $ref: '#/components/responses/MiscellaneousChargesResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /invoice/{invoice_id}/pricing_rules_logs:
    get:
      tags:
        - Invoices
      summary: List pricing rule logs
      description: List pricing rule logs
      operationId: listPricingRuleLogs
      parameters:
        - $ref: '#/components/parameters/invoice_id'
      responses:
        '200':
          $ref: '#/components/responses/PricingRulesLogsPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /credits:
    get:
      tags:
        - Credits
      summary: List credits
      description: Get all credits
      operationId: listCredits
      parameters:
        - $ref: '#/components/parameters/filter_next_page_token'
        - $ref: '#/components/parameters/filter_status'
        - $ref: '#/components/parameters/filter_account_id'
        - $ref: '#/components/parameters/filter_credit_id'
        - $ref: '#/components/parameters/filter_page_size'
      responses:
        '200':
          $ref: '#/components/responses/ListCreditsResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    post:
      tags:
        - Credits
      summary: Grant credit
      description: Grant credit
      operationId: createCredit
      requestBody:
        $ref: '#/components/requestBodies/CreateCreditRequest'
      responses:
        '200':
          $ref: '#/components/responses/CreateCreditResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /credits/{credit_id}:
    get:
      tags:
        - Credits
      summary: Get credit details
      description: Get credit details
      operationId: getCreditDetails
      parameters:
        - $ref: '#/components/parameters/credit_id'
      responses:
        '200':
          $ref: '#/components/responses/CreditDetailsResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /credits/{credit_id}/void:
    post:
      tags:
        - Credits
      summary: Void credit
      description: Void credit
      operationId: voidCredit
      parameters:
        - $ref: '#/components/parameters/credit_id'
      responses:
        '200':
          $ref: '#/components/responses/VoidCreditResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/credit_balance:
    get:
      tags:
        - Credits
      summary: Credit balance for Account
      description: Credit balance for Account
      operationId: CreditBalanceForAccount
      parameters:
        - $ref: '#/components/parameters/account_id'
      responses:
        '200':
          $ref: '#/components/responses/CreditBalanceResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/wallet_topup:
    post:
      tags:
        - Wallet
      summary: Top-up wallet for an account
      description: Top-up wallet for an account
      operationId: topUpWalletForAccount
      parameters:
        - $ref: '#/components/parameters/account_id'
      requestBody:
        $ref: '#/components/requestBodies/TopupWalletRequest'
      responses:
        '200':
          $ref: '#/components/responses/WalletBalanceResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/wallet:
    get:
      tags:
        - Wallet
      summary: Wallet balance for Account
      description: Wallet balance for Account
      operationId: WalletBalanceForAccount
      parameters:
        - $ref: '#/components/parameters/account_id'
      responses:
        '200':
          $ref: '#/components/responses/WalletBalanceResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    patch:
      tags:
        - Wallet
      summary: Update wallet details for an account
      description: Update wallet details for an account
      operationId: updateWalletForAccount
      parameters:
        - $ref: '#/components/parameters/account_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateWalletRequest'
      responses:
        '200':
          $ref: '#/components/responses/WalletBalanceResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /accounts/{account_id}/wallet/entries:
    get:
      tags:
        - Wallet
      summary: Wallet entries for Account
      description: Wallet entries for Account
      operationId: WalletEntriesForAccount
      parameters:
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/filter_next_page_token'
        - $ref: '#/components/parameters/filter_page_size'
      responses:
        '200':
          $ref: '#/components/responses/WalletEntriesPaginatedResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /payments:
    get:
      tags:
        - Payments
      summary: List all payments
      description: List all payments
      operationId: listPayments
      parameters:
        - $ref: '#/components/parameters/filter_next_page_token'
        - $ref: '#/components/parameters/filter_page_size'
      responses:
        '200':
          $ref: '#/components/responses/ListPaymentResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
    post:
      tags:
        - Payments
      summary: create payments
      description: create payments
      operationId: createPayments
      requestBody:
        $ref: '#/components/requestBodies/CreatePaymentRequest'
      responses:
        '201':
          $ref: '#/components/responses/PaymentResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /payments/{payment_id}:
    get:
      tags:
        - Payments
      summary: Get a payment
      description: Get payment
      operationId: getPayment
      parameters:
        - $ref: '#/components/parameters/payment_id'
        - $ref: '#/components/parameters/version'
      responses:
        '200':
          $ref: '#/components/responses/PaymentResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
  /authenticate:
    post:
      tags:
        - Authentication
      summary: Generate short lived bearer token
      description: |
        Generates and returns a bearer token. Behavior of this API differs on the basis of the auth mechanism used to make the request.
          - For API key auth, this API generates a JWT token whcih is valid for 24 hours and returns it.
          - For JWT bearer auth, returns the same JWT token in response
        For information on how to generate API token, refer [Generating New API Keys](https://docs.togai.com/api-reference/authentication#generating-new-api-keys) section of docs.
      operationId: authenticate
      responses:
        '200':
          $ref: '#/components/responses/TokenResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateCustomerRequest:
      description: Payload to create customer
      type: object
      additionalProperties: false
      required:
        - name
        - id
        - primaryEmail
        - address
      properties:
        id:
          description: Customer identifier
          type: string
          maxLength: 50
          example: 01BX5ZZKBKACTAV9WEVGEMMVRZ
        name:
          description: Name of the Customer
          type: string
          maxLength: 255
          minLength: 3
          example: ACME Enterprise
        primaryEmail:
          description: Primary email of the customer
          type: string
          maxLength: 320
          example: admin@example.com
        address:
          $ref: '#/components/schemas/Address'
        settings:
          type: array
          maxItems: 10
          minItems: 0
          items:
            $ref: '#/components/schemas/CreateEntitySetting'
        account:
          $ref: '#/components/schemas/CreateAccountRequestWithoutCustomerId'
    CreateCustomerContactRequest:
      description: Payload to create a contact for a customer
      type: object
      additionalProperties: false
      required:
        - name
        - email
      properties:
        preferredUsername:
          type: string
          maxLength: 50
          pattern: ^[A-Za-z0-9]{3,50}$
        name:
          type: string
          maxLength: 50
        password:
          type: string
          maxLength: 100
        email:
          type: string
          maxLength: 320
          pattern: ^\S+@\S+\.\S+$
        phone:
          type: string
          maxLength: 30
        verified:
          type: boolean
        loginAccess:
          type: boolean
          default: false
    UpdateCustomerRequest:
      description: Payload to update customer
      type: object
      additionalProperties: false
      properties:
        name:
          description: Name of the Customer
          type: string
          maxLength: 255
          minLength: 3
          example: ACME Enterprise
        primaryEmail:
          description: Primary email of the customer
          type: string
          maxLength: 320
          example: admin@example.com
        address:
          $ref: '#/components/schemas/Address'
    CreateAccountRequestWithoutCustomerId:
      description: Payload to create account
      type: object
      additionalProperties: false
      required:
        - name
        - id
      properties:
        id:
          description: Identifier of the account
          type: string
          maxLength: 50
          example: ACC00001
        name:
          description: Name of the Account
          type: string
          maxLength: 255
          minLength: 3
          example: Primary Account
        invoiceCurrency:
          description: |
            Use [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in which the account must be invoiced.  
            For example: AED is the currency code for United Arab Emirates dirham.
          type: string
          minLength: 3
          maxLength: 3
        aliases:
          description: Aliases are tags that are associated with an account. Multiple aliases are allowed for a single account.
          type: array
          maxItems: 10
          minItems: 0
          items:
            type: string
            maxLength: 50
            minLength: 3
          example: acme_primary
        accountAliases:
          description: Aliases which effective range
          type: array
          items:
            $ref: '#/components/schemas/CreateAccountAliasRequest'
        address:
          $ref: '#/components/schemas/Address'
        primaryEmail:
          description: Primary email of the account
          type: string
          maxLength: 320
          example: admin@example.com
        billingInformation:
          $ref: '#/components/schemas/AccountsBillingInformation'
        settings:
          type: array
          maxItems: 10
          minItems: 0
          items:
            $ref: '#/components/schemas/CreateEntitySetting'
        netTermDays:
          description: Net term for the invoices of the account
          type: integer
          format: int32
          example: 45
        metadata:
          description: |
            Additional information associated with the account.
            Example: GSTN, VATN
          type: object
          additionalProperties:
            type: string
        tags:
          description: Tag for accounts are stored in lowercase
          type: array
          uniqueItems: true
          items:
            type: string
        status:
          description: Status of the created account defaults to ACTIVE
          type: string
          enum:
            - ACTIVE
            - DRAFT
    CreateAccountRequest:
      description: Payload to create account
      allOf:
        - $ref: '#/components/schemas/CreateAccountRequestWithoutCustomerId'
        - type: object
          required:
            - customerId
          properties:
            customerId:
              description: Customer Identifier for whom the account is being created
              type: string
              maxLength: 255
              minLength: 1
              example: C1234ewf
    UpdateAccountRequest:
      description: Payload to update account
      type: object
      additionalProperties: false
      properties:
        name:
          description: Name of the Account
          type: string
          maxLength: 255
          minLength: 3
          example: ACME Enterprise
        status:
          type: string
          enum:
            - ACTIVE
            - DRAFT
        invoiceCurrency:
          description: |
            [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency in which the account must be invoiced
            Defaults to Base currency.
          type: string
          minLength: 3
          maxLength: 3
          example: USD
        netTermDays:
          type: integer
          format: int32
        primaryEmail:
          description: Primary email of the account
          type: string
          maxLength: 320
          example: admin@example.com
        billingInformation:
          $ref: '#/components/schemas/AccountsBillingInformation'
        address:
          $ref: '#/components/schemas/Address'
        metadata:
          description: |
            Additional information associated with the account.
            Example: GSTN, VATN
            NOTE: This replaces the existing metadata if the metadata in the request is not null. 
            To remove all existing metadata, use empty object
          type: object
          additionalProperties:
            type: string
        tags:
          description: Tag for accounts are stored in lowercase
          type: array
          uniqueItems: true
          items:
            type: string
    AccountAlias:
      description: Account Alias
      type: object
      additionalProperties: false
      required:
        - id
        - value
        - effectiveFrom
        - effectiveUntil
        - createdAt
      properties:
        id:
          description: Alias identifier (UUID)
          type: string
        value:
          description: Alias value
          type: string
          maxLength: 50
          minLength: 3
        effectiveFrom:
          description: Effective from date
          type: string
          format: date-time
        effectiveUntil:
          description: Effective until date
          type: string
          format: date-time
        createdAt:
          description: Alias creation date
          type: string
          format: date-time
        updatedAt:
          description: Alias update date
          type: string
          format: date-time
    AccountAliasesPaginatedResponse:
      description: Paginated response for account aliases
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AccountAlias'
        nextToken:
          type: string
          example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
    CreateAccountAliasRequest:
      description: An alternative account identifier for event ingestion with a defined effective duration.
      type: object
      additionalProperties: false
      required:
        - value
      properties:
        value:
          type: string
          maxLength: 50
          minLength: 1
        effectiveFrom:
          type: string
          format: date-time
          description: Effective from date, if not provided, it will be set to -infinity
        effectiveUntil:
          type: string
          format: date-time
          description: Effective until date, if not provided, it will be set to +infinity
    AddAccountAliasesRequest:
      description: Payload to add aliases from account
      type: object
      additionalProperties: false
      properties:
        aliases:
          description: List of aliases to add
          type: array
          maxItems: 10
          minItems: 1
          items:
            type: string
            maxLength: 50
            minLength: 3
        accountAliases:
          description: List of account aliases to add
          type: array
          maxItems: 10
          minItems: 1
          items:
            $ref: '#/components/schemas/CreateAccountAliasRequest'
    RemoveAccountAliasesRequest:
      description: Payload to remove account aliases
      type: object
      additionalProperties: false
      properties:
        aliases:
          type: array
          items:
            type: string
        accountAliases:
          type: array
          items:
            title: RemoveAccountAliasRequest
            type: object
            additionalProperties: false
            required:
              - id
            properties:
              id:
                type: string
                description: Alias identifier (UUID)
              from:
                type: string
                format: date-time
                description: Alias will be deleted from this date, If not provided, it will be deleted from now
    CreateEventSchemaRequest:
      description: Request to create event schema
      type: object
      additionalProperties: false
      required:
        - name
        - attributes
        - dimensions
      properties:
        name:
          description: Name of the event. Must be unique for an organization.
          type: string
          maxLength: 50
          pattern: ^[\sa-zA-Z0-9_-]*$
        description:
          description: Description of the event
          type: string
          maxLength: 255
        attributes:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/EventAttributeSchema'
        dimensions:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/DimensionsSchema'
        enrichments:
          $ref: '#/components/schemas/Enrichments'
        filterFields:
          type: array
          uniqueItems: true
          items:
            type: string
          description: List of fields that can be used for filtering in usage meter
        eventIdTemplate:
          description: Template used to generate event id based on event payload
          type: string
    UpdateEventSchemaRequest:
      description: Request to update event schema
      type: object
      additionalProperties: false
      properties:
        description:
          description: Description of the event
          type: string
          maxLength: 255
        attributes:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/EventAttributeSchema'
        dimensions:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/DimensionsSchema'
        enrichments:
          $ref: '#/components/schemas/Enrichments'
        filterFields:
          type: array
          uniqueItems: true
          items:
            type: string
          description: List of fields that can be used for filtering in usage meter
        eventIdTemplate:
          description: Template used to generate event id based on event payload
          type: string
    UsageMeterFilterEntry:
      description: Filter entry with field and value
      type: object
      required:
        - field
        - value
      properties:
        field:
          type: string
        value:
          type: string
    CreateUsageMeterRequest:
      description: Request to create usage meter
      type: object
      additionalProperties: false
      required:
        - name
        - type
        - aggregation
      properties:
        name:
          description: Name of the usage meter. Must be unique for an organization.
          type: string
          maxLength: 50
          pattern: ^[\sa-zA-Z0-9_-]*$
        billableName:
          description: Billable name of usage meter. Billable name takes precedence over name to display in invoice.
          type: string
          maxLength: 255
        description:
          description: Description of the usage meter
          type: string
          maxLength: 255
        filters:
          description: The usage meter's applicability will be determined by comparing the filter condition agianst the events.
          type: array
          items:
            $ref: '#/components/schemas/UsageMeterFilterEntry'
        type:
          description: Type of usage meter
          type: string
          enum:
            - COUNTER
        aggregation:
          $ref: '#/components/schemas/UsageMeterAggregation'
        computations:
          type: array
          items:
            $ref: '#/components/schemas/Computation'
        eventSchemaName:
          description: Event Schema Identifier
          type: string
    UpdateUsageMeterRequest:
      description: Request to update usage meter
      type: object
      additionalProperties: false
      properties:
        name:
          description: Name of usage meter.
          type: string
          maxLength: 255
        billableName:
          description: Billable name of usage meter. Billable name takes precedence over name to display in invoice.
          type: string
          maxLength: 255
        description:
          description: Description of the usage meter
          type: string
          maxLength: 255
        eventSchemaName:
          description: Event Schema Identifier
          type: string
        type:
          description: |
            Type of usage meter
            * COUNTER - Count usage
          type: string
          enum:
            - COUNTER
          example: COUNTER
        aggregation:
          $ref: '#/components/schemas/UsageMeterAggregation'
        computations:
          type: array
          items:
            $ref: '#/components/schemas/Computation'
        filters:
          type: array
          items:
            $ref: '#/components/schemas/UsageMeterFilterEntry'
    CreatePricePlanRequest:
      description: Request to create a price plan
      type: object
      additionalProperties: false
      required:
        - name
        - pricePlanDetails
      properties:
        name:
          type: string
          description: Name of the price plan
          maxLength: 50
        description:
          description: Description of price plan
          type: string
          maxLength: 255
        type:
          $ref: '#/components/schemas/PricePlanType'
        pricePlanDetails:
          $ref: '#/components/schemas/CreatePricePlanDetails'
        pricingRules:
          type: array
          items:
            $ref: '#/components/schemas/CreatePricingRule'
    BulkRateCardOperationsRequest:
      description: Bulk rate card operations for price plan
      type: object
      required:
        - operations
      properties:
        operations:
          type: array
          items:
            $ref: '#/components/schemas/RateCardOperation'
    BulkRateCardOperationsResponse:
      description: Bulk rate card operations response
      type: object
      required:
        - rateCards
      properties:
        rateCards:
          type: array
          items:
            $ref: '#/components/schemas/RateCard'
    RateCardOperation:
      description: Rate card operation
      type: object
      required:
        - actionType
        - rateCardName
      properties:
        actionType:
          description: Operation type
          type: string
          enum:
            - CREATE
            - UPDATE
            - DELETE
        rateCardName:
          type: string
          description: Required for UPDATE and DELETE operations
          maxLength: 50
        rateCard:
          $ref: '#/components/schemas/RateCardData'
    CreatePricePlanV2Request:
      description: Request to create a price plan
      type: object
      additionalProperties: false
      required:
        - name
        - type
        - supportedCurrencies
      properties:
        name:
          type: string
          description: Name of the price plan
          maxLength: 50
        description:
          description: Description of price plan
          type: string
          maxLength: 255
        type:
          $ref: '#/components/schemas/PricePlanType'
        pricingCycleConfig:
          $ref: '#/components/schemas/PricingCycleConfig'
        supportedCurrencies:
          description: List of currencies supported by the price plan
          type: array
          uniqueItems: true
          items:
            type: string
        deferredRevenue:
          description: |
            This option can be enabled while creating a price plan to opt for deferred revenue finalization.
            i.e, Togai will assume that the price plan may change any time during the pricing cycle and 
            thereby does not compute the revenue in near-real time. 
            This gives the flexibility of editing rate cards in price plan from beginning of the pricing cycle.
            Enabling this mode comes with the following limitations.
            1. Following rate cards are not supported under a `deferredRevenue` plan
                * creditGrantRateCards,
                * billingEntitlementRateCards,
                * entitlementOverageRateCards,
                * IN_ADVANCE fixedFeeRateCards,
                * IN_ADVANCE licenseRateCards
            2. Metrics API return revenue metrics only after the grace period of the account's pricing cycle 
            (i.e, only once the invoice becomes DUE)
          type: boolean
        allowOngoingCycleUpdates:
          description: |
            Allow changes to price plan from the beginning of the ongoing cycle.
          type: boolean
    UpdatePricePlanV2Request:
      description: Request to update a price plan
      type: object
      additionalProperties: false
      properties:
        description:
          description: Description of price plan
          type: string
          maxLength: 255
        pricingCycleConfig:
          $ref: '#/components/schemas/PricingCycleConfig'
        supportedCurrencies:
          description: List of currencies supported by the price plan
          type: array
          uniqueItems: true
          items:
            type: string
    PricePlanV2:
      allOf:
        - $ref: '#/components/schemas/CreatePricePlanV2Request'
        - type: object
          required:
            - id
            - referenceId
            - version
            - status
            - createdAt
            - updatedAt
          properties:
            id:
              type: string
              maxLength: 50
            referenceId:
              type: string
              maxLength: 50
            version:
              type: integer
            status:
              type: string
              enum:
                - DRAFT
                - ACTIVE
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
    PricePlanV2PaginatedResponse:
      description: Paginated response for price plan
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PricePlanV2'
        nextToken:
          type: string
    RateCardPaginatedResponse:
      description: Paginated response for rate card
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/RateCard'
        nextToken:
          type: string
    CreatePricePlanDetails:
      type: object
      additionalProperties: false
      required:
        - supportedCurrencies
      properties:
        pricingCycleConfig:
          $ref: '#/components/schemas/PricingCycleConfig'
        supportedCurrencies:
          description: List of currencies supported by the price plan
          type: array
          uniqueItems: true
          items:
            type: string
        usageRateCards:
          description: List of usage rate cards
          type: array
          items:
            $ref: '#/components/schemas/UsageRateCard'
        fixedFeeRateCards:
          type: array
          items:
            $ref: '#/components/schemas/FixedFeeRateCard'
        licenseRateCards:
          type: array
          items:
            $ref: '#/components/schemas/LicenseRateCard'
        billingEntitlementRateCards:
          type: array
          items:
            $ref: '#/components/schemas/BillingEntitlementRateCard'
        minimumCommitment:
          $ref: '#/components/schemas/MinimumCommitment'
        creditGrantRateCards:
          type: array
          items:
            $ref: '#/components/schemas/CreditGrantRateCard'
        entitlementOverageRateCards:
          type: array
          items:
            $ref: '#/components/schemas/EntitlementOverageRateCard'
        deferredRevenue:
          description: |
            This option can be enabled while creating a price plan to opt for deferred revenue finalization.
            i.e, Togai will assume that the price plan may change any time during the pricing cycle and 
            thereby does not compute the revenue in near-real time. 
            This gives the flexibility of editing rate cards in price plan from beginning of the pricing cycle.
            Enabling this mode comes with the following limitations.
            1. Following rate cards are not supported under a `deferredRevenue` plan
                * creditGrantRateCards,
                * billingEntitlementRateCards,
                * entitlementOverageRateCards,
                * IN_ADVANCE fixedFeeRateCards,
                * IN_ADVANCE licenseRateCards
            2. Metrics API return revenue metrics only after the grace period of the account's pricing cycle 
            (i.e, only once the invoice becomes DUE)
          type: boolean
        allow_ongoing_cycle_updates:
          description: |
            Allow changes to price plan from the beginning of the ongoing cycle.
          type: boolean
    CreatePricingRule:
      type: object
      additionalProperties: false
      required:
        - order
        - name
        - computation
        - action
      properties:
        name:
          description: Name of the pricing rule
          type: string
        order:
          description: Order of the pricing rule
          type: integer
          format: int32
        invoiceTiming:
          $ref: '#/components/schemas/PricingRuleTiming'
        condition:
          description: JSON logic condition deciding whether to compute this pricing rule or not
          type: string
        computation:
          description: JSON logic to be computed
          type: string
        action:
          $ref: '#/components/schemas/PricingRuleAction'
    UpdatePricePlanRequest:
      allOf:
        - $ref: '#/components/schemas/FinalizePricePlanRequest'
        - description: Request to update a price plan
          type: object
          additionalProperties: false
          properties:
            description:
              description: Description of price plan
              type: string
              maxLength: 255
            pricePlanDetails:
              $ref: '#/components/schemas/CreatePricePlanDetailsOverride'
            pricingRules:
              type: array
              items:
                $ref: '#/components/schemas/CreatePricingRule'
    MigrationMode:
      type: string
      enum:
        - IMMEDIATE
        - IMMEDIATE_IGNORE_OVERRIDE
        - NEXT_CYCLE
        - NEXT_CYCLE_IGNORE_OVERRIDE
        - NONE
        - START_OF_CURRENT_CYCLE
    VersionsToMigrate:
      type: string
      enum:
        - LATEST_VERSION
        - ALL_VERSION
    FinalizePricePlanRequest:
      description: Request to finalize a price plan version
      type: object
      additionalProperties: false
      properties:
        migrationMode:
          $ref: '#/components/schemas/MigrationMode'
        versionsToMigrate:
          $ref: '#/components/schemas/VersionsToMigrate'
    ActivatePricePlanRequest:
      description: Request to activate currencies of a price plan
      type: object
      additionalProperties: false
      required:
        - currencies
      properties:
        currencies:
          description: List of currencies to activate
          type: array
          uniqueItems: true
          items:
            type: string
            minLength: 1
    CalculateRevenueRequest:
      description: Request to get revenue details
      type: object
      additionalProperties: false
      required:
        - currencyConfig
        - pricePlanDetailsConfig
        - usageConfig
        - licenseEntriesConfig
      properties:
        currencyConfig:
          title: CurrencyConfig
          description: Configuration for getting the currency
          type: object
          required:
            - mode
          properties:
            mode:
              type: string
              enum:
                - CUSTOM
                - ACCOUNT_INVOICE
              description: |
                Mode to get the currency
                - CUSTOM: Use the currency provided in the request
                - ACCOUNT_INVOICE: Use the invoice currency of the given account
            currency:
              description: Currency to be used, this will be considered if mode is CUSTOM
              type: string
              minLength: 1
            accountId:
              description: Id of the account of which invoice currency will be used, this will be considered if mode is ACCOUNT_INVOICE
              type: string
        pricePlanDetailsConfig:
          title: PricePlanDetailsConfig
          description: Configuration for getting the usage rate card
          type: object
          required:
            - mode
          properties:
            mode:
              type: string
              enum:
                - CUSTOM
                - PRICE_PLAN
                - ACCOUNT
              description: |
                Mode to get the usage rate card
                - CUSTOM: Use the price plan details provided in the request
                - PRICE_PLAN: Use the usage rate cards of the given price plan
                - ACCOUNT: Use the usage rate cards of a associated price plan of the given account
            pricePlanDetails:
              $ref: '#/components/schemas/CreatePricePlanDetails'
            pricePlanId:
              description: Id of the price plan, this will be considered if mode is PRICE_PLAN
              type: string
              minLength: 1
            accountId:
              description: Id of the account, this will be considered if mode is ACCOUNT
              type: string
              minLength: 1
            effectiveOn:
              description: Will be used for getting the usage rate card, only used if mode is ACCOUNT or PRICE_PLAN
              type: string
              format: date-time
            pricingCycleOrdinal:
              description: nth cycle, will be used to calculate revenue for the particular cycle, only used if mode is CUSTOM or PRICE_PLAN
              type: integer
        usageConfig:
          title: UsageConfig
          description: Configuration for getting the usage
          type: object
          required:
            - mode
          properties:
            mode:
              type: string
              enum:
                - CUSTOM
                - LOOKUP_RANGE
                - LOOKUP_CYCLE
              description: |
                Mode to get the usage for the usage meters
                - CUSTOM: Use the usages provided in the request
                - LOOKUP_RANGE: Use the usage of a given account for the specified range
                - LOOKUP_CYCLE: Use the usage of a given account for the specified cycle
            usageMap:
              description: Map of usage meter id and usage, this will be considered if mode is CUSTOM
              type: object
              additionalProperties:
                type: number
            lookupRange:
              description: Range of usage to be looked up, this will be considered if mode is LOOKUP_RANGE
              type: object
              required:
                - start
                - end
                - accountId
              properties:
                start:
                  type: string
                  format: date-time
                end:
                  type: string
                  format: date-time
                accountId:
                  type: string
                  minLength: 1
            lookupCycle:
              description: Cycle of usage to be looked up, this will be considered if mode is LOOKUP_CYCLE
              type: object
              required:
                - accountId
              properties:
                cycleEffectiveOn:
                  type: string
                  format: date-time
                accountId:
                  type: string
                  minLength: 1
        licenseEntriesConfig:
          title: LicenseEntriesConfig
          description: Configuration for getting the license entries
          type: object
          required:
            - mode
          properties:
            mode:
              type: string
              enum:
                - CUSTOM
                - LOOKUP_RANGE
                - LOOKUP_CYCLE
              description: |
                Mode to get the license entries for the license rate cards
                - CUSTOM: Use the license entries provided in the request
                - LOOKUP_RANGE: Use the license entries of a given account for the specified range
                - LOOKUP_CYCLE: Use the license entries of a given account for the specified cycle
            custom:
              description: List of license entries, this will be considered if mode is CUSTOM
              type: array
              items:
                type: object
                title: LicenseEntry
                required:
                  - licenseId
                  - quantity
                  - effectiveFrom
                properties:
                  licenseId:
                    type: string
                    minLength: 1
                  quantity:
                    type: integer
                  effectiveFrom:
                    type: string
                    format: date-time
            lookupRange:
              description: Range of license entries to be looked up, this will be considered if mode is LOOKUP_RANGE
              type: object
              required:
                - start
                - end
                - accountId
              properties:
                start:
                  type: string
                  format: date-time
                end:
                  type: string
                  format: date-time
                accountId:
                  type: string
                  minLength: 1
            lookupCycle:
              description: Cycle of license entries to be looked up, this will be considered if mode is LOOKUP_CYCLE
              type: object
              required:
                - accountId
              properties:
                cycleEffectiveOn:
                  description: Effective date of the cycle, will be used to get the license entries of the cycle
                  type: string
                  format: date-time
                accountId:
                  type: string
                  minLength: 1
        namedLicenseEntriesConfig:
          title: NamedLicenseEntriesConfig
          description: Configuration for getting the named license entries
          type: object
          required:
            - mode
          properties:
            mode:
              type: string
              enum:
                - CUSTOM
                - LOOKUP_RANGE
                - LOOKUP_CYCLE
              description: |
                Mode to get the named license entries for the license rate cards
                - CUSTOM: Use the named license entries provided in the request
                - LOOKUP_RANGE: Use the named license entries of a given account for the specified range
                - LOOKUP_CYCLE: Use the named license entries of a given account for the specified cycle
            custom:
              description: List of named license entries, this will be considered if mode is CUSTOM
              type: array
              items:
                type: object
                title: NamedLicenseEntry
                required:
                  - licenseId
                  - name
                  - effectiveFrom
                properties:
                  licenseId:
                    type: string
                    minLength: 1
                  name:
                    type: integer
                  effectiveFrom:
                    type: string
                    format: date-time
                  effectiveUntil:
                    type: string
                    format: date-time
            lookupRange:
              description: Range of named license entries to be looked up, this will be considered if mode is LOOKUP_RANGE
              type: object
              required:
                - start
                - end
                - accountId
              properties:
                start:
                  type: string
                  format: date-time
                end:
                  type: string
                  format: date-time
                accountId:
                  type: string
                  minLength: 1
            lookupCycle:
              description: Cycle of named license entries to be looked up, this will be considered if mode is LOOKUP_CYCLE
              type: object
              required:
                - accountId
              properties:
                cycleEffectiveOn:
                  description: Effective date of the cycle, will be used to get the named license entries of the cycle
                  type: string
                  format: date-time
                accountId:
                  type: string
                  minLength: 1
        prorationConfig:
          title: ProrationConfig
          description: Configuration for getting the proration, if not provided no proration will be applied
          type: object
          required:
            - mode
          properties:
            mode:
              type: string
              enum:
                - CUSTOM
                - LOOKUP_CYCLE
              description: |
                Mode to get the proration
                - CUSTOM: Use the proration provided in the request
                - LOOKUP_CYCLE: Use the proration of a given account for the specified cycle
            customConfig:
              description: Custom proration config, this will be considered if mode is CUSTOM
              type: object
              required:
                - cycleStartDate
                - cycleEndDate
                - currentDate
              properties:
                cycleStartDate:
                  type: string
                  format: date-time
                cycleEndDate:
                  type: string
                  format: date-time
                currentDate:
                  type: string
                  format: date-time
            lookupCycleConfig:
              description: Cycle of proration to be looked up, this will be considered if mode is LOOKUP_CYCLE
              type: object
              required:
                - accountId
              properties:
                currentDateTime:
                  description: Defaults to current date time if not provided
                  type: string
                  format: date-time
                cycleEffectiveOn:
                  description: Defaults to current date time if not provided
                  type: string
                  format: date-time
                accountId:
                  type: string
                  minLength: 1
        entitlementOverageConfig:
          title: EntitlementOverageConfig
          description: Configuration for getting the entitlement overages
          type: object
          required:
            - mode
          properties:
            mode:
              type: string
              enum:
                - CUSTOM
                - LOOKUP_CYCLE
              description: |
                Mode to get the entitlement overages for the entitlement overage rate cards
                - CUSTOM: Use the entitlement overages provided in the request
                - LOOKUP_CYCLE: Use the entitlement overages of a given account for the specified cycle
            custom:
              description: Quantity of entitlement overages, this will be considered if mode is CUSTOM
              type: array
              items:
                type: object
                title: EntitlementOverageEntry
                required:
                  - featureId
                  - quantity
                properties:
                  featureId:
                    type: string
                    minLength: 1
                  quantity:
                    type: number
            lookupCycle:
              description: Billing cycle of entitlement overages to be looked up, this will be considered if mode is LOOKUP_CYCLE
              type: object
              required:
                - accountId
                - billingCycleEndDate
              properties:
                billingCycleEndDate:
                  description: Effective date of the cycle, will be used to get the license entries of the cycle
                  type: string
                  format: date-time
                accountId:
                  type: string
                  minLength: 1
    UpdatePricingScheduleRequestWithActions:
      description: Request to associate or disassociate a price plan to an account with actions
      allOf:
        - $ref: '#/components/schemas/UpdatePricingScheduleRequest'
        - type: object
          properties:
            preActions:
              description: Pre actions to be performed before association or disassociation
              type: array
              items:
                $ref: '#/components/schemas/PreAction'
    FinalizeAccountSchedules:
      description: Request to finalize account schedules
      type: object
      additionalProperties: false
      properties:
        mergeSchedules:
          type: boolean
          description: |
            If this flag is true, the schedules will be merged with the existing schedules of the account if possible.
            If this flag is false, the existing schedules will be replaced with the new schedules.
            Default value is false
        preActions:
          description: Pre actions to be performed before association or disassociation
          type: array
          items:
            $ref: '#/components/schemas/PreAction'
    PreAction:
      type: object
      title: PreAction
      description: Pre action to be performed before association or disassociation
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - GRANT_LICENSE
          description: Type of pre action to be performed
        config:
          type: object
          description: |
            Configuration required for performing pre action
            - `GRANT_LICENSE`: grant one time licenses to an account before association
              - `licenseId` [Required]: Id of the license to be granted
              - `updateType` [Required]: Type of update to be performed on the license (RELATIVE or ABSOLUTE)
              - `quantity` [Required]: Quantity of license to be granted
              - `effectiveFrom` [Optional]: Effective date from which the license will be granted
          additionalProperties:
            type: string
    UpdatePricingScheduleRequest:
      type: object
      additionalProperties: false
      required:
        - effectiveFrom
        - effectiveUntil
      properties:
        mode:
          type: string
          enum:
            - ASSOCIATE
            - DISASSOCIATE
          description: Mode of request to create dis/association
        pricePlanId:
          type: string
          description: Id of the price plan if association request
        effectiveFrom:
          type: string
          format: date
          description: |
            Date of effectiveness of the association. The date is expected in YYYY-MM-DD format
            - Editing of a BILLING plan with deferredRevenue can be achieved with 
              effectiveFrom as start date of current cycle or using `retainStartOffset` option.
        effectiveUntil:
          type: string
          format: date
          description: |
            Date until which the association must be effective. The date is expected in YYYY-MM-DD format
        pricePlanDetailsOverride:
          $ref: '#/components/schemas/CreatePricePlanDetailsOverride'
        pricingRulesOverride:
          type: array
          items:
            $ref: '#/components/schemas/CreatePricingRule'
        retainStartOffsets:
          type: boolean
          description: |
            If this flag is true, current pricing cycle of the account on the date of association will continue rather 
            than the configurations of the newly associated price plan. Pricing cycle overrides specified  using 
            `pricePlanDetailsOverride` will take precedence over the pricing cycle configurations of 
            the new price plan that the account needs to migrate to. PricingCycleInterval of the existing plan and 
            the new plan must be same for this to work. We'll return a `400 BadRequest` otherwise.
            Examples:
              - Ongoing plan (1st Oct to 30th Oct) - {dayOffset: 1, monthOffset: NIL}
                New association (15th Oct to 15th Nov) of different price plan with retainStartOffsets option true 
                will use the same pricing cycle configuration {dayOffset: 1, monthOffset: NIL} rather than using the
                pricing cycle configuration of the new price plan that the account needs to migrate to.
              - Ongoing plan (1st Oct to 30th Oct) - {dayOffset: 1, monthOffset: NIL}
                New association (1st Nov to 30th Nov) of different price plan with retainStartOffsets option true will
                throw a `400 BadRequest` as no existing price plan configuration found on date of association
    EditAccountScheduleRequest:
      description: Request to dis/associate one or more schedules to an account
      type: object
      additionalProperties: false
      required:
        - edits
      properties:
        edits:
          type: array
          minItems: 1
          maxItems: 10
          items:
            $ref: '#/components/schemas/UpdateAccountScheduleV2Request'
    UpdateAccountScheduleV2Request:
      description: Request to dis/associate one or more schedules to an account
      type: object
      additionalProperties: false
      required:
        - effectiveFrom
        - effectiveUntil
      properties:
        mode:
          type: string
          enum:
            - ASSOCIATE
            - DISASSOCIATE
          description: Mode of request to create dis/association
        effectiveFrom:
          type: string
          format: date
          description: |
            Date of effectiveness of the association. The date is expected in YYYY-MM-DD format
            - Editing of a BILLING plan with deferredRevenue can be achieved with 
              effectiveFrom as start date of current cycle or using `retainStartOffset` option.
        effectiveUntil:
          type: string
          format: date
          description: |
            Date until which the association must be effective. The date is expected in YYYY-MM-DD format
        associationConfig:
          type: object
          additionalProperties: false
          title: AssociationConfig
          properties:
            pricePlanId:
              type: string
              description: Id of the price plan if association request
            scheduleId:
              type: string
              description: If provided, rate cards and pricing rules will copied from this schedule
            pricingCycleConfigOverride:
              $ref: '#/components/schemas/PricingCycleConfig'
            retainStartOffsets:
              type: boolean
              description: |
                If this flag is true, current pricing cycle of the account on the date of association will continue rather 
                than the configurations of the newly associated price plan. Pricing cycle overrides specified  using 
                `pricePlanDetailsOverride` will take precedence over the pricing cycle configurations of 
                the new price plan that the account needs to migrate to. PricingCycleInterval of the existing plan and 
                the new plan must be same for this to work. We'll return a `400 BadRequest` otherwise.
                Examples:
                  - Ongoing plan (1st Oct to 30th Oct) - {dayOffset: 1, monthOffset: NIL}
                    New association (15th Oct to 15th Nov) of different price plan with retainStartOffsets option true 
                    will use the same pricing cycle configuration {dayOffset: 1, monthOffset: NIL} rather than using the
                    pricing cycle configuration of the new price plan that the account needs to migrate to.
                  - Ongoing plan (1st Oct to 30th Oct) - {dayOffset: 1, monthOffset: NIL}
                    New association (1st Nov to 30th Nov) of different price plan with retainStartOffsets option true will
                    throw a `400 BadRequest` as no existing price plan configuration found on date of association
        mergeSchedules:
          type: boolean
          description: |
            If this flag is true, the schedules will be merged with the existing schedules of the account if possible.
            If this flag is false, the existing schedules will be replaced with the new schedules.
            Default value is false
    UpdatePricingRulesRequest:
      type: object
      additionalProperties: false
      properties:
        pricingRules:
          type: array
          items:
            $ref: '#/components/schemas/CreatePricingRule'
    EditPricingScheduleRequest:
      description: Request to dis/associate one or more schedules to an account
      type: object
      additionalProperties: false
      required:
        - edits
      properties:
        edits:
          type: array
          minItems: 1
          maxItems: 10
          items:
            $ref: '#/components/schemas/UpdatePricingScheduleRequest'
    CreatePricePlanMigrationRequest:
      description: Request to create price plan migration request
      allOf:
        - $ref: '#/components/schemas/pricePlanMigrationConfig'
        - type: object
          properties:
            requireConfirmation:
              description: |
                This field specifies whether to process job or to wait till the job is confirmed. Default value: false
              type: boolean
    pricePlanMigrationConfig:
      description: Migrate all account associations of a price plan to another price plan
      type: object
      additionalProperties: false
      required:
        - sourceId
        - sourceVersion
        - migrationMode
      properties:
        sourceId:
          description: Id of source price plan
          type: string
          maxLength: 255
        sourceVersion:
          description: Version of the source price plan
          type: integer
          format: int32
        targetId:
          description: Id of target price plan
          type: string
          maxLength: 255
        targetVersion:
          description: Version of the target price plan
          type: integer
          format: int32
        migrationMode:
          type: string
          enum:
            - IMMEDIATE
            - IMMEDIATE_IGNORE_OVERRIDE
            - NEXT_CYCLE
            - NEXT_CYCLE_IGNORE_OVERRIDE
            - START_OF_CURRENT_CYCLE
        retainStartOffsets:
          type: boolean
          description: |
            If this flag is true, current pricing cycle of the account on the date of association will continue rather 
            than the configurations of the newly associated price plan. Pricing cycle overrides specified  using 
            `pricePlanDetailsOverride` will take precedence over the pricing cycle configurations of 
            the new price plan that the account needs to migrate to. PricingCycleInterval of the existing plan and 
            the new plan must be same for this to work. We'll return a `400 BadRequest` otherwise.
            Examples:
              - Ongoing plan (1st Oct to 30th Oct) - {dayOffset: 1, monthOffset: NIL}
                New association (15th Oct to 15th Nov) of different price plan with retainStartOffsets option true 
                will use the same pricing cycle configuration {dayOffset: 1, monthOffset: NIL} rather than using the
                pricing cycle configuration of the new price plan that the account needs to migrate to.
              - Ongoing plan (1st Oct to 30th Oct) - {dayOffset: 1, monthOffset: NIL}
                New association (1st Nov to 30th Nov) of different price plan with retainStartOffsets option true will
                throw a `400 BadRequest` as no existing price plan configuration found on date of association
        isPricePlanV2Migration:
          type: boolean
          description: |
            If this flag is true, the migration will be done for price plan v2. Default value is false
    UpdateAddOnRequest:
      description: Request to update an addon
      type: object
      additionalProperties: false
      properties:
        name:
          description: Name of addon
          type: string
          maxLength: 255
        billableName:
          description: Billable name of addon. Billable name takes precedence over name to display in invoice.
          type: string
          maxLength: 255
    UpdateSettingRequest:
      description: Update Settings
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
        value:
          type: string
        dataType:
          $ref: '#/components/schemas/SettingDataType'
    PurchaseStatus:
      type: string
      enum:
        - SUCCESS
        - FAILURE
        - PENDING
        - IN_PROGRESS
        - PROPOSAL_ACTIVE
        - PROPOSAL_APPROVED
        - PROPOSAL_DECLINED
        - PROPOSAL_EXPIRED
      description: Status of the purchase
    WalletTopupDetails:
      description: Information related to wallet topup purchase
      type: object
      additionalProperties: false
      required:
        - topupAmount
      properties:
        purchaseAmount:
          description: |
            Specifies the amount to be paid to top up wallet with the specified top up amount. 
            If left null, purchase amount will be same as top up amount
          type: number
        topupAmount:
          description: Specifies the value to be topped up in the wallet
          type: number
    CreatePurchaseRequest:
      description: Create a purchase for an account
      type: object
      additionalProperties: false
      properties:
        pricePlanId:
          type: string
          description: Id of the price plan, Required for ENTITLEMENT_GRANT, ASSOCIATION purchase
        quantity:
          type: integer
          format: int32
        rateCardQuantities:
          type: object
          additionalProperties:
            type: number
        idempotencyKey:
          type: string
        purchasePlanOverride:
          $ref: '#/components/schemas/PurchasePlanOverride'
        associationOverride:
          $ref: '#/components/schemas/CreatePricePlanDetailsOverride'
        walletTopupDetails:
          $ref: '#/components/schemas/WalletTopupDetails'
        effectiveFrom:
          type: string
          format: date
        effectiveUntil:
          type: string
          format: date
        expiryDate:
          type: string
          format: date-time
        type:
          $ref: '#/components/schemas/PurchaseType'
    CreateProposalRequest:
      allOf:
        - $ref: '#/components/schemas/CreatePurchaseRequest'
        - type: object
          required:
            - paymentMode
            - type
          properties:
            paymentMode:
              type: string
              enum:
                - PREPAID
                - POSTPAID
    UpdateProposalStatus:
      description: Approve or decline a proposal of a billing plan for an account
      type: object
      additionalProperties: false
      required:
        - status
      properties:
        status:
          type: string
          enum:
            - APPROVE
            - DECLINE
    PurchasePlanOverride:
      description: entitlements override options for purchase of a price plan for an account
      type: object
      additionalProperties: false
      properties:
        fixedFeeRateCards:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/FixedFeeRateCard'
        billingEntitlementRateCards:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/BillingEntitlementRateCard'
        creditGrantRateCards:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/CreditGrantRateCard'
    CreateInvoiceGroupRequest:
      description: Create an invoice group
      type: object
      additionalProperties: false
      required:
        - dailyInvoiceConsolidation
        - accountIds
        - address
        - name
        - email
      properties:
        name:
          type: string
        email:
          type: string
          maxLength: 320
        dailyInvoiceConsolidation:
          type: boolean
        accountIds:
          type: array
          maxItems: 100
          minItems: 1
          items:
            type: string
        netTermDays:
          type: integer
          format: int32
        address:
          $ref: '#/components/schemas/Address'
    UpdateInvoiceGroupAccounts:
      description: Add accounts to an invoice group
      type: object
      additionalProperties: false
      required:
        - accountIds
      properties:
        accountIds:
          type: array
          maxItems: 100
          minItems: 1
          items:
            type: string
    CreateFeatureRequest:
      description: Create a Feature stand-alone or associate it with schemas
      type: object
      additionalProperties: false
      required:
        - name
        - schemaAssociations
      properties:
        name:
          description: Name of the feature
          type: string
          maxLength: 255
        billableName:
          description: Billable name of feature. Billable name takes precedence over name to display in invoice.
          type: string
          maxLength: 255
        schemaAssociations:
          $ref: '#/components/schemas/SchemaFeature'
    UpdateFeatureRequest:
      description: Update a Feature properties
      type: object
      additionalProperties: false
      properties:
        name:
          description: Name of the feature
          type: string
          maxLength: 255
        billableName:
          description: Billable name of addon. Billable name takes precedence over name to display in invoice.
          type: string
          maxLength: 255
        schemaAssociations:
          $ref: '#/components/schemas/SchemaFeature'
    SchemaFeature:
      description: Association of a feature with event_schemas
      type: array
      maxItems: 50
      items:
        $ref: '#/components/schemas/EventSchemasForFeature'
      uniqueItems: true
    EventSchemasForFeature:
      description: event_schema details that are in association with feature
      type: object
      required:
        - schemaName
        - attributeName
      properties:
        schemaName:
          type: string
          pattern: ^[\sa-zA-Z0-9_-]*$
        attributeName:
          type: string
    CreateBulkAliasRequest:
      description: Create bulk alias
      type: object
      additionalProperties: false
      required:
        - aliases
      properties:
        aliases:
          type: array
          maxItems: 100
          minItems: 1
          items:
            $ref: '#/components/schemas/CreateAliasRequest'
    CreateAliasRequest:
      description: Create an alias
      type: object
      additionalProperties: false
      required:
        - value
      properties:
        value:
          type: string
          maxLength: 255
    CreateAlertRequest:
      type: object
      additionalProperties: false
      required:
        - alertTemplateId
        - interval
        - status
      properties:
        alertTemplateId:
          type: string
        interval:
          type: integer
        validity:
          type: integer
          description: Validity of the alert in minutes, if null then alert will be valid forever
        description:
          type: string
        entityDetails:
          additionalProperties:
            type: object
        ownerDetails:
          additionalProperties:
            type: object
        parameters:
          additionalProperties:
            type: object
        status:
          $ref: '#/components/schemas/AlertStatus'
    AlertTemplate:
      type: object
      additionalProperties: false
      required:
        - id
        - name
        - interval
        - createdAt
      properties:
        id:
          type: string
          description: Alert Template ID
        name:
          type: string
          description: Alert Template Name
        description:
          type: string
          description: Alert Template Description
        interval:
          type: integer
          description: Cron Interval
        entitySchema:
          type: string
          description: Entity Schema
        entityType:
          type: string
          description: Entity Type
        ownerSchema:
          type: string
          description: Owner Schema
        ownerType:
          type: string
          description: Owner Type
        parametersSchema:
          type: string
          description: Parameters Schema
        createdAt:
          type: string
          format: date-time
          description: Created At
        updatedAt:
          type: string
          format: date-time
          description: Updated At
    AlertTemplatesPaginatedResponse:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AlertTemplate'
        nextToken:
          type: string
    AlertsPaginatedResponse:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Alert'
        nextToken:
          type: string
    Alert:
      type: object
      additionalProperties: false
      required:
        - id
        - version
        - alertTemplateId
        - interval
        - status
        - createdAt
      properties:
        id:
          type: string
          description: Alert ID
        version:
          type: integer
          description: Alert Version
        description:
          type: string
          description: Alert Description
        status:
          $ref: '#/components/schemas/AlertStatus'
        validity:
          type: integer
          description: Validity of the alert in minutes, if null then alert will be valid forever
        alertTemplateId:
          type: string
          description: Alert Template Id
        interval:
          type: integer
          description: Interval
        entityDetails:
          additionalProperties:
            type: object
        ownerDetails:
          additionalProperties:
            type: object
        parameters:
          additionalProperties:
            type: object
        createdAt:
          type: string
          format: date-time
          description: Created At
        updatedAt:
          type: string
          format: date-time
          description: Updated At
    AlertStatus:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
    UpdateIncidentStatusRequest:
      type: object
      additionalProperties: false
      required:
        - status
      properties:
        status:
          type: string
          description: Incident Status
          enum:
            - CLOSED
    UpdateAlertRequest:
      type: object
      additionalProperties: false
      properties:
        description:
          type: string
        status:
          $ref: '#/components/schemas/AlertStatus'
        interval:
          type: integer
        validity:
          type: integer
        parameters:
          additionalProperties:
            type: object
    Incident:
      type: object
      additionalProperties: false
      required:
        - id
        - alertId
        - alertVersion
        - alertTemplateId
        - status
        - createdAt
      properties:
        id:
          type: string
          description: Incident ID
        alertId:
          type: string
          description: Alert ID
        alertVersion:
          type: integer
          description: Alert Version
        alertTemplateId:
          type: string
          description: Alert Template Id
        validUntil:
          type: string
          format: date-time
        reportData:
          additionalProperties:
            type: object
        status:
          type: string
          description: Incident Status
        lastCheckedAt:
          type: string
          format: date-time
          description: Last Checked At
        createdAt:
          type: string
          format: date-time
          description: Created At
        updatedAt:
          type: string
          format: date-time
          description: Updated At
    IncidentsPaginatedResponse:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Incident'
        nextToken:
          type: string
    ReportStatus:
      type: string
      enum:
        - QUEUED
        - RUNNING
        - FAILED
        - UPLOAD_PENDING
        - COMPLETED
    ReportType:
      type: string
      enum:
        - TEMPLATE
        - QUERY
        - CUSTOM
    Report:
      type: object
      description: Represents a Report
      additionalProperties: false
      required:
        - id
        - name
        - status
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        name:
          type: string
        account_id:
          type: string
        status:
          $ref: '#/components/schemas/ReportStatus'
        fileId:
          type: string
        queryInput:
          $ref: '#/components/schemas/QueryInput'
        reportTemplateId:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        preSignedUrl:
          type: string
        type:
          $ref: '#/components/schemas/ReportType'
    ReportsPaginatedResponse:
      type: object
      description: Represents a list response for reports
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Report'
        nextToken:
          type: string
    BaseSuccessResponse:
      type: object
      additionalProperties: false
      required:
        - success
      properties:
        success:
          type: boolean
          example: true
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - message
      properties:
        message:
          type: string
          description: error description
          maxLength: 500
    TokenResponse:
      type: object
      additionalProperties: false
      required:
        - token
      properties:
        token:
          type: string
    CreateCustomerResponse:
      type: object
      additionalProperties: false
      required:
        - name
        - id
        - togaiCustomerId
        - primaryEmail
      properties:
        id:
          description: Identifier of customer
          type: string
          maxLength: 50
        togaiCustomerId:
          description: Unique identifier of customer
          type: string
        name:
          description: Name of the Customer
          type: string
          maxLength: 255
          minLength: 3
        primaryEmail:
          description: Primary email of the customer
          type: string
          maxLength: 320
        billingAddress:
          type: string
        address:
          $ref: '#/components/schemas/Address'
        settings:
          type: array
          maxItems: 10
          minItems: 0
          items:
            $ref: '#/components/schemas/CreateEntitySetting'
        account:
          $ref: '#/components/schemas/Account'
    CustomerPaginatedResponse:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Customer'
        nextToken:
          type: string
        context:
          $ref: '#/components/schemas/PaginationOptions'
    CreateCustomerContactResponse:
      type: object
      additionalProperties: false
      required:
        - username
        - name
        - verified
        - createdAt
        - loginAccess
      properties:
        username:
          type: string
          maxLength: 50
        preferredUsername:
          type: string
          maxLength: 50
        name:
          type: string
          maxLength: 50
        email:
          type: string
          maxLength: 320
        phone:
          type: string
          maxLength: 20
        loginAccess:
          type: boolean
        createdBy:
          type: string
          maxLength: 50
        createdAt:
          type: string
          format: date-time
        verified:
          type: boolean
    AccountPaginatedResponse:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Account'
        nextToken:
          type: string
        context:
          $ref: '#/components/schemas/PaginationOptions'
    EventSchemaListPaginatedResponse:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/EventSchemaListData'
        nextToken:
          type: string
        context:
          $ref: '#/components/schemas/PaginationOptions'
    UsageMeterPaginatedResponse:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/UsageMeter'
        nextToken:
          type: string
        context:
          $ref: '#/components/schemas/PaginationOptions'
    PricePlanListData:
      description: Data of price plan list
      type: object
      additionalProperties: false
      required:
        - id
        - name
        - version
        - pricePlanDetails
        - status
        - usageMeters
        - createdAt
        - updatedAt
        - type
      properties:
        id:
          description: Identifier of price plan
          type: string
          maxLength: 50
        name:
          type: string
          description: Name of the price plan
          maxLength: 50
        version:
          type: integer
          format: int32
          description: Version of the price plan
        description:
          description: Description of price plan
          type: string
          maxLength: 255
        status:
          description: Status of Price plan
          type: string
          enum:
            - DRAFT
            - ACTIVE
            - ARCHIVED
        usageMeters:
          type: array
          description: Usage meters id linked to the price plan
          items:
            type: string
        pricePlanDetails:
          $ref: '#/components/schemas/PricePlanDetails'
        pricingRules:
          type: array
          items:
            $ref: '#/components/schemas/PricingRule'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        type:
          $ref: '#/components/schemas/PricePlanType'
    PricePlanPaginatedResponse:
      type: object
      required:
        - data
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PricePlanListData'
        nextToken:
          type: string
        context:
          $ref: '#/components/schemas/PaginationOptions'
    PricePlanInfo:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
        description:
          type: string
    PricingScheduleWithPricePlanId:
      allOf:
        - $ref: '#/components/schemas/PricingSchedule'
        - type: object
          required:
            - pricePlanId
          properties:
            pricePlanId:
              type: string
            pricePlanName:
              type: string
            pricePlanInfo:
              $ref: '#/components/schemas/PricePlanInfo'
    PricingSchedulePaginatedResponse:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PricingScheduleWithPricePlanId'
        nextToken:
          type: string
        previousToken:
          type: string
    SchedulesPaginatedResponse:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AccountSchedule'
        nextToken:
          type: string
        previousToken:
          type: string
    ScheduleInfo:
      type: object
      additionalProperties: false
      required:
        - supportedCurrencies
        - pricingCycleConfig
      properties:
        supportedCurrencies:
          type: array
          items:
            type: string
        pricingCycleConfig:
          $ref: '#/components/schemas/PricingCycleConfig'
        pricingRules:
          type: array
          items:
            $ref: '#/components/schemas/PricingRule'
    AccountSchedule:
      type: object
      additionalProperties: false
      required:
        - id
        - accountId
        - pricePlanId
        - pricePlanInfo
        - version
        - deferredRevenue
        - startDate
        - endDate
        - allowOngoingCycleUpdates
        - accountScheduleInfo
      properties:
        id:
          type: string
        accountId:
          type: string
        pricePlanId:
          type: string
        version:
          type: integer
        deferredRevenue:
          type: boolean
        pricePlanInfo:
          $ref: '#/components/schemas/PricePlanInfo'
        accountScheduleInfo:
          $ref: '#/components/schemas/ScheduleInfo'
        isOverridden:
          description: |
            Indicates whether the schedule is overridden. Note: A null value for this field does not imply that the schedule is not overridden.
          type: boolean
        startDate:
          type: string
          format: date-time
        endDate:
          type: string
          format: date-time
        allowOngoingCycleUpdates:
          type: boolean
    ValidatedEntityErrorsPaginatedResponse:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ValidatedEntityError'
        nextToken:
          type: string
    ValidatedEntityError:
      type: object
      additionalProperties: false
      required:
        - referenceId
        - entityId
        - entityType
        - errorMessage
      properties:
        referenceId:
          description: Reference ID of the entity, can be Schedule Id or Purchase Id
          type: string
        entityId:
          description: Identifier of the entity
          type: string
        entityType:
          description: Type of the entity, can be Rate card or Pricing rule
          type: string
        errorMessage:
          description: Error message for the validation
          type: string
    PricingRulesPaginatedResponse:
      type: object
      required:
        - data
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PricingRule'
    UpdatePricingScheduleResponse:
      type: object
      additionalProperties: false
      required:
        - accountId
        - accountName
        - pricingSchedules
      properties:
        accountId:
          description: Identifier of the account
          type: string
          maxLength: 50
        accountName:
          description: Name of the Account
          type: string
        pricingSchedules:
          type: array
          items:
            $ref: '#/components/schemas/PlanOverride'
    CalculateRevenueResponse:
      type: object
      additionalProperties: false
      required:
        - revenueInfo
        - pricePlanDetails
        - currency
      properties:
        currency:
          type: string
        usageLookupRange:
          type: object
          title: UsageLookupRange
          description: Start and end dates of usage lookup if usage mode is LOOKUP
          additionalProperties: false
          required:
            - start
            - end
          properties:
            start:
              type: string
              format: date-time
            end:
              type: string
              format: date-time
        pricePlanDetails:
          $ref: '#/components/schemas/PricePlanDetails'
        revenueInfo:
          type: array
          items:
            title: RevenueInfo
            type: object
            additionalProperties: false
            required:
              - usages
            properties:
              usageRateCard:
                $ref: '#/components/schemas/UsageRateCard'
              fixedFeeRateCard:
                $ref: '#/components/schemas/FixedFeeRateCard'
              licenseRateCard:
                $ref: '#/components/schemas/LicenseRateCard'
              billingEntitlementRateCard:
                $ref: '#/components/schemas/BillingEntitlementRateCard'
              creditGrantRateCard:
                $ref: '#/components/schemas/CreditGrantRateCard'
              entitlementOverageRateCard:
                $ref: '#/components/schemas/EntitlementOverageRateCard'
              usages:
                type: object
                additionalProperties:
                  type: number
              fixedFeeRevenueSummary:
                type: object
                title: FixedFeeRevenueSummary
                additionalProperties: false
                required:
                  - revenue
                properties:
                  revenue:
                    type: number
              licenseRevenueSummary:
                type: array
                items:
                  $ref: '#/components/schemas/SlabRevenueSummary'
              billingEntitlementRevenueSummary:
                type: object
                title: BillingEntitlementRevenueSummary
                additionalProperties: false
                required:
                  - revenue
                properties:
                  revenue:
                    type: number
              creditGrantRevenueSummary:
                type: object
                title: CreditGrantRevenueSummary
                additionalProperties: false
                required:
                  - revenue
                properties:
                  revenue:
                    type: number
              entitlementOverageRevenueSummary:
                type: object
                title: EntitlementOverageRevenueSummary
                additionalProperties: false
                required:
                  - revenue
                properties:
                  revenue:
                    type: number
              slabRevenueSummaries:
                type: array
                items:
                  $ref: '#/components/schemas/SlabRevenueSummary'
    CalculateRevenueResponseV2:
      type: object
      additionalProperties: false
      required:
        - revenueInfo
        - currency
      properties:
        currency:
          type: string
        usageLookupRange:
          type: object
          title: UsageLookupRange
          description: Start and end dates of usage lookup if usage mode is LOOKUP
          additionalProperties: false
          required:
            - start
            - end
          properties:
            start:
              type: string
              format: date-time
            end:
              type: string
              format: date-time
        revenueInfo:
          type: array
          items:
            title: RevenueInfoV2
            type: object
            additionalProperties: false
            required:
              - usages
              - rateCard
            properties:
              rateCard:
                $ref: '#/components/schemas/RateCard'
              usages:
                type: object
                additionalProperties:
                  type: number
              fixedFeeRevenueSummary:
                type: object
                title: FixedFeeRevenueSummary
                additionalProperties: false
                required:
                  - revenue
                properties:
                  revenue:
                    type: number
              licenseRevenueSummary:
                type: array
                items:
                  $ref: '#/components/schemas/SlabRevenueSummary'
              billingEntitlementRevenueSummary:
                type: object
                title: BillingEntitlementRevenueSummary
                additionalProperties: false
                required:
                  - revenue
                properties:
                  revenue:
                    type: number
              creditGrantRevenueSummary:
                type: object
                title: CreditGrantRevenueSummary
                additionalProperties: false
                required:
                  - revenue
                properties:
                  revenue:
                    type: number
              entitlementOverageRevenueSummary:
                type: object
                title: EntitlementOverageRevenueSummary
                additionalProperties: false
                required:
                  - revenue
                properties:
                  revenue:
                    type: number
              slabRevenueSummaries:
                type: array
                items:
                  $ref: '#/components/schemas/SlabRevenueSummary'
    SlabRevenueSummary:
      type: object
      additionalProperties: false
      required:
        - order
        - usage
        - revenue
      properties:
        order:
          type: integer
        usage:
          type: number
        revenue:
          type: number
        metadata:
          title: SlabRevenueMetadata
          type: object
          additionalProperties: false
          properties:
            minimumRateApplied:
              type: boolean
            maximumRateApplied:
              type: boolean
            packageQuantity:
              type: integer
    GetCustomerPortalDelegateTokenRequest:
      description: Request to get delegate token for customer portal
      type: object
      additionalProperties: false
      required:
        - customerId
      properties:
        customerId:
          description: Identifier of the customer
          type: string
        accountIds:
          description: |
            Identifier of the accounts under the customer for which access is requested. Maximum of 5 account ids can be provided
          type: array
          items:
            type: string
        allAccountsAccess:
          description: Flag to specify if access for every account under the customer is required
          type: boolean
        expiry:
          description: |
            Expiry in seconds from the time of generation. 
            If not provided, generated token will have the expiry of the token used for requesting.
          type: integer
          format: int64
    SettingPaginatedResponse:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Setting'
        nextToken:
          type: string
        context:
          $ref: '#/components/schemas/PaginationOptions'
    AddOnPaginatedResponse:
      type: object
      required:
        - data
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AddOn'
        nextToken:
          type: string
        context:
          $ref: '#/components/schemas/PaginationOptions'
    Customer:
      description: Structure of customer
      type: object
      additionalProperties: false
      required:
        - name
        - id
        - togaiCustomerId
        - primaryEmail
        - billingAddress
        - address
        - status
        - createdAt
        - updatedAt
      properties:
        id:
          description: Identifier of customer
          type: string
          maxLength: 50
        togaiCustomerId:
          description: Unique identifier of customer
          type: string
        name:
          description: Name of the Customer
          type: string
          maxLength: 255
          minLength: 3
        primaryEmail:
          description: Primary email of the customer
          type: string
          maxLength: 320
        billingAddress:
          description: billing address of the customer
          type: string
          maxLength: 1000
          example: 201 Boulevard, WA 53123
        address:
          $ref: '#/components/schemas/Address'
        status:
          description: Status of the customer
          type: string
          enum:
            - ACTIVE
            - ARCHIVED
          example: ACTIVE
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    AccountsBillingInformation:
      description: Billing information of an account
      type: object
      additionalProperties: false
      properties:
        emailRecipients:
          type: array
          items:
            description: |
              Emails in this array will be added in to: in mail. Primary email will be added if left blank.
            type: string
            maxLength: 320
        additionalEmailRecipients:
          type: array
          items:
            description: |
              Emails in this array will be added in cc: in mail.
            type: string
            maxLength: 320
    Account:
      description: Structure of an account
      type: object
      additionalProperties: false
      required:
        - name
        - id
        - togaiAccountId
        - togaiCustomerId
        - status
        - customerId
      properties:
        id:
          description: Identifier of the account
          type: string
          maxLength: 50
        togaiAccountId:
          description: Unique identifier of the account
          type: string
        togaiCustomerId:
          description: Unique identifier of the customer
          type: string
        name:
          description: Name of the Account
          type: string
          maxLength: 255
          minLength: 3
        customerId:
          description: Identifier of the customer
          type: string
        invoiceCurrency:
          description: |
            [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency in which the account must be invoiced
            Defaults to Base currency.
          type: string
          minLength: 3
          maxLength: 3
          example: USD
        aliases:
          description: list of aliases of the account
          type: array
          maxItems: 10
          minItems: 0
          items:
            title: AccountAliases
            type: object
            properties:
              alias:
                type: string
                maxLength: 50
        netTermDays:
          type: integer
          format: int32
        address:
          $ref: '#/components/schemas/Address'
        primaryEmail:
          description: Primary email of the customer
          type: string
          maxLength: 320
          example: admin@example.com
        billingInformation:
          $ref: '#/components/schemas/AccountsBillingInformation'
        status:
          description: Status of the account
          type: string
          enum:
            - ACTIVE
            - DRAFT
            - ARCHIVED
          example: ACTIVE
        settings:
          type: array
          maxItems: 10
          minItems: 0
          items:
            $ref: '#/components/schemas/CreateEntitySetting'
        invoiceGroupDetails:
          $ref: '#/components/schemas/InvoiceGroupDetails'
        metadata:
          description: |
            Additional information associated with the account.
            Example: GSTN, VATN
          type: object
          additionalProperties:
            type: string
        tags:
          description: Tag for accounts are stored in lowercase
          type: array
          uniqueItems: true
          items:
            type: string
    EventSchemaVersionsResponse:
      description: Response for event schema versions
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/EventSchema'
    GetJobResponse:
      type: object
      additionalProperties: false
      required:
        - id
        - type
        - updatedAt
        - status
        - totalJobEntries
        - pendingJobEntries
        - failedJobEntries
        - completedJobEntries
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - PRICE_PLAN
            - EVENT_CORRECTIONS
            - BILL_RUN
        settledAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        status:
          type: string
          enum:
            - SCHEDULED
            - PENDING
            - INITIALIZED
            - WAITING_FOR_CONFIRMATION
            - IN_PROGRESS
            - COMPLETED
            - FAILED
            - CANCELLED
        totalJobEntries:
          type: integer
          format: int32
        pendingJobEntries:
          type: integer
          format: int32
        failedJobEntries:
          type: integer
          format: int32
        completedJobEntries:
          type: integer
          format: int32
        metadata:
          type: object
          additionalProperties:
            type: string
    JobsWithoutStatusInfoResponse:
      type: object
      additionalProperties: false
      required:
        - id
        - type
        - status
        - updatedAt
      properties:
        id:
          type: string
        type:
          type: string
        status:
          type: string
        updatedAt:
          type: string
          format: date-time
    JobsPaginatedResponse:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/JobsWithoutStatusInfoResponse'
        nextToken:
          type: string
        context:
          $ref: '#/components/schemas/PaginationOptions'
    JobEntriesResponse:
      type: object
      additionalProperties: false
      required:
        - entityId
        - jobId
        - status
        - createdAt
        - comments
      properties:
        entityId:
          type: string
        jobId:
          type: string
        status:
          type: string
          enum:
            - PENDING
            - IN_PROGRESS
            - COMPLETED
            - FAILED
            - CANCELLED
        createdAt:
          type: string
          format: date-time
        metadata:
          type: object
          additionalProperties:
            type: string
    JobEntriesPaginatedResponse:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/JobEntriesResponse'
        nextToken:
          type: string
        context:
          $ref: '#/components/schemas/PaginationOptions'
    EventSchemaListData:
      allOf:
        - $ref: '#/components/schemas/EventSchema'
        - type: object
          properties:
            usageMetersCount:
              type: integer
    EventSchema:
      description: Structure of an event schema
      type: object
      additionalProperties: false
      required:
        - name
        - version
      properties:
        name:
          description: Name of the event. Must be unique for an organization.
          type: string
          maxLength: 50
          pattern: ^[\sa-zA-Z0-9_-]*$
        description:
          description: Description of the event
          type: string
          maxLength: 255
        version:
          description: Version of event schema
          type: integer
          format: int32
          minimum: 1
          example: 1
        status:
          description: |
            Status of event schema
            * DRAFT - Schema is in draft state 
            * ACTIVE - Schema is currently active 
            * INACTIVE - Schema is currently inactive
            * ARCHIVED - Older version of event schema
          type: string
          enum:
            - DRAFT
            - ACTIVE
            - INACTIVE
            - ARCHIVED
          example: DRAFT
        attributes:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/EventAttributeSchema'
          uniqueItems: true
        dimensions:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/DimensionsSchema'
          uniqueItems: true
        filterFields:
          type: array
          uniqueItems: true
          items:
            type: string
        featureDetails:
          $ref: '#/components/schemas/FeatureDetails'
        enrichments:
          $ref: '#/components/schemas/Enrichments'
        eventIdTemplate:
          description: Template used to generate event id based on event payload
          type: string
        eventLevelRevenue:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    FeatureDetails:
      description: details of feature associated with event schema with attribute name
      type: object
      additionalProperties: false
      required:
        - featureId
        - attributeName
      properties:
        featureId:
          type: string
        attributeName:
          type: string
    EventAttributeSchema:
      description: Structure of an event attribute
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          description: Name of the event attribute.
          type: string
          maxLength: 50
          pattern: ^[\sa-zA-Z0-9_-]*$
          example: distance
        defaultUnit:
          description: Unit for the attribute
          type: string
          maxLength: 10
          example: kms
    DimensionsSchema:
      description: Structure of dimensions
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          description: Name of the event dimension
          type: string
          maxLength: 50
          pattern: ^[\sa-zA-Z0-9_-]*$
          example: city
    Enrichments:
      type: object
      additionalProperties: false
      required:
        - fields
      properties:
        dependencies:
          type: array
          items:
            $ref: '#/components/schemas/Dependency'
        fields:
          type: array
          items:
            $ref: '#/components/schemas/Field'
    Dependency:
      type: object
      additionalProperties: false
      required:
        - type
        - key
        - name
      properties:
        type:
          type: string
          enum:
            - SETTING
        key:
          type: string
        name:
          type: string
    Field:
      type: object
      additionalProperties: false
      required:
        - name
        - type
        - enrichmentType
        - value
        - order
      properties:
        name:
          type: string
        type:
          type: string
          enum:
            - ATTRIBUTE
            - DIMENSION
        enrichmentType:
          type: string
          enum:
            - VALUE
            - JSON_LOGIC
            - JSON_LOGIC_FROM_DEPENDENCY
        value:
          type: string
        order:
          type: integer
          format: int32
    UsageMeterAggregation:
      description: |
        Aggregation to be applied on usage meter result
        * COUNT - Counts number of events matching the usage meter
        * SUM - Sums up results of computation of all events matching usage meter
      type: string
      enum:
        - COUNT
        - SUM
    UsageMeter:
      description: Structure of usage meter
      type: object
      additionalProperties: false
      required:
        - id
        - name
        - displayName
        - type
        - aggregation
      properties:
        id:
          description: Identifier of the usage meter
          type: string
          maxLength: 20
        name:
          description: Name of the usage meter
          type: string
          maxLength: 50
          pattern: ^[\sa-zA-Z0-9_-]*$
          example: rides-usage
        billableName:
          description: Billable name of addon. Billable name takes precedence over name to display in invoice.
          type: string
          maxLength: 255
          example: Rides Usage
        displayName:
          description: |
            Display name of usage meter. This is an auto-generated field which contains billableName of usage meter.
            If billableName is not provided, name will be used as display name.
          type: string
          maxLength: 255
        description:
          type: string
          maxLength: 255
          example: Meter to track cab rides
        filters:
          type: array
          items:
            $ref: '#/components/schemas/UsageMeterFilterEntry'
        type:
          description: Type of usage meter
          type: string
          enum:
            - COUNTER
          example: COUNTER
        status:
          description: Status of usage meter
          type: string
          enum:
            - DRAFT
            - ACTIVE
            - INACTIVE
            - ARCHIVED
          example: DRAFT
        aggregation:
          $ref: '#/components/schemas/UsageMeterAggregation'
        computations:
          type: array
          minItems: 0
          maxItems: 1
          items:
            $ref: '#/components/schemas/Computation'
        eventSchema:
          $ref: '#/components/schemas/EventSchema'
        createdAt:
          type: string
          format: date-time
        lastActivatedAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Computation:
      type: object
      required:
        - computation
        - order
      properties:
        id:
          description: Optional identifier describing the matcher and computation pair
          type: string
          maxLength: 50
        matcher:
          description: |
            Condition to be applied on event. Upon matching it the corresponding computation will be considered for usage_meter unit calculation. The result of the matcher needs to be [truthy](https://jsonlogic.com/truthy.html) in order to be considered as a match.
          type: string
          maxLength: 1500
          example: |
            {
              "and": [
                {"in": [{"var": "dimension.city"}, "chennai", "mumbai"]},
                "or": [
                  {">": [{"var": "attribute.distance"}, 100]},
                  {"<": [{"var": "attribute.distance"}, 20]}
                ]
              ]
            }
        computation:
          description: |
            Computation to be applied on an event if it matches the matcher. In case of a COUNT aggregation type, computation should be passed as '1'
          type: string
          maxLength: 500
          example:
            '*':
              - var: attributes.distance
              - 0.4
        order:
          description: The order in which multiple matched computations will get evaluated
          type: integer
    PaginationOptions:
      type: object
      additionalProperties: false
      properties:
        pageSize:
          type: integer
        sortOrder:
          type: string
          enum:
            - ASC
            - DESC
    PlanOverride:
      type: object
      description: Represents effectiveness period and config of a price plan. i.e, price plan bound by time.
      additionalProperties: false
      required:
        - id
        - pricePlanId
        - pricePlanName
        - startDate
        - endDate
      properties:
        id:
          type: string
        pricePlanId:
          type: string
        pricePlanName:
          type: string
        pricePlanDetailsOverride:
          $ref: '#/components/schemas/PricePlanDetailsOverride'
        pricingRulesOverride:
          type: array
          items:
            $ref: '#/components/schemas/PricingRule'
        startDate:
          type: string
          format: date-time
        endDate:
          type: string
          format: date-time
    Setting:
      type: object
      description: Represents a setting
      additionalProperties: false
      required:
        - id
        - value
        - entityType
        - entityId
        - namespace
        - name
        - dataType
      properties:
        id:
          type: string
        value:
          type: string
        entityType:
          type: string
        entityId:
          type: string
        namespace:
          type: string
        name:
          type: string
        dataType:
          $ref: '#/components/schemas/SettingDataType'
    CreateEntitySetting:
      type: object
      description: Represents a setting
      additionalProperties: false
      required:
        - id
        - value
        - namespace
        - name
        - dataType
      properties:
        id:
          type: string
        value:
          type: string
        namespace:
          type: string
        name:
          type: string
        dataType:
          $ref: '#/components/schemas/SettingDataType'
    PurchaseType:
      type: string
      description: Specifies whether this purchase is for granting entitlements or for an association or for wallet topup or prepaid purchase. If left null, ENTITLEMENT_GRANT is taken as default
      enum:
        - ENTITLEMENT_GRANT
        - ASSOCIATION
        - WALLET_TOPUP
        - PREPAID
    Purchase:
      type: object
      description: Represents a Purchase
      additionalProperties: false
      required:
        - id
        - accountId
        - createdAt
        - status
        - type
      properties:
        id:
          type: string
        accountId:
          type: string
          minLength: 1
        pricePlanId:
          description: Id of the price plan, Required for ENTITLEMENT_GRANT, ASSOCIATION purchase
          type: string
          minLength: 1
        quantity:
          type: integer
          format: int32
        rateCardQuantities:
          type: object
          additionalProperties:
            type: number
        idempotencyKey:
          type: string
        pricePlanVersion:
          type: integer
          format: int32
        purchasePlanOverride:
          $ref: '#/components/schemas/PricePlanDetailsOverride'
        associationOverride:
          $ref: '#/components/schemas/CreatePricePlanDetailsOverride'
        walletTopupDetails:
          $ref: '#/components/schemas/WalletTopupDetails'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        effectiveFrom:
          type: string
          format: date
        effectiveUntil:
          type: string
          format: date
        expiryDate:
          type: string
          format: date-time
        price:
          type: number
        invoiceId:
          type: string
        invoiceCurrency:
          type: string
        status:
          $ref: '#/components/schemas/PurchaseStatus'
        type:
          $ref: '#/components/schemas/PurchaseType'
        comment:
          type: string
    Proposal:
      allOf:
        - $ref: '#/components/schemas/Purchase'
        - type: object
          required:
            - paymentMode
          properties:
            paymentMode:
              type: string
              enum:
                - PREPAID
                - POSTPAID
            proposalResponseDate:
              type: string
              format: date-time
    GetPurchaseResponse:
      allOf:
        - $ref: '#/components/schemas/Purchase'
        - type: object
          additionalProperties: false
          properties:
            purchasePlan:
              $ref: '#/components/schemas/PricePlanDetails'
            features:
              type: array
              items:
                title: PurchaseFeatureDetails
                type: object
                additionalProperties: false
                required:
                  - id
                  - name
                  - creditsGranted
                  - creditsAvailable
                  - updatedAt
                  - effectiveFrom
                  - effectiveUntil
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  creditsGranted:
                    type: number
                  creditsAvailable:
                    type: number
                  updatedAt:
                    type: string
                    format: date-time
                  effectiveFrom:
                    type: string
                    format: date-time
                  effectiveUntil:
                    type: string
                    format: date-time
    GetProposalResponse:
      allOf:
        - $ref: '#/components/schemas/Proposal'
        - type: object
          additionalProperties: false
    PurchaseListResponse:
      type: object
      description: Represents a Purchase for List Response
      additionalProperties: false
      required:
        - id
        - status
        - createdAt
        - type
      properties:
        id:
          type: string
        pricePlanId:
          type: string
        pricePlanName:
          type: string
        quantity:
          type: integer
          format: int32
        rateCardQuantities:
          type: object
          additionalProperties:
            type: number
        pricePlanVersion:
          type: integer
          format: int32
        status:
          $ref: '#/components/schemas/PurchaseStatus'
        idempotencyKey:
          type: string
        purchasePlan:
          $ref: '#/components/schemas/PricePlanDetails'
        walletTopupDetails:
          $ref: '#/components/schemas/WalletTopupDetails'
        price:
          type: number
        invoiceCurrency:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        type:
          $ref: '#/components/schemas/PurchaseType'
    ProposalsListResponse:
      type: object
      description: Represents a Proposal for List Response
      additionalProperties: false
      required:
        - id
        - status
        - createdAt
        - updatedAt
        - paymentMode
        - type
      properties:
        id:
          type: string
        pricePlanId:
          type: string
        pricePlanName:
          type: string
        pricePlanVersion:
          type: integer
          format: int32
        status:
          $ref: '#/components/schemas/PurchaseStatus'
        walletTopupDetails:
          $ref: '#/components/schemas/WalletTopupDetails'
        idempotencyKey:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        expiryDate:
          type: string
          format: date-time
        paymentMode:
          type: string
          enum:
            - PREPAID
            - POSTPAID
        type:
          $ref: '#/components/schemas/PurchaseType'
    PurchasePaginatedListData:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseListResponse'
        nextToken:
          type: string
        context:
          $ref: '#/components/schemas/PaginationOptions'
    ProposalsPaginatedResponse:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ProposalsListResponse'
        nextToken:
          type: string
        context:
          $ref: '#/components/schemas/PaginationOptions'
    InvoiceGroupDetails:
      description: Invoice group details
      type: object
      additionalProperties: false
      required:
        - id
        - name
        - email
        - dailyInvoiceConsolidation
        - invoiceCurrency
        - billingAddress
      properties:
        id:
          type: string
        name:
          type: string
        email:
          type: string
          maxLength: 320
        dailyInvoiceConsolidation:
          type: boolean
        netTermDays:
          type: integer
          format: int32
        invoiceCurrency:
          type: string
        billingAddress:
          $ref: '#/components/schemas/Address'
    InvoiceGroups:
      allOf:
        - $ref: '#/components/schemas/InvoiceGroupDetails'
        - type: object
          required:
            - accountsCount
            - createdAt
            - updatedAt
          properties:
            accountsCount:
              type: integer
              format: int32
              minimum: 0
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
    InvoiceGroupPaginatedResponse:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceGroups'
        nextToken:
          type: string
    InvoiceGroupAccountsPaginatedResponse:
      allOf:
        - $ref: '#/components/schemas/InvoiceGroups'
        - type: object
          required:
            - accounts
          properties:
            accounts:
              type: array
              items:
                type: string
            nextToken:
              type: string
    Feature:
      type: object
      description: Represents a Feature
      additionalProperties: false
      required:
        - id
        - name
        - displayName
        - schemaAssociations
        - createdAt
      properties:
        id:
          type: string
        name:
          type: string
        billableName:
          type: string
          maxLength: 255
        displayName:
          description: |
            Display name of feature. This is an auto-generated field which contains billableName of feature.
            If billableName is not provided, name will be used as display name.
          type: string
          maxLength: 255
        schemaAssociations:
          $ref: '#/components/schemas/SchemaFeature'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    FeatureListResponse:
      type: object
      description: Represents a Feature for List Response
      additionalProperties: false
      required:
        - id
        - name
        - displayName
        - createdAt
        - schemaCount
      properties:
        id:
          type: string
        name:
          type: string
        billableName:
          type: string
          maxLength: 255
        displayName:
          description: |
            Display name of feature. This is an auto-generated field which contains billableName of feature.
            If billableName is not provided, name will be used as display name.
          type: string
          maxLength: 255
        schemaCount:
          type: integer
          format: int32
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    FeaturePaginatedListData:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/FeatureListResponse'
        nextToken:
          type: string
        context:
          $ref: '#/components/schemas/PaginationOptions'
    FileDownloadUrlResponse:
      type: object
      additionalProperties: false
      required:
        - downloadUrl
      properties:
        downloadUrl:
          type: string
    Alias:
      type: object
      description: Represents an Alias
      additionalProperties: false
      required:
        - value
        - createdAt
      properties:
        value:
          type: string
        createdAt:
          type: string
          format: date-time
    AliasPaginatedResponse:
      type: object
      description: Represents for list response of alias
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Alias'
        nextToken:
          type: string
    AddOn:
      allOf:
        - $ref: '#/components/schemas/CreateAddOnRequest'
        - type: object
          required:
            - id
            - createdAt
            - status
            - displayName
          properties:
            id:
              description: Id of addon
              type: string
              example: addon.1zYnCiM9Bpg.1zYn
            createdAt:
              description: Created Time of addon
              type: string
              format: date-time
            status:
              description: status of addon
              type: string
              enum:
                - ACTIVE
                - ARCHIVED
              example: ACTIVE
            displayName:
              description: |
                Display name of addon. This is an auto-generated field which contains billableName of addon.
                If billableName is not provided, name will be used as display name.
              type: string
    AddOnType:
      type: string
      enum:
        - LICENSE
        - FIXED_FEE
        - CREDIT_GRANT
        - NAMED_LICENSE
      description: |
        LICENSE: Addon can be used in license rate cards
        FIXED_FEE: Addon can be used in fixed fee rate cards
        CREDIT_GRANT: Addon can be used in credit grant rate cards
        NAMED_LICENSE: Addon can be used in license rate cards
    Address:
      description: billing address of the customer
      type: object
      additionalProperties: false
      properties:
        phoneNumber:
          description: Contact number
          type: string
        line1:
          description: Address line 1 (eg. Street, PO Box, Company Name)
          type: string
        line2:
          description: Address line 2 (eg. apartment, suite, unit or building)
          type: string
        postalCode:
          description: ZIP or postal code
          type: string
        city:
          description: City, district, suburb, town or village
          type: string
        state:
          description: State, county, province or region
          type: string
        country:
          description: Two letter country code [ISO-3166-1 Alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
          type: string
    Attribute:
      description: Metric to be recorded
      type: object
      additionalProperties: false
      required:
        - name
        - value
      properties:
        name:
          description: Name of the event attribute
          type: string
          minLength: 1
          maxLength: 50
          example: message
        value:
          description: Value of the event attribute
          type: string
          pattern: ^-?\d{1,512}(\.\d+)?$
          example: 100
        unit:
          description: Unit with which the attribute value was measured. Natively supported units - "Meters, Miles, Kilometers, Grams, Kilograms, ounces, Pounds, Minutes, Hours, Seconds, Milliseconds, Microseconds, None". Clients are free to add any other custom units.
          type: string
          minLength: 1
          maxLength: 50
          example: characters
    BillingConfig:
      type: object
      properties:
        interval:
          description: Represents the number of pricing cycles after which the rate card will be billed
          type: integer
          format: int64
          example: 3
        startOffset:
          description: Represents the offset for pricing cycles after which the rate card will be billed
          type: integer
          format: int64
          example: 5
    BillingEntitlementRateCard:
      description: Billing Entitlement rate card
      type: object
      additionalProperties: false
      required:
        - featureId
        - featureConfigs
        - ratePlan
        - rateValues
        - invoiceTiming
      properties:
        featureId:
          type: string
        featureConfigs:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/FeatureConfig'
        tag:
          type: string
          description: A tag string to group rate cards
        invoiceTiming:
          $ref: '#/components/schemas/InvoiceTiming'
        displayName:
          type: string
          description: Name your rate card, this will be used in invoice
        name:
          type: string
          description: Unique identifier for the rate card in a price plan. If left null it is auto-generated.
        ratePlan:
          $ref: '#/components/schemas/RatePlan'
        rateValues:
          type: array
          items:
            $ref: '#/components/schemas/RateValue'
        recurrenceConfig:
          $ref: '#/components/schemas/RecurrenceConfig'
    CreateAddOnRequest:
      description: Request to create an addon
      type: object
      additionalProperties: false
      required:
        - name
        - type
      properties:
        name:
          description: Name of addon
          type: string
          maxLength: 255
        type:
          $ref: '#/components/schemas/AddOnType'
        billableName:
          description: Billable name of addon. Billable name takes precedence over name to display in invoice.
          type: string
          maxLength: 255
    CreatePricePlanDetailsOverride:
      type: object
      properties:
        pricingCycleConfig:
          $ref: '#/components/schemas/PricingCycleConfig'
        supportedCurrencies:
          type: array
          uniqueItems: true
          minItems: 1
          items:
            type: string
        usageRateCards:
          type: array
          items:
            $ref: '#/components/schemas/UsageRateCard'
        billingEntitlementRateCards:
          type: array
          items:
            $ref: '#/components/schemas/BillingEntitlementRateCard'
        entitlementOverageRateCards:
          type: array
          items:
            $ref: '#/components/schemas/EntitlementOverageRateCard'
        fixedFeeRateCards:
          type: array
          items:
            $ref: '#/components/schemas/FixedFeeRateCard'
        licenseRateCards:
          type: array
          items:
            $ref: '#/components/schemas/LicenseRateCard'
        minimumCommitment:
          $ref: '#/components/schemas/MinimumCommitment'
        creditGrantRateCards:
          type: array
          items:
            $ref: '#/components/schemas/CreditGrantRateCard'
    CreditGrantRateCard:
      description: Credit grant rate card
      type: object
      additionalProperties: false
      required:
        - id
        - rateDetails
        - grantDetails
      properties:
        id:
          type: string
        displayName:
          type: string
        name:
          type: string
          description: Unique identifier for the rate card in a price plan. If left null it is auto-generated.
        tag:
          type: string
          description: A tag string to group creditGrantRateCard
        grantDetails:
          $ref: '#/components/schemas/GrantDetails'
        rateDetails:
          $ref: '#/components/schemas/CreditRateDetails'
        invoiceTiming:
          $ref: '#/components/schemas/InvoiceTiming'
        type:
          $ref: '#/components/schemas/CreditGrantType'
        recurrenceConfig:
          $ref: '#/components/schemas/RecurrenceConfig'
    CreditGrantType:
      type: string
      enum:
        - ONE_TIME
        - RECURRING
      description: Credit grant applies either for a one-time occurrence or for each cycle.
    CreditRateDetails:
      type: object
      description: Amount to be credited
      additionalProperties: false
      required:
        - pricingModel
        - currencySlabRateDetails
      properties:
        pricingModel:
          $ref: '#/components/schemas/PricingModel'
        currencySlabRateDetails:
          type: array
          items:
            $ref: '#/components/schemas/CurrencySlabRateDetail'
    CurrencyRateValue:
      type: object
      required:
        - currency
        - rate
      properties:
        currency:
          type: string
        rate:
          type: number
    CurrencySlabRateDetail:
      type: object
      description: The association of a currency along with its slab detail
      additionalProperties: false
      required:
        - currency
        - creditAmount
        - slabDetails
      properties:
        currency:
          type: string
        creditAmount:
          type: number
          description: The amount of credit that needs to be credited
          minimum: 0
        slabDetails:
          type: array
          items:
            $ref: '#/components/schemas/SlabDetail'
        rateConfig:
          type: object
          additionalProperties:
            type: string
    Dimensions:
      description: Dimensions are tags/labels associated with the events.
      type: object
      additionalProperties:
        type: string
        minLength: 1
        maxLength: 200
        example:
          Country: India
    EntitlementOverageRateCard:
      type: object
      required:
        - ratePlan
        - rateValues
        - featureId
      properties:
        featureId:
          type: string
          description: Unique Identifier of the attached Feature
          maxLength: 50
        displayName:
          type: string
          description: Name to be displayed during invoice
        name:
          type: string
          description: Unique identifier for the rate card in a price plan. If left null it is auto-generated.
        tag:
          type: string
          description: A tag string to group rate cards
        maxQuantity:
          type: number
          description: Maximum quantity allowed for the feature, if not specified, unlimited quantity is allowed
        ratePlan:
          $ref: '#/components/schemas/RatePlan'
        rateValues:
          type: array
          items:
            $ref: '#/components/schemas/RateValue'
        billingConfig:
          $ref: '#/components/schemas/BillingConfig'
          description: Represents the billing config of the entitlement overage rate card. If not specified interval:1 and startOffset:0 is taken as default value
    Event:
      description: Contents of the event
      type: object
      additionalProperties: false
      required:
        - schemaName
        - timestamp
        - accountId
        - attributes
        - dimensions
      properties:
        schemaName:
          description: |
            Name of the Event Schema. 
            Know more about [event schema](https://docs.togai.com/docs/event-schemas)
          type: string
          minLength: 1
          maxLength: 50
        id:
          description: Togai restricts users to ingest events with same id within a period of *45 days*. This restriction is common for [/entitled API](/api-reference/entitlements/ingest-event-if-a-user-is-entitled-to-a-feature), [/ingest API](/api-reference/event-ingestion/ingest-events-to-togai) and [/ingestBatch API](/api-reference/event-ingestion/ingest-events-to-togai-in-batch). i.e, an id used on /ingest API will not be allowed on /ingestBatch or /entitled APIs
          type: string
          maxLength: 512
          example: c0b1306d-f506-43a6-856b-69221efaee6b
        timestamp:
          description: Source time stamp of the event. This timestamp must be in ISO 8601 format.
          type: string
          format: date-time
          example: '2022-06-15T07:30:35.123'
        accountId:
          description: The event will be associated with the provided account
          type: string
          maxLength: 512
          example: 1
        attributes:
          description: Attributes are numeric values. It can be usage metric which you push to Togai
          type: array
          minItems: 0
          maxItems: 10
          items:
            $ref: '#/components/schemas/Attribute'
        dimensions:
          $ref: '#/components/schemas/Dimensions'
    ExpiryType:
      type: string
      description: Expiry type of grant
      enum:
        - PRICING_CYCLE
        - NO_EXPIRY
        - CUSTOM
    FeatureConfig:
      description: Feature configuration object
      type: object
      additionalProperties: false
      required:
        - effectiveUntil
        - featureCreditLimit
      properties:
        effectiveFrom:
          type: string
          format: duration
        effectiveUntil:
          type: string
          format: duration
        featureCreditLimit:
          type: number
          minimum: 0
    FixedFeeRateCard:
      title: FixedFeeRateCard
      type: object
      required:
        - id
        - rateValues
        - enableProration
      properties:
        id:
          description: Unique Identifier of the attached AddOn
          type: string
          maxLength: 50
        displayName:
          type: string
          description: Name of the attached AddOn
        name:
          type: string
          description: Unique identifier for the rate card in a price plan. If left null it is auto-generated.
        tag:
          type: string
          description: A tag string to group fixedFeeRateCards
        invoiceTiming:
          $ref: '#/components/schemas/InvoiceTiming'
        type:
          $ref: '#/components/schemas/FixedFeeType'
        rateValues:
          type: array
          items:
            $ref: '#/components/schemas/CurrencyRateValue'
        enableProration:
          type: boolean
          example: false
        recurrenceConfig:
          $ref: '#/components/schemas/RecurrenceConfig'
    FixedFeeType:
      type: string
      enum:
        - ONE_TIME
        - RECURRING
      description: Fixed fee applies either for a one-time occurrence or for each cycle.
    GrantDetails:
      description: Grant details of Credit Grant Rate Card
      type: object
      additionalProperties: false
      required:
        - priority
        - expiryType
      properties:
        priority:
          type: integer
          minimum: 0
        expiryType:
          $ref: '#/components/schemas/ExpiryType'
        expiryDuration:
          type: string
          format: duration
        applicableEntityIds:
          type: array
          items:
            type: string
    InvoiceTiming:
      type: string
      enum:
        - IN_ADVANCE
        - IN_ARREARS
        - PREPAID
      x-enum-varnames:
        - IN_ADVANCE
        - IN_ARREARS
        - PREPAID
      description: |
        If IN_ADVANCE, the rate card will be invoiced in the previous billing cycle.
        If IN_ARREARS, the rate card will be invoiced in the current billing cycle.
        If PREPAID, credits/entitlements will be granted only after invoice is paid
    LicenseRateCard:
      title: LicenseRateCard
      type: object
      required:
        - id
        - rateValues
        - ratePlan
        - enableProration
      properties:
        id:
          description: Unique Identifier of the attached AddOn
          type: string
          maxLength: 50
        type:
          $ref: '#/components/schemas/AddOnType'
        displayName:
          type: string
          description: Name of the attached AddOn
        name:
          type: string
          description: Unique identifier for the rate card in a price plan. If left null it is auto-generated.
        tag:
          type: string
          description: A tag string to group licenseRateCards
        invoiceTiming:
          $ref: '#/components/schemas/InvoiceTiming'
        usageCycle:
          $ref: '#/components/schemas/UsageCycleInterval'
        enableProration:
          type: boolean
          example: false
        config:
          $ref: '#/components/schemas/LicenseRateCardConfig'
        ratePlan:
          $ref: '#/components/schemas/RatePlan'
        rateValues:
          type: array
          items:
            $ref: '#/components/schemas/RateValue'
        proratedRefundMode:
          $ref: '#/components/schemas/ProratedRefundMode'
    LicenseRateCardConfig:
      title: LicenseRateCardConfig
      type: object
      properties:
        maxQuantity:
          description: Max allowed quantity for a particular license in a price plan
          type: integer
          format: int64
          example: 100
        maxQuantityBreachAction:
          $ref: '#/components/schemas/MaxQuantityBreachAction'
    MaxQuantityBreachAction:
      type: string
      enum:
        - DO_NOTHING
      description: |
        Action to be taken when the license maxQuantity is breached: 
        - `DO_NOTHING`: Refrain from granting any new licenses.
    MinimumCommitment:
      title: MinimumCommitment
      type: object
      required:
        - displayName
        - rateValues
      properties:
        displayName:
          type: string
        rateValues:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/CurrencyRateValue'
    PricePlan:
      description: Price plan entity
      type: object
      additionalProperties: false
      required:
        - id
        - name
        - type
        - status
        - pricingSchedule
      properties:
        id:
          type: string
          description: Price plan id
        name:
          type: string
          description: Name of the price plan
          maxLength: 50
        type:
          $ref: '#/components/schemas/PricePlanType'
        description:
          description: Description of price plan
          type: string
          maxLength: 255
        status:
          description: Status of Price plan
          type: string
          enum:
            - DRAFT
            - ACTIVE
            - ARCHIVED
        pricingSchedule:
          type: array
          items:
            $ref: '#/components/schemas/PricingSchedule'
    PricePlanDetails:
      type: object
      required:
        - supportedCurrencies
        - activeCurrencies
      properties:
        supportedCurrencies:
          type: array
          uniqueItems: true
          items:
            type: string
        activeCurrencies:
          type: array
          uniqueItems: true
          readOnly: true
          items:
            type: string
        pricingCycleConfig:
          $ref: '#/components/schemas/PricingCycleConfig'
        usageRateCards:
          type: array
          items:
            $ref: '#/components/schemas/UsageRateCard'
        fixedFeeRateCards:
          type: array
          items:
            $ref: '#/components/schemas/FixedFeeRateCard'
        licenseRateCards:
          type: array
          items:
            $ref: '#/components/schemas/LicenseRateCard'
        billingEntitlementRateCards:
          type: array
          items:
            $ref: '#/components/schemas/BillingEntitlementRateCard'
        entitlementOverageRateCards:
          type: array
          items:
            $ref: '#/components/schemas/EntitlementOverageRateCard'
        minimumCommitment:
          $ref: '#/components/schemas/MinimumCommitment'
        creditGrantRateCards:
          type: array
          items:
            $ref: '#/components/schemas/CreditGrantRateCard'
        type:
          $ref: '#/components/schemas/PricePlanType'
        deferredRevenue:
          type: boolean
        allow_ongoing_cycle_updates:
          description: |
            Allow changes to price plan from the beginning of the ongoing cycle.
            type: boolean
    PricePlanDetailsOverride:
      allOf:
        - $ref: '#/components/schemas/CreatePricePlanDetailsOverride'
        - type: object
          properties:
            fixedFeeRateCards:
              type: array
              minItems: 1
              items:
                $ref: '#/components/schemas/FixedFeeRateCard'
    PricePlanType:
      type: string
      description: Type of price plan
      enum:
        - BILLING
        - PURCHASE
    PriceType:
      type: string
      enum:
        - FLAT
        - PER_UNIT
        - PACKAGE
    PricingCycleConfig:
      type: object
      description: Represents configurations related to pricing cycle
      required:
        - interval
        - gracePeriod
      properties:
        interval:
          $ref: '#/components/schemas/PricingCycleInterval'
        startOffset:
          type: object
          description: |
            Represents the start of pricing cycle in terms of
             - dayOffset - number of days from beginning of week / month and
             - monthOffset - number of months from beginning of interval (quarter, half-year or year)
            Note: If a day with offset doesn't exist for a month, closest previous day is considered
            Examples:
            WEEKLY -
              - {dayOffset: 1, monthOffset: NIL} - First day of every week (Monday)
              - {dayOffset: 3, monthOffset: NIL} - 3rd day of every week (Wednesday)
              - {dayOffset: LAST, monthOffset: NIL} - Last day of every week (Sunday)
            MONTHLY -
              - {dayOffset: 1, monthOffset: NIL} - First day of every month
              - {dayOffset: 12, monthOffset: NIL} - 12th of every month
              - {dayOffset: 28, monthOffset: NIL} - 28th of every month. i.e, 28th of Jan, 28th of Feb, ...
              - {dayOffset: 30, monthOffset: NIL} - 30th of every month. i.e, 28th of Jan, 28th of Feb, ...
              - {dayOffset: LAST, monthOffset: NIL} - Last day of every month. i.e, 31st of Jan, 28th of Feb, ...
            QUARTERLY
              - {dayOffset: 15, monthOffset: FIRST} - 15th Jan, 15th Apr, 15th Jul and 15th Oct
              - {dayOffset: 15, monthOffset: 2} - 15th Feb, 15th May, 15th Aug and 15th Nov
              - {dayOffset: 15, monthOffset: LAST} - 15th Mar, 15th Jun, 15th Sep and 15th Dec
              - {dayOffset: LAST, monthOffset: FIRST} - 31st Jan, 30th Apr, 30th Jul and 31th Oct
            HALF_YEARLY
              - {dayOffset: 15, monthOffset: FIRST} - 15th Jan and 15th Jul
              - {dayOffset: 15, monthOffset: 4} - 15th Apr and 15th Oct
              - {dayOffset: 15, monthOffset: LAST} - 15th Jun and 15th Dec
            ANNUALLY
              - {dayOffset: 15, monthOffset: FIRST} - 15th Jan
              - {dayOffset: 15, monthOffset: 1} - 15th Jan
              - {dayOffset: LAST, monthOffset: 2} - 29th Feb on Leap year, 28th otherwise 
              - {dayOffset: 15, monthOffset: 8} - 15th Aug
              - {dayOffset: 15, monthOffset: LAST} - 15th Dec
          required:
            - dayOffset
            - monthOffset
          properties:
            dayOffset:
              type: string
              description: |
                If interval is WEEKLY, min: "1" and max: "7" as strings. Spl. string allowed: LAST
                Otherwise, min: "1" and max: "31" as strings. Spl. string allowed: LAST
            monthOffset:
              type: string
              description: |
                min: "1" and max: "12". Spl. string allowed: FIRST / LAST.
                For QUARTERLY only 1 - 3 is allowed and for HALF_YEARLY 1 - 6. This being an optional field, shouldn't be passed for MONTHLY.
        gracePeriod:
          type: integer
          description: |
            Togai allows you to ingest past dated events that will be processed by a pricing cycle till the end grace period. 
            For example: Pricing cycle is Monthly from 1st to 30th and gracePeriod is 5 days which next month 1 to 5th date, you can ingest past dated events during this grace period.
          format: int32
          example: 3
        anniversaryCycle:
          type: boolean
          description: |
            Togai calculates the startOffsets based on the date of association instead of requiring from the user and 
            these offsets will be applied as an override if this flag is enabled.
            Examples:
            WEEKLY -
              - 23/10/2023 (Monday) - {dayOffset: 1, monthOffset: NIL} 
              - 25/10/2023 (Wednesday) - {dayOffset: 3, monthOffset: NIL} 
              - 29/10/2023 (Sunday) - {dayOffset: 7, monthOffset: NIL}
            MONTHLY -
              - 1st Oct - {dayOffset: 1, monthOffset: NIL}
              - 12th Oct - {dayOffset: 12, monthOffset: NIL}
              - 28th Oct - {dayOffset: 28, monthOffset: NIL}
              - 30th Oct - {dayOffset: 30, monthOffset: NIL}
              - 31th Oct - {dayOffset: LAST, monthOffset: NIL}
            QUARTERLY
              - 15th Jan, 15th Apr, 15th Jul and 15th Oct - {dayOffset: 15, monthOffset: 1}
              - 15th Feb, 15th May, 15th Aug and 15th Nov - {dayOffset: 15, monthOffset: 2} 
              - 15th Mar, 15th Jun, 15th Sep and 15th Dec - {dayOffset: 15, monthOffset: 3}
            HALF_YEARLY
              - 15th Jan and 15th Jul - {dayOffset: 15, monthOffset: 1} 
              - 15th Apr and 15th Oct - {dayOffset: 15, monthOffset: 4} 
              - 15th Jun and 15th Dec - {dayOffset: 15, monthOffset: 6}
            ANNUALLY
              - 15th Jan - {dayOffset: 15, monthOffset: 1}
              - 29th Feb on Leap year  - {dayOffset: LAST, monthOffset: 2}
              - 28th Feb  - {dayOffset: LAST, monthOffset: 2}
              - 15th Aug - {dayOffset: 15, monthOffset: 8}
              - 15th Dec - {dayOffset: 15, monthOffset: 12}
    PricingCycleInterval:
      type: string
      description: Interval field allow you to define the billing interval you would like to set
      enum:
        - WEEKLY
        - MONTHLY
        - QUARTERLY
        - HALF_YEARLY
        - ANNUALLY
    PricingModel:
      type: string
      description: |
        Togai supports two type of pricing model Tiered and Volume. Tiered pricing model applies respective slab and its rate to the usage value while volume pricing model applies the latest matching slab of the usage value and applies respective rate. 
        For more understanding read [Rate Cards](https://docs.togai.com/docs/priceplan#setting-up-multiple-rate-cards)
      enum:
        - TIERED
        - VOLUME
    PricingRule:
      type: object
      description: Represents pricing rules of a price plan. i.e, price plan bound by time.
      additionalProperties: false
      required:
        - id
        - name
        - version
        - order
        - computation
        - action
      properties:
        id:
          type: string
        name:
          type: string
        version:
          type: integer
          format: int32
          minimum: 1
        invoiceTiming:
          $ref: '#/components/schemas/PricingRuleTiming'
        order:
          type: integer
          format: int32
          minimum: 1
        condition:
          description: JSON logic condition deciding whether to compute this pricing rule or not
          type: string
        computation:
          description: JSON logic to be computed
          type: string
        action:
          description: JSON logic to be computed
          title: action
          $ref: '#/components/schemas/PricingRuleAction'
    PricingRuleAction:
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - ADD
            - UPDATE
        target:
          type: string
        id:
          type: string
        description:
          type: string
        metadata:
          type: object
          additionalProperties:
            type: string
    PricingRuleTiming:
      type: string
      enum:
        - IN_ADVANCE
        - IN_ARREARS
      x-enum-varnames:
        - IN_ADVANCE
        - IN_ARREARS
      description: |
        If IN_ADVANCE, the rule will be applied on rate cards with invoice timing IN_ADVANCE .
        If IN_ARREARS, the rule will be applied on rate cards with invoice timing IN_ARREARS .
    PricingSchedule:
      type: object
      description: Represents effectiveness period and config of a price plan. i.e, price plan bound by time.
      additionalProperties: false
      required:
        - id
        - startDate
        - endDate
        - version
        - isOverriden
      properties:
        id:
          type: string
        pricePlanDetails:
          $ref: '#/components/schemas/PricePlanDetails'
        startDate:
          type: string
          format: date-time
        endDate:
          type: string
          format: date-time
        version:
          type: integer
          format: int32
          minimum: 1
        pricingRules:
          type: array
          items:
            $ref: '#/components/schemas/PricingRule'
        isOverriden:
          type: boolean
    ProratedRefundMode:
      type: string
      enum:
        - NONE
        - CREDITS
        - PAYMENT
        - WALLET
    QueryColumn:
      type: object
      required:
        - columnName
      properties:
        dataSource:
          type: string
        columnName:
          type: string
        alias:
          type: string
        functions:
          type: array
          items:
            $ref: '#/components/schemas/QueryFunction'
        aggregator:
          type: string
    QueryFilter:
      type: object
      required:
        - column
        - operator
        - args
      properties:
        column:
          $ref: '#/components/schemas/QueryColumn'
        operator:
          type: string
        args:
          type: array
          items:
            type: string
    QueryFunction:
      type: object
      required:
        - name
        - args
      properties:
        name:
          type: string
        args:
          type: array
          items:
            type: string
    QueryInput:
      type: object
      required:
        - selects
        - baseDataSource
        - limit
        - sort
      properties:
        selects:
          type: array
          items:
            $ref: '#/components/schemas/QueryColumn'
        queryFilters:
          type: array
          items:
            $ref: '#/components/schemas/QueryFilter'
        baseDataSource:
          type: string
        sort:
          type: array
          items:
            type: object
            required:
              - column
              - sortOrder
            properties:
              column:
                $ref: '#/components/schemas/QueryColumn'
              sortOrder:
                type: string
        seekValues:
          type: array
          items:
            type: string
        limit:
          type: integer
    RateCard:
      allOf:
        - $ref: '#/components/schemas/RateCardData'
        - type: object
          required:
            - name
            - pricePlanId
            - displayName
            - referenceId
            - referenceType
          properties:
            name:
              type: string
              maxLength: 50
            referenceId:
              type: string
              maxLength: 50
            referenceType:
              type: string
              maxLength: 50
            displayName:
              type: string
              description: Display name of the rate card
              maxLength: 255
            currencies:
              description: List of currencies supported by the rate card
              type: array
              uniqueItems: true
              items:
                type: string
            pricePlanId:
              description: Price plan identifier
              type: string
              maxLength: 50
            accountId:
              description: Account identifier
              type: string
    RateCardData:
      description: Request to create a rate card
      type: object
      additionalProperties: false
      required:
        - billableId
        - invoiceTiming
        - rateCardDetails
        - type
      properties:
        billableId:
          description: Billable identifier
          type: string
          maxLength: 50
        type:
          $ref: '#/components/schemas/RateCardType'
        displayName:
          type: string
          description: Display name of the rate card
          maxLength: 255
        invoiceTiming:
          $ref: '#/components/schemas/InvoiceTiming'
        rateCardDetails:
          $ref: '#/components/schemas/RateCardDetails'
        tag:
          type: string
          description: Tag for rate card
          maxLength: 50
    RateCardDetails:
      description: Rate card details
      type: object
      additionalProperties: false
      properties:
        fixedFeeRateCard:
          $ref: '#/components/schemas/FixedFeeRateCard'
        billingEntitlementRateCard:
          $ref: '#/components/schemas/BillingEntitlementRateCard'
        creditGrantRateCard:
          $ref: '#/components/schemas/CreditGrantRateCard'
        usageRateCard:
          $ref: '#/components/schemas/UsageRateCard'
        licenseRateCard:
          $ref: '#/components/schemas/LicenseRateCard'
        entitlementOverageRateCard:
          $ref: '#/components/schemas/EntitlementOverageRateCard'
        minimumCommitmentRateCard:
          $ref: '#/components/schemas/MinimumCommitment'
    RateCardType:
      description: Rate card type
      type: string
      enum:
        - MINIMUM_COMMITMENT
        - BILLING_ENTITLEMENT
        - CREDIT_GRANT
        - ENTITLEMENT_OVERAGE
        - FIXED_FEE
        - LICENSE
        - USAGE
    RatePlan:
      type: object
      description: Contains all rate related configurations
      required:
        - pricingModel
        - slabs
      properties:
        pricingModel:
          $ref: '#/components/schemas/PricingModel'
        slabs:
          description: Rate cards can have single or multiple slab up to 100.
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Slab'
    RateValue:
      type: object
      description: Represents a rate
      required:
        - currency
        - slabRates
      properties:
        currency:
          type: string
        slabRates:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/SlabRate'
        rateConfig:
          type: object
          additionalProperties:
            type: string
    RecurrenceConfig:
      type: object
      properties:
        interval:
          description: Represents the number of pricing cycles after which the rate card will be charged
          type: integer
          format: int64
          example: 3
        offset:
          description: Represents the offset for pricing cycles after which the rate card will be charged
          type: integer
          format: int64
          example: 5
    SettingDataType:
      type: string
      enum:
        - STRING
        - NUMERIC
        - JSON
        - JSON_LOGIC
    Slab:
      type: object
      description: Represents a pricing priceType (rates + slabs) for usage price plan
      required:
        - order
        - startAfter
        - priceType
      properties:
        order:
          type: integer
          format: int32
          minimum: 1
          maximum: 10
        startAfter:
          type: number
        priceType:
          $ref: '#/components/schemas/PriceType'
        slabConfig:
          type: object
          additionalProperties:
            type: string
    SlabDetail:
      type: object
      description: The details of a slab
      additionalProperties: false
      required:
        - startAfter
        - priceType
        - rate
      properties:
        startAfter:
          type: number
        priceType:
          $ref: '#/components/schemas/PriceType'
        slabConfig:
          type: object
          additionalProperties:
            type: string
        rate:
          type: number
        slabRateConfig:
          type: object
          additionalProperties:
            type: string
    SlabRate:
      type: object
      description: Represents a rate for a slab
      required:
        - order
        - rate
      properties:
        order:
          type: integer
          format: int32
        rate:
          type: number
        slabRateConfig:
          type: object
          additionalProperties:
            type: string
    UsageCycleInterval:
      type: string
      description: |
        UsageCycleInterval field allows you to treat the billing interval as many smaller windows. Revenue is calculated for
        each of the windows (usage cycles) and their sum is considered as the billing interval revenue.
        Example: 1 Named License being used across entire billing interval. Rate Value: $1/license
        CASE 1: Without usage cycle. $1 is charged for the entire billing cycle.
        CASE 2: Usage cycle is configure to be WEEKLY and the billing interval has 4 weeks. In this case $1 is charged 
        for each week totalling to $4 across for the billing interval
      enum:
        - WEEKLY
        - MONTHLY
        - QUARTERLY
        - HALF_YEARLY
        - ANNUALLY
    UsageRateCard:
      type: object
      required:
        - usageMeterId
        - ratePlan
        - rateValues
      properties:
        displayName:
          type: string
          description: Name your rate card, this will be displayed in the Togai App
        name:
          type: string
          description: Unique identifier for the rate card in a price plan. If left null it is auto-generated.
        tag:
          type: string
          description: A tag string to group usageRateCards
        usageMeterId:
          type: string
          example: um.1zYnCiM9Bpg.1zYn
        ratePlan:
          $ref: '#/components/schemas/RatePlan'
        rateValues:
          type: array
          items:
            $ref: '#/components/schemas/RateValue'
    IngestEventRequest:
      description: Payload for ingesting events
      type: object
      additionalProperties: false
      required:
        - event
      properties:
        event:
          $ref: '#/components/schemas/Event'
    IngestBatchEventRequest:
      description: Payload for ingesting batch events
      type: object
      additionalProperties: false
      required:
        - events
      properties:
        events:
          type: array
          minItems: 1
          maxItems: 1000
          items:
            $ref: '#/components/schemas/Event'
    IngestEventResponse:
      type: object
      additionalProperties: false
      properties:
        success:
          type: boolean
          example: true
        statusCode:
          type: integer
          format: int32
        name:
          type: string
        message:
          type: string
          maxLength: 500
        code:
          type: string
        details:
          type: object
    GetEventResponse:
      description: Get single event response
      type: object
      required:
        - events
      additionalProperties: false
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/EventWithStatusAndEventPipelineInfo'
    EventCorrectionRequest:
      description: Event Correction Payload for event correction
      type: object
      additionalProperties: false
      properties:
        event:
          $ref: '#/components/schemas/Event'
    GetEventsResponse:
      description: Get batch events response
      type: object
      additionalProperties: false
      required:
        - events
      properties:
        events:
          type: array
          minItems: 1
          maxItems: 50
          items:
            $ref: '#/components/schemas/EventWithStatus'
        nextToken:
          type: string
          maxLength: 500
          example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ==
    EventsCorrectionResponse:
      description: Events Correction response
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          minItems: 1
          maxItems: 50
          items:
            $ref: '#/components/schemas/EventCorrectionInfo'
    LicenseUpdateRequest:
      description: License update request
      type: object
      additionalProperties: false
      required:
        - licenseId
        - accountId
        - updateType
        - quantity
      properties:
        licenseId:
          type: string
          description: The license id for which the update is requested
          maxLength: 50
          example: lic.fdjsl.313
        accountId:
          type: string
          description: The account id for which the license is being updated
          maxLength: 50
          example: acc.fdjsl.313
        updateType:
          type: string
          description: The type of update to be performed
          enum:
            - RELATIVE
            - ABSOLUTE
        quantity:
          type: number
          description: The quantity to be updated
        effectiveFrom:
          type: string
          description: The effective from date for the update
          format: date-time
          example: '2021-03-04T14:25:10Z'
        idempotencyKey:
          type: string
          description: The idempotency key for uniqueness of the license update request
          example: idempotencyKey#1
        metadata:
          type: object
          additionalProperties:
            type: string
          example:
            key1: value1
            key2: value2
    LicenseEntryDetailsUpdateRequest:
      description: License Entry Details update request
      type: object
      additionalProperties: false
      required:
        - accountId
        - effectiveFrom
        - metadata
      properties:
        accountId:
          type: string
          description: The account id for which the license is being updated
          maxLength: 50
          example: acc.fdjsl.313
        effectiveFrom:
          type: string
          description: The effective from date of the license entry
          format: date-time
          example: '2021-03-04T14:25:10Z'
        metadata:
          type: object
          additionalProperties:
            type: string
          example:
            key1: value1
            key2: value2
    GetLicenseUpdatesResponse:
      description: Get license updates response
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/LicenseUpdateResponse'
        nextToken:
          type: string
          maxLength: 500
          example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ==
    LicenseUpdate:
      description: License update
      type: object
      additionalProperties: false
      required:
        - licenseId
        - accountId
        - quantity
        - effectiveFrom
      properties:
        licenseId:
          type: string
          maxLength: 50
          example: lic.fdjsl.313
        accountId:
          type: string
          maxLength: 50
          example: acc.fdjsl.313
        quantity:
          description: Absolute quantity of the license
          type: number
          example: 10
        effectiveFrom:
          type: string
          format: date-time
          example: '2021-03-04T14:25:10Z'
        metadata:
          type: object
          additionalProperties:
            type: string
          example:
            key1: value1
            key2: value2
    LicenseUpdateResponse:
      allOf:
        - $ref: '#/components/schemas/LicenseUpdate'
        - type: object
          additionalProperties: false
          required:
            - createdAt
          properties:
            createdAt:
              type: string
              format: date-time
              example: '2021-03-04T14:25:10Z'
    NamedLicenseUpdate:
      description: Named License update response
      type: object
      additionalProperties: false
      required:
        - id
        - licenseId
        - accountId
        - name
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          maxLength: 50
          example: named_license_entry.20rvWRx.0ZwPG
        licenseId:
          type: string
          maxLength: 50
          example: addon.fdjsl.313
        accountId:
          type: string
          maxLength: 50
          example: '123'
        name:
          type: string
          maxLength: 50
          example: user1
        effectiveFrom:
          type: string
          format: date-time
          example: '2021-03-04T14:25:10Z'
        effectiveUntil:
          type: string
          format: date-time
          example: '2021-03-04T14:25:10Z'
        createdAt:
          type: string
          format: date-time
          example: '2021-03-04T14:25:10Z'
        updatedAt:
          type: string
          format: date-time
          example: '2021-03-04T14:25:10Z'
    NamedLicenseUpdatesPaginatedResponse:
      description: Named License updates paginated response
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/NamedLicenseUpdate'
        nextToken:
          type: string
          maxLength: 500
          example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ==
    GetFeatureCreditsResponse:
      description: Get feature credits response
      type: object
      additionalProperties: false
      required:
        - accountId
        - featureId
        - granted
        - balance
        - usedOverage
      properties:
        accountId:
          type: string
          maxLength: 50
          example: acc.fdjsl.313
        featureId:
          type: string
          maxLength: 50
          example: feat.fdjsl.313
        granted:
          type: number
          example: 15
        balance:
          type: number
          example: 10
        overageLimit:
          type: number
          example: 15
        usedOverage:
          type: number
          example: 10
    FeatureCreditEntry:
      description: Get feature credits response
      type: object
      additionalProperties: false
      required:
        - id
        - source
        - status
        - used
        - effectiveFrom
        - effectiveUntil
      properties:
        id:
          type: string
          maxLength: 50
          example: purchase.20rvWRxQcQK.0ZwPG$1
        source:
          type: string
          description: Source of the feature credit
          enum:
            - ENTITLEMENT
            - PRICE_PLAN
            - OVERAGE
            - REFUND
        status:
          type: string
          description: Status of the feature credit entry
          enum:
            - ACTIVE
            - EXPIRED
            - VOIDED
        effectiveFrom:
          type: string
          format: date-time
          example: '2021-03-04T14:25:10Z'
        effectiveUntil:
          type: string
          format: date-time
          example: '2021-05-20T01:00:10Z'
        granted:
          type: number
          example: 15
        balance:
          type: number
          example: 10
        used:
          type: number
          example: 10
    GetFeatureCreditEntriesPaginatedResponse:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/FeatureCreditEntry'
        nextToken:
          type: string
    EventWithStatus:
      description: Raw usage event ingested by the business team and the status of the event ingestion.
      type: object
      additionalProperties: false
      required:
        - referenceId
        - eventPayload
        - ingestionStatus
        - createdAt
      properties:
        referenceId:
          type: string
          description: Unique id generated by Togai to identify an event uniquely
        eventPayload:
          $ref: '#/components/schemas/Event'
        ingestionStatus:
          $ref: '#/components/schemas/IngestionStatus'
        customerId:
          description: The associated account belongs to this customer
          type: string
          maxLength: 50
          example: '1'
        source:
          $ref: '#/components/schemas/EventSource'
        createdAt:
          description: Created time stamp of the event. This timestamp must be in ISO 8601 format.
          type: string
          format: date-time
          example: '2022-06-15T07:30:35.123'
    EventWithStatusAndEventPipelineInfo:
      allOf:
        - $ref: '#/components/schemas/EventWithStatus'
        - type: object
          additionalProperties: false
          required:
            - eventPipelineInfo
          properties:
            eventPipelineInfo:
              $ref: '#/components/schemas/EventPipelineInfo'
    EventCorrectionInfo:
      allOf:
        - $ref: '#/components/schemas/EventWithStatus'
        - type: object
          additionalProperties: false
          required:
            - status
            - reason
          properties:
            status:
              type: string
              description: Status of the event requested for correction
              enum:
                - REVERTED
                - REVERTED_AND_REINGESTED
                - FAILED
            reason:
              type: string
              description: Status description of the event requested for correction
    IngestionStatus:
      description: Status about the event ingestion.
      type: object
      additionalProperties: false
      required:
        - status
      properties:
        status:
          type: string
          description: Ingestion status
          enum:
            - INGESTION_IN_PROGRESS
            - INGESTION_FAILED
            - INGESTION_FAILED_SCHEMA_NOT_DEFINED
            - INGESTION_FAILED_ENRICHMENT_FAILED
            - INGESTION_FAILED_UNITS_INVALID
            - INGESTION_COMPLETED_NO_MATCHING_METERS
            - INGESTION_COMPLETED_EVENT_METERED
            - INGESTION_COMPLETED_EVENT_NOT_METERED
            - INGESTION_FAILED_PAST_GRACE_PERIOD
            - INGESTION_FAILED_ACCOUNT_NOT_FOUND
            - INGESTION_FAILED_DUPLICATE_EVENT
            - INGESTION_FAILED_NO_EVENT_ID
            - INGESTION_FAILED_INVALID_NAMED_LICENSE_EVENT
            - INGESTION_FAILED_INSUFFICIENT_CREDITS
            - REVERTED
            - UNKNOWN
          example: INGESTION_COMPLETED
        statusDescription:
          type: string
          maxLength: 250
          example: Ingestion Completed successfully
    EventSource:
      description: Source of ingestion of event
      type: object
      additionalProperties: false
      required:
        - id
        - type
      properties:
        id:
          type: string
          description: Unique identifier representing the source
          maxLength: 100
        type:
          type: string
          description: Type of source
          maxLength: 100
    EventPipelineInfo:
      description: Information related to ingestion of an event
      type: object
      additionalProperties: false
      properties:
        eventSchema:
          title: EventPipelineInfoEventSchema
          type: object
          additionalProperties: false
          required:
            - name
            - version
          properties:
            name:
              type: string
            version:
              type: integer
              format: int32
        usageMeters:
          type: array
          items:
            title: EventPipelineInfoUsageMeters
            type: object
            additionalProperties: false
            required:
              - id
              - name
              - version
              - status
            properties:
              id:
                type: string
              name:
                type: string
              version:
                type: integer
                format: int32
              status:
                type: string
                enum:
                  - PROCESSED_FILTERED_OUT
                  - PROCESSED_UNITS_COMPUTED
              units:
                type: number
        pricePlans:
          type: array
          items:
            title: EventPipelineInfoPricePlans
            type: object
            additionalProperties: false
            required:
              - name
              - id
              - scheduleId
              - cycleStart
              - cycleEnd
            properties:
              name:
                type: string
              id:
                type: string
              scheduleId:
                type: string
              cycleStart:
                type: string
                format: date
              cycleEnd:
                type: string
                format: date
              usageMeters:
                type: array
                uniqueItems: true
                items:
                  type: string
        account:
          title: EventPipelineInfoAccount
          type: object
          additionalProperties: false
          required:
            - id
            - name
          properties:
            id:
              type: string
            name:
              type: string
            alias:
              type: string
        customer:
          title: EventPipelineInfoCustomer
          type: object
          additionalProperties: false
          required:
            - id
            - name
          properties:
            id:
              type: string
            name:
              type: string
        featureDetails:
          title: EventPipelineInfoFeatureDetails
          type: object
          additionalProperties: false
          required:
            - featureId
            - mappedAttribute
          properties:
            featureId:
              type: string
            mappedAttribute:
              type: string
            overageInCycle:
              type: number
            overageInEvent:
              type: number
        enrichments:
          title: EventPipelineInfoEnrichments
          type: object
          additionalProperties: false
          properties:
            attributes:
              type: array
              items:
                $ref: '#/components/schemas/EnrichedField'
            dimensions:
              type: array
              items:
                $ref: '#/components/schemas/EnrichedField'
            dependencies:
              type: array
              items:
                $ref: '#/components/schemas/EnrichmentDependency'
        revenueDetails:
          type: array
          items:
            title: EventPipelineInfoRevenueDetails
            type: object
            additionalProperties: false
            required:
              - usageMeterId
              - revenueBaseCurrency
              - revenueInvoiceCurrency
            properties:
              usageMeterId:
                type: string
              revenueBaseCurrency:
                type: number
              revenueInvoiceCurrency:
                type: number
        statusBeforeReverting:
          type: string
        baseCurrency:
          type: string
        invoiceCurrency:
          type: string
    EnrichedField:
      readOnly: true
      description: enriched field
      type: object
      additionalProperties: false
      required:
        - name
        - type
        - value
      properties:
        name:
          type: string
        type:
          type: string
          enum:
            - ATTRIBUTE
            - DIMENSION
        value:
          type: string
    EnrichmentDependency:
      readOnly: true
      description: enrichment dependency
      type: object
      additionalProperties: false
      required:
        - key
        - type
        - value
      properties:
        key:
          type: string
        type:
          type: string
          enum:
            - SETTING
        name:
          type: string
        value:
          type: string
    GetMetricsRequest:
      type: object
      description: Request to get metrics from togai
      additionalProperties: false
      required:
        - startTime
        - endTime
        - metricQueries
      properties:
        startTime:
          type: string
          format: date-time
          description: Start date time of the query (inclusive)
          example: '2017-07-21T00:00:00Z'
        endTime:
          type: string
          format: date-time
          description: End date time of the query (exclusive)
          example: '2017-07-21T00:00:00Z'
        metricQueries:
          type: array
          items:
            $ref: '#/components/schemas/MetricQuery'
          uniqueItems: true
    MetricName:
      type: string
      description: |
        Define the metric you would like to get - allowed options are
        EVENTS - Aggregation of raw events,
        USAGE - Default to METER_USAGE. To be deprecated soon,
        METER_USAGE - Aggregated usage value from Usage meters,
        NAMED_LICENSE_USAGE - Aggregated usage value from Named Licenses,
        REVENUE - Aggregated revenue value from Pricing Plans
        USAGE_FOR_CYCLE - Usage in pricing cycle
        REVENUE_FOR_CYCLE - Revenue in pricing cycle
      enum:
        - EVENTS
        - USAGE
        - METER_USAGE
        - NAMED_LICENSE_USAGE
        - REVENUE
        - USAGE_FOR_CYCLE
        - REVENUE_FOR_CYCLE
      default: EVENTS
    MetricQuery:
      type: object
      description: Object representing a single metrics query
      additionalProperties: false
      required:
        - id
        - name
        - aggregationPeriod
      properties:
        id:
          type: string
          description: |
            Mandatory  for all request. 
            User defined ID for identifying the request for your internal reference
        name:
          $ref: '#/components/schemas/MetricName'
        aggregationPeriod:
          type: string
          description: Set the aggregation period. Allowed periods are HOUR, DAY, WEEK, MONTH
          enum:
            - HOUR
            - DAY
            - WEEK
            - MONTH
          default: DAY
        groupBy:
          type: string
          description: |
            Group your metric with a groupBy field. 
            Allowed fields are 
            ACCOUNT_ID
            EVENT_STATUS 
            SCHEMA_NAME 
            USAGE_METER_ID [Use BILLABLE_ID as this will be deprecated soon...]
            BILLABLE_ID
            RAW_EVENT_STATUS
            Please refer the table above for the list of combinations allowed in the groupBy
        configs:
          description: |
            Configurations.
            | Metric Name       | Config Key | Allowed Values  | Default value |              Description          |
            |-------------------|------------|-----------------|---------------|-----------------------------------|
            | REVENUE           | CURRENCY   | BASE or INVOICE | BASE          | currency to return the revenue in |
            | REVENUE_FOR_CYCLE | CURRENCY   | BASE or INVOICE | BASE          | currency to return the revenue in |
          additionalProperties:
            type: string
        filters:
          type: array
          description: |
            Filter on specific fields. 
            Refer possible fieldNames and fieldValues from the table above.
          minItems: 1
          maxItems: 5
          items:
            type: object
            title: MetricQueryFilterEntry
            description: |

              | Metric Name       | FilterEntry Name |    Allowed groupBy fields                                           |      Default Values      |                 Allowed Values                                  |
              |-------------------|------------------|---------------------------------------------------------------------|--------------------------|-----------------------------------------------------------------|
              | EVENTS            | ACCOUNT_ID       | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, RAW_EVENT_STATUS             | None                     | *\<one or more valid account IDs>                               |
              | EVENTS            | CUSTOMER_ID      | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, RAW_EVENT_STATUS             | None                     | *\<one or more valid customer IDs>                              |
              | EVENTS            | SCHEMA_NAME      | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, RAW_EVENT_STATUS             | None                     | *\<at most one valid schema names>                              |
              | EVENTS            | EVENT_STATUS     | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, RAW_EVENT_STATUS             | [PROCESSED, UNPROCESSED] | oneOrMoreOf PROCESSED, UNPROCESSED, IN_PROGRESS, IngestionStatus|      
              | USAGE             | ACCOUNT_ID       | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid account IDs>                               |
              | USAGE             | CUSTOMER_ID      | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid customer IDs>                              |
              | USAGE             | USAGE_METER_ID   | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid usage meter name>                          |
              | USAGE             | BILLABLE_ID      | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid usage meter name>                          |
              | REVENUE           | ACCOUNT_ID       | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid account IDs>                               |
              | REVENUE           | CUSTOMER_ID      | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid customer IDs>                              |
              | REVENUE           | USAGE_METER_ID   | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid usage meter name>                          |
              | REVENUE           | BILLABLE_ID      | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid usage meter name>                          |
              | EVENTS            | ORGANIZATION_ID  | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | <From auth token>        |                                                                 |
              | USAGE             | ORGANIZATION_ID  | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | <From auth token>        |                                                                 |
              | REVENUE           | ORGANIZATION_ID  | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | <From auth token>        |                                                                 |
              | USAGE_FOR_CYCLE   | ACCOUNT_ID       | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid account IDs>                               |
              | USAGE_FOR_CYCLE   | CUSTOMER_ID      | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid customer IDs>                              |
              | USAGE_FOR_CYCLE   | USAGE_METER_ID   | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid usage meter name>                          |
              | USAGE_FOR_CYCLE   | BILLABLE_ID      | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid usage meter name>                          |
              | REVENUE_FOR_CYCLE | ACCOUNT_ID       | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid account IDs>                               |
              | REVENUE_FOR_CYCLE | CUSTOMER_ID      | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid customer IDs>                              |
              | REVENUE_FOR_CYCLE | USAGE_METER_ID   | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid usage meter name>                          |
              | REVENUE_FOR_CYCLE | BILLABLE_ID      | ACCOUNT_ID, USAGE_METER_ID, BILLABLE_ID CUSTOMER_ID                 | None                     | *\<one or more valid usage meter name>                          |
            additionalProperties: false
            required:
              - fieldName
              - fieldValues
            properties:
              fieldName:
                type: string
                example: ACCOUNT_ID
              fieldValues:
                type: array
                items:
                  type: string
                  example: account#1
    UpdateFeatureCreditsRequest:
      type: object
      properties:
        effectiveUntil:
          type: string
          format: date-time
          description: Expiry date-time for a feature credits entry
        granted:
          type: number
          description: Granted units for a feature credits entry
    GetMetricsResponse:
      type: object
      description: Response to GetMetrics Request
      additionalProperties: false
      required:
        - results
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/MetricQueryResponse'
    MetricQueryResponse:
      type: object
      description: Response to GetMetrics Request
      additionalProperties: false
      required:
        - id
        - name
        - data
      properties:
        id:
          type: string
        name:
          $ref: '#/components/schemas/MetricName'
        data:
          type: array
          items:
            $ref: '#/components/schemas/MetricDataPoints'
    MetricDataPoints:
      type: object
      additionalProperties: false
      required:
        - timestamps
        - metricValues
      properties:
        groupedBy:
          title: MetricDataPointsGroupedBy
          type: object
          required:
            - fieldName
            - fieldValue
          properties:
            fieldName:
              type: string
            fieldValue:
              type: string
        timestamps:
          type: array
          items:
            type: string
            format: date-time
          maxItems: 300
        metricValues:
          type: array
          items:
            type: number
          maxItems: 300
    ValidateEntitlementValueRequest:
      type: object
      additionalProperties: false
      required:
        - value
      properties:
        value:
          type: string
          description: Value of the entitlement
    GetEntitlementValuesResponse:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            type: object
            additionalProperties: false
            required:
              - featureId
              - value
            properties:
              featureId:
                type: string
                description: Feature ID
              value:
                type: string
                description: Value of the feature
    RevenueSummaryWithMetadata:
      type: object
      required:
        - revenue
      properties:
        revenue:
          type: number
        revenueSummary:
          description: |
            Field: revenue is computed for all rate cards
            Field: slabRevenues is supported for only usage/license
            Field: metadata is populated based on application of rateConfig('minimumRate', 'maximumRate')
          type: array
          items:
            $ref: '#/components/schemas/RevenueSummaryWithMetadata'
        slabRevenues:
          type: array
          items:
            $ref: '#/components/schemas/SlabRevenueWithMetadata'
        metadata:
          type: object
          additionalProperties:
            type: string
    SlabRevenue:
      type: object
      required:
        - order
        - usage
        - revenue
      properties:
        order:
          type: integer
          format: int32
          minimum: 1
          maximum: 10
        usage:
          type: number
        revenue:
          type: number
    SlabRevenueWithMetadata:
      allOf:
        - $ref: '#/components/schemas/SlabRevenue'
        - type: object
          properties:
            metadata:
              type: object
              additionalProperties:
                type: string
    CreateCreditRequest:
      type: object
      description: payload to create credits
      additionalProperties: false
      required:
        - creditRequests
      properties:
        creditRequests:
          type: array
          items:
            $ref: '#/components/schemas/CreditRequest'
    CreatePaymentRequest:
      type: object
      description: payload to create payment
      additionalProperties: false
      required:
        - accountId
        - externalPaymentReference
        - lineItemRecords
        - currency
        - totalAmount
      properties:
        description:
          description: A brief description of the payment
          type: string
          maxLength: 512
          example: Payment for Invoice inv.234.23afv
        notes:
          description: A detailed note about the payment
          type: string
          maxLength: 512
          example: Payment for purchase of credits
        accountId:
          type: string
          maxLength: 512
          example: ACC001
        externalPaymentReference:
          $ref: '#/components/schemas/ExternalPaymentReference'
        lineItemRecords:
          type: array
          minLength: 1
          items:
            $ref: '#/components/schemas/PaymentLineItemRecord'
        currency:
          type: string
          maxLength: 512
          example: USD
        totalAmount:
          type: number
    TopupWalletRequest:
      type: object
      description: Payload to topup wallet of an account
      additionalProperties: false
      required:
        - topupAmount
      properties:
        topupAmount:
          type: number
    UpdateWalletRequest:
      type: object
      description: Payload to update wallet of an account
      additionalProperties: false
      properties:
        effectiveFrom:
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/WalletStatus'
    ExternalPaymentReference:
      type: object
      description: external payment reference object
      additionalProperties: false
      required:
        - sourceName
        - sourceType
        - transactionNumber
      properties:
        sourceName:
          type: string
        sourceType:
          type: string
          enum:
            - GATEWAY
            - CASH
            - CHEQUE
            - BANK_TRANSFER
            - CARD
        transactionNumber:
          description: Check number or Card transaction number
          type: string
        description:
          type: string
        metadata:
          type: object
          additionalProperties: true
    PaymentLineItemRecord:
      type: object
      description: payment line item record object
      additionalProperties: false
      required:
        - type
        - order
      properties:
        type:
          type: string
          enum:
            - INVOICE
            - CREDIT
            - WALLET_CREDIT
        togaiId:
          type: string
          example: inv.234.12efwe
        amount:
          type: number
        order:
          type: integer
          format: int32
    CreditRequest:
      description: Payload to grant Credits
      type: object
      additionalProperties: false
      required:
        - accountId
        - effectiveFrom
        - priority
        - purpose
      properties:
        accountId:
          type: string
          example: ACC001
        purpose:
          type: string
          example: PREPAID_CREDIT
        applicableEntityIds:
          description: |
            List of entity ids for which the credit is applicable. If null or empty, the credit is applicable to all ids. This list can accept special values like: - ALL_USAGE_METER_RATE_CARDS: To apply the credit to all usage meter rate cards - ALL_FIXED_FEE_RATE_CARDS: To apply the credit to all fixed fee rate cards
          type: array
          uniqueItems: true
          items:
            type: string
            example:
              - umg.1znQx9jiIXw.r44fc
              - ALL_USAGE_METER_RATE_CARDS
              - ALL_FIXED_FEE_RATE_CARDS
        effectiveFrom:
          type: string
          format: date
          example: '2020-07-04'
        effectiveUntil:
          type: string
          format: date
          example: '2021-07-04'
        creditAmount:
          type: number
          example: 1000
        priority:
          type: integer
          example: 1
        grantorId:
          description: The entity through which the credit has been granted
          type: string
        idempotencyKey:
          description: The idempotency key for uniqueness of the credit record
          type: string
    ManageMiscellaneousChargesRequest:
      description: Payload to update custom line items
      type: object
      additionalProperties: false
      required:
        - items
      properties:
        items:
          $ref: '#/components/schemas/MiscellaneousCharges'
    CreateCustomInvoiceRequest:
      description: Payload to create invoice
      type: object
      additionalProperties: false
      required:
        - accountId
        - startDate
        - endDate
        - status
        - lineItems
      properties:
        accountId:
          type: string
          example: ACC001
        ownerType:
          type: string
          enum:
            - ACCOUNT
            - INVOICE_GROUP
        startDate:
          type: string
          format: date-time
          example: '2020-06-04T12:00:00.000Z'
        endDate:
          type: string
          format: date-time
          example: '2020-07-04T12:00:00.000Z'
        idempotencyKey:
          type: string
          example: '1234567890'
        status:
          title: CreateInvoiceStatus
          description: Status to create an invoice in.
          type: string
          enum:
            - DRAFT
            - DUE
            - PAID
          example: DUE
        lineItems:
          type: array
          minItems: 1
          maxItems: 50
          items:
            $ref: '#/components/schemas/CustomInvoiceLineItem'
        autoAdvance:
          type: boolean
          description: |
            This property defines the behaviour of status transition of the invoice.
            If true, invoice auto transitions from `DRAFT` to `DUE` or `PAID` at the end of pricing cycle.
            If false, the invoice’s state doesn’t automatically advance without an explicit action.
            Default: false
        applyCredits:
          type: boolean
          description: |
            This property defines the behaviour of whether or not to use credits to net off with the invoice amount. Default: true
        applyWalletBalance:
          type: boolean
          description: |
            This property defines the behaviour of whether or not to use wallet amount to net off with the invoice amount. Default: true
    UpdateInvoiceRequest:
      description: Payload to update an invoice
      type: object
      additionalProperties: false
      properties:
        startDate:
          type: string
          format: date-time
          example: '2020-06-04T12:00:00.000Z'
        endDate:
          type: string
          format: date-time
          example: '2020-07-04T12:00:00.000Z'
        status:
          description: Status of invoice
          type: string
          enum:
            - DUE
            - PAID
            - VOID
            - UN_COLLECTIBLE
            - REFUND_INITIATED
          example: DUE
        lineItems:
          type: array
          minItems: 1
          maxItems: 50
          items:
            $ref: '#/components/schemas/CustomInvoiceLineItem'
        autoAdvance:
          type: boolean
          description: |
            This property defines the behaviour of status updates of invoices like:
            Enabling this property to true auto updates the status of invoice to DUE or PAID accordingly
            But disabling this property of left null does not auto update the custom status
    MiscellaneousChargesResponse:
      description: Miscellaneous charges response
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/MiscellaneousCharges'
    PricingRulesLogsPaginatedResponse:
      description: Pricing Rules Logs response
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PricingRulesLog'
    PricingRulesLog:
      description: Pricing Rules Logs
      type: object
      additionalProperties: false
      required:
        - id
        - order
        - changes
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - CONDITION_TRUE
            - CONDITION_FALSE
            - CONDITION_ERROR
            - COMPUTATION_ERROR
        order:
          type: integer
          format: int32
        changes:
          $ref: '#/components/schemas/PricingRuleChangesLog'
        rule:
          $ref: '#/components/schemas/PricingRuleInfo'
        variablesValue:
          type: object
          nullable: true
          additionalProperties:
            $ref: '#/components/schemas/PricingRulesValues'
    PricingRulesValues:
      title: PricingRulesValues
      type: object
      properties:
        name:
          type: string
        value:
          type: string
    PricingRuleInfo:
      description: Pricing Rule Info
      type: object
      additionalProperties: false
      required:
        - id
      properties:
        id:
          type: string
        name:
          type: string
        condition:
          type: string
        computation:
          type: string
    PricingRuleChangesLog:
      description: Pricing Rules Logs Changes
      type: object
      additionalProperties: false
      required:
        - key
        - oldRevenue
        - newRevenue
      properties:
        key:
          type: string
        keyName:
          type: string
        oldRevenue:
          type: number
        newRevenue:
          type: number
        oldUsage:
          type: number
        newUsage:
          type: number
        errorMessage:
          type: string
    ListInvoicesResponse:
      description: List invoices response
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          minItems: 0
          maxItems: 50
          items:
            $ref: '#/components/schemas/InvoiceSummary'
        nextToken:
          type: string
          maxLength: 500
          example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ==
    ListCreditsResponse:
      description: List credits response
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          minItems: 0
          maxItems: 50
          items:
            $ref: '#/components/schemas/Credit'
        nextToken:
          type: string
          maxLength: 500
          example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ==
    ListPaymentResponse:
      description: List payments response
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          minItems: 0
          maxItems: 50
          items:
            $ref: '#/components/schemas/Payment'
        nextToken:
          type: string
          maxLength: 500
          example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ==
    CreditDetailsResponse:
      allOf:
        - $ref: '#/components/schemas/Credit'
        - type: object
          additionalProperties: false
          required:
            - transactions
          properties:
            transactions:
              type: array
              items:
                $ref: '#/components/schemas/CreditTransaction'
    CreditBalanceResponse:
      description: Credit Balance response
      type: object
      additionalProperties: false
      required:
        - activeCredits
        - availableBalance
        - runningBalance
        - inapplicableCredits
        - unit
        - lastUpdatedAt
      properties:
        activeCredits:
          type: number
          example: 1000
        availableBalance:
          type: number
          example: 700
        runningBalance:
          type: number
          example: 500
        inapplicableCredits:
          type: number
          example: 500
        unit:
          type: string
          example: USD
        lastUpdatedAt:
          type: string
          format: date-time
          example: '2021-01-01T00:00:00Z'
    WalletStatus:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
    WalletBalanceResponse:
      description: Wallet Balance response
      type: object
      additionalProperties: false
      required:
        - id
        - accountId
        - effectiveFrom
        - status
        - customerId
        - balance
        - creditUnit
      properties:
        id:
          type: string
        accountId:
          type: string
          example: ACC001
        customerId:
          type: string
          example: ACC001
        balance:
          description: |
            This amount is the difference of total credited amount and sum of consumed, hold amount.
            ie. credit amount - (consumed amount + hold amount)
          type: number
          example: 500
        creditUnit:
          type: string
          example: USD
        externalId:
          type: string
        status:
          $ref: '#/components/schemas/WalletStatus'
        holdAmount:
          type: number
          example: 500
        effectiveFrom:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        metadata:
          type: object
          additionalProperties: true
    WalletEntriesPaginatedResponse:
      description: List wallet entries response
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          minItems: 0
          maxItems: 50
          items:
            $ref: '#/components/schemas/WalletEntry'
        nextToken:
          type: string
          maxLength: 500
          example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ==
    WalletEntry:
      type: object
      additionalProperties: false
      required:
        - id
        - walletId
        - transactionType
        - status
        - amount
        - createdAt
        - closingBalance
      properties:
        id:
          description: Identifier of credit transactions
          type: string
          maxLength: 50
        description:
          description: description of the entry
          type: string
          maxLength: 50
        walletId:
          type: string
        transactionType:
          type: string
          enum:
            - CREDITED
            - DEBITED
          example: CREDITED
        status:
          type: string
          enum:
            - COMPLETED
            - ON_HOLD
          example: COMPLETED
        entityId:
          type: string
        amount:
          type: number
          example: 200
        createdAt:
          type: string
          format: date-time
        closingBalance:
          type: number
          example: 200
    InvoicesType:
      description: Represents the type of entity(STANDARD/AD_HOC/COMPOSITE)
      type: string
      enum:
        - STANDARD
        - AD_HOC
        - CUSTOM
        - COMPOSITE
        - STANDARD_ADVANCED
        - ADHOC_ADVANCED
    InvoicesClass:
      description: Represents the class of entity( INVOICE/ORDER/BILLABLE)
      type: string
      enum:
        - INVOICE
        - ORDER
        - BILLABLE
    InvoicesStatus:
      description: Status of the invoice
      type: string
      enum:
        - DRAFT
        - DUE
        - PAID
        - VOID
        - UN_COLLECTIBLE
        - REFUND_INITIATED
        - REFUND_COMPLETED
        - MERGED
        - PARTIALLY_PAID
    InvoiceSummary:
      description: Structure of invoice response
      type: object
      additionalProperties: false
      required:
        - id
        - status
        - invoiceDate
        - updatedAt
        - invoiceClass
        - invoiceType
        - totalAmount
        - paidAmount
        - netTermDays
      properties:
        id:
          description: Identifier of invoice
          type: string
          maxLength: 50
        customerId:
          type: string
        ownerId:
          type: string
        pricePlanId:
          type: string
        status:
          $ref: '#/components/schemas/InvoicesStatus'
          example: DUE
        finalizingStatus:
          type: string
          enum:
            - FINALIZING
            - FINALIZED
        invoiceClass:
          $ref: '#/components/schemas/InvoicesClass'
          example: INVOICE
        invoiceType:
          $ref: '#/components/schemas/InvoicesType'
          example: STANDARD
        startDate:
          description: Start date of the invoice
          type: string
          format: date-time
          example: '2020-07-04T12:00:00.000Z'
        endDate:
          description: End date of the invoice
          type: string
          format: date-time
          example: '2020-07-04T12:00:00.000Z'
        endDateInclusive:
          description: Inclusive end date of the invoice
          type: string
          format: date-time
          example: '2020-07-03T11:59:59.999Z'
        invoiceDate:
          description: Invoice date of the invoice
          type: string
          format: date-time
          example: '2020-07-04T12:00:00.000Z'
        dueDate:
          description: Due date of the invoice
          type: string
          format: date-time
          example: '2020-07-04T12:00:00.000Z'
        generatedAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        sequenceId:
          type: string
          description: Sequence id of the invoice
        pdfUrl:
          description: Download URL of the pdf file corresponding to the invoice
          type: string
        totalAmount:
          type: number
        paidAmount:
          type: number
        invoiceDetails:
          $ref: '#/components/schemas/InvoiceDetails'
        netTermDays:
          type: integer
          description: Number of days from the invoice date after which an invoice is considered overdue.
    Invoice:
      description: Structure of invoice
      type: object
      additionalProperties: false
      required:
        - id
        - status
        - invoiceDate
        - updatedAt
        - invoiceClass
        - invoiceType
        - totalAmount
        - paidAmount
        - netTermDays
      properties:
        id:
          description: Identifier of invoice
          type: string
          maxLength: 50
        customerId:
          type: string
        ownerId:
          type: string
        pricePlanId:
          type: string
        usageInfo:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineItem'
        revenueInfo:
          $ref: '#/components/schemas/InvoiceLineItem'
        invoiceDetails:
          $ref: '#/components/schemas/InvoiceDetails'
        status:
          $ref: '#/components/schemas/InvoicesStatus'
          example: DUE
        finalizingStatus:
          type: string
          enum:
            - FINALIZING
            - FINALIZED
        invoiceClass:
          $ref: '#/components/schemas/InvoicesClass'
          example: INVOICE
        invoiceType:
          $ref: '#/components/schemas/InvoicesType'
        autoAdvance:
          type: boolean
          example: true
        startDate:
          description: Start date of the invoice
          type: string
          format: date-time
          example: '2020-07-04T12:00:00.000Z'
        endDate:
          description: End date of the invoice
          type: string
          format: date-time
          example: '2020-07-04T12:00:00.000Z'
        endDateInclusive:
          description: Inclusive end date of the invoice
          type: string
          format: date-time
          example: '2020-07-03T11:59:59.999Z'
        invoiceDate:
          description: Invoice date of the invoice
          type: string
          format: date-time
          example: '2020-07-04T12:00:00.000Z'
        dueDate:
          description: Due date of the invoice
          type: string
          format: date-time
          example: '2020-07-04T12:00:00.000Z'
        generatedAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        metadata:
          type: object
          additionalProperties: true
        info:
          type: array
          items:
            type: object
            additionalProperties: false
            required:
              - type
              - value
            properties:
              type:
                type: string
                description: Type of the information
              value:
                type: string
                description: Value of the information
        sequenceId:
          type: string
          description: Sequence id of the invoice
        pdfUrl:
          description: Download URL of the pdf file corresponding to the invoice
          type: string
        totalAmount:
          type: number
        paidAmount:
          type: number
        netTermDays:
          type: integer
          description: Number of days from the invoice date after which an invoice is considered overdue.
    Payment:
      description: Payment object
      type: object
      additionalProperties: false
      required:
        - id
        - accountId
        - externalPaymentReferences
        - lineItemRecords
        - totalAmount
        - currency
        - version
        - createdBy
        - createdAt
      properties:
        id:
          type: string
          example: pay.w123rwe.1231
        description:
          type: string
        notes:
          type: string
        accountId:
          type: string
          example: ACC001
        externalPaymentReferences:
          $ref: '#/components/schemas/ExternalPaymentReference'
        lineItemRecords:
          type: array
          minLength: 1
          items:
            $ref: '#/components/schemas/PaymentLineItemRecord'
        totalAmount:
          type: number
        currency:
          type: string
        version:
          type: number
        createdBy:
          type: string
        createdAt:
          type: string
          format: date-time
    InvoiceLineItem:
      type: object
      additionalProperties: false
      required:
        - description
        - type
        - value
      properties:
        id:
          type: string
        description:
          type: string
        type:
          type: string
          enum:
            - TOTAL_USAGE
            - USAGE_METER_USAGE
            - GRAND_TOTAL_AMOUNT
            - TOTAL_AMOUNT
            - NET_AMOUNT
            - GROSS_AMOUNT
            - SUB_TOTAL_AMOUNT
            - PRICE_PLAN_AMOUNT
            - FIXED_FEE_RATE_CARD_AMOUNT
            - CREDIT_GRANT_RATE_CARD_AMOUNT
            - BILLING_ENTITLEMENT_RATE_CARD_AMOUNT
            - ENTITLEMENT_OVERAGE_RATE_CARD_AMOUNT
            - ENTITLEMENT_OVERAGE_RATE_CARD_SLAB_AMOUNT
            - LICENSE_RATE_CARD_AMOUNT
            - USAGE_CYCLE_AMOUNT
            - LICENSE_RATE_CARD_SLAB_AMOUNT
            - USAGE_RATE_CARD_AMOUNT
            - USAGE_RATE_CARD_SLAB_AMOUNT
            - TOTAL_CREDITS
            - SUB_CREDITS
            - TOTAL_ADVANCED_FEES
            - ADVANCED_FIXED_FEE
            - ADVANCED_LICENSE_RATE_CARD_AMOUNT
            - ADVANCED_BILLING_ENTITLEMENT_RATE_CARD_AMOUNT
            - ADVANCED_CREDIT_GRANT_RATE_CARD_AMOUNT
            - TOTAL_MISCELLANEOUS_CHARGES
            - MISCELLANEOUS_CHARGE
            - TRUE_UP_AMOUNT
            - TOTAL_PURCHASE_AMOUNT
            - CUSTOM_AMOUNT
            - CUSTOM_TAG
            - TOTAL_PRICING_RULE_ADDITION_AMOUNT
            - PRICING_RULE_ADDITION_AMOUNT
            - PRICING_RULE_REVENUE_UPDATE_AMOUNT
            - PRICING_RULE_USAGE_UPDATE_AMOUNT
            - RATE_CONFIG_ADJUSTMENT_AMOUNT
            - TOTAL_TAX_AMOUNT
            - TAX_AMOUNT
            - PROXY_AMOUNT
          description: |
            Type of the line item
            - GRAND_TOTAL_AMOUNT: Sum of all total amount of individual invoices in a grouped(composite) invoice
            - TOTAL_AMOUNT: Total revenue of the invoice
            - NET_AMOUNT: Net revenue of the invoice ( Gross revenue - Discounts )
            - GROSS_AMOUNT: Gross revenue of the invoice 
            - PRICE_PLAN_AMOUNT: SUB_TOTAL_AMOUNT + true up amount
            - SUB_TOTAL_AMOUNT: Sum of all rate card revenues
            - TRUE_UP_AMOUNT: Minimum commitment - SUB_TOTAL_AMOUNT (Always positive)
            - TOTAL_USAGE: List of all the usage meter usages
            - USAGE_METER_USAGE: Usage of an usage meter
            - USAGE_RATE_CARD_AMOUNT: Revenue generated from usage rate card
            - USAGE_RATE_CARD_SLAB_AMOUNT: Revenue generated from usage rate card slab
            - FIXED_FEE_RATE_CARD_AMOUNT: Revenue generated from fixed fee rate card
            - CREDIT_GRANT_RATE_CARD_AMOUNT: : Revenue generated from credit grant rate card
            - BILLING_ENTITLEMENT_RATE_CARD_AMOUNT: Revenue generated from billing entitlement rate card
            - ENTITLEMENT_OVERAGE_RATE_CARD_AMOUNT: : Revenue generated from entitlement overage rate card
            - ENTITLEMENT_OVERAGE_RATE_CARD_SLAB_AMOUNT: Revenue generated from entitlement overage rate card slab
            - LICENSE_RATE_CARD_AMOUNT: Revenue generated from license rate card
            - TOTAL_CREDITS: Sum of all credit amounts
            - SUB_CREDITS: Granted credit value
            - TOTAL_ADVANCED_FEES: Sum of all advanced fee revenue
            - ADVANCED_FIXED_FEE: Revenue generated from advanced fixed fee rate card
            - ADVANCED_LICENSE_RATE_CARD_AMOUNT: Revenue generated from advanced license rate card
            - ADVANCED_BILLING_ENTITLEMENT_RATE_CARD_AMOUNT: Revenue generated from advanced billing entitlement rate card
            - ADVANCED_CREDIT_GRANT_RATE_CARD_AMOUNT: Revenue generated from advanced credit grant rate card
            - TOTAL_MISCELLANEOUS_CHARGES: Net revenue of all MISCELLANEOUS_CHARGE
            - MISCELLANEOUS_CHARGE: Custom amount added to a DRAFT invoice
            - TOTAL_PURCHASE_AMOUNT: Net revenue all rate cards in a purchase plan
            - CUSTOM_AMOUNT: Custom amount added a DRAFT invoice
            - CUSTOM_TAG: User defined tags given to each rate card
            - TOTAL_PRICING_RULE_ADDITION_AMOUNT: Sum of all line items added by applying pricing rules
            - PRICING_RULE_ADDITION_AMOUNT: Amount added to invoice as a result of applying a pricing rule
            - PRICING_RULE_REVENUE_UPDATE_AMOUNT: Difference in revenue(value) obtained as a result of applying a pricing rule
            - PRICING_RULE_USAGE_UPDATE_AMOUNT: Difference in usage(quantity) obtained as a result of applying a pricing rule
            - RATE_CONFIG_ADJUSTMENT_AMOUNT: Difference in revenue obtained as a result of applying rate config['minimumRate', 'maximumRate'] at rate card level
        valuePerQuantity:
          type: number
        quantity:
          type: number
        units:
          type: string
        value:
          type: number
        metadata:
          type: object
          additionalProperties: true
    CustomInvoiceLineItem:
      type: object
      description: |
        Custom line item. Either `value` or `quantity` + `valuePerQuantity` is required.
        In case `quantity` and `valuePerQuantity` are provided, `value` is computed as (`quantity` X `valuePerQuantity`)
      additionalProperties: false
      properties:
        id:
          type: string
        description:
          type: string
        valuePerQuantity:
          type: number
        quantity:
          type: number
        value:
          type: number
        billableId:
          type: string
    InvoiceDetails:
      type: object
      additionalProperties: false
      properties:
        customer:
          type: object
          additionalProperties: false
          required:
            - name
            - primaryEmail
          properties:
            name:
              type: string
            primaryEmail:
              type: string
            billingAddress:
              type: string
            address:
              $ref: '#/components/schemas/Address'
        account:
          type: object
          additionalProperties: false
          required:
            - name
            - invoiceCurrency
            - address
            - primaryEmail
          properties:
            name:
              type: string
            invoiceCurrency:
              type: string
            address:
              $ref: '#/components/schemas/Address'
            primaryEmail:
              type: string
        pricePlanName:
          type: string
        invoiceGroup:
          type: object
          additionalProperties: false
          required:
            - id
            - name
            - dailyInvoiceConsolidation
            - invoiceCurrency
            - address
          properties:
            id:
              type: string
            name:
              type: string
            email:
              type: string
            dailyInvoiceConsolidation:
              type: boolean
            invoiceCurrency:
              type: string
            address:
              $ref: '#/components/schemas/Address'
        organization:
          type: object
          additionalProperties: false
          required:
            - businessName
            - address
            - primaryEmail
          properties:
            businessName:
              type: string
            address:
              $ref: '#/components/schemas/Address'
            primaryEmail:
              type: string
            metadata:
              type: object
              additionalProperties:
                type: string
        logoUrl:
          type: string
    CreateCreditResponse:
      type: object
      additionalProperties: false
      required:
        - credits
      properties:
        credits:
          type: array
          items:
            $ref: '#/components/schemas/Credit'
    Credit:
      allOf:
        - $ref: '#/components/schemas/CreditRequest'
        - type: object
          additionalProperties: false
          required:
            - id
            - customerId
            - status
            - createdAt
          properties:
            id:
              description: Identifier of credits
              type: string
              maxLength: 50
              example: cred.1znqBOVcai0.0tBFz
            customerId:
              type: string
              example: 7VcRw9xZDIqsC5E
            status:
              type: string
              enum:
                - ACTIVE
                - CONSUMED
                - EXPIRED
                - VOIDED
              example: ACTIVE
            creditUnit:
              type: string
              example: USD
            holdAmount:
              type: number
              example: 500
            consumedAmount:
              type: number
              example: 400
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
    CreditTransaction:
      type: object
      additionalProperties: false
      required:
        - id
        - creditId
        - transactionType
        - amount
        - createdAt
      properties:
        id:
          description: Identifier of credit transactions
          type: string
          maxLength: 50
        creditId:
          type: string
        transactionType:
          type: string
          enum:
            - CREDITED
            - DEBITED
            - EXPIRED
            - VOIDED
          example: CREDITED
        invoiceId:
          type: string
        entityId:
          type: string
        amount:
          type: number
          example: 200
        createdAt:
          type: string
          format: date-time
    MiscellaneousCharges:
      type: array
      items:
        title: MiscellaneousCharge
        description: Miscellaneous charges are the charges that can be added to the invoice. A charge must either have rate and quantity or value. In case of rate and quantity, the value must not be provided as it is automatically calculated as (rate * quantity).
        type: object
        additionalProperties: false
        required:
          - name
        properties:
          name:
            description: Name of the miscellaneous charge
            type: string
            example: Charge 1
          rate:
            description: Rate of the charge
            type: number
            example: 20
          quantity:
            description: Quantity of the charge
            type: number
            example: 10
          value:
            description: |
              Value of the charge
              Possible values:
              1. Fixed number [Example: 10]
              2. Json Logic [Example: {"*": [{"var": "um.lineitem.id"}, 0.1]}]
                 You can use all line item ids as variables in the json logic
            type: string
            example: 100
          considerForRevenue:
            description: Specifies whether to consider this miscellaneous charge for revenue or not
            type: boolean
            default: false
            example: true
  responses:
    BaseSuccessResponse:
      description: OK
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BaseSuccessResponse'
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            ErrorResponse:
              summary: Error message
              value:
                message: <Reason message>
    TokenResponse:
      description: OK
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TokenResponse'
    CreateCustomerResponse:
      description: Response for Create customer request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateCustomerResponse'
          examples:
            CreateCustomerResponse:
              $ref: '#/components/examples/CreateCustomerResponse'
    CustomerResponse:
      description: Response for Get customer requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Customer'
          examples:
            Customer:
              $ref: '#/components/examples/Customer'
    CustomerPaginatedResponse:
      description: Response for list customers request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CustomerPaginatedResponse'
          examples:
            CustomerPaginatedResponse:
              $ref: '#/components/examples/CustomerPaginatedResponse'
    CreateCustomerContactResponse:
      description: Response for CreateCustomerContactRequest
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateCustomerContactResponse'
          examples:
            User:
              $ref: '#/components/examples/CreateCustomerContactResponse'
    AccountPaginatedResponse:
      description: Response for list customers request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AccountPaginatedResponse'
          examples:
            AccountPaginatedResponse:
              $ref: '#/components/examples/AccountPaginatedResponse'
    AccountResponse:
      description: Response for Create and Get account requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Account'
          examples:
            Account:
              $ref: '#/components/examples/Account'
    CreateProposalResponse:
      description: Response to create proposal request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Proposal'
          examples:
            CreateProposalResponse:
              $ref: '#/components/examples/Proposal'
    UpdateProposalResponse:
      description: Response to update proposal status request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Proposal'
          examples:
            CreateProposalResponse:
              $ref: '#/components/examples/Proposal'
    InvoiceGroupResponse:
      description: Response to create invoice group request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InvoiceGroups'
          examples:
            InvoiceGroupResponse:
              $ref: '#/components/examples/InvoiceGroups'
    InvoiceGroupPaginatedResponse:
      description: Response to get invoice group request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InvoiceGroupPaginatedResponse'
          examples:
            InvoiceGroupPaginatedResponse:
              $ref: '#/components/examples/InvoiceGroupPaginatedResponse'
    InvoiceGroupAccountsPaginatedResponse:
      description: Response to get invoice group request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InvoiceGroupAccountsPaginatedResponse'
          examples:
            InvoiceGroupAccountsPaginatedResponse:
              $ref: '#/components/examples/InvoiceGroupAccountsPaginatedResponse'
    EventSchemaResponse:
      description: Response for Create and Get event schema requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EventSchema'
          examples:
            EventSchema:
              $ref: '#/components/examples/EventSchema'
    EventSchemaListPaginatedResponse:
      description: Response for list events request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EventSchemaListPaginatedResponse'
          examples:
            EventSchemaPaginatedResponse:
              $ref: '#/components/examples/EventSchemaListPaginatedResponse'
    EventSchemaVersionsResponse:
      description: Response for list event schema versions request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EventSchemaVersionsResponse'
          examples:
            EventSchemaVersionsResponse:
              $ref: '#/components/examples/EventSchemaVersionsResponse'
    UsageMeterResponse:
      description: Response for Create and Get usage event requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UsageMeter'
          examples:
            UsageMeter:
              $ref: '#/components/examples/UsageMeter'
    UsageMeterPaginatedResponse:
      description: Response for list usage_meters request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UsageMeterPaginatedResponse'
          examples:
            UsageMeterPaginatedResponse:
              $ref: '#/components/examples/UsageMeterPaginatedResponse'
    PricePlanResponse:
      description: Response for Create and Get price plan requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PricePlan'
          examples:
            PricePlanResponse:
              $ref: '#/components/examples/PricePlan'
    PricePlanPaginatedResponse:
      description: Response for list price plans request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PricePlanPaginatedResponse'
          examples:
            PricePlanPaginatedResponse:
              $ref: '#/components/examples/PricePlanPaginatedResponse'
    PricingSchedulePaginatedResponse:
      description: Response for list pricing schedules request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PricingSchedulePaginatedResponse'
          examples:
            PricingSchedulePaginatedResponse:
              $ref: '#/components/examples/PricingSchedulePaginatedResponse'
    PricingRulesPaginatedResponse:
      description: Response for create/list pricing rules request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PricingRulesPaginatedResponse'
          examples:
            PricingRulesPaginatedResponse:
              $ref: '#/components/examples/PricingRulesPaginatedResponse'
    UpdatePricingScheduleResponse:
      description: Response for dis/associate price plan request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdatePricingScheduleResponse'
          examples:
            UpdatePricingScheduleResponse:
              $ref: '#/components/examples/UpdatePricingScheduleResponse'
    EditPricingScheduleResponse:
      description: Response for edit pricing schedule request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdatePricingScheduleResponse'
          examples:
            UpdatePricingScheduleResponse:
              $ref: '#/components/examples/UpdatePricingScheduleResponse'
    CalculateRevenueResponse:
      description: Response payload for calculateRevenueAPI
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CalculateRevenueResponse'
          examples:
            CalculateRevenueResponse:
              $ref: '#/components/examples/CalculateRevenueResponse'
    CalculateRevenueResponseV2:
      description: Response payload for calculateRevenueAPI
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CalculateRevenueResponseV2'
    SettingResponse:
      description: Response for insert and update settings request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Setting'
          examples:
            Setting:
              $ref: '#/components/examples/Setting'
    SettingPaginatedResponse:
      description: Response for list setting request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SettingPaginatedResponse'
          examples:
            SettingPaginatedResponse:
              $ref: '#/components/examples/SettingPaginatedResponse'
    GetJobResponse:
      description: Response for get job status request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GetJobResponse'
          examples:
            GetJobResponse:
              $ref: '#/components/examples/GetJobResponse'
    JobEntriesPaginatedResponse:
      description: Response for list job entries request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/JobEntriesPaginatedResponse'
          examples:
            JobEntriesPaginatedResponse:
              $ref: '#/components/examples/JobEntriesPaginatedResponse'
    AddOnResponse:
      description: Response for Create and Get addons requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AddOn'
    AddOnPaginatedResponse:
      description: Response for List addons requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AddOnPaginatedResponse'
    JobsPaginatedResponse:
      description: Response for list customers request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/JobsPaginatedResponse'
          examples:
            JobsPaginatedResponse:
              $ref: '#/components/examples/JobsPaginatedResponse'
    CreatePurchaseResponse:
      description: Response for initiation of a purchase of entitlement plan for an account
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Purchase'
          examples:
            CreatePurchaseResponse:
              $ref: '#/components/examples/CreatePurchaseResponse'
    GetPurchaseResponse:
      description: Response for getting a specific purchase detail of an account
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GetPurchaseResponse'
          examples:
            GetPurchaseForPurchasePlanResponse:
              $ref: '#/components/examples/GetPurchaseForPurchasePlanResponse'
    PurchasePaginatedResponse:
      description: Response for list Purchase for an account request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PurchasePaginatedListData'
          examples:
            PurchasePaginatedResponse:
              $ref: '#/components/examples/PurchasePaginatedResponse'
    GetProposalResponse:
      description: Response for getting a specific proposal
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GetProposalResponse'
          examples:
            GetProposalResponse:
              $ref: '#/components/examples/GetProposalResponse'
    ProposalsPaginatedResponse:
      description: Response for list proposals of an account request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProposalsPaginatedResponse'
          examples:
            ProposalsPaginatedResponse:
              $ref: '#/components/examples/ProposalsPaginatedResponse'
    FeatureResponse:
      description: Response for Create and Get Feature requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Feature'
          examples:
            FeatureResponse:
              $ref: '#/components/examples/FeatureResponse'
    FeaturePaginatedResponse:
      description: Response for list Feature request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FeaturePaginatedListData'
          examples:
            FeaturePaginatedResponse:
              $ref: '#/components/examples/FeaturePaginatedResponse'
    FileDownloadUrlResponse:
      description: Response for getting a download url for a file
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FileDownloadUrlResponse'
          examples:
            FileDownloadUrlResponse:
              $ref: '#/components/examples/FileDownloadUrlResponse'
    AliasResponse:
      description: Response for adding or removing aliases
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Alias'
          examples:
            AliasResponse:
              $ref: '#/components/examples/AliasResponse'
    AliasPaginatedResponse:
      description: Response for list aliases request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AliasPaginatedResponse'
          examples:
            AliasPaginatedResponse:
              $ref: '#/components/examples/AliasPaginatedResponse'
    AccountAliasesPaginatedResponse:
      description: Response for list account aliases request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AccountAliasesPaginatedResponse'
          examples:
            AccountAliasesPaginatedResponse:
              $ref: '#/components/examples/AccountAliasesPaginatedResponse'
    AlertTemplateResponse:
      description: Response for getting alert template
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AlertTemplate'
          examples:
            AlertResponse:
              $ref: '#/components/examples/AlertTemplateResponse'
    AlertTemplatesPaginatedResponse:
      description: Response for list Alert request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AlertTemplatesPaginatedResponse'
          examples:
            AlertTemplatesPaginatedResponse:
              $ref: '#/components/examples/AlertTemplatesPaginatedResponse'
    AlertsPaginatedResponse:
      description: Response for list Alert request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AlertsPaginatedResponse'
          examples:
            AlertsPaginatedResponse:
              $ref: '#/components/examples/AlertsPaginatedResponse'
    AlertResponse:
      description: Response for install alert request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Alert'
          examples:
            AlertResponse:
              $ref: '#/components/examples/AlertResponse'
    IncidentResponse:
      description: Response for getting incident
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Incident'
          examples:
            IncidentResponse:
              $ref: '#/components/examples/IncidentResponse'
    IncidentsPaginatedResponse:
      description: Response for list incidents request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IncidentsPaginatedResponse'
          examples:
            IncidentsPaginatedResponse:
              $ref: '#/components/examples/IncidentsPaginatedResponse'
    ReportsPaginatedResponse:
      description: Response for List Report requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ReportsPaginatedResponse'
          examples:
            ReportsPaginatedResponse:
              $ref: '#/components/examples/ReportsPaginatedResponse'
    PricePlanV2:
      description: Response for Create and Get price plan requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PricePlanV2'
    PricePlanV2PaginatedResponse:
      description: Response for list price plans request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PricePlanV2PaginatedResponse'
    BulkRateCardOperationsResponse:
      description: Response for bulk rate card operations of a price plan
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BulkRateCardOperationsResponse'
    RateCardPaginatedResponse:
      description: Response for list rate cards request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateCardPaginatedResponse'
    SchedulesPaginatedResponse:
      description: Paginated response for pricing schedules
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SchedulesPaginatedResponse'
    ValidatedEntityErrorsPaginatedResponse:
      description: Paginated response for draft entities validations
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidatedEntityErrorsPaginatedResponse'
    InvoiceResponse:
      description: Response for Get invoice requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Invoice'
          examples:
            Invoice:
              $ref: '#/components/examples/Invoice'
    ListInvoicesResponse:
      description: Response for Get invoice requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListInvoicesResponse'
          examples:
            ListInvoicesResponse:
              $ref: '#/components/examples/ListInvoicesResponse'
    ListCreditsResponse:
      description: Response for Get invoice requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListCreditsResponse'
          examples:
            ListCreditsResponse:
              $ref: '#/components/examples/ListCreditsResponse'
    PaymentResponse:
      description: Response for POST payments requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Payment'
          examples:
            Payment:
              $ref: '#/components/examples/Payment'
    ListPaymentResponse:
      description: Response for GET payments requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListPaymentResponse'
          examples:
            ListPaymentResponse:
              $ref: '#/components/examples/ListPaymentResponse'
    CreateCreditResponse:
      description: Response for List credits request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateCreditResponse'
          examples:
            Credit:
              $ref: '#/components/examples/CreateCreditResponse'
    VoidCreditResponse:
      description: Response for Void credit request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Credit'
          examples:
            Credit:
              $ref: '#/components/examples/VoidCreditResponse'
    CreditDetailsResponse:
      description: Response for Fetch Credit Details request. This contains Credit Transactions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreditDetailsResponse'
    CreditBalanceResponse:
      description: Response for Credit Balance Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreditBalanceResponse'
          examples:
            CreditBalanceResponse:
              $ref: '#/components/examples/CreditBalanceResponse'
    WalletBalanceResponse:
      description: Response for Credit Balance Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WalletBalanceResponse'
          examples:
            WalletBalanceResponse:
              $ref: '#/components/examples/WalletBalanceResponse'
    WalletEntriesPaginatedResponse:
      description: Response for Credit Balance Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WalletEntriesPaginatedResponse'
          examples:
            CreditBalanceResponse:
              $ref: '#/components/examples/WalletEntriesPaginatedResponse'
    MiscellaneousChargesResponse:
      description: Response for Miscellaneous Charges Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MiscellaneousChargesResponse'
          examples:
            MiscellaneousChargesResponse:
              $ref: '#/components/examples/MiscellaneousChargesResponse'
    PricingRulesLogsPaginatedResponse:
      description: Response for list Invoice Pricing Rules Logs Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PricingRulesLogsPaginatedResponse'
          examples:
            PricingRulesLogsPaginatedResponse:
              $ref: '#/components/examples/PricingRulesLogsPaginatedResponse'
  parameters:
    customer_id:
      in: path
      name: customer_id
      required: true
      schema:
        type: string
        maxLength: 50
        example: 01BX5ZZKBKACTAV9WEVGEMMVRZ
    event_schema_name:
      in: path
      name: event_schema_name
      required: true
      schema:
        type: string
        maxLength: 50
        example: rides
    purchase_proposal_id:
      in: path
      name: purchase_proposal_id
      required: true
      schema:
        type: string
        maxLength: 512
        example: purchase.20rqjgFJf2O.ejl25
    invoice_group_id:
      in: path
      name: invoice_group_id
      required: true
      schema:
        type: string
        maxLength: 512
        example: inv_grp.20rqjgFJf2O.ejl25
    usage_meter_id:
      in: path
      name: usage_meter_id
      required: true
      schema:
        type: string
        maxLength: 50
        example: um.1zYnCiM9Bpg.1zYn
    next_token:
      in: query
      name: nextToken
      required: false
      schema:
        type: string
        example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
    compact:
      in: query
      name: compact
      required: false
      schema:
        type: boolean
        example: false
    dry_run:
      in: query
      name: dry_run
      required: false
      schema:
        type: boolean
        example: false
    includeGroupDetails:
      in: query
      name: includeGroupDetails
      required: false
      schema:
        type: boolean
        example: true
    effectiveOn:
      in: query
      name: effectiveOn
      required: false
      schema:
        type: string
        format: date-time
        example: '2020-03-30T10:41:10.088499'
    start_date:
      in: query
      name: start_date
      required: false
      schema:
        type: string
        example: '2023-03-30T10:41:10.088499'
    end_date:
      in: query
      name: end_date
      required: false
      schema:
        type: string
        example: '2099-03-30T10:41:10.088499'
    page_size:
      in: query
      name: pageSize
      required: false
      schema:
        type: number
        example: 10
    fetch_for:
      name: fetchFor
      in: query
      required: false
      description: |
        Fetch for flag used to get the reports from:
        1. ALL: Both the organization and accounts
        2. ORGANIZATION: Only the organization
        3. ACCOUNTS: Only accounts, works with account_id filter only.
      schema:
        type: string
        enum:
          - ALL
          - ORGANIZATION
          - ACCOUNTS
        default: ORGANIZATION
    price_plan_id:
      in: path
      name: price_plan_id
      required: true
      schema:
        type: string
        maxLength: 50
        example: pp.1zYnCiM9Bpg.lv25y
    price_plan_version:
      in: query
      name: version
      description: |
        Optional version to get a specific version. Gets latest version if it is not provided.
        Possible values:
        1. LATEST - Get the latest version of the price plan, can be draft
        2. ACTIVE - Get the latest active version of the price plan
        3. NUMBER - Get the specific version of the price plans
      required: false
      schema:
        type: string
    rate_card_mode:
      in: query
      name: mode
      required: true
      description: |
        Possible values:
        1. ACTIVE - Get the active rate card
        2. DRAFT - Get the draft rate card
      schema:
        type: string
    pricing_schedule_id:
      in: path
      name: pricing_schedule_id
      required: true
      schema:
        type: string
        maxLength: 50
        example: sch.1zYnCiM9Bpg.lv25y
    purchase_id:
      in: path
      name: purchase_id
      required: true
      schema:
        type: string
        maxLength: 50
        example: purchase.1zYnCiM9Bpg.lv25y
    addon_id:
      in: path
      name: addon_id
      required: true
      schema:
        type: string
        maxLength: 50
        example: addon.1zYnCiM9Bpg.lv25y
    discard:
      in: query
      name: discard
      required: false
      schema:
        type: boolean
        example: false
    version_query:
      in: query
      name: version
      description: Optional version to get a specific version. Gets latest version if it is not provided.
      required: false
      schema:
        type: integer
        format: int32
        example: 2
    settings_entity_type:
      in: query
      name: entity_type
      schema:
        type: string
        example: ACCOUNT
    settings_entity_id:
      in: query
      name: entity_id
      schema:
        type: string
        example: acc_X1Df3sRf3
    settings_setting_id:
      in: query
      name: setting_id
      schema:
        type: string
    settings_namespace:
      in: query
      name: namespace
      schema:
        type: string
        example: USER
    settings_full_setting_id:
      in: path
      name: setting_id_str
      required: true
      schema:
        type: string
        example: setting.USER.success_threshold.ACCOUNT.G234DZZKBKACATFFGVGEMERFI
    invoice_timing:
      in: query
      name: invoice_timing
      description: Optional field to filter pricing rules based on invoice timing
      required: false
      schema:
        type: string
        enum:
          - IN_ADVANCE
          - IN_ARREARS
    job_id:
      in: path
      name: job_id
      required: true
      schema:
        type: string
        example: mig.20aUyEZSuYq.SoGbS
    file_id:
      in: path
      name: file_id
      required: true
      schema:
        type: string
        example: file.20aUyEZSuYq.SoGbS
    alias:
      in: path
      name: alias
      required: true
      schema:
        type: string
        example: custom_value
    include_price_plan_info:
      in: query
      name: include_price_plan_info
      required: false
      schema:
        type: boolean
        example: true
    incident_id:
      in: path
      name: incident_id
      required: true
      schema:
        type: string
        example: inc.20aUyEZSuYq.SoGbS
    alert_template_id:
      in: path
      name: alert_template_id
      required: true
      schema:
        type: string
        example: abcd-efgh-ijkl-mnop
    alert_id:
      in: path
      name: alert_id
      required: true
      schema:
        type: string
        example: alert.20aUyEZSuYq.SoGbS
    expiry_in_sec:
      in: query
      name: expiry
      required: false
      schema:
        type: integer
        format: int32
        example: 300
    includeSchema:
      in: query
      name: includeSchema
      required: false
      schema:
        type: boolean
        example: true
    schedule_id:
      in: path
      name: schedule_id
      required: true
      schema:
        type: string
        example: sch.20aUyEZSuYq.SoGbS
    account_id:
      in: path
      description: account_id corresponding to an account
      name: account_id
      required: true
      schema:
        type: string
        maxLength: 50
        example: ACC00001
    feature_id:
      in: path
      description: feature_id corresponding to a feature
      name: feature_id
      required: true
      schema:
        type: string
        maxLength: 50
        example: feat.fdjskl.sdkjl
    event_id:
      in: path
      name: event_id
      required: true
      schema:
        type: string
        maxLength: 50
        example: f4a52f2d-b798-4e08-8b24-db0a5a468ba3
    event_correction_action:
      in: query
      description: Action to perform in event correction
      name: action
      required: true
      schema:
        type: string
        enum:
          - UNDO
          - REDO
          - REDO_EVENT
        example: UNDO
    filter_next_page_token:
      in: query
      description: Pagination token used as a marker to get records from next page.
      name: nextToken
      required: false
      schema:
        type: string
        example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ==
    filter_schema_name:
      in: query
      description: Filter option to filter the events based on schema name.
      name: schema_name
      required: false
      schema:
        type: string
        example: Rides
    filter_page_size:
      in: query
      description: |-
        Maximum page size expected by client to return the record list. 

         NOTE: Max page size cannot be more than 50. Also 50 is the default page size if no value is provided.
      name: pageSize
      required: false
      schema:
        type: integer
        example: 10
    filter_license_id:
      in: query
      description: License Id to filter
      name: licenseId
      required: false
      schema:
        type: string
        example: addon.1zYnCiM9Bpg.1zYn
    filter_effective_from:
      in: query
      description: effectiveFrom to filter
      name: effectiveFrom
      required: false
      schema:
        type: string
        format: date-time
        example: '2021-03-04T14:25:10Z'
    entry_id:
      in: path
      description: |
        `entryId` corresponding to a particular entitlement/overage grant entry

        Formats:
        1. If source of entry is an entitlement grant rate card in price plan: `schedule_id#pricing_cycle_start_date$PRICE_PLAN`
        2. If source of entry is an entitlement overage rate card in price plan: `schedule_id#pricing_cycle_start_date$OVERAGE`
        3. If source of entry is a purchase: `purchase_id#int_index$PURCHASE`
      name: entry_id
      required: true
      schema:
        type: string
        maxLength: 50
        example: purchase.21HbazIT3JQ.D90jC#1$PURCHASE
    filter_account_id:
      in: query
      description: Filter option to filter based on account id.
      name: account_id
      required: false
      schema:
        type: string
        example: '1234'
    filter_status:
      in: query
      description: Filter option to filter by status.
      name: status
      required: false
      schema:
        type: string
      examples:
        processed:
          value: PROCESSED
        in_progress:
          value: IN_PROGRESS
    require_confirmation:
      in: query
      name: require_confirmation
      description: Specifies whether to start a migration only after a confirmation
      required: false
      schema:
        type: boolean
        example: false
    invoice_id:
      in: path
      name: invoice_id
      required: true
      schema:
        type: string
        example: ACC001
    payment_id:
      in: path
      name: payment_id
      required: true
      schema:
        type: string
        example: payment.1zYnCiM9Bpg.lv25y
    version:
      in: query
      name: version
      description: Optional version to get a specific version. Gets latest version if it is not provided.
      required: false
      schema:
        type: integer
        format: int32
        example: 2
    credit_id:
      in: path
      name: credit_id
      required: true
      schema:
        type: string
        example: creds.1znQx9jiIXw.r44fc
    filter_credit_id:
      in: query
      description: Filter option to filter based on credit id.
      name: id
      required: false
      schema:
        type: string
        example: cred.1znpoFlsI3U.zmg85
    filter_customer_id:
      in: query
      description: Filter option to filter based on customer id.
      name: customer_id
      required: false
      schema:
        type: string
        example: '1234'
    filter_start_time:
      in: query
      name: start_time
      description: Start time filter in epoch milli seconds
      required: false
      schema:
        type: integer
        format: int64
        example: 1650110402000
    filter_end_time:
      in: query
      name: end_time
      description: End time filter in epoch milli seconds
      required: false
      schema:
        type: integer
        format: int64
        example: 1650110402000
    filter_owner_id:
      in: query
      description: Filter option to filter based on owner id.
      name: owner_id
      required: false
      schema:
        type: string
        example: ACC001
  examples:
    CreateFeatureRequest:
      value:
        name: DiscountCredits
        schemaAssociations:
          - event_schema1
          - event_schema2
    UpdateFeatureRequest:
      value:
        name: DiscountCredits
        schemaAssociations:
          - event_schema1
          - event_schema3
    CreatePurchaseForPurchasePlanRequest:
      value:
        pricePlanId: pp.20txw0FrqjQ.byM8V
        type: ENTITLEMENT_GRANT
        rateCardQuantities:
          feature.20txvOAhiIS.m3X3d: 1.2
    CreatePurchaseForAssociationRequest:
      value:
        pricePlanId: pp.20v1Tgjuwlc.O55xo
        type: ASSOCIATION
        effectiveFrom: {}
        effectiveUntil: {}
        expiryDate: {}
        associationOverride:
          supportedCurrencies:
            - USD
          pricingCycleConfig:
            interval: MONTHLY
            startOffset:
              dayOffset: '1'
              monthOffset: NIL
            gracePeriod: 1
          usageRateCards:
            - displayName: rr1
              usageMeterId: um.20Ms65CtgMy.nwFP0
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: FLAT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 10
                      slabRateConfig: {}
              tag: '1'
          fixedFeeRateCards:
            - id: addon.20sidL2HJ7o.vvzDT
              rateValues:
                - currency: USD
                  rate: 50
              enableProration: false
              displayName: normal
              tag: '1'
              invoiceTiming: IN_ARREARS
              type: RECURRING
            - id: addon.20sidQxYRjs.4oBSU
              rateValues:
                - currency: USD
                  rate: 10
              enableProration: false
              displayName: anotherNormal
              tag: '2'
              invoiceTiming: IN_ARREARS
              type: RECURRING
              recurrenceConfig:
                interval: 2
                offset: 1
            - id: addon.20sidzySWoa.Bzrcc
              rateValues:
                - currency: USD
                  rate: 40
              enableProration: false
              displayName: inadvance
              tag: '1'
              invoiceTiming: IN_ADVANCE
              type: RECURRING
              recurrenceConfig:
                interval: 1
                offset: 0
          licenseRateCards:
            - id: addon.20darMuJ6C8.bdgRj
              enableProration: false
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: FLAT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 15
                      slabRateConfig: {}
              displayName: license
              tag: '2'
              config:
                maxQuantity: 100
          billingEntitlementRateCards:
            - featureId: feature.20jxa18BdUW.d4XQw
              featureConfigs:
                - featureCreditLimit: 100
                  effectiveUntil: P20D
              invoiceTiming: IN_ADVANCE
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 1
                      slabRateConfig: {}
              displayName: feature1
            - featureId: feature.20uE1xqEudk.MMVH8
              featureConfigs:
                - featureCreditLimit: 200
                  effectiveUntil: P20D
              invoiceTiming: IN_ADVANCE
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 2
                      slabRateConfig: {}
              displayName: feature2
          minimumCommitment:
            displayName: Minimum Commitment
            rateValues:
              - currency: USD
                rate: 0
          creditGrantRateCards:
            - id: addon.20ufMNoJoAC.TUzRi
              type: RECURRING
              displayName: Credit2
              rateDetails:
                pricingModel: TIERED
                currencySlabRateDetails:
                  - currency: USD
                    creditAmount: 100
                    slabDetails:
                      - startAfter: 0
                        priceType: FLAT
                        rate: 10
              grantDetails:
                priority: 1
                expiryType: NO_EXPIRY
                applicableEntityIds: []
              invoiceTiming: IN_ADVANCE
            - id: addon.20ufMNoJoAC.TUzRi
              type: RECURRING
              displayName: Credit2
              rateDetails:
                pricingModel: TIERED
                currencySlabRateDetails:
                  - currency: USD
                    slabDetails:
                      - rate: 11
                        priceType: FLAT
                        startAfter: 0
                        slabConfig: {}
                        slabRateConfig: {}
                    creditAmount: 11
                  - currency: INR
                    slabDetails:
                      - rate: 11
                        priceType: FLAT
                        startAfter: 0
                        slabConfig: {}
                        slabRateConfig: {}
                    creditAmount: 11
              grantDetails:
                priority: 1
                expiryType: NO_EXPIRY
                applicableEntityIds: []
              invoiceTiming: IN_ADVANCE
    CreatePurchaseForWalletTopupRequest:
      value:
        type: WALLET_TOPUP
        walletTopupDetails:
          topupAmount: 50
    CreateProposalForOneTimePurchasePlanRequest:
      value:
        pricePlanId: pp.20dINmd0lBg.05sKa
        type: ENTITLEMENT_GRANT
        paymentMode: PREPAID
        quantity: 1
        purchasePlanOverride:
          billingEntitlementRateCards:
            - featureId: feature.20jxa18BdUW.d4XQw
              featureConfigs:
                - featureCreditLimit: 100
                  effectiveUntil: P20D
              invoiceTiming: IN_ADVANCE
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 1
                      slabRateConfig: {}
              displayName: feature1
              tag: tag 1
    CreateProposalForAssociationRequest:
      value:
        pricePlanId: pp.20v1Tgjuwlc.O55xo
        type: ASSOCIATION
        paymentMode: PREPAID
        effectiveFrom: {}
        effectiveUntil: {}
        expiryDate: {}
        associationOverride:
          supportedCurrencies:
            - USD
          pricingCycleConfig:
            interval: MONTHLY
            startOffset:
              dayOffset: '1'
              monthOffset: NIL
            gracePeriod: 1
            anniversaryCycle: false
          usageRateCards:
            - displayName: rr1
              usageMeterId: um.20Ms65CtgMy.nwFP0
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: FLAT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 10
                      slabRateConfig: {}
              tag: '1'
          fixedFeeRateCards:
            - id: addon.20sidL2HJ7o.vvzDT
              rateValues:
                - currency: USD
                  rate: 50
              enableProration: false
              displayName: normal
              tag: '1'
              invoiceTiming: IN_ARREARS
              type: RECURRING
              recurrenceConfig:
                interval: 2
                offset: 1
            - id: addon.20sidQxYRjs.4oBSU
              rateValues:
                - currency: USD
                  rate: 10
              enableProration: false
              displayName: anotherNormal
              tag: '2'
              invoiceTiming: IN_ARREARS
              type: RECURRING
            - id: addon.20sidzySWoa.Bzrcc
              rateValues:
                - currency: USD
                  rate: 40
              enableProration: false
              displayName: inadvance
              tag: '1'
              invoiceTiming: IN_ADVANCE
              type: RECURRING
          licenseRateCards:
            - id: addon.20darMuJ6C8.bdgRj
              enableProration: false
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: FLAT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 15
                      slabRateConfig: {}
              displayName: license
              tag: '2'
              config: null
          billingEntitlementRateCards:
            - featureId: feature.20jxa18BdUW.d4XQw
              featureConfigs:
                - featureCreditLimit: 100
                  effectiveUntil: P20D
              invoiceTiming: IN_ADVANCE
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 1
                      slabRateConfig: {}
              displayName: feature1
            - featureId: feature.20uE1xqEudk.MMVH8
              featureConfigs:
                - featureCreditLimit: 200
                  effectiveUntil: P20D
              invoiceTiming: IN_ADVANCE
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 2
                      slabRateConfig: {}
              displayName: feature2
              tag: tag_acme
          minimumCommitment:
            displayName: Minimum Commitment
            rateValues:
              - currency: USD
                rate: 0
          creditGrantRateCards:
            - id: addon.20ufMNoJoAC.TUzRi
              type: RECURRING
              displayName: Credit2
              rateDetails:
                pricingModel: TIERED
                currencySlabRateDetails:
                  - currency: USD
                    creditAmount: 100
                    slabDetails:
                      - startAfter: 0
                        priceType: FLAT
                        rate: 10
              grantDetails:
                priority: 1
                expiryType: PRICING_CYCLE
                applicableEntityIds: []
              invoiceTiming: IN_ARREARS
              recurrenceConfig:
                offset: 0
                interval: 1
            - id: addon.20ufMNoJoAC.TUzRi
              type: RECURRING
              displayName: Credit2
              rateDetails:
                pricingModel: TIERED
                currencySlabRateDetails:
                  - currency: USD
                    slabDetails:
                      - rate: 11
                        priceType: FLAT
                        startAfter: 0
                        slabConfig: {}
                        slabRateConfig: {}
                    creditAmount: 11
                  - currency: INR
                    slabDetails:
                      - rate: 11
                        priceType: FLAT
                        startAfter: 0
                        slabConfig: {}
                        slabRateConfig: {}
                    creditAmount: 11
              grantDetails:
                priority: 1
                expiryType: PRICING_CYCLE
                applicableEntityIds: []
              invoiceTiming: IN_ARREARS
              recurrenceConfig:
                offset: 0
                interval: 1
    UpdateProposalStatus:
      value:
        status: APPROVE
    CreateInvoiceGroupRequest:
      value:
        dailyInvoiceConsolidation: true
        accountIds:
          - ACC0001
          - ACC0002
        netTermDays: 30
    UpdateInvoiceGroupAccounts:
      value:
        accountIds:
          - ACC0001
          - ACC0002
    CreateCustomerRequest:
      value:
        id: 01BX5ZZKBKACTAV9WEVGEMMVRZ
        name: ACME Enterprise
        primaryEmail: admin@example.com
        address:
          phoneNumber: '+919876543210'
          line1: 2281 Broadway Street
          line2: G-31
          postalCode: '29501'
          city: Florence
          state: South Carolina
          country: US
        settings:
          - id: customerSettingId
            value: INR
            namespace: USER
            name: Settings Name
            dataType: STRING
        account:
          id: ACC00001
          name: Primary Account
          invoiceCurrency: USD
          aliases:
            - acme_primary
            - admin@example.com
          settings:
            - id: accountSettingId
              value: INR
              namespace: USER
              name: Settings Name
              dataType: STRING
    UpdateCustomerRequest:
      value:
        name: ACME Enterprise
        primaryEmail: admin@example.com
        address:
          phoneNumber: '+919876543210'
          line1: 2281 Broadway Street
          line2: G-31
          postalCode: '29501'
          city: Florence
          state: South Carolina
          country: US
    CreateCustomerContactRequest:
      summary: A sample create contact for a customer request
      value:
        name: Lorem Ipsum
        password: nii2du35bdtuethntv3q7416
        email: bob@acme.com
        phone: '+1234071628'
        verified: true
        loginAccess: true
    CreateAccountRequest:
      value:
        id: ACC00001
        name: Primary Account
        customerId: C1234qwd
        aliases:
          - acme_primary
          - acme_1
        address:
          phoneNumber: '+919876543210'
          line1: 2281 Broadway Street
          line2: G-31
          postalCode: '29501'
          city: Florence
          state: South Carolina
          country: US
        primaryEmail: admin@example.com
        settings:
          - id: accountSettingId
            value: INR
            namespace: USER
            name: Settings Name
            dataType: STRING
        netTermDays: 45
    UpdateAccountRequest:
      value:
        name: New Account Name
        primaryEmail: admin@example.com
        address:
          phoneNumber: '+919876543210'
          line1: 2281 Broadway Street
          line2: G-31
          postalCode: '29501'
          city: Florence
          state: South Carolina
    AccountAliasesPaginatedResponse:
      value:
        data:
          - id: abcd-12345-uids
            value: hello
            effectiveFrom: '2022-06-04T00:00:00Z'
            effectiveUntil: '2022-06-05T00:00:00Z'
            createdAt: '2022-06-04T00:00:00Z'
            updatedAt: '2022-06-04T00:00:00Z'
        nextToken: fdsjhklfhdslhfjdklsahfkjdsa...
    AlertTemplateResponse:
      value:
        id: abcd-efgh-ijkl-mnop
        name: Alert1
        desc: Alert1 Description
        entitySchema: '{"type":"object","properties":{"usageMeterId":{"type":"string"}}}'
        entityType: UsageMeter
        interval: '30'
        parametersSchema: '{"type":"object","properties":{"threshold":{"type":"number"}}}'
        ownerSchema: '{"type":"object","properties":{"accountId":{"type":"string"}}}'
        ownerType: Account
        createdAt: '2020-01-01T00:00:00Z'
        updatedAt: '2020-01-01T00:00:00Z'
    AlertTemplatesPaginatedResponse:
      value:
        data:
          - id: abcd-efgh-ijkl-mnop
            name: Alert1
            desc: Alert1 Description
            entitySchema: '{"type":"object","properties":{"usageMeterId":{"type":"string"}}}'
            entityType: UsageMeter
            defaultInterval: '30'
            parametersSchema: '{"type":"object","properties":{"threshold":{"type":"number"}}}'
            ownerSchema: '{"type":"object","properties":{"accountId":{"type":"string"}}}'
            ownerType: Account
            createdAt: '2020-01-01T00:00:00Z'
            updatedAt: '2020-01-01T00:00:00Z'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
    AlertResponse:
      value:
        id: alert.1zYnCiM9Bpg.lv25y
        version: 1
        alertId: alert.1zYnCiM9Bpg.lv25y
        description: Alert1 Description
        cronInterval: '30'
        ownerDetails:
          accountId: account_1
        entityDetails:
          usageMeterId: um.1zYnCiM9Bpg.lv25y
        parameters:
          threshold: 10
        status: ACTIVE
        createdAt: '2020-01-01T00:00:00Z'
        updatedAt: '2020-01-01T00:00:00Z'
    AlertsPaginatedResponse:
      value:
        data:
          - id: alert.1zYnCiM9Bpg.lv25y
            version: 1
            alertId: alert.1zYnCiM9Bpg.lv25y
            description: Alert1 Description
            cronInterval: '30'
            ownerDetails:
              accountId: account_1
            entityDetails:
              usageMeterId: um.1zYnCiM9Bpg.lv25y
            parameters:
              threshold: 10
            status: ACTIVE
            createdAt: '2020-01-01T00:00:00Z'
            updatedAt: '2020-01-01T00:00:00Z'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
    IncidentResponse:
      value:
        id: incident.1zYnCiM9Bpg.lv25y
        alertTemplateId: abcd-efgh-ijkl-mnop
        alertId: alert.1zYnCiM9Bpg.lv25y
        alertVersion: 1
        validUntil: '2020-01-01T00:00:00Z'
        reportData:
          usageValue: 10
        status: ACTIVE
        createdAt: '2020-01-01T00:00:00Z'
        updatedAt: '2020-01-01T00:00:00Z'
    IncidentsPaginatedResponse:
      value:
        data:
          - id: incident.1zYnCiM9Bpg.lv25y
            alertTemplateId: abcd-efgh-ijkl-mnop
            alertId: alert.1zYnCiM9Bpg.lv25y
            alertVersion: 1
            validUntil: '2020-01-01T00:00:00Z'
            reportData:
              usageValue: 10
            status: ACTIVE
            createdAt: '2020-01-01T00:00:00Z'
            updatedAt: '2020-01-01T00:00:00Z'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
    ReportsPaginatedResponse:
      value:
        data:
          - id: report.23Xx0Jkc2DM.FgysO
            name: acme-2024-09-18.csv
            status: COMPLETED
            createdAt: '2024-09-18T01:30:08.216867Z'
            updatedAt: '2024-09-18T01:30:08.350259Z'
            accountId: null
            fileId: file.23Xx0JkTljo.4JN5B
            queryInput: null
            reportTemplateId: null
            preSignedUrl: null
            type: CUSTOM
          - id: report.231kfXmrPq7.YJkpy
            name: Demo Report
            status: COMPLETED
            createdAt: '2024-06-28T16:38:05.517189Z'
            updatedAt: '2024-06-28T16:38:20.533519Z'
            accountId: null
            fileId: file.231kfo14hqu.7ejfb
            queryInput:
              selects:
                - columnName: name
                  dataSource: null
                  alias: ' cus1-account'
                  functions: null
                  aggregator: null
              baseDataSource: customers
              sort:
                - column:
                    columnName: name
                    dataSource: null
                    alias: ' cus1-account'
                    functions: []
                    aggregator: null
                  sortOrder: ASC
              limit: 1000,
              queryFilters: null
              seekValues: null
            reportTemplateId: report_template.231kfPGCpoQ.SSeyY
            preSignedUrl: null
            type: TEMPLATE
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
    AddAccountAliasesRequest:
      value:
        aliases:
          - account2@acme.com
          - '+1234567890'
    RemoveAccountAliasesRequest:
      value:
        aliases:
          - abcd-12345-uids
          - efgh-12345-uids
    CreateEventSchemaRequest:
      summary: Create event schema request payload
      value:
        name: ride_completed
        description: Cab ride completed
        attributes:
          - name: distance
          - name: time
        dimensions:
          - name: city
          - name: vehicle_type
        enrichments:
          dependencies:
            - type: SETTING
              key: setting.user.meters_per_km
              name: meters_per_km
          fields:
            - name: distanceInKM
              type: ATTRIBUTE
              enrichmentType: JSON_LOGIC
              value: '{"/":[{"var":["attribute.distance"]},{"var":["dependencies.meters_per_km"]}]}'
              order: 1
            - name: rideType
              type: DIMENSION
              enrichmentType: JSON_LOGIC
              value: '{"if":[{"<=":[100,{"var":["attribute.distanceInKM"]}]},"long_distance","short_distance"]}'
              order: 2
    UpdateEventSchemaRequest:
      summary: Update event schema request payload
      value:
        description: Cab ride completed
        status: DRAFT
        attributes:
          - name: distance
          - name: time
        dimensions:
          - name: city
          - name: vehicle_type
        enrichments:
          dependencies:
            - type: SETTING
              key: setting.user.meters_per_km
              name: meters_per_km
          fields:
            - name: distanceInKM
              type: ATTRIBUTE
              enrichmentType: JSON_LOGIC
              value: '{"/":[{"var":["attribute.distance"]},{"var":["dependencies.meters_per_km"]}]}'
              order: 1
            - name: rideType
              type: DIMENSION
              enrichmentType: JSON_LOGIC
              value: '{"if":[{"<=":[100,{"var":["attribute.distanceInKM"]}]},"long_distance","short_distance"]}'
              order: 2
    CreateUsageMeterRequest:
      value:
        name: Rides
        description: Cab rides
        type: COUNTER
        aggregation: SUM
        eventSchemaName: evfhr123d
        computations:
          - matcher: |
              {
                "and": [
                  {"in": [{"var": "dimension.city"}, "chennai", "mumbai"]},
                  "or": [
                    {">": [{"var": "attribute.distance"}, 100]},
                    {"<": [{"var": "attribute.distance"}, 20]}
                  ]
                ]
              }
            computation:
              '*':
                - var: attributes.distance
                - 0.4
    CreateNonAnniversaryBillingPricePlanRequest:
      value:
        name: grantCheck
        type: BILLING
        description: Starter plan
        pricePlanDetails:
          supportedCurrencies:
            - USD
          pricingCycleConfig:
            interval: MONTHLY
            startOffset:
              dayOffset: '1'
              monthOffset: NIL
            gracePeriod: 1
            anniversaryCycle: false
          usageRateCards:
            - displayName: rr1
              usageMeterId: um.20Ms65CtgMy.nwFP0
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: FLAT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 10
                      slabRateConfig: {}
                  rateConfig:
                    minimumRate: '1'
                    maximumRate: '10'
              tag: '1'
          fixedFeeRateCards:
            - id: addon.20sidL2HJ7o.vvzDT
              rateValues:
                - currency: USD
                  rate: 50
              enableProration: false
              displayName: normal
              tag: '1'
              invoiceTiming: IN_ARREARS
              type: RECURRING
            - id: addon.20sidQxYRjs.4oBSU
              rateValues:
                - currency: USD
                  rate: 10
              enableProration: false
              displayName: anotherNormal
              tag: '2'
              invoiceTiming: IN_ARREARS
              type: RECURRING
            - id: addon.20sidzySWoa.Bzrcc
              rateValues:
                - currency: USD
                  rate: 40
              enableProration: false
              displayName: inadvance
              tag: '1'
              invoiceTiming: IN_ADVANCE
              type: RECURRING
          licenseRateCards:
            - id: addon.20rzlEPp6no.1BYez
              enableProration: false
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: FLAT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 15
                      slabRateConfig: {}
                  rateConfig:
                    minimumRate: '1'
                    maximumRate: '10'
              displayName: license
              tag: '2'
              config: {}
          billingEntitlementRateCards:
            - featureId: feature.20jxa18BdUW.d4XQw
              featureConfigs:
                - featureCreditLimit: 100
                  effectiveUntil: P20D
              invoiceTiming: IN_ADVANCE
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 1
                      slabRateConfig: {}
              displayName: feature1
              tag: tag_acme
            - featureId: feature.20uE1xqEudk.MMVH8
              featureConfigs:
                - featureCreditLimit: 200
                  effectiveUntil: P20D
              invoiceTiming: IN_ADVANCE
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 2
                      slabRateConfig: {}
              displayName: feature2
              tag: tag_acme
          minimumCommitment:
            displayName: Minimum Commitment
            rateValues:
              - currency: USD
                rate: 0
          creditGrantRateCards:
            - id: addon.20ufMNoJoAC.TUzRi
              type: RECURRING
              displayName: Credit2
              rateDetails:
                pricingModel: TIERED
                currencySlabRateDetails:
                  - currency: USD
                    creditAmount: 100
                    slabDetails:
                      - startAfter: 0
                        priceType: FLAT
                        rate: 10
              grantDetails:
                priority: 1
                expiryType: PRICING_CYCLE
                applicableEntityIds: []
              invoiceTiming: IN_ARREARS
              recurrenceConfig:
                offset: 0
                interval: 1
            - id: addon.20ufMNoJoAC.TUzRi
              type: RECURRING
              displayName: Credit2
              rateDetails:
                pricingModel: TIERED
                currencySlabRateDetails:
                  - currency: USD
                    slabDetails:
                      - rate: 11
                        priceType: FLAT
                        startAfter: 0
                        slabConfig: {}
                        slabRateConfig: {}
                    creditAmount: 11
                  - currency: INR
                    slabDetails:
                      - rate: 11
                        priceType: FLAT
                        startAfter: 0
                        slabConfig: {}
                        slabRateConfig: {}
                    creditAmount: 11
              grantDetails:
                priority: 1
                expiryType: PRICING_CYCLE
                applicableEntityIds: []
              invoiceTiming: IN_ARREARS
              recurrenceConfig:
                offset: 0
                interval: 1
          entitlementOverageRateCards:
            - featureId: feature.20jxa18BdUW.d4XQw
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 1
                      slabRateConfig: {}
              displayName: feature1
              tag: tag_acme
              maxQuantity: 50
              billingConfig:
                interval: 1
                startOffset: 4
            - featureId: feature.20uE1xqEudk.MMVH8
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 2
                      slabRateConfig: {}
              displayName: feature2
              tag: tag_acme
              maxQuantity: 50
    CreateAnniversaryBillingPricePlanRequest:
      value:
        name: grantCheck
        description: Anniversary price plan
        type: BILLING
        pricePlanDetails:
          supportedCurrencies:
            - USD
          pricingCycleConfig:
            interval: MONTHLY
            gracePeriod: 1
            anniversaryCycle: true
          usageRateCards:
            - displayName: rr1
              usageMeterId: um.20Ms65CtgMy.nwFP0
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: FLAT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 10
                      slabRateConfig: {}
              tag: '1'
          fixedFeeRateCards:
            - id: addon.20sidL2HJ7o.vvzDT
              rateValues:
                - currency: USD
                  rate: 50
              enableProration: false
              displayName: normal
              tag: '1'
              invoiceTiming: IN_ARREARS
              type: RECURRING
            - id: addon.20sidQxYRjs.4oBSU
              rateValues:
                - currency: USD
                  rate: 10
              enableProration: false
              displayName: anotherNormal
              tag: '2'
              invoiceTiming: IN_ARREARS
              type: RECURRING
            - id: addon.20sidzySWoa.Bzrcc
              rateValues:
                - currency: USD
                  rate: 40
              enableProration: false
              displayName: inadvance
              tag: '1'
              invoiceTiming: IN_ADVANCE
              type: RECURRING
          licenseRateCards:
            - id: addon.20rzlEPp6no.1BYez
              enableProration: false
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: FLAT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 15
                      slabRateConfig: {}
              displayName: license
              tag: '2'
          billingEntitlementRateCards:
            - featureId: feature.20jxa18BdUW.d4XQw
              featureConfigs:
                - featureCreditLimit: 100
                  effectiveUntil: P20D
              invoiceTiming: IN_ADVANCE
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 1
                      slabRateConfig: {}
              displayName: feature1
              tag: tag_acme
            - featureId: feature.20uE1xqEudk.MMVH8
              featureConfigs:
                - featureCreditLimit: 200
                  effectiveUntil: P20D
              invoiceTiming: IN_ADVANCE
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 2
                      slabRateConfig: {}
              displayName: feature2
              tag: tag_acme
          minimumCommitment:
            displayName: Minimum Commitment
            rateValues:
              - currency: USD
                rate: 0
          creditGrantRateCards:
            - id: addon.20ufMNoJoAC.TUzRi
              type: RECURRING
              displayName: Credit2
              rateDetails:
                pricingModel: TIERED
                currencySlabRateDetails:
                  - currency: USD
                    creditAmount: 100
                    slabDetails:
                      - startAfter: 0
                        priceType: FLAT
                        rate: 10
              grantDetails:
                priority: 1
                expiryType: PRICING_CYCLE
                applicableEntityIds: []
              invoiceTiming: IN_ARREARS
              recurrenceConfig:
                offset: 0
                interval: 1
            - id: addon.20ufMNoJoAC.TUzRi
              type: RECURRING
              displayName: Credit2
              rateDetails:
                pricingModel: TIERED
                currencySlabRateDetails:
                  - currency: USD
                    slabDetails:
                      - rate: 11
                        priceType: FLAT
                        startAfter: 0
                        slabConfig: {}
                        slabRateConfig: {}
                    creditAmount: 11
                  - currency: INR
                    slabDetails:
                      - rate: 11
                        priceType: FLAT
                        startAfter: 0
                        slabConfig: {}
                        slabRateConfig: {}
                    creditAmount: 11
              grantDetails:
                priority: 1
                expiryType: PRICING_CYCLE
                applicableEntityIds: []
              invoiceTiming: IN_ARREARS
              recurrenceConfig:
                offset: 0
                interval: 1
          entitlementOverageRateCards:
            - featureId: feature.20jxa18BdUW.d4XQw
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 1
                      slabRateConfig: {}
              displayName: feature1
              tag: tag_acme
              maxQuantity: 50
              billingConfig:
                interval: 1
                startOffset: 4
            - featureId: feature.20uE1xqEudk.MMVH8
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 2
                      slabRateConfig: {}
              displayName: feature2
              tag: tag_acme
    CreatePurchasePricePlanRequest:
      value:
        name: Purchase Plan
        type: PURCHASE
        pricePlanDetails:
          billingEntitlementRateCards:
            - featureId: feature.20txvOAhiIS.m3X3d
              featureConfigs:
                - featureCreditLimit: 100
                  effectiveUntil: P20D
              invoiceTiming: IN_ADVANCE
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 1
              displayName: feature1
          fixedFeeRateCards:
            - id: addon.20sidL2HJ7o.vvzDT
              rateValues:
                - currency: USD
                  rate: 50
              enableProration: false
              displayName: normal
              tag: '1'
              type: ONE_TIME
            - id: addon.20sidQxYRjs.4oBSU
              rateValues:
                - currency: USD
                  rate: 10
              enableProration: false
              displayName: anotherNormal
              tag: '2'
              type: ONE_TIME
          supportedCurrencies:
            - USD
    UpdatePricePlanRequest:
      value:
        description: updated description
        pricePlanDetails:
          pricingCycleConfig:
            interval: MONTHLY
            startOffset:
              dayOffset: '6'
              monthOffset: NIL
            gracePeriod: 3
            anniversaryCycle: true
        migrationMode: IMMEDIATE_IGNORE_OVERRIDE
    ActivatePricePlanRequest:
      value:
        currencies:
          - USD
          - INR
    FirstCalculateRevenueRequestExample:
      description: |
        Example request for calculate revenue API on a existing price plan with custom currency and usage.
      value:
        currencyConfig:
          mode: CUSTOM
          currency: USD
        pricePlanDetailsConfig:
          mode: PRICE_PLAN
          pricePlanId: pp.fdhkf.djf
          effectiveOn: '2020-01-01T00:00:00Z'
          pricingCycleOrdinal: 1
        usageConfig:
          mode: CUSTOM
          usageMap:
            um.1zcgWalbM2y.qaX5j: 100
        licenseEntriesConfig:
          mode: CUSTOM
          custom:
            - licenseId: license.1zcgWalbM2y.qaX5j
              quantity: 10
              effectiveFrom: '2020-01-01T00:00:00Z'
        entitlementOverageConfig:
          mode: CUSTOM
          custom:
            - featureId: feature.1122.ahoiud
              quantity: 5
            - featureId: feature.3452.abcaf2
              quantity: 28
    SecondCalculateRevenueRequestExample:
      description: |
        Example request for calculate revenue API on a custom price plan with currency as the invoice currency of a existing account, and existing usage of a account over a time period
      value:
        currencyConfig:
          mode: ACCOUNT_INVOICE
          accountId: ACC00001
        pricePlanDetailsConfig:
          mode: CUSTOM
          pricingCycleOrdinal: 1
          pricePlanDetails:
            supportedCurrencies:
              - USD
            pricingCycleConfig:
              interval: MONTHLY
              startOffset:
                dayOffset: '4'
                monthOffset: '1'
              gracePeriod: 3
              anniversaryCycle: false
            usageRateCards:
              - displayName: Local Rides
                usageMeterId: um.1zYnCiM9Bpg.1zYn
                ratePlan:
                  pricingModel: TIERED
                  slabs:
                    - order: 1
                      startAfter: 0
                      priceType: FLAT
                rateValues:
                  - currency: USD
                    slabRates:
                      - rate: 40
                        order: 1
        usageConfig:
          mode: LOOKUP_RANGE
          lookupRange:
            start: '2020-01-01T00:00:00Z'
            end: '2020-01-31T00:00:00Z'
            accountId: ACC00001
        licenseEntriesConfig:
          mode: LOOKUP_RANGE
          lookupRange:
            start: '2020-01-01T00:00:00Z'
            end: '2020-01-31T00:00:00Z'
            accountId: ACC00001
        entitlementOverageConfig:
          mode: LOOKUP_CYCLE
          lookupCycle:
            accountId: ACC0001
            billingCycleEndDate: '2020-01-31T00:00:00Z'
    ThirdCalculateRevenueRequestExample:
      value:
        currencyConfig:
          mode: ACCOUNT_INVOICE
          accountId: ACC00001
        pricePlanDetailsConfig:
          mode: ACCOUNT
          accountId: ACC00001
          effectiveOn: '2020-01-01T00:00:00Z'
        usageConfig:
          mode: LOOKUP_CYCLE
          lookupCycle:
            accountId: ACC00001
            cycleEffectiveOn: '2020-01-01T00:00:00Z'
        licenseEntriesConfig:
          mode: LOOKUP_CYCLE
          lookupCycle:
            accountId: ACC00001
            cycleEffectiveOn: '2020-01-01T00:00:00Z'
      description: |
        Example request for calculate revenue API on a already associated price plan of the account  with currency as the invoice currency of an existing account, and existing usage of a account over a certain pricing cycle
    UpdatePricingScheduleAssociateRequest:
      value:
        mode: ASSOCIATE
        pricePlanId: pp.1zYnCiM9Bpg.lv25y
        effectiveFrom: '2022-07-04'
        effectiveUntil: '2022-10-04'
    UpdatePricingScheduleDisassociateRequest:
      value:
        mode: DISASSOCIATE
        effectiveFrom: '2022-07-04'
        effectiveUntil: '2022-10-04'
    EditPricingScheduleRequest:
      value:
        edits:
          - mode: ASSOCIATE
            pricePlanId: pp.1zYnCiM9Bpg.lv25y
            effectiveFrom: '2022-07-04'
            effectiveUntil: '2022-10-04'
          - mode: DISASSOCIATE
            effectiveFrom: '2022-08-04'
            effectiveUntil: '2022-09-04'
    UpdateSettingRequest:
      value:
        value: '{"USD":"1"}'
        name: Base_Currency
        dataType: JSON
    GetCustomerPortalDelegateTokenRequestAllAccountsAccess:
      value:
        customerId: acme_cust
        allAccountsAccess: true
        expiry: 60000
    GetCustomerPortalDelegateTokenRequestSelectedAccountsAccess:
      value:
        customerId: acme_cust
        accountIds:
          - acme_accnt_1
          - acme_accnt_2
        expiry: 60000
    CreatePricePlanMigrationRequest:
      value:
        requireConfirmation: true
        sourceId: pp.1zYnCiM9Bpg.lv25y
        sourceVersion: 1
        targetId: pp.2zYnCiM9Bpg.bfeu2
        targetVersion: 2
        migrationMode: IMMEDIATE
    CreateBulkAliasRequest:
      value:
        aliases:
          - value: alias1
    CreateAlertRequest:
      value:
        alertTemplateId: abcd-efgh-ijkl-mnop
        interval: '30'
        entityDetails:
          usageMeterId: um.1zYnCiM9Bpg.lv25y
        ownerDetails:
          accountId: account_1
        parameters:
          threshold: 10
    UpdateAlertRequest:
      value:
        status: INACTIVE
    UpdateIncidentStatusRequest:
      value:
        status: CLOSE
    Customer:
      summary: A sample Customer
      value:
        id: 01BX5ZZKBKACTAV9WEVGEMMVRZ
        togaiCustomerId: customer.dsvvre314.dcs14
        name: ACME Enterprise
        primaryEmail: admin@example.com
        address:
          phoneNumber: '+919876543210'
          line1: 2281 Broadway Street
          line2: G-31
          postalCode: '29501'
          city: Florence
          state: South Carolina
          country: US
        billingAddress: 2281 Broadway Street, G-31, 29501, Florence, South Carolina, US
        status: ACTIVE
        updatedAt: '2020-07-04T12:00:00.000Z'
        createdAt: '2020-07-04T12:00:00.000Z'
    CreateCustomerResponse:
      value:
        id: 01BX5ZZKBKACTAV9WEVGEMMVRZ
        togaiCustomerId: customer.dsvvre314.dcs314
        name: ACME Enterprise
        primaryEmail: admin@example.com
        address:
          phoneNumber: '+919876543210'
          line1: 2281 Broadway Street
          line2: G-31
          postalCode: '29501'
          city: Florence
          state: South Carolina
          country: US
        settings:
          - id: customerSettingId
            value: INR
            namespace: USER
            name: Settings Name
            dataType: STRING
        account:
          id: G234DZZKBKACATFFGVGEMERFH
          togaiAccountId: account.safdla.c234ds
          customerId: 01BX5ZZKBKACTAV9WEVGEMMVRZ
          togaiCustomerId: customer.savass.11e1a
          name: ACME Enterprise - Account
          invoiceCurrency: USD
          status: ACTIVE
          aliases:
            - alias: G234DZZKBKACATFFGVGEMERFH
              status: ACTIVE
          settings:
            - id: accountSettingId
              value: INR
              namespace: USER
              name: Settings Name
              dataType: STRING
    CustomerPaginatedResponse:
      value:
        data:
          - id: 01BX5ZZKBKACTAV9WEVGEMMVRZ
            togaiCustomerId: customer.dsvvre314.dcs314
            name: ACME Enterprise
            primaryEmail: admin@example.com
            address:
              phoneNumber: '+919876543210'
              line1: 2281 Broadway Street
              line2: G-31
              postalCode: '29501'
              city: Florence
              state: South Carolina
              country: US
            billingAddress: 2281 Broadway Street, G-31, 29501, Florence, South Carolina, US
            status: ACTIVE
            createdAt: '2020-01-01T10:10:22Z'
            updatedAt: '2020-01-01T10:10:22Z'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
        context:
          pageSize: 10
    CreateCustomerContactResponse:
      value:
        username: 3d9e0a90-38d5-49d8-b34d-fdbe2e6cf8f2
        name: Lorem Ipsum
        email: bob@acme.com
        verified: true
        phone: '+1234071628'
        loginAccess: true
        createdBy: hrn:Xghfdksd::iam-user/johnny314
        createdAt: '2020-01-01T00:00:00Z'
    AccountPaginatedResponse:
      value:
        data:
          - id: G234DZZKBKACATFFGVGEMERFI
            togaiAccountId: account.dsvvre314.dcs314
            customerId: ACME_CUSTOMER_1
            togaiCustomerId: customer.dsvvre314.dcs314
            name: ACME Enterprise - Account2
            status: ACTIVE
            aliases:
              - alias: account2@acme.com
              - alias: '+1234567890'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
        context:
          pageSize: 10
    Proposal:
      value:
        id: purchase.20rvWRxQcQK.0ZwPG
        accountId: account2394
        pricePlanId: pp.20rqb4MK9ia.TD0eG
        createdAt: '2023-07-26T12:36:56.58015Z'
        type: ASSOCIATION
        status: PROPOSAL_ACTIVE
        paymentMode: PREPAID
        associationOverride:
          pricingCycleConfig:
            interval: MONTHLY
            startOffset:
              dayOffset: '2'
              monthOffset: NIL
            gracePeriod: 3
            anniversaryCycle: false
        updatedAt: '2023-07-26T12:36:56.58015Z'
        effectiveFrom: '2023-06-30'
        effectiveUntil: '2023-08-30'
        comment: Proposal Approved
    InvoiceGroups:
      value:
        id: inv_group.20rvWRxQcQK.0ZwPG
        name: Invoice Group 1
        email: acme@acme.com
        dailyInvoiceConsolidation: true
        accountsCount: 2
        gracePeriod: 3
        netTermDays: 45
        invoiceCurrency: USD
        billingAddress:
          phoneNumber: '+919876543210'
          line1: 2281 Broadway Street
          line2: G-31
          postalCode: '29501'
          city: Florence
          state: South Carolina
          country: US
        createdAt: '2023-07-26T12:36:56.58015Z'
        updatedAt: '2023-07-26T12:36:56.58015Z'
    InvoiceGroupPaginatedResponse:
      value:
        data:
          - id: inv_group.20rvWRxQcQK.0ZwPG
            name: Invoice Group 1
            email: acme@acme.com
            dailyInvoiceConsolidation: true
            accountsCount: 2
            gracePeriod: 3
            netTermDays: 45
            invoiceCurrency: USD
            billingAddress:
              phoneNumber: '+919876543210'
              line1: 2281 Broadway Street
              line2: G-31
              postalCode: '29501'
              city: Florence
              state: South Carolina
              country: US
            createdAt: '2023-07-26T12:36:56.58015Z'
            updatedAt: '2023-07-26T12:36:56.58015Z'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
    InvoiceGroupAccountsPaginatedResponse:
      value:
        id: inv_group.20rvWRxQcQK.0ZwPG
        name: Invoice Group 1
        email: acme@acme.com
        dailyInvoiceConsolidation: true
        accountsCount: 2
        accounts:
          - ACC0001
          - ACC0002
        gracePeriod: 3
        netTermDays: 45
        invoiceCurrency: USD
        billingAddress:
          phoneNumber: '+919876543210'
          line1: 2281 Broadway Street
          line2: G-31
          postalCode: '29501'
          city: Florence
          state: South Carolina
          country: US
        createdAt: '2023-07-26T12:36:56.58015Z'
        updatedAt: '2023-07-26T12:36:56.58015Z'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
    EventSchemaListPaginatedResponse:
      value:
        data:
          - name: ride_completed
            description: Cab ride completed
            version: 1
            status: DRAFT
            attributes:
              - name: distance
              - name: time
            dimensions:
              - name: city
              - name: ride_type
            usageMetersCount: 10
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
        context:
          pageSize: 10
    UsageMeterPaginatedResponse:
      value:
        data:
          - id: 01BX5ZZKBKACTAV9WEVG
            name: Rides
            displayName: Rides Usage
            description: Cab rides
            type: COUNTER
            aggregation: COUNT
            status: DRAFT
            computations:
              - matcher: |
                  {
                    "and": [
                      {"in": [{"var": "dimension.city"}, "chennai", "mumbai"]},
                      "or": [
                        {">": [{"var": "attribute.distance"}, 100]},
                        {"<": [{"var": "attribute.distance"}, 20]}
                      ]
                    ]
                  }
                order: 1
                computation: '1'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
        context:
          pageSize: 10
    UpdatePricingScheduleResponse:
      value:
        accountId: G234DZZKBKACATFFGVGEMERFI
        accountName: ACME Enterprise - Account2
        pricingSchedules:
          - id: sch.4325kbjedsc.34dww
            pricePlanId: pp.1zYnCiM9Bpg.lv25y
            pricePlanName: ENTERPRISE_PLAN
            startDate: '2022-12-02T00:00:00Z'
            endDate: '9999-01-01T00:00:00Z'
    CalculateRevenueResponse:
      value:
        currency: USD
        pricePlanDetails:
          supportedCurrencies:
            - USD
          activeCurrencies:
            - USD
          pricingCycleConfig:
            interval: MONTHLY
            startOffset:
              dayOffset: '1'
              monthOffset: NIL
            gracePeriod: 1
            anniversaryCycle: false
          usageRateCards:
            - displayName: AfterShip Shipments1
              usageMeterId: um.1zcgWalbM2y.qaX5j
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - priceType: PER_UNIT
                    startAfter: 0
                    order: 1
                  - priceType: PACKAGE
                    startAfter: 2
                    order: 2
                    slabConfig:
                      packageSize: '10'
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 10
                      slabRateConfig:
                        minimumRate: '1'
                        maximumRate: '10'
                    - order: 2
                      rate: 20
              tag: '1'
          type: BILLING
        revenueInfo:
          - usages:
              um.fdjal.kdajf: 10
            usageRateCard:
              displayName: AfterShip Shipments1
              usageMeterId: um.1zcgWalbM2y.qaX5j
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - priceType: PER_UNIT
                    startAfter: 0
                    order: 1
                  - priceType: PACKAGE
                    startAfter: 2
                    order: 2
                    slabConfig:
                      packageSize: '10'
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 10
                      slabRateConfig:
                        minimumRate: 1
                        maximumRate: 10
                    - order: 2
                      rate: 20
            slabRevenueSummaries:
              - order: 1
                usage: 10
                revenue: 100
              - order: 2
                usage: 0
                revenue: 0
    Account:
      summary: A sample Account
      value:
        id: G234DZZKBKACATFFGVGEMERFI
        togaiAccountId: account.safdla.c234ds
        customerId: ACME
        togaiCustomerId: customer.savass.11e1a
        name: ACME Enterprise - Account2
        invoiceCurrency: USD
        address:
          phoneNumber: '+919876543210'
          line1: 2281 Broadway Street
          line2: G-31
          postalCode: '29501'
          city: Florence
          state: South Carolina
          country: US
        primaryEmail: admin@example.com
        billingInformation:
          emailRecipients:
            - admin@example.com
            - acme@acme.com
            - acmeacme@acme.com
          additionalEmailRecipients:
            - admin@acme.com
        aliases:
          - alias: account2@acme.com
          - alias: '+1234567890'
        status: ACTIVE
    EventSchema:
      summary: A sample event schema
      value:
        name: ride_completed
        description: Cab ride completed
        version: 1
        attributes:
          - name: distance
          - name: time
        dimensions:
          - name: city
          - name: ride_type
        featureDetails:
          featureId: feature.1122.ahoiud
          attributeName: distance
        eventLevelRevenue: false
    EventSchemaVersionsResponse:
      summary: A sample event schema versions response
      value:
        data:
          - name: ride_completed
            description: Cab ride completed
            version: 1
            status: DRAFT
            attributes:
              - name: distance
              - name: time
            dimensions:
              - name: city
              - name: ride_type
    UsageMeter:
      value:
        id: um.1zlQTBWlkeO.lB7fh
        name: Rides
        displayName: Rides
        description: Cab rides
        type: COUNTER
        aggregation: COUNT
        status: DRAFT
        computations:
          - matcher: |
              {
                "and": [
                  {"in": [{"var": "dimension.city"}, "chennai", "mumbai"]},
                  "or": [
                    {">": [{"var": "attribute.distance"}, 100]},
                    {"<": [{"var": "attribute.distance"}, 20]}
                  ]
                ]
              }
            order: 1
            computation: '1'
    PricePlan:
      value:
        id: pp.20sieTc1u2i.fY8AT
        name: grantCheck
        type: BILLING
        status: ACTIVE
        pricingSchedule:
          - id: sch.20sieTcdnQ0.ZmseL
            startDate: '1970-01-01T00:00:00Z'
            endDate: '9999-01-01T00:00:00Z'
            version: 1
            isOverriden: false
            pricePlanDetails:
              supportedCurrencies:
                - USD
              activeCurrencies:
                - USD
              pricingCycleConfig:
                interval: MONTHLY
                startOffset:
                  dayOffset: '1'
                  monthOffset: NIL
                gracePeriod: 1
                anniversaryCycle: false
              usageRateCards:
                - displayName: rr1
                  usageMeterId: um.20Ms65CtgMy.nwFP0
                  ratePlan:
                    pricingModel: TIERED
                    slabs:
                      - order: 1
                        startAfter: 0
                        priceType: FLAT
                        slabConfig: {}
                  rateValues:
                    - currency: USD
                      slabRates:
                        - order: 1
                          rate: 10
                          slabRateConfig: {}
                  tag: '1'
              fixedFeeRateCards:
                - id: addon.20sidL2HJ7o.vvzDT
                  rateValues:
                    - currency: USD
                      rate: 50
                  enableProration: false
                  displayName: normal
                  tag: '1'
                  invoiceTiming: IN_ARREARS
                  type: RECURRING
                - id: addon.20sidQxYRjs.4oBSU
                  rateValues:
                    - currency: USD
                      rate: 10
                  enableProration: false
                  displayName: anotherNormal
                  tag: '2'
                  invoiceTiming: IN_ARREARS
                  type: RECURRING
                  recurrenceConfig:
                    interval: 2
                    offset: 1
                - id: addon.20sidzySWoa.Bzrcc
                  rateValues:
                    - currency: USD
                      rate: 40
                  enableProration: false
                  displayName: inadvance
                  tag: '1'
                  invoiceTiming: IN_ADVANCE
                  type: RECURRING
              licenseRateCards:
                - id: addon.20darMuJ6C8.bdgRj
                  enableProration: false
                  ratePlan:
                    pricingModel: TIERED
                    slabs:
                      - order: 1
                        startAfter: 0
                        priceType: FLAT
                        slabConfig: {}
                  rateValues:
                    - currency: USD
                      slabRates:
                        - order: 1
                          rate: 15
                          slabRateConfig: {}
                  displayName: license
                  tag: '2'
                  config:
                    maxQuantity: 100
              billingEntitlementRateCards:
                - featureId: feature.20jxa18BdUW.d4XQw
                  featureConfigs:
                    - featureCreditLimit: 100
                      effectiveUntil: P20D
                  invoiceTiming: IN_ADVANCE
                  ratePlan:
                    pricingModel: TIERED
                    slabs:
                      - order: 1
                        startAfter: 0
                        priceType: PER_UNIT
                        slabConfig: {}
                  rateValues:
                    - currency: USD
                      slabRates:
                        - order: 1
                          rate: 1
                  displayName: feature1
                - featureId: feature.20uE1xqEudk.MMVH8
                  featureConfigs:
                    - featureCreditLimit: 200
                      effectiveUntil: P20D
                  invoiceTiming: IN_ADVANCE
                  ratePlan:
                    pricingModel: TIERED
                    slabs:
                      - order: 1
                        startAfter: 0
                        priceType: PER_UNIT
                        slabConfig: {}
                  rateValues:
                    - currency: USD
                      slabRates:
                        - order: 1
                          rate: 2
                  displayName: feature2
              minimumCommitment:
                displayName: Minimum Commitment
                rateValues:
                  - currency: USD
                    rate: 0
              creditGrantRateCards:
                - id: addon.20ufMNoJoAC.TUzRi
                  type: RECURRING
                  displayName: Credit2
                  rateDetails:
                    pricingModel: TIERED
                    currencySlabRateDetails:
                      - currency: USD
                        creditAmount: 100
                        slabDetails:
                          - startAfter: 0
                            priceType: FLAT
                            rate: 10
                  grantDetails:
                    priority: 1
                    expiryType: PRICING_CYCLE
                    applicableEntityIds: []
                  invoiceTiming: IN_ARREARS
                  recurrenceConfig:
                    offset: 0
                    interval: 1
                - id: addon.20ufMNoJoAC.TUzRi
                  type: RECURRING
                  displayName: Credit2
                  rateDetails:
                    pricingModel: TIERED
                    currencySlabRateDetails:
                      - currency: USD
                        slabDetails:
                          - rate: 11
                            priceType: FLAT
                            startAfter: 0
                            slabConfig: {}
                            slabRateConfig: {}
                        creditAmount: 11
                      - currency: INR
                        slabDetails:
                          - rate: 11
                            priceType: FLAT
                            startAfter: 0
                            slabConfig: {}
                            slabRateConfig: {}
                        creditAmount: 11
                  grantDetails:
                    priority: 1
                    expiryType: PRICING_CYCLE
                    applicableEntityIds: []
                  invoiceTiming: IN_ARREARS
                  recurrenceConfig:
                    offset: 0
                    interval: 1
              type: BILLING
        description: Starter plan
    PricePlanPaginatedResponse:
      value:
        data:
          - id: um.1zYnCiM9Bpg.lv25y
            version: 1
            type: BILLING
            name: Rides - Pro plan
            description: ''
            status: DRAFT
            usageMeters:
              - um.1zlQTBWlkeO.lB7fh
              - um.1zYnCiM9Bpg.1zYn
            pricePlanDetails:
              pricingCycleConfig:
                interval: MONTHLY
                startOffset:
                  dayOffset: '4'
                  monthOffset: NIL
                gracePeriod: 3
                anniversaryCycle: false
              supportedCurrencies:
                - USD
              activeCurrencies:
                - USD
            updatedAt: '2020-01-01T00:00:00Z'
            createdAt: '2020-01-01T00:00:00Z'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
    PricingRulesPaginatedResponse:
      value:
        data:
          - id: um.1zYnCiM9Bpg.lv25y
            name: Rule 1
            version: 1
            order: 1
            computation: |
              {"+": [{"var": "revenue.urc.um.21lmjsfcXPs.d929R"}, {"var": "usage.urc.um.21lmjObpMV6.9XeFl"}]}
            condition: |
              {">": [{"+": [{"var": "revenue.urc.um.21lmjObpMV6.9XeFl"}, {"var": "usage.urc.um.21lmjObpMV6.9XeFl"}]}, 100]}
            action:
              type: UPDATE
              target: revenue.ff.addon.21ERXMFJ83s.9EM5S
    PricingSchedulePaginatedResponse:
      value:
        data:
          - id: sch.4325kbjedsc.34dww
            pricePlanId: pp.bs8932bf328
            version: 1
            startDate: '2080-10-04T00:00:00Z'
            endDate: '2099-10-04T00:00:00Z'
            isOverriden: false
            pricePlanDetails:
              supportedCurrencies:
                - USD
              activeCurrencies:
                - USD
              pricingCycleConfig:
                interval: MONTHLY
                startOffset:
                  dayOffset: '4'
                  monthOffset: NIL
                gracePeriod: 3
                anniversaryCycle: false
              usageRateCards:
                - displayName: Local Rides
                  usageMeterId: um.1zYnCiM9Bpg.1zYn
                  ratePlan:
                    pricingModel: TIERED
                    slabs:
                      - order: 1
                        startAfter: 0
                        priceType: FLAT
                  rateValues:
                    - currency: USD
                      slabRates:
                        - rate: 40
                          order: 1
              fixedFeeRateCards:
                - id: addon.2077efUBMXo.DyzlZ
                  displayName: Maintenance
                  enableProration: false
                  rateValues:
                    - currency: USD
                      rate: 10
              minimumCommitment:
                displayName: Minimum Commitment
                rateValues:
                  - currency: USD
                    rate: 10
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
        previousToken: eyJwYXlsb2FkIjp7InN0YXJ0X2RhdGUiOiInsic3RhcnRfZGF0ZWxsfSwidG9rZW5UeXBlIjoiUifQ==
    Setting:
      value:
        id: UserSetting
        value: INR
        entityType: ORGANIZATION
        entityId: XlK5h64gND
        namespace: USER
        name: Settings Name
        dataType: STRING
    SettingPaginatedResponse:
      value:
        data:
          - id: TogaiSetting
            value: INR
            entityType: ORGANIZATION
            entityId: XlK5h64gND
            namespace: togai
            name: Settings Name
            dataType: STRING
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
        context:
          pageSize: 10
    GetJobResponse:
      value:
        id: job.20aUyEZSuYq.SoGbS
        type: PRICE_PLAN
        updatedAt: '2080-10-04T00:00:00Z'
        status: COMPLETED
        totalJobEntries: 100
        pendingJobEntries: 40
        failedJobEntries: 20
        completedJobEntries: 40
        metadata:
          sourceId: pp.njrjk314hfr
          targetId: pp.rhk32h4dsfq
    JobEntriesPaginatedResponse:
      value:
        data:
          - entityId: inv.423535.afe325
            jobId: job.20aUyEZSuYq.SoGbS
            createdAt: '2080-10-04T00:00:00Z'
            status: COMPLETED
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
    JobsPaginatedResponse:
      value:
        data:
          - id: mig.20aUyEZSuYq.SoGbS
            type: PRICE_PLAN
            status: COMPLETED
            updatedAt: '2080-10-04T00:00:00Z'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
        context:
          pageSize: 10
    CreatePurchaseResponse:
      value:
        id: purchase.1zYnCiM9Bpg.lv25y
        accountId: G234DZZKBKACATFFGVGEMERFI
        pricePlanId: pp.1zYnCiM9Bpg.lv25y
        quantity: 1
        idempotencyKey: AAAAAABBBEEEDDSS23
        pricePlanVersion: 1
        purchasePlanOverride:
          billingEntitlementRateCards:
            - featureId: feature.20jxa18BdUW.d4XQw
              featureConfigs:
                - featureCreditLimit: 100
                  effectiveUntil: P20D
              invoiceTiming: IN_ADVANCE
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 1
                      slabRateConfig: {}
              displayName: feature1
        type: ENTITLEMENT_GRANT
        status: SUCCESS
        createdAt: '2020-01-01T00:00:00Z'
        updatedAt: '2020-01-01T00:00:00Z'
    GetProposalResponse:
      value:
        id: purchase.1zYnCiM9Bpg.lv25y
        accountId: G234DZZKBKACATFFGVGEMERFI
        pricePlanId: pp.1zYnCiM9Bpg.lv25y
        quantity: 1
        idempotencyKey: AAAAAABBBEEEDDSS23
        pricePlanVersion: 1
        type: ENTITLEMENT_GRANT
        status: PROPOSAL_ACTIVE
        paymentMode: PREPAID
        purchasePlanOverride:
          billingEntitlementRateCards:
            - featureId: feature.20jxa18BdUW.d4XQw
              featureConfigs:
                - featureCreditLimit: 100
                  effectiveUntil: P20D
              invoiceTiming: IN_ADVANCE
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 1
              displayName: feature1
        createdAt: '2020-01-01T00:00:00Z'
        updatedAt: '2020-01-01T00:00:00Z'
    GetPurchaseForPurchasePlanResponse:
      value:
        id: purchase.20txx14r0m8.VKxaB
        accountId: c102
        pricePlanId: pp.20txw0FrqjQ.byM8V
        pricePlanVersion: 1
        createdAt: '2023-07-31T15:49:25.007848Z'
        type: ENTITLEMENT_GRANT
        status: SUCCESS
        purchasePlan:
          billingEntitlementRateCards:
            - featureId: feature.20txvOAhiIS.m3X3d
              featureConfigs:
                - effectiveUntil: P20D
                  featureCreditLimit: 100
                  effectiveFrom: PT0S
              invoiceTiming: IN_ADVANCE
              ratePlan:
                pricingModel: TIERED
                slabs:
                  - order: 1
                    startAfter: 0
                    priceType: PER_UNIT
                    slabConfig: {}
              rateValues:
                - currency: USD
                  slabRates:
                    - order: 1
                      rate: 1
              displayName: feature1
          supportedCurrencies:
            - USD
          activeCurrencies:
            - USD
        features:
          - id: feature.20txvOAhiIS.m3X3d
            name: feature1
            creditsGranted: 120
            creditsAvailable: 120
            updatedAt: '2023-07-31T15:47:52.570011Z'
            effectiveFrom: '2023-07-31T15:51:34.308371Z'
            effectiveUntil: '2023-08-20T15:51:34.308371Z'
        rateCardQuantities:
          feature.20txvOAhiIS.m3X3d: 1.2
        updatedAt: '2023-07-31T15:51:35.093598Z'
        price: 120
        invoiceId: inv.20txx3jeQU4.nlMQh
        invoiceCurrency: USD
    PurchasePaginatedResponse:
      value:
        data:
          - id: purchase.1zYnCiM9Bpg.lv25y
            pricePlanId: pp.20dINmd0lBg.05sKa
            pricePlanName: Entitlement Plan
            quantity: 1
            pricePlanVersion: 1
            type: ENTITLEMENT_GRANT
            status: SUCCESS
            idempotencyKey: AAAAABBBBDDDD7730
            createdAt: '2020-01-01T00:00:00Z'
            updatedAt: '2020-01-01T00:00:00Z'
          - id: purchase.20txx14r0m8.VKxaB
            pricePlanId: pp.20txw0FrqjQ.byM8V
            pricePlanName: pp_feature_purchase
            pricePlanVersion: 1
            type: ENTITLEMENT_GRANT
            status: SUCCESS
            purchasePlan:
              billingEntitlementRateCards:
                - featureId: feature.20txvOAhiIS.m3X3d
                  featureConfigs:
                    - effectiveUntil: P20D
                      featureCreditLimit: 100
                      effectiveFrom: PT0S
                  invoiceTiming: IN_ADVANCE
                  ratePlan:
                    pricingModel: TIERED
                    slabs:
                      - order: 1
                        startAfter: 0
                        priceType: PER_UNIT
                        slabConfig: {}
                  rateValues:
                    - currency: USD
                      slabRates:
                        - order: 1
                          rate: 1
                  displayName: feature1
              supportedCurrencies:
                - USD
              activeCurrencies:
                - USD
            createdAt: '2023-07-31T15:49:25.007848Z'
            rateCardQuantities:
              feature.20txvOAhiIS.m3X3d: 1.2
            price: 120
            invoiceCurrency: USD
            updatedAt: '2023-07-31T15:51:35.093598Z'
    ProposalsPaginatedResponse:
      value:
        data:
          - id: purchase.1zYnCiM9Bpg.lv25y
            pricePlanId: pp.20dINmd0lBg.05sKa
            pricePlanName: Advanced Tier
            type: ASSOCIATION
            status: PROPOSAL_ACTIVE
            paymentMode: PREPAID
            pricePlanVersion: 2
            createdAt: '2020-01-01T00:00:00Z'
            updatedAt: '2020-01-01T00:00:00Z'
    FeatureResponse:
      value:
        id: feature.1zYnCiM9Bpg.lv25y
        name: DiscountCredits
        displayName: DiscountCredits
        schemaAssociations:
          - schemaName: event_schema1
            attributeName: distance
          - schemaName: event_schema2
            attributeName: time
        createdAt: '2020-01-01T00:00:00Z'
        updatedAt: '2020-01-01T00:00:00Z'
    FeaturePaginatedResponse:
      value:
        data:
          - id: feature.1zYnCiM9Bpg.lv25y
            name: DiscountCredits
            displayName: DiscountCredits
            schemaCount: 2
            createdAt: '2020-01-01T00:00:00Z'
            updatedAt: '2020-01-01T00:00:00Z'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
        context:
          pageSize: 10
    FileDownloadUrlResponse:
      value:
        downloadUrl: https://s3.amazonaws.com/...
    AliasResponse:
      value:
        value: acme_primary
        createdAt: '2020-01-01T00:00:00Z'
    AliasPaginatedResponse:
      value:
        data:
          - value: acme_primary
            createdAt: '2020-01-01T00:00:00Z'
    IngestEventRequest:
      summary: example event ingestion request
      value:
        event:
          timestamp: '2022-06-15T07:30:35.123'
          schemaName: travelCompletedEvent
          id: c0b1306d-f506-43a6-856b-69221efaee6b
          accountId: '1'
          attributes:
            - name: distanceTravelled
              value: '50'
              unit: Miles
            - name: timeSpent
              value: '60'
              unit: Minutes
          dimensions:
            location: Seattle
            costCenterCode: '1234'
            travelType: Business
    UsageEventRequest:
      summary: example named license event ingestion request
      value:
        event:
          id: 42162b5e-22f6-4cd3-a9d9-019ba2c485c1
          timestamp: '2024-04-18T16:00:17'
          accountId: customer@biswa
          schemaName: togai-usage
          dimensions:
            usage_meter_id: um.21UFaN6gpmS.RAbFG
          attributes:
            - name: usage
              value: '10'
    NamedLicenseEventRequest:
      summary: example usage event ingestion request
      value:
        event:
          id: id-123
          timestamp: '2024-04-18T13:23:55'
          accountId: sampleID
          schemaName: togai-named-license
          dimensions:
            license_id: addon.sample.sample
            name: unique_name
          attributes:
            - name: action
              value: '1'
    IngestEventBatchRequest:
      summary: example batch event ingestion request
      value:
        events:
          - timestamp: '2022-06-15T07:30:35.123'
            schemaName: travelCompletedEvent
            id: c0b1306d-f506-43a6-856b-69221efaee6b
            accountId: '1'
            attributes:
              - name: distanceTravelled
                value: '50'
                unit: Miles
              - name: timeSpent
                value: '60'
                unit: Minutes
            dimensions:
              location: Seattle
              costCenterCode: '1234'
              travelType: Business
          - timestamp: '2022-06-15T07:30:35.123'
            schemaName: sendMessageEvent
            id: c0b1306d-f506-43a6-856b-69221efaee6c
            accountId: '1'
            attributes:
              - name: messageSentCount
                value: '50'
                unit: None
              - name: sizeOfMessage
                value: '60'
                unit: KiloBytes
            dimensions:
              location: Seattle
              costCenterCode: '1234'
              messageProviderName: Twilio
    GetEventResponse:
      summary: example get event response
      value:
        events:
          - eventPayload:
              timestamp: '2023-02-23T14:25:10Z'
              schemaName: travelCompletedEvent
              referenceId: event.dsvhk32.234n3
              id: c0b1306d-f506-43a6-856b-69221efaee6b
              accountId: '1'
              attributes:
                - name: distanceTravelled
                  value: '50'
                  unit: Miles
                - name: timeSpent
                  value: '60'
                  unit: Minutes
              dimensions:
                location: Seattle
                costCenterCode: '1234'
                travelType: Business
            eventPipelineInfo:
              eventSchema:
                name: Rides
                version: 1
              usageMeters:
                - id: 23bh55ZZdifACTAV9WEV
                  name: rides_distance
                  version: 1
                  status: PROCESSED_UNITS_COMPUTED
                  units: 10.42
                - id: 23bh55ZZdifACTAV9WEV
                  name: rides_time
                  version: 1
                  status: PROCESSED_FILTERED_OUT
              pricePlans:
                - name: pro-plan
                  id: 68551191-982b-4663-92fa-38a6f8313e91
                  scheduleId: c0b1306d-f506-43a6-856b-69221efaee6b
                  cycleStart: 04-03-2022
                  cycleEnd: 04-04-2022
              account:
                id: acme-prod
              customer:
                id: acme_inc
            ingestionStatus:
              status: INGESTION_COMPLETED_EVENT_NOT_METERED
              statusDescription: Event ingestion completed successfully but the event is not associated with any bill plan.
            createdAt: '2021-03-04T14:25:10Z'
    EventsCorrectionResponse:
      summary: Example event correction response
      value:
        data:
          - referenceId: event.21OpEx4DHQu.CZlyh
            eventPayload:
              timestamp: '2023-02-23T14:25:10Z'
              schemaName: travelCompletedEvent
              id: c0b1306d-f506-43a6-856b-69221efaee6b
              accountId: '1'
              attributes:
                - name: distanceTravelled
                  value: '50'
                  unit: Miles
                - name: timeSpent
                  value: '60'
                  unit: Minutes
              dimensions:
                location: Seattle
                costCenterCode: '1234'
                travelType: Business
            ingestionStatus:
              status: INGESTION_COMPLETED_EVENT_NOT_METERED
              statusDescription: Event ingestion completed successfully but the event is not associated with any bill plan.
            customerId: CUS0001
            source:
              id: ENTITLED
              type: ENTITLED
            createdAt: '2023-02-23T14:25:10Z'
            status: REVERTED
            reason: Event Reverted
          - referenceId: event.23OrTx4FGQu.XVpzf
            eventPayload:
              timestamp: '2023-02-23T14:25:10Z'
              schemaName: smsSentEvent
              id: sdvb325j-f506-43a6-856b-69221efaee6b
              accountId: '1'
              attributes:
                - name: smsCount
                  value: '50'
                  unit: count
              dimensions: {}
            ingestionStatus:
              status: INGESTION_COMPLETED_EVENT_NOT_METERED
              statusDescription: Event ingestion completed successfully but the event is not associated with any bill plan.
            customerId: CUS0001
            source:
              id: ''
              type: ''
            createdAt: '2023-01-01T14:25:10Z'
            status: FAILED
            reason: Event was ingested in past pricing cycle
    GetLicenseUpdatesResponse:
      summary: example get license updates response
      value:
        data:
          - licenseId: lic.fdjsl.313
            accountId: acc.fdjsl.313
            quantity: 10
            effectiveFrom: '2020-01-01T00:00:00Z'
            createdAt: '2021-03-04T14:25:10Z'
    LicenseUpdateResponse:
      summary: example license update response
      value:
        licenseId: lic.fdjsl.313
        accountId: acc.fdjsl.313
        quantity: 10
        effectiveFrom: '2020-01-01T00:00:00Z'
        createdAt: '2021-03-04T14:25:10Z'
    GetFeatureCreditsResponse:
      summary: example get feature credits response
      value:
        accountId: acc.fdjsl.313
        featureId: feat.fdjsl.313
        granted: 15
        balance: 10
        overageLimit: 20
        usedOverage: 15
    FeatureCreditEntry:
      summary: example update feature credits response
      value:
        id: purchase.20rvWRxQcQK.0ZwPG$1
        status: ACTIVE
        source: ENTITLEMENT
        effectiveFrom: '2020-01-01T00:00:00Z'
        effectiveUntil: '2025-01-01T00:00:00Z'
        granted: 15
        balance: 10
        used: 5
    GetFeatureCreditEntriesPaginatedResponse:
      summary: example list feature credit entries response
      value:
        data:
          - id: purchase.20rvWRxQcQK.0ZwPG
            source: ENTITLEMENT
            status: ACTIVE
            granted: 10
            balance: 5
            used: 5
            effectiveFrom: '2020-01-01T00:00:00Z'
            effectiveUntil: '2021-03-04T14:25:10Z'
          - id: purchase.20rvWRxQcQK.0ZwPG
            source: ENTITLEMENT
            status: ACTIVE
            granted: 10
            balance: 5
            used: 5
            effectiveFrom: '2020-01-01T00:00:00Z'
            effectiveUntil: '2021-03-04T14:25:10Z'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ==
      description: |
        Examples response of list feature entries API. The source id can either be a 'PURCHASE_ID' incase of entry source being a purchase or 'SCHEDULE_ID#CYCLE_START_DATE' in case of entry source being a price plan rate card to indicate the schedule_id and its start_date that granted the credits
    GetEventsResponse:
      summary: example get batch event response
      value:
        events:
          - eventPayload:
              timestamp: '2023-02-23T14:25:10Z'
              schemaName: travelCompletedEvent
              id: c0b1306d-f506-43a6-856b-69221efaee6b
              referenceId: event.dsvhk32.234n3
              accountId: '1'
              attributes:
                - name: distanceTravelled
                  value: '50'
                  unit: Miles
                - name: timeSpent
                  value: '60'
                  unit: Minutes
              dimensions:
                location: Seattle
                costCenterCode: '1234'
                travelType: Business
            ingestionStatus:
              status: INGESTION_COMPLETED_EVENT_NOT_METERED
              statusDescription: Event ingestion completed successfully but the event is not associated with any bill plan.
            createdAt: '2021-03-04T14:25:10Z'
          - eventPayload:
              timestamp: '2023-02-23T14:25:10Z'
              schemaName: sendMessageEvent
              referenceId: event.dsvhk32.234n4
              id: c0b1306d-f506-43a6-856b-69221efaee6c
              accountId: '1'
              attributes:
                - name: messageSentCount
                  value: '50'
                  unit: None
                - name: sizeOfMessage
                  value: '60'
                  unit: KiloBytes
              dimensions:
                location: Seattle
                costCenterCode: '1234'
                messageProviderName: Twilio
            ingestionStatus:
              status: INGESTION_COMPLETED_EVENT_METERED
              statusDescription: Ingestion completed successfully
            createdAt: '2021-03-04T14:25:10Z'
    GetMetricsResponse:
      summary: example get metrics response
      value:
        results:
          - id: m1
            name: EVENTS
            data:
              - timestamps:
                  - '2017-07-21T00:00:00Z'
                  - '2017-07-22T00:00:00Z'
                metricValues:
                  - 53
                  - 32
          - id: m2
            name: USAGE
            data:
              - timestamps:
                  - '2017-07-01T00:00:00Z'
                metricValues:
                  - 123.45
    GetEntitlementValuesResponse:
      value:
        data:
          - featureId: feat.fdjsl.313
            value: 'true'
          - featureId: feat.fdjsl.314
            value: custom
    NamedLicenseUpdatesPaginatedResponse:
      value:
        data:
          - id: named_license_entry.20rvWRx.0ZwPG
            licenseId: addon.fdjsl.313
            accountId: '123'
            name: user1
            effectiveFrom: '2021-03-04T14:25:10Z'
            effectiveUntil: '2021-03-04T14:25:10Z'
            createdAt: '2021-03-04T14:25:10Z'
            updatedAt: '2021-03-04T14:25:10Z'
    Payment:
      summary: A sample Payment
      value:
        id: payment.1223dfs.234ds
        description: Payment for services
        notes: Invoice payment
        accountId: acc123
        currency: USD
        externalPaymentReferences:
          sourceName: XYZ Company
          sourceType: CARD
          transactionNumber: TXN123
          description: Card payment
        lineItemRecords:
          - togaiId: inv.234.12efwe
            amount: 1000
            type: INVOICE
            order: 1
          - togaiId: inv.235.12efwe
            amount: 600
            type: INVOICE
            order: 2
          - togaiId: cred.236.12efwe
            amount: 100
            type: CREDIT
            order: 3
        totalAmount: 1700
        version: 1
        createdBy: user123
        createdAt: '2023-01-01T12:00:00'
    ListPaymentResponse:
      summary: A sample list payments response
      value:
        data:
          - id: payment.1223dfs.234ds
            description: Payment for services
            notes: Invoice payment
            accountId: acc123
            currency: USD
            externalPaymentReferences:
              sourceName: XYZ Company
              sourceType: CARD
              transactionNumber: TXN123
              description: Card payment
            lineItemRecords:
              - togaiId: inv.234.12efwe
                amount: 1000
                type: INVOICE
                order: 1
              - togaiId: inv.235.12efwe
                amount: 600
                type: INVOICE
                order: 2
              - togaiId: cred.236.12efwe
                amount: 100
                type: CREDIT
                order: 3
            totalAmount: 1700
            version: 1
            createdBy: user123
            createdAt: '2023-01-01T12:00:00'
    Invoice:
      summary: A sample Invoice
      value:
        id: inv.hkgkgyh.ghg
        sequenceId: 2020-07-2958
        customerId: 7VcRw9xZDIqsC5E
        ownerId: ACC001
        usageInfo:
          - description: rides - local
            type: USAGE_METER_USAGE
            value: 15
            units: USAGE_UNITS
          - description: rides - pro
            type: USAGE_METER_USAGE
            value: 5
            units: USAGE_UNITS
        revenueInfo:
          description: Grand Total Amount
          type: GRAND_TOTAL_AMOUNT
          units: USD
          value: 881.94
          lineItems:
            - description: Total Amount
              type: TOTAL_AMOUNT
              units: USD
              value: 881.94
              lineItems:
                - description: Total amount due
                  type: NET_AMOUNT
                  units: USD
                  value: 881.94
                  lineItems:
                    - description: Sum Total
                      type: GROSS_AMOUNT
                      units: USD
                      value: 981.94
                      lineItems:
                        - description: Payout_NEFT
                          type: USAGE_RATE_CARD_AMOUNT
                          units: USD
                          value: 392.1
                          lineItems:
                            - description: Slab 1
                              type: USAGE_RATE_CARD_SLAB_AMOUNT
                              valuePerQuantity: 0.001
                              quantity: 10000
                              units: USD
                              value: 10
                            - description: Slab 2
                              type: USAGE_RATE_CARD_SLAB_AMOUNT
                              valuePerQuantity: 0.001
                              quantity: 10000
                              units: USD
                              value: 10
                        - description: Payout IMPS
                          type: USAGE_RATE_CARD_AMOUNT
                          valuePerQuantity: 0.001
                          quantity: 32109
                          units: USD
                          value: 589.94
                          lineItems:
                            - description: Slab 1
                              type: USAGE_RATE_CARD_SLAB_AMOUNT
                              valuePerQuantity: 0.001
                              quantity: 10000
                              units: USD
                              value: 10
                            - description: Slab 2
                              type: USAGE_RATE_CARD_SLAB_AMOUNT
                              valuePerQuantity: 0.001
                              quantity: 10000
                              units: USD
                              value: 10
        invoiceDetails:
          customer:
            name: John Doe
            primaryEmail: john@togai.com
            address:
              line1: 2281 Broadway Street
              line2: G-31
              postalCode: '29501'
              city: Florence
              state: South Carolina
              country: US
          account:
            name: Togai
            address:
              line1: 2281 Broadway Street
              line2: G-31
              postalCode: '29501'
              city: Florence
              state: South Carolina
              country: US
            primaryEmail: john@togai.com
            invoiceCurrency: USD
          pricePlanName: Togai Basic
        totalAmount: 881.94
        paidAmount: 0
        invoiceClass: INVOICE
        invoiceType: STANDARD
        status: DUE
        finalizingStatus: FINALIZED
        startDate: '2020-07-04T12:00:00.000Z'
        endDate: '2020-08-04T12:00:00.000Z'
        invoiceDate: '2020-08-04T12:00:00.000Z'
        generatedAt: '2020-08-04T12:00:00.000Z'
        updatedAt: '2020-08-04T12:00:00.000Z'
    ListInvoicesResponse:
      summary: A sample ListInvoicesResponse
      value:
        data:
          - id: inv.hkgkgyh.ghg
            customerId: 7VcRw9xZDIqsC5E
            ownerId: ACC001
            invoiceClass: INVOICE
            invoiceType: AD_HOC
            status: DUE
            finalizingStatus: FINALIZED
            totalAmount: 100
            paidAmount: 0
            startDate: '2020-07-04T12:00:00.000Z'
            endDate: '2020-07-04T12:00:00.000Z'
            invoiceDate: '2020-07-04T12:00:00.000Z'
            generatedAt: '2020-07-04T12:00:00.000Z'
            updatedAt: '2020-07-04T12:00:00.000Z'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ==
    CreateCreditResponse:
      summary: A sample for a Create Credit Response
      value:
        - id: creds.1znQx9jiIXw.r44fc
          customerId: 7VcRw9xZDIqsC5E
          accountId: ACC001
          purpose: Prepaid Credit
          effectiveFrom: '2020-07-04'
          effectiveUntil: '2021-07-04'
          status: ACTIVE
          creditAmount: 1000
          creditUnit: USD
          holdAmount: 500
          consumedAmount: 400
          priority: 1
          createdAt: '2020-07-04T12:00:00.000Z'
        - id: creds.1znQ46jiIXw.r24fc
          customerId: 7VcRw9xZDIqsC5E
          accountId: ACC001
          purpose: Prepaid Credit
          effectiveFrom: '2020-08-04'
          effectiveUntil: '2021-08-04'
          status: ACTIVE
          creditAmount: 1000
          creditUnit: USD
          holdAmount: 500
          consumedAmount: 400
          priority: 1
          createdAt: '2020-08-04T12:00:00.000Z'
    VoidCreditResponse:
      summary: A sample Credit
      value:
        accountId: biswa
        purpose: credits
        effectiveFrom: '2024-03-06'
        priority: 1
        id: cred.22LLLScunZg.om5kC
        customerId: biswa
        status: VOIDED
        createdAt: '2024-03-13T12:33:39.986252Z'
        applicableEntityIds: []
        effectiveUntil: '2025-03-06'
        creditAmount: 10
        grantorId: addon.22IZs2ZVEnw.0zDFe
        creditUnit: USD
        holdAmount: 0
        consumedAmount: 0
        updatedAt: '2024-03-13T12:42:33.489822Z'
    ListCreditsResponse:
      summary: A sample Credits List
      value:
        data:
          - id: creds.1znQx9jiIXw.r44fc
            customerId: 7VcRw9xZDIqsC5E
            accountId: ACC001
            purpose: Prepaid Credit
            effectiveFrom: '2020-07-04'
            effectiveUntil: '2021-07-04'
            status: ACTIVE
            creditAmount: 1000
            creditUnit: USD
            holdAmount: 500
            consumedAmount: 400
            priority: 1
            createdAt: '2020-07-04T12:00:00.000Z'
        nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ==
    MiscellaneousChargesResponse:
      summary: A sample MiscellaneousChargesResponse
      value:
        data:
          - name: charge 1
            value: '100'
          - name: charge 2
            rate: 20
            quantity: 10
            value: '200'
    PricingRulesLogsPaginatedResponse:
      summary: A sample PricingRulesLogsPaginatedResponse
      value:
        data:
          - id: rule_log.21x6RLQxnpg.1DHMH
            ruleId: pp_rule.21wpdBGbhRI.L26uj
            order: 1
            changes:
              key: urc.um.21wpFfFWtw0.PDfXy
              oldUsage: 100
              newUsage: 200
              oldRevenue: 200
              newRevenue: 400
    CreateCreditRequest:
      summary: A sample for CreateCreditRequest
      value:
        creditRequests:
          - accountId: ACC001
            purpose: Prepaid Credit
            effectiveFrom: '2023-02-04'
            effectiveUntil: '2024-02-04'
            creditAmount: 1000
            priority: 1
    CreatePaymentRequest:
      summary: A sample for CreatePaymentRequest
      value:
        description: Payment for services
        notes: Invoice payment
        currency: USD
        accountId: acc123
        totalAmount: 10000
        externalPaymentReference:
          sourceName: XYZ Company
          sourceType: CARD
          transactionNumber: TXN123
          description: Card payment
        lineItemRecords:
          - togaiId: inv.234.12efwe
            order: 1
            amount: 1000
            type: INVOICE
          - togaiId: inv.236.12efwe
            order: 2
            amount: 500
            type: INVOICE
          - togaiId: cred.236.12efwe
            order: 3
            amount: 200
            type: CREDIT
    TopupWalletRequest:
      summary: A sample for TopupWalletRequest
      value:
        topupAmount: 50
    UpdateWalletRequest:
      summary: A sample for UpdateWalletRequest
      value:
        effectiveFrom: '2023-02-04T00:00:00Z'
        status: ACTIVE
    ManageMiscellaneousChargesRequest:
      summary: A sample for ManageMiscellaneousChargesRequest
      value:
        items:
          - name: charge 1
            value: '100'
          - name: qty & rate charge
            rate: 20
            quantity: 10
          - name: json logic charge
            value: '{"var": "um.linitem.id"}'
    CreditBalanceResponse:
      summary: A sample for CreditBalanceResponse
      value:
        activeCredits: 1000
        availableBalance: 800
        runningBalance: 700
        inapplicableCredits: 100
        unit: USD
        lastUpdatedAt: '2020-07-04T12:00:00.000Z'
    WalletBalanceResponse:
      summary: A sample for WalletBalanceResponse
      value:
        id: wallet.1223.sf23f
        accountId: ACC001
        customerId: CUST001
        balance: 500
        creditUnit: USD
        externalId: ext_id_123
        status: ACTIVE
        holdAmount: 500
        createdAt: '2023-12-13T12:00:00Z'
        updatedAt: '2023-12-13T12:00:00Z'
        metadata:
          autoNetOff: false
    WalletEntriesPaginatedResponse:
      summary: A sample for CreditBalanceResponse
      value:
        data:
          - id: wallet.q3df.1241
            description: payment
            walletId: cred.1234.2342
            transactionType: CREDITED
            entityId: inv.wrwerw.4234e
            amount: 500
            createdAt: '2023-11-07T05:31:56Z'
            closingBalance: 500
    CreateCustomInvoiceRequest:
      summary: A sample for CreateCustomInvoiceRequest
      value:
        accountId: ACC001
        startDate: '2020-06-04T12:00:00.000Z'
        endDate: '2020-07-04T12:00:00.000Z'
        idempotencyKey: '1234567890'
        status: DRAFT
        lineItems:
          - description: Payout IMPS
            valuePerQuantity: 0.001
            quantity: 32109
    UpdateInvoiceRequest:
      summary: A sample for UpdateInvoiceRequest
      value:
        startDate: '2020-06-04T12:00:00.000Z'
        endDate: '2020-07-04T12:00:00.000Z'
        status: DUE
        lineItems:
          - description: Payout IMPS
            valuePerQuantity: 0.001
            quantity: 32109
  requestBodies:
    CreatePurchaseRequest:
      description: Payload to initiate a purchase
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreatePurchaseRequest'
          examples:
            CreatePurchaseForPurchasePlanRequest:
              $ref: '#/components/examples/CreatePurchaseForPurchasePlanRequest'
            CreatePurchaseForAssociationRequest:
              $ref: '#/components/examples/CreatePurchaseForAssociationRequest'
            CreatePurchaseForWalletTopupRequest:
              $ref: '#/components/examples/CreatePurchaseForWalletTopupRequest'
    CreateProposalRequest:
      description: Payload to initiate a proposal
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateProposalRequest'
          examples:
            CreateProposalForOneTimePurchasePlanRequest:
              $ref: '#/components/examples/CreateProposalForOneTimePurchasePlanRequest'
            CreateProposalForAssociationRequest:
              $ref: '#/components/examples/CreateProposalForAssociationRequest'
    UpdateProposalStatus:
      description: Payload to approve or decline a proposal
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateProposalStatus'
          examples:
            UpdateProposalStatus:
              $ref: '#/components/examples/UpdateProposalStatus'
    CreateInvoiceGroupRequest:
      description: Payload to approve or decline a proposal
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateInvoiceGroupRequest'
          examples:
            CreateInvoiceGroupRequest:
              $ref: '#/components/examples/CreateInvoiceGroupRequest'
    UpdateInvoiceGroupAccounts:
      description: Payload to add or remove accounts to/from an invoice group
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateInvoiceGroupAccounts'
          examples:
            UpdateInvoiceGroupAccounts:
              $ref: '#/components/examples/UpdateInvoiceGroupAccounts'
    CreateCustomerRequest:
      description: Payload to create customer
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateCustomerRequest'
          examples:
            CreateCustomerRequest:
              $ref: '#/components/examples/CreateCustomerRequest'
    CreateCustomerContactRequest:
      description: Payload to create a contact for a customer
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateCustomerContactRequest'
          examples:
            CreateCustomerContactRequest:
              $ref: '#/components/examples/CreateCustomerContactRequest'
    UpdateCustomerRequest:
      description: Payload to update customer
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateCustomerRequest'
          examples:
            UpdateCustomerRequest:
              $ref: '#/components/examples/UpdateCustomerRequest'
    CreateAccountRequest:
      description: Payload to create account
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateAccountRequest'
          examples:
            CreateAccountRequest:
              $ref: '#/components/examples/CreateAccountRequest'
    UpdateAccountRequest:
      description: Payload to update account
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateAccountRequest'
          examples:
            UpdateAccountRequest:
              $ref: '#/components/examples/UpdateAccountRequest'
    AddAccountAliasesRequest:
      description: Payload to add aliases to account
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AddAccountAliasesRequest'
          examples:
            AddAccountAliasesRequest:
              $ref: '#/components/examples/AddAccountAliasesRequest'
    RemoveAccountAliasesRequest:
      description: Payload to remove aliases from account
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RemoveAccountAliasesRequest'
          examples:
            RemoveAccountAliasesRequest:
              $ref: '#/components/examples/RemoveAccountAliasesRequest'
    CreateEventSchemaRequest:
      description: Payload to create event schema
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateEventSchemaRequest'
          examples:
            EventSchema:
              $ref: '#/components/examples/CreateEventSchemaRequest'
    UpdateEventSchemaRequest:
      description: Payload to update event schema
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateEventSchemaRequest'
          examples:
            EventSchema:
              $ref: '#/components/examples/UpdateEventSchemaRequest'
    CreateUsageMeterRequest:
      description: Payload to create usage meter
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateUsageMeterRequest'
          examples:
            UsageMeter:
              $ref: '#/components/examples/CreateUsageMeterRequest'
    UpdateUsageMeterRequest:
      description: Payload to create usage meter
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateUsageMeterRequest'
    UpdatePricingScheduleRequestWithActions:
      description: Payload to associate or dissociate a price plan to an account with actions
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdatePricingScheduleRequestWithActions'
          examples:
            UpdatePricingScheduleAssociateRequest:
              $ref: '#/components/examples/UpdatePricingScheduleAssociateRequest'
            UpdatePricingScheduleDisassociateRequest:
              $ref: '#/components/examples/UpdatePricingScheduleDisassociateRequest'
    EditPricingScheduleRequest:
      description: Payload to dis/associate one or more price plans to an account
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EditPricingScheduleRequest'
          examples:
            EditPricingScheduleRequest:
              $ref: '#/components/examples/EditPricingScheduleRequest'
    EditAccountScheduleRequest:
      description: Payload to edit schedules of an account
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EditAccountScheduleRequest'
    CreatePricePlanRequest:
      description: Payload to create price plan
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreatePricePlanRequest'
          examples:
            CreateNonAnniversaryBillingPricePlanRequest:
              $ref: '#/components/examples/CreateNonAnniversaryBillingPricePlanRequest'
            CreateAnniversaryBillingPricePlanRequest:
              $ref: '#/components/examples/CreateAnniversaryBillingPricePlanRequest'
            CreatePurchasePricePlanRequest:
              $ref: '#/components/examples/CreatePurchasePricePlanRequest'
    UpdatePricePlanRequest:
      description: Payload to update price plan
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdatePricePlanRequest'
          examples:
            UpdatePricePlanRequest:
              $ref: '#/components/examples/UpdatePricePlanRequest'
    UpdateSettingRequest:
      description: Payload to update setting
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateSettingRequest'
          examples:
            UpdateSettingRequest:
              $ref: '#/components/examples/UpdateSettingRequest'
    CreateSettingRequest:
      description: Payload to insert setting
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Setting'
          examples:
            Setting:
              $ref: '#/components/examples/Setting'
    CalculateRevenueRequest:
      description: Request payload for calculateRevenueAPI
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CalculateRevenueRequest'
          examples:
            FirstCalculateRevenueRequestExample:
              $ref: '#/components/examples/FirstCalculateRevenueRequestExample'
            SecondCalculateRevenueRequestExample:
              $ref: '#/components/examples/SecondCalculateRevenueRequestExample'
            ThirdCalculateRevenueRequestExample:
              $ref: '#/components/examples/ThirdCalculateRevenueRequestExample'
    ActivatePricePlanRequest:
      description: Payload to activate price plan
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ActivatePricePlanRequest'
          examples:
            ActivatePricePlanRequest:
              $ref: '#/components/examples/ActivatePricePlanRequest'
    CreateAddOnRequest:
      description: Payload to create addon
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateAddOnRequest'
    UpdateAddOnRequest:
      description: Payload to update addon
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateAddOnRequest'
    CreatePricePlanMigrationRequest:
      description: Payload to create price plan migration request
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreatePricePlanMigrationRequest'
          examples:
            CreatePricePlanMigrationRequest:
              $ref: '#/components/examples/CreatePricePlanMigrationRequest'
    CreateFeatureRequest:
      description: Payload to create a Feature along the association with event_schemas
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateFeatureRequest'
          examples:
            CreateFeatureRequest:
              $ref: '#/components/examples/CreateFeatureRequest'
    UpdateFeatureRequest:
      description: Payload to update a Feature along the associations with event_schemas
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateFeatureRequest'
          examples:
            UpdateFeatureRequest:
              $ref: '#/components/examples/UpdateFeatureRequest'
    CreateBulkAliasRequest:
      description: Payload to create bulk aliases
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateBulkAliasRequest'
          examples:
            CreateAliasRequest:
              $ref: '#/components/examples/CreateBulkAliasRequest'
    GetCustomerPortalDelegateTokenRequest:
      description: Payload to get delegate token for customer portal
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GetCustomerPortalDelegateTokenRequest'
          examples:
            GetCustomerPortalDelegateTokenRequestAllAccountsAccess:
              $ref: '#/components/examples/GetCustomerPortalDelegateTokenRequestAllAccountsAccess'
            GetCustomerPortalDelegateTokenRequestSelectedAccountsAccess:
              $ref: '#/components/examples/GetCustomerPortalDelegateTokenRequestSelectedAccountsAccess'
    CreateAlertRequest:
      description: Payload to install an alert
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateAlertRequest'
          examples:
            CreateAlertRequest:
              $ref: '#/components/examples/CreateAlertRequest'
    UpdateAlertRequest:
      description: Payload to update alert
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateAlertRequest'
          examples:
            AlertResponse:
              $ref: '#/components/examples/UpdateAlertRequest'
    UpdateIncidentStatusRequest:
      description: Payload to update incident status
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateIncidentStatusRequest'
          examples:
            UpdateIncidentStatusRequest:
              $ref: '#/components/examples/UpdateIncidentStatusRequest'
    CreatePricePlanV2Request:
      description: Payload to create price plan
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreatePricePlanV2Request'
    UpdatePricePlanV2Request:
      description: Payload to update price plan
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdatePricePlanV2Request'
    FinalizePricePlanRequest:
      description: Payload to finalize price plan
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FinalizePricePlanRequest'
    BulkRateCardOperationsRequest:
      description: Payload to bulk rate card operations
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BulkRateCardOperationsRequest'
    UpdatePricingRulesRequest:
      description: Payload to update pricing rules
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdatePricingRulesRequest'
    FinalizeAccountSchedules:
      description: Payload to finalize account schedules
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FinalizeAccountSchedules'
    GetMetricsRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GetMetricsRequest'
          examples:
            GetMetricsRequest:
              value:
                startTime: '2017-07-21T00:00:00Z'
                endTime: '2017-07-22T00:00:00Z'
                metricQueries:
                  - id: m1
                    name: EVENTS
                    aggregationPeriod: DAY
                    filters:
                      - fieldName: ACCOUNT_ID
                        fieldValues:
                          - account#1
                      - fieldName: CUSTOMER_ID
                        fieldValues:
                          - customer#1
                      - fieldName: EVENT_STATUS
                        fieldValues:
                          - PROCESSED
                  - id: m2
                    name: USAGE
                    aggregationPeriod: MONTH
                    filters:
                      - fieldName: CUSTOMER_ID
                        fieldValues:
                          - customer#1
    IngestEventRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IngestEventRequest'
    EventCorrectionRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EventCorrectionRequest'
    UpdateFeatureCreditsRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateFeatureCreditsRequest'
          examples:
            UpdateFeatureCreditsRequest:
              value:
                effectiveUntil: '2023-02-23T14:25:10Z'
                granted: 200
    LicenseUpdateRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LicenseUpdateRequest'
          examples:
            AbsoluteLicenseUpdateRequest:
              value:
                licenseId: addon.21LdC76myzw.uiSWm
                accountId: account#1
                updateType: ABSOLUTE
                quantity: 10
            RelativeLicenseUpdateRequest:
              value:
                licenseId: addon.21JwBhBzM76.9mzoA
                accountId: account#2
                updateType: RELATIVE
                quantity: -5
            AbsoluteLicenseUpdateRequestWithIdempotencyKey:
              value:
                licenseId: addon.21LdC76myzw.uiSWm
                accountId: account#1
                updateType: ABSOLUTE
                quantity: 10
                idempotencyKey: idempotencyKey#1
            RelativeLicenseUpdateRequestWithIdempotencyKey:
              value:
                licenseId: addon.21JwBhBzM76.9mzoA
                accountId: account#2
                updateType: RELATIVE
                quantity: -5
                idempotencyKey: idempotencyKey#2
    LicenseEntryDetailsUpdateRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LicenseEntryDetailsUpdateRequest'
          examples:
            LicenseEntryDetailsUpdateRequest:
              value:
                accountId: account#1
                effectiveFrom: '2020-01-01T00:00:00Z'
                metadata:
                  PO Number: PO.432t5kbj.43tdsv
    ValidateEntitlementValueRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidateEntitlementValueRequest'
          examples:
            ValidateEntitlementValueRequest:
              value:
                value: enum1
    CreateCreditRequest:
      description: Payload to grant credits
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateCreditRequest'
          examples:
            CreateCreditRequest:
              $ref: '#/components/examples/CreateCreditRequest'
    CreatePaymentRequest:
      description: Payload to create a payment
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreatePaymentRequest'
          examples:
            CreatePaymentRequest:
              $ref: '#/components/examples/CreatePaymentRequest'
    TopupWalletRequest:
      description: Payload to topup wallet of an account
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TopupWalletRequest'
          examples:
            CreatePaymentRequest:
              $ref: '#/components/examples/TopupWalletRequest'
    UpdateWalletRequest:
      description: Payload to update wallet of an account
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateWalletRequest'
          examples:
            CreatePaymentRequest:
              $ref: '#/components/examples/UpdateWalletRequest'
    ManageMiscellaneousChargesRequest:
      description: Payload to update custom line items
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ManageMiscellaneousChargesRequest'
          examples:
            ManageMiscellaneousChargesRequest:
              $ref: '#/components/examples/ManageMiscellaneousChargesRequest'
    CreateCustomInvoiceRequest:
      description: Payload to create invoice
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateCustomInvoiceRequest'
          examples:
            CreateCustomInvoiceRequest:
              $ref: '#/components/examples/CreateCustomInvoiceRequest'
    UpdateInvoiceRequest:
      description: Payload to update an invoice
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateInvoiceRequest'
          examples:
            UpdateInvoiceRequest:
              $ref: '#/components/examples/UpdateInvoiceRequest'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Bearer <credential>
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
