openapi: '3.1.0'
info:
  title: 'Salable API'
  version: '0.0.0'
servers:
  - url: 'https://salable.app'
components:
  securitySchemes:
    BearerAuth:
      type: 'http'
      scheme: 'bearer'
  parameters:
    ResourceIdPathParam:
      name: 'id'
      in: 'path'
      required: true
      schema:
        type: 'string'
      description: 'Resource ID'
    IdempotencyKeyHeaderParam:
      in: 'header'
      name: 'idempotency-key'
      required: false
      schema:
        type: 'string'
        maxLength: 255
      description: 'Optional idempotency key to prevent duplicate requests. Use unique strings like V4 UUIDs to avoid collisions. The key will be deleted after 24 hours.'
  schemas:
    ErrorResponseBody:
      type: 'object'
      properties:
        title:
          type: 'string'
        detail:
          type:
            - 'string'
            - 'null'
        errors:
          type:
            - 'array'
            - 'null'
          items:
            type: 'object'
          description: 'The shape will be dependant on the error type'
    CreateProductResponseSchema:
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            name:
              type: 'string'
            isActive:
              type: 'boolean'
            archivedAt:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'organisation'
            - 'name'
            - 'isActive'
            - 'archivedAt'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    UpdateProductResponseSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            name:
              type: 'string'
            isActive:
              type: 'boolean'
            archivedAt:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'organisation'
            - 'name'
            - 'isActive'
            - 'archivedAt'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetProductListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              name:
                type: 'string'
              isActive:
                type: 'boolean'
              archivedAt:
                type:
                  - 'string'
                  - 'null'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
              plans:
                additionalProperties: false
                type: 'object'
                properties:
                  type:
                    const: 'list'
                    type: 'string'
                  data:
                    type: 'array'
                    items:
                      additionalProperties: false
                      type: 'object'
                      properties:
                        id:
                          type: 'string'
                        organisation:
                          type: 'string'
                        name:
                          type: 'string'
                        isActive:
                          type: 'boolean'
                        productId:
                          type: 'string'
                        tierTagId:
                          type:
                            - 'string'
                            - 'null'
                        trialPeriodDays:
                          type:
                            - 'integer'
                            - 'null'
                        archivedAt:
                          type:
                            - 'string'
                            - 'null'
                        createdAt:
                          type: 'string'
                        updatedAt:
                          type: 'string'
                      required:
                        - 'id'
                        - 'organisation'
                        - 'name'
                        - 'isActive'
                        - 'productId'
                        - 'tierTagId'
                        - 'trialPeriodDays'
                        - 'archivedAt'
                        - 'createdAt'
                        - 'updatedAt'
                  hasMore:
                    type: 'boolean'
                  path:
                    type: 'string'
                required:
                  - 'type'
                  - 'data'
                  - 'hasMore'
                  - 'path'
            required:
              - 'id'
              - 'organisation'
              - 'name'
              - 'isActive'
              - 'archivedAt'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetProductDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            name:
              type: 'string'
            isActive:
              type: 'boolean'
            archivedAt:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            plans:
              additionalProperties: false
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    additionalProperties: false
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      name:
                        type: 'string'
                      isActive:
                        type: 'boolean'
                      productId:
                        type: 'string'
                      tierTagId:
                        type:
                          - 'string'
                          - 'null'
                      trialPeriodDays:
                        type:
                          - 'integer'
                          - 'null'
                      archivedAt:
                        type:
                          - 'string'
                          - 'null'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'name'
                      - 'isActive'
                      - 'productId'
                      - 'tierTagId'
                      - 'trialPeriodDays'
                      - 'archivedAt'
                      - 'createdAt'
                      - 'updatedAt'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
            settings:
              additionalProperties: false
              type: 'object'
              properties:
                id:
                  type: 'string'
                organisation:
                  type: 'string'
                successUrl:
                  type:
                    - 'string'
                    - 'null'
                cancelUrl:
                  type:
                    - 'string'
                    - 'null'
                allowPromoCodes:
                  type: 'boolean'
                automaticTax:
                  type: 'boolean'
                collectBillingAddress:
                  type: 'boolean'
                collectShippingAddress:
                  type: 'boolean'
                cardPrefillPreference:
                  allOf:
                    - additionalProperties: false
                      anyOf:
                        - const: 'none'
                          type: 'string'
                        - const: 'always'
                          type: 'string'
                        - const: 'choice'
                          type: 'string'
                    - anyOf:
                        - const: 'none'
                          type: 'string'
                        - const: 'always'
                          type: 'string'
                        - const: 'choice'
                          type: 'string'
                pastDueEntitlements:
                  type: 'boolean'
                productId:
                  type:
                    - 'string'
                    - 'null'
                createdAt:
                  type: 'string'
                updatedAt:
                  type: 'string'
              required:
                - 'id'
                - 'organisation'
                - 'successUrl'
                - 'cancelUrl'
                - 'allowPromoCodes'
                - 'automaticTax'
                - 'collectBillingAddress'
                - 'collectShippingAddress'
                - 'cardPrefillPreference'
                - 'pastDueEntitlements'
                - 'productId'
                - 'createdAt'
                - 'updatedAt'
          required:
            - 'id'
            - 'organisation'
            - 'name'
            - 'isActive'
            - 'archivedAt'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetPlanListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        previousCursor:
          type:
            - 'string'
            - 'null'
        nextCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
        filterOptions:
          type: 'object'
          properties:
            currencies:
              type: 'array'
              items:
                type: 'string'
            intervals:
              type: 'array'
              items:
                type: 'object'
                properties:
                  interval:
                    type:
                      - 'string'
                      - 'null'
                  intervalCount:
                    type:
                      - 'number'
                      - 'null'
                required:
                  - 'interval'
                  - 'intervalCount'
          required:
            - 'currencies'
            - 'intervals'
        data:
          type: 'array'
          items:
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              name:
                type: 'string'
              isActive:
                type: 'boolean'
              productId:
                type: 'string'
              tierTagId:
                type:
                  - 'string'
                  - 'null'
              trialPeriodDays:
                type:
                  - 'integer'
                  - 'null'
              archivedAt:
                type:
                  - 'string'
                  - 'null'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
              product:
                additionalProperties: false
                type: 'object'
                properties:
                  id:
                    type: 'string'
                  organisation:
                    type: 'string'
                  name:
                    type: 'string'
                  isActive:
                    type: 'boolean'
                  archivedAt:
                    type:
                      - 'string'
                      - 'null'
                  createdAt:
                    type: 'string'
                  updatedAt:
                    type: 'string'
                required:
                  - 'id'
                  - 'organisation'
                  - 'name'
                  - 'isActive'
                  - 'archivedAt'
                  - 'createdAt'
                  - 'updatedAt'
              tierTag:
                additionalProperties: false
                properties: &ref_0
                  id:
                    type: 'string'
                  name:
                    type: 'string'
                  organisation:
                    type: 'string'
                  createdAt:
                    type: 'string'
                  updatedAt:
                    type: 'string'
                required: &ref_1
                  - 'id'
                  - 'name'
                  - 'organisation'
                  - 'createdAt'
                  - 'updatedAt'
                type:
                  - 'object'
                  - 'null'
              entitlements:
                type: 'object'
                properties:
                  type:
                    const: 'list'
                    type: 'string'
                  hasMore:
                    type: 'boolean'
                  path:
                    type: 'string'
                  data:
                    type: 'array'
                    items:
                      additionalProperties: false
                      type: 'object'
                      properties:
                        id:
                          type: 'string'
                        organisation:
                          type: 'string'
                        name:
                          type: 'string'
                        createdAt:
                          type: 'string'
                        updatedAt:
                          type: 'string'
                      required:
                        - 'id'
                        - 'organisation'
                        - 'name'
                        - 'createdAt'
                        - 'updatedAt'
                required:
                  - 'type'
                  - 'hasMore'
                  - 'path'
                  - 'data'
              lineItems:
                additionalProperties: false
                type: 'object'
                properties:
                  type:
                    const: 'list'
                    type: 'string'
                  hasMore:
                    type: 'boolean'
                  path:
                    type: 'string'
                  data:
                    type: 'array'
                    items:
                      type: 'object'
                      properties:
                        id:
                          type: 'string'
                        organisation:
                          type: 'string'
                        name:
                          type: 'string'
                        slug:
                          type: 'string'
                        stripeProductId:
                          type: 'string'
                        meterId:
                          type:
                            - 'string'
                            - 'null'
                        nickname:
                          type: 'string'
                        priceType:
                          allOf:
                            - additionalProperties: false
                              anyOf:
                                - const: 'metered'
                                  type: 'string'
                                - const: 'per_seat'
                                  type: 'string'
                                - const: 'flat_rate'
                                  type: 'string'
                            - anyOf:
                                - const: 'metered'
                                  type: 'string'
                                - const: 'per_seat'
                                  type: 'string'
                                - const: 'flat_rate'
                                  type: 'string'
                        intervalType:
                          allOf:
                            - additionalProperties: false
                              anyOf:
                                - const: 'one_off'
                                  type: 'string'
                                - const: 'recurring'
                                  type: 'string'
                            - anyOf:
                                - const: 'one_off'
                                  type: 'string'
                                - const: 'recurring'
                                  type: 'string'
                        billingScheme:
                          allOf:
                            - additionalProperties: false
                              anyOf:
                                - const: 'fixed'
                                  type: 'string'
                                - const: 'per_unit'
                                  type: 'string'
                                - const: 'tiered'
                                  type: 'string'
                                - const: 'flat_rate'
                                  type: 'string'
                            - anyOf:
                                - const: 'flat_rate'
                                  type: 'string'
                                - const: 'fixed'
                                  type: 'string'
                                - const: 'per_unit'
                                  type: 'string'
                                - const: 'tiered'
                                  type: 'string'
                        tiersMode:
                          allOf:
                            - anyOf:
                                - type: 'null'
                                - additionalProperties: false
                                  anyOf:
                                    - const: 'graduated'
                                      type: 'string'
                                    - const: 'volume'
                                      type: 'string'
                            - anyOf:
                                - type: 'null'
                                - anyOf:
                                    - const: 'graduated'
                                      type: 'string'
                                    - const: 'volume'
                                      type: 'string'
                        minQuantity:
                          type: 'integer'
                        maxQuantity:
                          type: 'integer'
                        isActive:
                          type: 'boolean'
                        planId:
                          type: 'string'
                        allowChangingQuantity:
                          type: 'boolean'
                        archivedAt:
                          type:
                            - 'string'
                            - 'null'
                        unitLabel:
                          type:
                            - 'string'
                            - 'null'
                        createdAt:
                          type: 'string'
                        updatedAt:
                          type: 'string'
                        meter:
                          additionalProperties: false
                          properties: &ref_2
                            id:
                              type: 'string'
                            slug:
                              type: 'string'
                            name:
                              type: 'string'
                            stripeMeterId:
                              type: 'string'
                            organisation:
                              type: 'string'
                            createdAt:
                              type: 'string'
                            updatedAt:
                              type: 'string'
                          required: &ref_3
                            - 'id'
                            - 'slug'
                            - 'name'
                            - 'stripeMeterId'
                            - 'organisation'
                            - 'createdAt'
                            - 'updatedAt'
                          type:
                            - 'object'
                            - 'null'
                        prices:
                          additionalProperties: false
                          type: 'object'
                          properties:
                            type:
                              const: 'list'
                              type: 'string'
                            hasMore:
                              type: 'boolean'
                            path:
                              type: 'string'
                            data:
                              type: 'array'
                              items:
                                type: 'object'
                                properties:
                                  id:
                                    type: 'string'
                                  organisation:
                                    type: 'string'
                                  stripePriceId:
                                    type: 'string'
                                  interval:
                                    allOf:
                                      - anyOf:
                                          - type: 'null'
                                          - additionalProperties: false
                                            anyOf:
                                              - const: 'day'
                                                type: 'string'
                                              - const: 'week'
                                                type: 'string'
                                              - const: 'month'
                                                type: 'string'
                                              - const: 'year'
                                                type: 'string'
                                      - anyOf:
                                          - type: 'null'
                                          - anyOf:
                                              - const: 'day'
                                                type: 'string'
                                              - const: 'week'
                                                type: 'string'
                                              - const: 'month'
                                                type: 'string'
                                              - const: 'year'
                                                type: 'string'
                                  intervalCount:
                                    type:
                                      - 'integer'
                                      - 'null'
                                  lineItemId:
                                    type: 'string'
                                  archivedAt:
                                    type:
                                      - 'string'
                                      - 'null'
                                  createdAt:
                                    type: 'string'
                                  updatedAt:
                                    type: 'string'
                                  currencyOptions:
                                    additionalProperties: false
                                    type: 'object'
                                    properties:
                                      type:
                                        const: 'list'
                                        type: 'string'
                                      hasMore:
                                        type: 'boolean'
                                      path:
                                        type: 'string'
                                      data:
                                        type: 'array'
                                        items:
                                          type: 'object'
                                          properties:
                                            id:
                                              type: 'string'
                                            organisation:
                                              type: 'string'
                                            currency:
                                              type: 'string'
                                            unitAmount:
                                              type:
                                                - 'number'
                                                - 'null'
                                            priceId:
                                              type: 'string'
                                            isDefault:
                                              type: 'boolean'
                                            createdAt:
                                              type: 'string'
                                            updatedAt:
                                              type: 'string'
                                            tiers:
                                              type: 'object'
                                              properties:
                                                type:
                                                  const: 'list'
                                                  type: 'string'
                                                data:
                                                  type: 'array'
                                                  items:
                                                    additionalProperties: false
                                                    type: 'object'
                                                    properties:
                                                      id:
                                                        type: 'string'
                                                      organisation:
                                                        type: 'string'
                                                      upTo:
                                                        type: 'string'
                                                      flatAmount:
                                                        type:
                                                          - 'number'
                                                          - 'null'
                                                      unitAmount:
                                                        type: 'number'
                                                      currencyOptionId:
                                                        type: 'string'
                                                      createdAt:
                                                        type: 'string'
                                                      updatedAt:
                                                        type: 'string'
                                                    required:
                                                      - 'id'
                                                      - 'organisation'
                                                      - 'upTo'
                                                      - 'flatAmount'
                                                      - 'unitAmount'
                                                      - 'currencyOptionId'
                                                      - 'createdAt'
                                                      - 'updatedAt'
                                                hasMore:
                                                  type: 'boolean'
                                                path:
                                                  type: 'string'
                                              required:
                                                - 'type'
                                                - 'data'
                                                - 'hasMore'
                                                - 'path'
                                          required:
                                            - 'id'
                                            - 'organisation'
                                            - 'currency'
                                            - 'unitAmount'
                                            - 'priceId'
                                            - 'isDefault'
                                            - 'createdAt'
                                            - 'updatedAt'
                                            - 'tiers'
                                    required:
                                      - 'type'
                                      - 'hasMore'
                                      - 'path'
                                      - 'data'
                                required:
                                  - 'id'
                                  - 'organisation'
                                  - 'stripePriceId'
                                  - 'interval'
                                  - 'intervalCount'
                                  - 'lineItemId'
                                  - 'archivedAt'
                                  - 'createdAt'
                                  - 'updatedAt'
                                  - 'currencyOptions'
                          required:
                            - 'type'
                            - 'hasMore'
                            - 'path'
                            - 'data'
                      required:
                        - 'id'
                        - 'organisation'
                        - 'name'
                        - 'slug'
                        - 'stripeProductId'
                        - 'meterId'
                        - 'nickname'
                        - 'priceType'
                        - 'intervalType'
                        - 'billingScheme'
                        - 'tiersMode'
                        - 'minQuantity'
                        - 'maxQuantity'
                        - 'isActive'
                        - 'planId'
                        - 'allowChangingQuantity'
                        - 'archivedAt'
                        - 'unitLabel'
                        - 'createdAt'
                        - 'updatedAt'
                        - 'meter'
                        - 'prices'
                required:
                  - 'type'
                  - 'hasMore'
                  - 'path'
                  - 'data'
            required:
              - 'id'
              - 'organisation'
              - 'name'
              - 'isActive'
              - 'productId'
              - 'tierTagId'
              - 'trialPeriodDays'
              - 'archivedAt'
              - 'createdAt'
              - 'updatedAt'
      required:
        - 'type'
        - 'previousCursor'
        - 'nextCursor'
        - 'hasMore'
        - 'data'
    GetPlanDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            name:
              type: 'string'
            isActive:
              type: 'boolean'
            productId:
              type: 'string'
            tierTagId:
              type:
                - 'string'
                - 'null'
            trialPeriodDays:
              type:
                - 'integer'
                - 'null'
            archivedAt:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            product:
              additionalProperties: false
              type: 'object'
              properties:
                id:
                  type: 'string'
                name:
                  type: 'string'
                archivedAt:
                  type:
                    - 'string'
                    - 'null'
              required:
                - 'id'
                - 'name'
                - 'archivedAt'
            tierTag:
              additionalProperties: false
              properties: *ref_0
              required: *ref_1
              type:
                - 'object'
                - 'null'
            subscriptionPlans:
              additionalProperties: false
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      ownerId:
                        type: 'string'
                      groupId:
                        type: 'string'
                      subscriptionId:
                        type: 'string'
                      planId:
                        type:
                          - 'string'
                          - 'null'
                      seats:
                        type: 'integer'
                      status:
                        allOf:
                          - additionalProperties: false
                            anyOf:
                              - const: 'active'
                                type: 'string'
                              - const: 'inactive'
                                type: 'string'
                          - anyOf:
                              - const: 'active'
                                type: 'string'
                              - const: 'inactive'
                                type: 'string'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                      subscription:
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          stripeSubscriptionId:
                            type:
                              - 'string'
                              - 'null'
                          ownerId:
                            type: 'string'
                          status:
                            type: 'string'
                          customerId:
                            type:
                              - 'string'
                              - 'null'
                          interval:
                            allOf:
                              - anyOf:
                                  - type: 'null'
                                  - additionalProperties: false
                                    anyOf:
                                      - const: 'day'
                                        type: 'string'
                                      - const: 'week'
                                        type: 'string'
                                      - const: 'month'
                                        type: 'string'
                                      - const: 'year'
                                        type: 'string'
                              - anyOf:
                                  - type: 'null'
                                  - anyOf:
                                      - const: 'day'
                                        type: 'string'
                                      - const: 'week'
                                        type: 'string'
                                      - const: 'month'
                                        type: 'string'
                                      - const: 'year'
                                        type: 'string'
                          intervalCount:
                            type:
                              - 'integer'
                              - 'null'
                          currencyShortCode:
                            type:
                              - 'string'
                              - 'null'
                          cancelAtPeriodEnd:
                            type: 'boolean'
                          isPerpetual:
                            type: 'boolean'
                          isSalableOnly:
                            type: 'boolean'
                          startDate:
                            type: 'string'
                          cancelledAt:
                            type:
                              - 'string'
                              - 'null'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                          owner:
                            additionalProperties: false
                            properties:
                              id:
                                type: 'string'
                              organisation:
                                type: 'string'
                              value:
                                type: 'string'
                              stripeCustomerId:
                                anyOf:
                                  - type: 'null'
                                  - type: 'string'
                              emailAddress:
                                anyOf:
                                  - type: 'null'
                                  - type: 'string'
                              createdAt:
                                type: 'string'
                              updatedAt:
                                type: 'string'
                            required:
                              - 'id'
                              - 'organisation'
                              - 'value'
                              - 'stripeCustomerId'
                              - 'emailAddress'
                              - 'createdAt'
                              - 'updatedAt'
                            type:
                              - 'object'
                              - 'null'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'stripeSubscriptionId'
                          - 'ownerId'
                          - 'status'
                          - 'customerId'
                          - 'interval'
                          - 'intervalCount'
                          - 'currencyShortCode'
                          - 'cancelAtPeriodEnd'
                          - 'isPerpetual'
                          - 'isSalableOnly'
                          - 'startDate'
                          - 'cancelledAt'
                          - 'createdAt'
                          - 'updatedAt'
                          - 'owner'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'ownerId'
                      - 'groupId'
                      - 'subscriptionId'
                      - 'planId'
                      - 'seats'
                      - 'status'
                      - 'createdAt'
                      - 'updatedAt'
                      - 'subscription'
              required:
                - 'type'
                - 'hasMore'
                - 'path'
                - 'data'
            entitlements:
              additionalProperties: false
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    additionalProperties: false
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      name:
                        type: 'string'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'name'
                      - 'createdAt'
                      - 'updatedAt'
              required:
                - 'type'
                - 'hasMore'
                - 'path'
                - 'data'
            lineItems:
              additionalProperties: false
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      name:
                        type: 'string'
                      slug:
                        type: 'string'
                      stripeProductId:
                        type: 'string'
                      meterId:
                        type:
                          - 'string'
                          - 'null'
                      nickname:
                        type: 'string'
                      priceType:
                        allOf:
                          - additionalProperties: false
                            anyOf:
                              - const: 'metered'
                                type: 'string'
                              - const: 'per_seat'
                                type: 'string'
                              - const: 'flat_rate'
                                type: 'string'
                          - anyOf:
                              - const: 'metered'
                                type: 'string'
                              - const: 'per_seat'
                                type: 'string'
                              - const: 'flat_rate'
                                type: 'string'
                      intervalType:
                        allOf:
                          - additionalProperties: false
                            anyOf:
                              - const: 'one_off'
                                type: 'string'
                              - const: 'recurring'
                                type: 'string'
                          - anyOf:
                              - const: 'one_off'
                                type: 'string'
                              - const: 'recurring'
                                type: 'string'
                      billingScheme:
                        allOf:
                          - additionalProperties: false
                            anyOf:
                              - const: 'fixed'
                                type: 'string'
                              - const: 'per_unit'
                                type: 'string'
                              - const: 'tiered'
                                type: 'string'
                              - const: 'flat_rate'
                                type: 'string'
                          - anyOf:
                              - const: 'flat_rate'
                                type: 'string'
                              - const: 'fixed'
                                type: 'string'
                              - const: 'per_unit'
                                type: 'string'
                              - const: 'tiered'
                                type: 'string'
                      tiersMode:
                        allOf:
                          - anyOf:
                              - type: 'null'
                              - additionalProperties: false
                                anyOf:
                                  - const: 'graduated'
                                    type: 'string'
                                  - const: 'volume'
                                    type: 'string'
                          - anyOf:
                              - type: 'null'
                              - anyOf:
                                  - const: 'graduated'
                                    type: 'string'
                                  - const: 'volume'
                                    type: 'string'
                      minQuantity:
                        type: 'integer'
                      maxQuantity:
                        type: 'integer'
                      isActive:
                        type: 'boolean'
                      planId:
                        type: 'string'
                      allowChangingQuantity:
                        type: 'boolean'
                      archivedAt:
                        type:
                          - 'string'
                          - 'null'
                      unitLabel:
                        type:
                          - 'string'
                          - 'null'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                      meter:
                        additionalProperties: false
                        properties: *ref_2
                        required: *ref_3
                        type:
                          - 'object'
                          - 'null'
                      prices:
                        additionalProperties: false
                        type: 'object'
                        properties:
                          type:
                            const: 'list'
                            type: 'string'
                          hasMore:
                            type: 'boolean'
                          path:
                            type: 'string'
                          data:
                            type: 'array'
                            items:
                              type: 'object'
                              properties:
                                id:
                                  type: 'string'
                                organisation:
                                  type: 'string'
                                stripePriceId:
                                  type: 'string'
                                interval:
                                  allOf:
                                    - anyOf:
                                        - type: 'null'
                                        - additionalProperties: false
                                          anyOf:
                                            - const: 'day'
                                              type: 'string'
                                            - const: 'week'
                                              type: 'string'
                                            - const: 'month'
                                              type: 'string'
                                            - const: 'year'
                                              type: 'string'
                                    - anyOf:
                                        - type: 'null'
                                        - anyOf:
                                            - const: 'day'
                                              type: 'string'
                                            - const: 'week'
                                              type: 'string'
                                            - const: 'month'
                                              type: 'string'
                                            - const: 'year'
                                              type: 'string'
                                intervalCount:
                                  type:
                                    - 'integer'
                                    - 'null'
                                lineItemId:
                                  type: 'string'
                                archivedAt:
                                  type:
                                    - 'string'
                                    - 'null'
                                createdAt:
                                  type: 'string'
                                updatedAt:
                                  type: 'string'
                                currencyOptions:
                                  additionalProperties: false
                                  type: 'object'
                                  properties:
                                    type:
                                      const: 'list'
                                      type: 'string'
                                    hasMore:
                                      type: 'boolean'
                                    path:
                                      type: 'string'
                                    data:
                                      type: 'array'
                                      items:
                                        type: 'object'
                                        properties:
                                          id:
                                            type: 'string'
                                          organisation:
                                            type: 'string'
                                          currency:
                                            type: 'string'
                                          unitAmount:
                                            type:
                                              - 'number'
                                              - 'null'
                                          priceId:
                                            type: 'string'
                                          isDefault:
                                            type: 'boolean'
                                          createdAt:
                                            type: 'string'
                                          updatedAt:
                                            type: 'string'
                                          tiers:
                                            type: 'object'
                                            properties:
                                              type:
                                                const: 'list'
                                                type: 'string'
                                              data:
                                                type: 'array'
                                                items:
                                                  additionalProperties: false
                                                  type: 'object'
                                                  properties:
                                                    id:
                                                      type: 'string'
                                                    organisation:
                                                      type: 'string'
                                                    upTo:
                                                      type: 'string'
                                                    flatAmount:
                                                      type:
                                                        - 'number'
                                                        - 'null'
                                                    unitAmount:
                                                      type: 'number'
                                                    currencyOptionId:
                                                      type: 'string'
                                                    createdAt:
                                                      type: 'string'
                                                    updatedAt:
                                                      type: 'string'
                                                  required:
                                                    - 'id'
                                                    - 'organisation'
                                                    - 'upTo'
                                                    - 'flatAmount'
                                                    - 'unitAmount'
                                                    - 'currencyOptionId'
                                                    - 'createdAt'
                                                    - 'updatedAt'
                                              hasMore:
                                                type: 'boolean'
                                              path:
                                                type: 'string'
                                            required:
                                              - 'type'
                                              - 'data'
                                              - 'hasMore'
                                              - 'path'
                                        required:
                                          - 'id'
                                          - 'organisation'
                                          - 'currency'
                                          - 'unitAmount'
                                          - 'priceId'
                                          - 'isDefault'
                                          - 'createdAt'
                                          - 'updatedAt'
                                          - 'tiers'
                                  required:
                                    - 'type'
                                    - 'hasMore'
                                    - 'path'
                                    - 'data'
                              required:
                                - 'id'
                                - 'organisation'
                                - 'stripePriceId'
                                - 'interval'
                                - 'intervalCount'
                                - 'lineItemId'
                                - 'archivedAt'
                                - 'createdAt'
                                - 'updatedAt'
                                - 'currencyOptions'
                        required:
                          - 'type'
                          - 'hasMore'
                          - 'path'
                          - 'data'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'name'
                      - 'slug'
                      - 'stripeProductId'
                      - 'meterId'
                      - 'nickname'
                      - 'priceType'
                      - 'intervalType'
                      - 'billingScheme'
                      - 'tiersMode'
                      - 'minQuantity'
                      - 'maxQuantity'
                      - 'isActive'
                      - 'planId'
                      - 'allowChangingQuantity'
                      - 'archivedAt'
                      - 'unitLabel'
                      - 'createdAt'
                      - 'updatedAt'
                      - 'meter'
                      - 'prices'
              required:
                - 'type'
                - 'hasMore'
                - 'path'
                - 'data'
          required:
            - 'id'
            - 'organisation'
            - 'name'
            - 'isActive'
            - 'productId'
            - 'tierTagId'
            - 'trialPeriodDays'
            - 'archivedAt'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    CreatePlanResponseSchema:
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            name:
              type: 'string'
            isActive:
              type: 'boolean'
            productId:
              type: 'string'
            tierTagId:
              type:
                - 'string'
                - 'null'
            trialPeriodDays:
              type:
                - 'integer'
                - 'null'
            archivedAt:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'organisation'
            - 'name'
            - 'isActive'
            - 'productId'
            - 'tierTagId'
            - 'trialPeriodDays'
            - 'archivedAt'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    UpdatePlanResponseSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            name:
              type: 'string'
            isActive:
              type: 'boolean'
            productId:
              type: 'string'
            tierTagId:
              type:
                - 'string'
                - 'null'
            trialPeriodDays:
              type:
                - 'integer'
                - 'null'
            archivedAt:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'organisation'
            - 'name'
            - 'isActive'
            - 'productId'
            - 'tierTagId'
            - 'trialPeriodDays'
            - 'archivedAt'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    SavePlanResponseSchema:
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            name:
              type: 'string'
            isActive:
              type: 'boolean'
            productId:
              type: 'string'
            tierTagId:
              type:
                - 'string'
                - 'null'
            trialPeriodDays:
              type:
                - 'integer'
                - 'null'
            archivedAt:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            entitlements:
              type: 'array'
              items:
                additionalProperties: false
                type: 'object'
                properties:
                  entitlementId:
                    type: 'string'
                  planId:
                    type: 'string'
                  createdAt:
                    type: 'string'
                  updatedAt:
                    type: 'string'
                required:
                  - 'entitlementId'
                  - 'planId'
                  - 'createdAt'
                  - 'updatedAt'
            tierTag:
              additionalProperties: false
              properties: *ref_0
              required: *ref_1
              type:
                - 'object'
                - 'null'
            lineItems:
              type: 'array'
              items:
                type: 'object'
                properties:
                  id:
                    type: 'string'
                  organisation:
                    type: 'string'
                  name:
                    type: 'string'
                  slug:
                    type: 'string'
                  stripeProductId:
                    type: 'string'
                  meterId:
                    type:
                      - 'string'
                      - 'null'
                  nickname:
                    type: 'string'
                  priceType:
                    allOf:
                      - additionalProperties: false
                        anyOf:
                          - const: 'metered'
                            type: 'string'
                          - const: 'per_seat'
                            type: 'string'
                          - const: 'flat_rate'
                            type: 'string'
                      - anyOf:
                          - const: 'metered'
                            type: 'string'
                          - const: 'per_seat'
                            type: 'string'
                          - const: 'flat_rate'
                            type: 'string'
                  intervalType:
                    allOf:
                      - additionalProperties: false
                        anyOf:
                          - const: 'one_off'
                            type: 'string'
                          - const: 'recurring'
                            type: 'string'
                      - anyOf:
                          - const: 'one_off'
                            type: 'string'
                          - const: 'recurring'
                            type: 'string'
                  billingScheme:
                    allOf:
                      - additionalProperties: false
                        anyOf:
                          - const: 'fixed'
                            type: 'string'
                          - const: 'per_unit'
                            type: 'string'
                          - const: 'tiered'
                            type: 'string'
                          - const: 'flat_rate'
                            type: 'string'
                      - anyOf:
                          - const: 'flat_rate'
                            type: 'string'
                          - const: 'fixed'
                            type: 'string'
                          - const: 'per_unit'
                            type: 'string'
                          - const: 'tiered'
                            type: 'string'
                  tiersMode:
                    allOf:
                      - anyOf:
                          - type: 'null'
                          - additionalProperties: false
                            anyOf:
                              - const: 'graduated'
                                type: 'string'
                              - const: 'volume'
                                type: 'string'
                      - anyOf:
                          - type: 'null'
                          - anyOf:
                              - const: 'graduated'
                                type: 'string'
                              - const: 'volume'
                                type: 'string'
                  minQuantity:
                    type: 'integer'
                  maxQuantity:
                    type: 'integer'
                  isActive:
                    type: 'boolean'
                  planId:
                    type: 'string'
                  allowChangingQuantity:
                    type: 'boolean'
                  archivedAt:
                    type:
                      - 'string'
                      - 'null'
                  unitLabel:
                    type:
                      - 'string'
                      - 'null'
                  createdAt:
                    type: 'string'
                  updatedAt:
                    type: 'string'
                  meter:
                    additionalProperties: false
                    properties: *ref_2
                    required: *ref_3
                    type:
                      - 'object'
                      - 'null'
                  prices:
                    type: 'array'
                    items:
                      type: 'object'
                      properties:
                        id:
                          type: 'string'
                        organisation:
                          type: 'string'
                        stripePriceId:
                          type: 'string'
                        interval:
                          allOf:
                            - anyOf:
                                - type: 'null'
                                - additionalProperties: false
                                  anyOf:
                                    - const: 'day'
                                      type: 'string'
                                    - const: 'week'
                                      type: 'string'
                                    - const: 'month'
                                      type: 'string'
                                    - const: 'year'
                                      type: 'string'
                            - anyOf:
                                - type: 'null'
                                - anyOf:
                                    - const: 'day'
                                      type: 'string'
                                    - const: 'week'
                                      type: 'string'
                                    - const: 'month'
                                      type: 'string'
                                    - const: 'year'
                                      type: 'string'
                        intervalCount:
                          type:
                            - 'integer'
                            - 'null'
                        lineItemId:
                          type: 'string'
                        archivedAt:
                          type:
                            - 'string'
                            - 'null'
                        createdAt:
                          type: 'string'
                        updatedAt:
                          type: 'string'
                        currencyOptions:
                          type: 'array'
                          items:
                            type: 'object'
                            properties:
                              id:
                                type: 'string'
                              organisation:
                                type: 'string'
                              currency:
                                type: 'string'
                              unitAmount:
                                type:
                                  - 'number'
                                  - 'null'
                              priceId:
                                type: 'string'
                              isDefault:
                                type: 'boolean'
                              createdAt:
                                type: 'string'
                              updatedAt:
                                type: 'string'
                              tiers:
                                type: 'array'
                                items:
                                  additionalProperties: false
                                  type: 'object'
                                  properties:
                                    id:
                                      type: 'string'
                                    organisation:
                                      type: 'string'
                                    upTo:
                                      type: 'string'
                                    flatAmount:
                                      type:
                                        - 'number'
                                        - 'null'
                                    unitAmount:
                                      type: 'number'
                                    currencyOptionId:
                                      type: 'string'
                                    createdAt:
                                      type: 'string'
                                    updatedAt:
                                      type: 'string'
                                  required:
                                    - 'id'
                                    - 'organisation'
                                    - 'upTo'
                                    - 'flatAmount'
                                    - 'unitAmount'
                                    - 'currencyOptionId'
                                    - 'createdAt'
                                    - 'updatedAt'
                            required:
                              - 'id'
                              - 'organisation'
                              - 'currency'
                              - 'unitAmount'
                              - 'priceId'
                              - 'isDefault'
                              - 'createdAt'
                              - 'updatedAt'
                              - 'tiers'
                      required:
                        - 'id'
                        - 'organisation'
                        - 'stripePriceId'
                        - 'interval'
                        - 'intervalCount'
                        - 'lineItemId'
                        - 'archivedAt'
                        - 'createdAt'
                        - 'updatedAt'
                        - 'currencyOptions'
                required:
                  - 'id'
                  - 'organisation'
                  - 'name'
                  - 'slug'
                  - 'stripeProductId'
                  - 'meterId'
                  - 'nickname'
                  - 'priceType'
                  - 'intervalType'
                  - 'billingScheme'
                  - 'tiersMode'
                  - 'minQuantity'
                  - 'maxQuantity'
                  - 'isActive'
                  - 'planId'
                  - 'allowChangingQuantity'
                  - 'archivedAt'
                  - 'unitLabel'
                  - 'createdAt'
                  - 'updatedAt'
                  - 'meter'
                  - 'prices'
          required:
            - 'id'
            - 'organisation'
            - 'name'
            - 'isActive'
            - 'productId'
            - 'tierTagId'
            - 'trialPeriodDays'
            - 'archivedAt'
            - 'createdAt'
            - 'updatedAt'
            - 'entitlements'
            - 'lineItems'
      required:
        - 'type'
        - 'data'
    GetApiKeyListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              value:
                type: 'string'
              organisation:
                type: 'string'
              type:
                allOf:
                  - additionalProperties: false
                    anyOf:
                      - const: 'publishable'
                        type: 'string'
                      - const: 'secret'
                        type: 'string'
                      - const: 'restricted'
                        type: 'string'
                  - anyOf:
                      - const: 'publishable'
                        type: 'string'
                      - const: 'secret'
                        type: 'string'
                      - const: 'restricted'
                        type: 'string'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
            required:
              - 'id'
              - 'value'
              - 'organisation'
              - 'type'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetApiKeyDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            value:
              type: 'string'
            organisation:
              type: 'string'
            type:
              allOf:
                - additionalProperties: false
                  anyOf:
                    - const: 'publishable'
                      type: 'string'
                    - const: 'secret'
                      type: 'string'
                    - const: 'restricted'
                      type: 'string'
                - anyOf:
                    - const: 'publishable'
                      type: 'string'
                    - const: 'secret'
                      type: 'string'
                    - const: 'restricted'
                      type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'value'
            - 'organisation'
            - 'type'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    CreateApiKeyResponseSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            value:
              type: 'string'
            organisation:
              type: 'string'
            type:
              allOf:
                - additionalProperties: false
                  anyOf:
                    - const: 'publishable'
                      type: 'string'
                    - const: 'secret'
                      type: 'string'
                    - const: 'restricted'
                      type: 'string'
                - anyOf:
                    - const: 'publishable'
                      type: 'string'
                    - const: 'secret'
                      type: 'string'
                    - const: 'restricted'
                      type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'value'
            - 'organisation'
            - 'type'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetCartListSchema:
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              ownerId:
                type: 'string'
              currency:
                type:
                  - 'string'
                  - 'null'
              interval:
                allOf:
                  - anyOf:
                      - type: 'null'
                      - additionalProperties: false
                        anyOf:
                          - const: 'day'
                            type: 'string'
                          - const: 'week'
                            type: 'string'
                          - const: 'month'
                            type: 'string'
                          - const: 'year'
                            type: 'string'
                  - anyOf:
                      - type: 'null'
                      - anyOf:
                          - const: 'day'
                            type: 'string'
                          - const: 'week'
                            type: 'string'
                          - const: 'month'
                            type: 'string'
                          - const: 'year'
                            type: 'string'
              intervalCount:
                type:
                  - 'integer'
                  - 'null'
              status:
                allOf:
                  - additionalProperties: false
                    anyOf:
                      - const: 'active'
                        type: 'string'
                      - const: 'abandoned'
                        type: 'string'
                      - const: 'complete'
                        type: 'string'
                  - anyOf:
                      - const: 'active'
                        type: 'string'
                      - const: 'abandoned'
                        type: 'string'
                      - const: 'complete'
                        type: 'string'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
              owner:
                additionalProperties: false
                type: 'object'
                properties:
                  id:
                    type: 'string'
                  organisation:
                    type: 'string'
                  value:
                    type: 'string'
                  stripeCustomerId:
                    type:
                      - 'string'
                      - 'null'
                  emailAddress:
                    type:
                      - 'string'
                      - 'null'
                  createdAt:
                    type: 'string'
                  updatedAt:
                    type: 'string'
                required:
                  - 'id'
                  - 'organisation'
                  - 'value'
                  - 'stripeCustomerId'
                  - 'emailAddress'
                  - 'createdAt'
                  - 'updatedAt'
            required:
              - 'id'
              - 'organisation'
              - 'ownerId'
              - 'currency'
              - 'interval'
              - 'intervalCount'
              - 'status'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetCartDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            ownerId:
              type: 'string'
            currency:
              type:
                - 'string'
                - 'null'
            interval:
              allOf:
                - anyOf:
                    - type: 'null'
                    - additionalProperties: false
                      anyOf:
                        - const: 'day'
                          type: 'string'
                        - const: 'week'
                          type: 'string'
                        - const: 'month'
                          type: 'string'
                        - const: 'year'
                          type: 'string'
                - anyOf:
                    - type: 'null'
                    - anyOf:
                        - const: 'day'
                          type: 'string'
                        - const: 'week'
                          type: 'string'
                        - const: 'month'
                          type: 'string'
                        - const: 'year'
                          type: 'string'
            intervalCount:
              type:
                - 'integer'
                - 'null'
            status:
              allOf:
                - additionalProperties: false
                  anyOf:
                    - const: 'active'
                      type: 'string'
                    - const: 'abandoned'
                      type: 'string'
                    - const: 'complete'
                      type: 'string'
                - anyOf:
                    - const: 'active'
                      type: 'string'
                    - const: 'abandoned'
                      type: 'string'
                    - const: 'complete'
                      type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            owner:
              additionalProperties: false
              type: 'object'
              properties:
                id:
                  type: 'string'
                organisation:
                  type: 'string'
                value:
                  type: 'string'
                stripeCustomerId:
                  type:
                    - 'string'
                    - 'null'
                emailAddress:
                  type:
                    - 'string'
                    - 'null'
                createdAt:
                  type: 'string'
                updatedAt:
                  type: 'string'
              required:
                - 'id'
                - 'organisation'
                - 'value'
                - 'stripeCustomerId'
                - 'emailAddress'
                - 'createdAt'
                - 'updatedAt'
            cartItems:
              additionalProperties: false
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      cartId:
                        type: 'string'
                      planId:
                        type: 'string'
                      metadata:
                        anyOf:
                          - type: 'null'
                          - {}
                      granteeId:
                        type:
                          - 'string'
                          - 'null'
                      groupId:
                        type:
                          - 'string'
                          - 'null'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                      plan:
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          name:
                            type: 'string'
                          isActive:
                            type: 'boolean'
                          productId:
                            type: 'string'
                          tierTagId:
                            type:
                              - 'string'
                              - 'null'
                          trialPeriodDays:
                            type:
                              - 'integer'
                              - 'null'
                          archivedAt:
                            type:
                              - 'string'
                              - 'null'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                          product:
                            additionalProperties: false
                            type: 'object'
                            properties:
                              type:
                                const: 'object'
                                type: 'string'
                              data:
                                additionalProperties: false
                                type: 'object'
                                properties:
                                  id:
                                    type: 'string'
                                  organisation:
                                    type: 'string'
                                  name:
                                    type: 'string'
                                  isActive:
                                    type: 'boolean'
                                  archivedAt:
                                    type:
                                      - 'string'
                                      - 'null'
                                  createdAt:
                                    type: 'string'
                                  updatedAt:
                                    type: 'string'
                                required:
                                  - 'id'
                                  - 'organisation'
                                  - 'name'
                                  - 'isActive'
                                  - 'archivedAt'
                                  - 'createdAt'
                                  - 'updatedAt'
                            required:
                              - 'type'
                              - 'data'
                          lineItems:
                            type: 'object'
                            properties:
                              type:
                                const: 'list'
                                type: 'string'
                              data:
                                type: 'array'
                                items:
                                  type: 'object'
                                  properties:
                                    id:
                                      type: 'string'
                                    organisation:
                                      type: 'string'
                                    name:
                                      type: 'string'
                                    slug:
                                      type: 'string'
                                    stripeProductId:
                                      type: 'string'
                                    meterId:
                                      type:
                                        - 'string'
                                        - 'null'
                                    nickname:
                                      type: 'string'
                                    priceType:
                                      allOf:
                                        - additionalProperties: false
                                          anyOf:
                                            - const: 'metered'
                                              type: 'string'
                                            - const: 'per_seat'
                                              type: 'string'
                                            - const: 'flat_rate'
                                              type: 'string'
                                        - anyOf:
                                            - const: 'metered'
                                              type: 'string'
                                            - const: 'per_seat'
                                              type: 'string'
                                            - const: 'flat_rate'
                                              type: 'string'
                                    intervalType:
                                      allOf:
                                        - additionalProperties: false
                                          anyOf:
                                            - const: 'one_off'
                                              type: 'string'
                                            - const: 'recurring'
                                              type: 'string'
                                        - anyOf:
                                            - const: 'one_off'
                                              type: 'string'
                                            - const: 'recurring'
                                              type: 'string'
                                    billingScheme:
                                      allOf:
                                        - additionalProperties: false
                                          anyOf:
                                            - const: 'fixed'
                                              type: 'string'
                                            - const: 'per_unit'
                                              type: 'string'
                                            - const: 'tiered'
                                              type: 'string'
                                            - const: 'flat_rate'
                                              type: 'string'
                                        - anyOf:
                                            - const: 'flat_rate'
                                              type: 'string'
                                            - const: 'fixed'
                                              type: 'string'
                                            - const: 'per_unit'
                                              type: 'string'
                                            - const: 'tiered'
                                              type: 'string'
                                    tiersMode:
                                      allOf:
                                        - anyOf:
                                            - type: 'null'
                                            - additionalProperties: false
                                              anyOf:
                                                - const: 'graduated'
                                                  type: 'string'
                                                - const: 'volume'
                                                  type: 'string'
                                        - anyOf:
                                            - type: 'null'
                                            - anyOf:
                                                - const: 'graduated'
                                                  type: 'string'
                                                - const: 'volume'
                                                  type: 'string'
                                    minQuantity:
                                      type: 'integer'
                                    maxQuantity:
                                      type: 'integer'
                                    isActive:
                                      type: 'boolean'
                                    planId:
                                      type: 'string'
                                    allowChangingQuantity:
                                      type: 'boolean'
                                    archivedAt:
                                      type:
                                        - 'string'
                                        - 'null'
                                    unitLabel:
                                      type:
                                        - 'string'
                                        - 'null'
                                    createdAt:
                                      type: 'string'
                                    updatedAt:
                                      type: 'string'
                                    prices:
                                      additionalProperties: false
                                      type: 'object'
                                      properties:
                                        type:
                                          const: 'list'
                                          type: 'string'
                                        data:
                                          type: 'array'
                                          items:
                                            type: 'object'
                                            properties:
                                              id:
                                                type: 'string'
                                              organisation:
                                                type: 'string'
                                              stripePriceId:
                                                type: 'string'
                                              interval:
                                                allOf:
                                                  - anyOf:
                                                      - type: 'null'
                                                      - additionalProperties: false
                                                        anyOf:
                                                          - const: 'day'
                                                            type: 'string'
                                                          - const: 'week'
                                                            type: 'string'
                                                          - const: 'month'
                                                            type: 'string'
                                                          - const: 'year'
                                                            type: 'string'
                                                  - anyOf:
                                                      - type: 'null'
                                                      - anyOf:
                                                          - const: 'day'
                                                            type: 'string'
                                                          - const: 'week'
                                                            type: 'string'
                                                          - const: 'month'
                                                            type: 'string'
                                                          - const: 'year'
                                                            type: 'string'
                                              intervalCount:
                                                type:
                                                  - 'integer'
                                                  - 'null'
                                              lineItemId:
                                                type: 'string'
                                              archivedAt:
                                                type:
                                                  - 'string'
                                                  - 'null'
                                              createdAt:
                                                type: 'string'
                                              updatedAt:
                                                type: 'string'
                                              currencyOptions:
                                                type: 'object'
                                                properties:
                                                  type:
                                                    const: 'list'
                                                    type: 'string'
                                                  data:
                                                    type: 'array'
                                                    items:
                                                      additionalProperties: false
                                                      type: 'object'
                                                      properties:
                                                        id:
                                                          type: 'string'
                                                        organisation:
                                                          type: 'string'
                                                        currency:
                                                          type: 'string'
                                                        unitAmount:
                                                          type:
                                                            - 'number'
                                                            - 'null'
                                                        priceId:
                                                          type: 'string'
                                                        isDefault:
                                                          type: 'boolean'
                                                        createdAt:
                                                          type: 'string'
                                                        updatedAt:
                                                          type: 'string'
                                                      required:
                                                        - 'id'
                                                        - 'organisation'
                                                        - 'currency'
                                                        - 'unitAmount'
                                                        - 'priceId'
                                                        - 'isDefault'
                                                        - 'createdAt'
                                                        - 'updatedAt'
                                                required:
                                                  - 'type'
                                                  - 'data'
                                            required:
                                              - 'id'
                                              - 'organisation'
                                              - 'stripePriceId'
                                              - 'interval'
                                              - 'intervalCount'
                                              - 'lineItemId'
                                              - 'archivedAt'
                                              - 'createdAt'
                                              - 'updatedAt'
                                              - 'currencyOptions'
                                      required:
                                        - 'type'
                                        - 'data'
                                  required:
                                    - 'id'
                                    - 'organisation'
                                    - 'name'
                                    - 'slug'
                                    - 'stripeProductId'
                                    - 'meterId'
                                    - 'nickname'
                                    - 'priceType'
                                    - 'intervalType'
                                    - 'billingScheme'
                                    - 'tiersMode'
                                    - 'minQuantity'
                                    - 'maxQuantity'
                                    - 'isActive'
                                    - 'planId'
                                    - 'allowChangingQuantity'
                                    - 'archivedAt'
                                    - 'unitLabel'
                                    - 'createdAt'
                                    - 'updatedAt'
                                    - 'prices'
                            required:
                              - 'type'
                              - 'data'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'name'
                          - 'isActive'
                          - 'productId'
                          - 'tierTagId'
                          - 'trialPeriodDays'
                          - 'archivedAt'
                          - 'createdAt'
                          - 'updatedAt'
                          - 'product'
                          - 'lineItems'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'cartId'
                      - 'planId'
                      - 'metadata'
                      - 'granteeId'
                      - 'groupId'
                      - 'createdAt'
                      - 'updatedAt'
                      - 'plan'
              required:
                - 'type'
                - 'data'
          required:
            - 'id'
            - 'organisation'
            - 'ownerId'
            - 'currency'
            - 'interval'
            - 'intervalCount'
            - 'status'
            - 'createdAt'
            - 'updatedAt'
            - 'owner'
            - 'cartItems'
      required:
        - 'type'
        - 'data'
    CreateCartResponseSchema:
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            ownerId:
              type: 'string'
            currency:
              type:
                - 'string'
                - 'null'
            interval:
              allOf:
                - anyOf:
                    - type: 'null'
                    - additionalProperties: false
                      anyOf:
                        - const: 'day'
                          type: 'string'
                        - const: 'week'
                          type: 'string'
                        - const: 'month'
                          type: 'string'
                        - const: 'year'
                          type: 'string'
                - anyOf:
                    - type: 'null'
                    - anyOf:
                        - const: 'day'
                          type: 'string'
                        - const: 'week'
                          type: 'string'
                        - const: 'month'
                          type: 'string'
                        - const: 'year'
                          type: 'string'
            intervalCount:
              type:
                - 'integer'
                - 'null'
            status:
              allOf:
                - additionalProperties: false
                  anyOf:
                    - const: 'active'
                      type: 'string'
                    - const: 'abandoned'
                      type: 'string'
                    - const: 'complete'
                      type: 'string'
                - anyOf:
                    - const: 'active'
                      type: 'string'
                    - const: 'abandoned'
                      type: 'string'
                    - const: 'complete'
                      type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'organisation'
            - 'ownerId'
            - 'currency'
            - 'interval'
            - 'intervalCount'
            - 'status'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GenerateCheckoutLinkSchema:
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            url:
              type: 'string'
          required:
            - 'url'
      required:
        - 'type'
        - 'data'
    BatchCartActionsResponseSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            total:
              type: 'number'
            succeeded:
              type: 'number'
            failed:
              type: 'number'
            skipped:
              type: 'number'
            results:
              type: 'array'
              items:
                additionalProperties: false
                type: 'object'
                properties:
                  id:
                    type: 'string'
                  status:
                    anyOf:
                      - const: 'succeeded'
                        type: 'string'
                      - const: 'failed'
                        type: 'string'
                      - const: 'skipped'
                        type: 'string'
                  reason:
                    type: 'string'
                required:
                  - 'id'
                  - 'status'
          required:
            - 'total'
            - 'succeeded'
            - 'failed'
            - 'skipped'
            - 'results'
      required:
        - 'type'
        - 'data'
    GetCurrencyOptionsListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              currency:
                type: 'string'
              unitAmount:
                type:
                  - 'number'
                  - 'null'
              priceId:
                type: 'string'
              isDefault:
                type: 'boolean'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
              tiers:
                type: 'object'
                properties:
                  type:
                    const: 'list'
                    type: 'string'
                  data:
                    type: 'array'
                    items:
                      additionalProperties: false
                      type: 'object'
                      properties:
                        id:
                          type: 'string'
                        organisation:
                          type: 'string'
                        upTo:
                          type: 'string'
                        flatAmount:
                          type:
                            - 'number'
                            - 'null'
                        unitAmount:
                          type: 'number'
                        currencyOptionId:
                          type: 'string'
                        createdAt:
                          type: 'string'
                        updatedAt:
                          type: 'string'
                      required:
                        - 'id'
                        - 'organisation'
                        - 'upTo'
                        - 'flatAmount'
                        - 'unitAmount'
                        - 'currencyOptionId'
                        - 'createdAt'
                        - 'updatedAt'
                  hasMore:
                    type: 'boolean'
                  path:
                    type: 'string'
                required:
                  - 'type'
                  - 'data'
                  - 'hasMore'
                  - 'path'
            required:
              - 'id'
              - 'organisation'
              - 'currency'
              - 'unitAmount'
              - 'priceId'
              - 'isDefault'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetCurrencyOptionDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            currency:
              type: 'string'
            unitAmount:
              type:
                - 'number'
                - 'null'
            priceId:
              type: 'string'
            isDefault:
              type: 'boolean'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            tiers:
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    additionalProperties: false
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      upTo:
                        type: 'string'
                      flatAmount:
                        type:
                          - 'number'
                          - 'null'
                      unitAmount:
                        type: 'number'
                      currencyOptionId:
                        type: 'string'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'upTo'
                      - 'flatAmount'
                      - 'unitAmount'
                      - 'currencyOptionId'
                      - 'createdAt'
                      - 'updatedAt'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
          required:
            - 'id'
            - 'organisation'
            - 'currency'
            - 'unitAmount'
            - 'priceId'
            - 'isDefault'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetUsageListSchema:
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              ownerId:
                type: 'string'
              usageId:
                type: 'string'
              status:
                allOf:
                  - additionalProperties: false
                    anyOf:
                      - const: 'recorded'
                        type: 'string'
                      - const: 'current'
                        type: 'string'
                      - const: 'final'
                        type: 'string'
                  - anyOf:
                      - const: 'current'
                        type: 'string'
                      - const: 'recorded'
                        type: 'string'
                      - const: 'final'
                        type: 'string'
              count:
                type: 'integer'
              recordedAt:
                type:
                  - 'string'
                  - 'null'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
            required:
              - 'id'
              - 'organisation'
              - 'ownerId'
              - 'usageId'
              - 'status'
              - 'count'
              - 'recordedAt'
              - 'createdAt'
              - 'updatedAt'
        previousCursor:
          type:
            - 'string'
            - 'null'
        nextCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'previousCursor'
        - 'nextCursor'
        - 'hasMore'
    GetEntitlementsListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              name:
                type: 'string'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
            required:
              - 'id'
              - 'organisation'
              - 'name'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetEntitlementDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            name:
              type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'organisation'
            - 'name'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    CreateEntitlementResponseSchema:
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            name:
              type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'organisation'
            - 'name'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    CheckEntitlementsSchema:
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            entitlements:
              type: 'array'
              items:
                type: 'object'
                properties:
                  type:
                    anyOf:
                      - const: 'entitlement'
                        type: 'string'
                      - const: 'meter'
                        type: 'string'
                  value:
                    type: 'string'
                  expiryDate:
                    type:
                      - 'string'
                      - 'null'
                required:
                  - 'type'
                  - 'value'
                  - 'expiryDate'
            signature:
              type: 'string'
          required:
            - 'entitlements'
            - 'signature'
      required:
        - 'type'
        - 'data'
    GetEventListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              type:
                type: 'string'
              payload: {}
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
            required:
              - 'id'
              - 'organisation'
              - 'type'
              - 'payload'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetEventDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            type:
              type: 'string'
            payload: {}
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            destinations:
              additionalProperties: false
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      eventId:
                        type: 'string'
                      webhookId:
                        type: 'string'
                      organisation:
                        type: 'string'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                      webhook:
                        additionalProperties: false
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          url:
                            type: 'string'
                          organisation:
                            type: 'string'
                          secret: {}
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                        required:
                          - 'id'
                          - 'url'
                          - 'organisation'
                          - 'secret'
                          - 'createdAt'
                          - 'updatedAt'
                    required:
                      - 'id'
                      - 'eventId'
                      - 'webhookId'
                      - 'organisation'
                      - 'createdAt'
                      - 'updatedAt'
                      - 'webhook'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
          required:
            - 'id'
            - 'organisation'
            - 'type'
            - 'payload'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetEventAttemptsListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              destinationId:
                type: 'string'
              attempt:
                type: 'integer'
              status:
                allOf:
                  - additionalProperties: false
                    anyOf:
                      - const: 'success'
                        type: 'string'
                      - const: 'error'
                        type: 'string'
                      - const: 'pending'
                        type: 'string'
                  - anyOf:
                      - const: 'success'
                        type: 'string'
                      - const: 'error'
                        type: 'string'
                      - const: 'pending'
                        type: 'string'
              message:
                type:
                  - 'string'
                  - 'null'
              organisation:
                type: 'string'
              sentCount:
                type: 'integer'
              scheduledAt:
                type:
                  - 'string'
                  - 'null'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
            required:
              - 'id'
              - 'destinationId'
              - 'attempt'
              - 'status'
              - 'message'
              - 'organisation'
              - 'sentCount'
              - 'scheduledAt'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetDestinationListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              eventId:
                type: 'string'
              webhookId:
                type: 'string'
              organisation:
                type: 'string'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
            required:
              - 'id'
              - 'eventId'
              - 'webhookId'
              - 'organisation'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetDestinationDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            eventId:
              type: 'string'
            webhookId:
              type: 'string'
            organisation:
              type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            attempts:
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    additionalProperties: false
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      destinationId:
                        type: 'string'
                      attempt:
                        type: 'integer'
                      status:
                        allOf:
                          - additionalProperties: false
                            anyOf:
                              - const: 'success'
                                type: 'string'
                              - const: 'error'
                                type: 'string'
                              - const: 'pending'
                                type: 'string'
                          - anyOf:
                              - const: 'success'
                                type: 'string'
                              - const: 'error'
                                type: 'string'
                              - const: 'pending'
                                type: 'string'
                      message:
                        type:
                          - 'string'
                          - 'null'
                      organisation:
                        type: 'string'
                      sentCount:
                        type: 'integer'
                      scheduledAt:
                        type:
                          - 'string'
                          - 'null'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                    required:
                      - 'id'
                      - 'destinationId'
                      - 'attempt'
                      - 'status'
                      - 'message'
                      - 'organisation'
                      - 'sentCount'
                      - 'scheduledAt'
                      - 'createdAt'
                      - 'updatedAt'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
          required:
            - 'id'
            - 'eventId'
            - 'webhookId'
            - 'organisation'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetGranteeListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              name:
                type:
                  - 'string'
                  - 'null'
              granteeId:
                type: 'string'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
            required:
              - 'id'
              - 'organisation'
              - 'name'
              - 'granteeId'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetGranteeDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            name:
              type:
                - 'string'
                - 'null'
            granteeId:
              type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            memberships:
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      granteeId:
                        type: 'string'
                      groupId:
                        type: 'string'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                      group:
                        additionalProperties: false
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          ownerId:
                            type: 'string'
                          name:
                            type:
                              - 'string'
                              - 'null'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'ownerId'
                          - 'name'
                          - 'createdAt'
                          - 'updatedAt'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'granteeId'
                      - 'groupId'
                      - 'createdAt'
                      - 'updatedAt'
                      - 'group'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
          required:
            - 'id'
            - 'organisation'
            - 'name'
            - 'granteeId'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    CreateGranteeResponseSchema:
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            name:
              type:
                - 'string'
                - 'null'
            granteeId:
              type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'organisation'
            - 'name'
            - 'granteeId'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetGroupsListSchema:
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              ownerId:
                type: 'string'
              name:
                type:
                  - 'string'
                  - 'null'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
              owner:
                additionalProperties: false
                type: 'object'
                properties:
                  id:
                    type: 'string'
                  organisation:
                    type: 'string'
                  value:
                    type: 'string'
                  stripeCustomerId:
                    type:
                      - 'string'
                      - 'null'
                  emailAddress:
                    type:
                      - 'string'
                      - 'null'
                  createdAt:
                    type: 'string'
                  updatedAt:
                    type: 'string'
                required:
                  - 'id'
                  - 'organisation'
                  - 'value'
                  - 'stripeCustomerId'
                  - 'emailAddress'
                  - 'createdAt'
                  - 'updatedAt'
            required:
              - 'id'
              - 'organisation'
              - 'ownerId'
              - 'name'
              - 'createdAt'
              - 'updatedAt'
        previousCursor:
          type:
            - 'string'
            - 'null'
        nextCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'previousCursor'
        - 'nextCursor'
        - 'hasMore'
    GetGroupDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            ownerId:
              type: 'string'
            name:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            owner:
              additionalProperties: false
              type: 'object'
              properties:
                id:
                  type: 'string'
                organisation:
                  type: 'string'
                value:
                  type: 'string'
                stripeCustomerId:
                  type:
                    - 'string'
                    - 'null'
                emailAddress:
                  type:
                    - 'string'
                    - 'null'
                createdAt:
                  type: 'string'
                updatedAt:
                  type: 'string'
              required:
                - 'id'
                - 'organisation'
                - 'value'
                - 'stripeCustomerId'
                - 'emailAddress'
                - 'createdAt'
                - 'updatedAt'
            memberships:
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      granteeId:
                        type: 'string'
                      groupId:
                        type: 'string'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                      grantee:
                        additionalProperties: false
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          name:
                            type:
                              - 'string'
                              - 'null'
                          granteeId:
                            type: 'string'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'name'
                          - 'granteeId'
                          - 'createdAt'
                          - 'updatedAt'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'granteeId'
                      - 'groupId'
                      - 'createdAt'
                      - 'updatedAt'
                      - 'grantee'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
            subscriptionPlans:
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      ownerId:
                        type: 'string'
                      groupId:
                        type: 'string'
                      subscriptionId:
                        type: 'string'
                      planId:
                        type:
                          - 'string'
                          - 'null'
                      seats:
                        type: 'integer'
                      status:
                        allOf:
                          - additionalProperties: false
                            anyOf:
                              - const: 'active'
                                type: 'string'
                              - const: 'inactive'
                                type: 'string'
                          - anyOf:
                              - const: 'active'
                                type: 'string'
                              - const: 'inactive'
                                type: 'string'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                      subscriptionPlanLineItems:
                        type: 'object'
                        properties:
                          type:
                            const: 'list'
                            type: 'string'
                          data:
                            type: 'array'
                            items:
                              additionalProperties: false
                              type: 'object'
                              properties:
                                id:
                                  type: 'string'
                                organisation:
                                  type: 'string'
                                subscriptionPlanId:
                                  type: 'string'
                                lineItemStripeProductId:
                                  type: 'string'
                                type:
                                  allOf:
                                    - additionalProperties: false
                                      anyOf:
                                        - const: 'unit'
                                          type: 'string'
                                        - const: 'metered'
                                          type: 'string'
                                    - anyOf:
                                        - const: 'unit'
                                          type: 'string'
                                        - const: 'metered'
                                          type: 'string'
                                quantity:
                                  type: 'integer'
                                usageId:
                                  type:
                                    - 'string'
                                    - 'null'
                                stripeSubscriptionItemId:
                                  type:
                                    - 'string'
                                    - 'null'
                                stripePriceId:
                                  type:
                                    - 'string'
                                    - 'null'
                                expiryDate:
                                  type:
                                    - 'string'
                                    - 'null'
                                createdAt:
                                  type: 'string'
                                updatedAt:
                                  type: 'string'
                              required:
                                - 'id'
                                - 'organisation'
                                - 'subscriptionPlanId'
                                - 'lineItemStripeProductId'
                                - 'type'
                                - 'quantity'
                                - 'usageId'
                                - 'stripeSubscriptionItemId'
                                - 'stripePriceId'
                                - 'expiryDate'
                                - 'createdAt'
                                - 'updatedAt'
                          hasMore:
                            type: 'boolean'
                          path:
                            type: 'string'
                        required:
                          - 'type'
                          - 'data'
                          - 'hasMore'
                          - 'path'
                      subscription:
                        additionalProperties: false
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          stripeSubscriptionId:
                            type:
                              - 'string'
                              - 'null'
                          ownerId:
                            type: 'string'
                          status:
                            type: 'string'
                          customerId:
                            type:
                              - 'string'
                              - 'null'
                          interval:
                            allOf:
                              - anyOf:
                                  - type: 'null'
                                  - additionalProperties: false
                                    anyOf:
                                      - const: 'day'
                                        type: 'string'
                                      - const: 'week'
                                        type: 'string'
                                      - const: 'month'
                                        type: 'string'
                                      - const: 'year'
                                        type: 'string'
                              - anyOf:
                                  - type: 'null'
                                  - anyOf:
                                      - const: 'day'
                                        type: 'string'
                                      - const: 'week'
                                        type: 'string'
                                      - const: 'month'
                                        type: 'string'
                                      - const: 'year'
                                        type: 'string'
                          intervalCount:
                            type:
                              - 'integer'
                              - 'null'
                          currencyShortCode:
                            type:
                              - 'string'
                              - 'null'
                          cancelAtPeriodEnd:
                            type: 'boolean'
                          isPerpetual:
                            type: 'boolean'
                          isSalableOnly:
                            type: 'boolean'
                          startDate:
                            type: 'string'
                          cancelledAt:
                            type:
                              - 'string'
                              - 'null'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'stripeSubscriptionId'
                          - 'ownerId'
                          - 'status'
                          - 'customerId'
                          - 'interval'
                          - 'intervalCount'
                          - 'currencyShortCode'
                          - 'cancelAtPeriodEnd'
                          - 'isPerpetual'
                          - 'isSalableOnly'
                          - 'startDate'
                          - 'cancelledAt'
                          - 'createdAt'
                          - 'updatedAt'
                      plan:
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          name:
                            type: 'string'
                          isActive:
                            type: 'boolean'
                          productId:
                            type: 'string'
                          tierTagId:
                            type:
                              - 'string'
                              - 'null'
                          trialPeriodDays:
                            type:
                              - 'integer'
                              - 'null'
                          archivedAt:
                            type:
                              - 'string'
                              - 'null'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                          entitlements:
                            type: 'object'
                            properties:
                              type:
                                const: 'list'
                                type: 'string'
                              data:
                                type: 'array'
                                items:
                                  additionalProperties: false
                                  type: 'object'
                                  properties:
                                    id:
                                      type: 'string'
                                    organisation:
                                      type: 'string'
                                    name:
                                      type: 'string'
                                    createdAt:
                                      type: 'string'
                                    updatedAt:
                                      type: 'string'
                                  required:
                                    - 'id'
                                    - 'organisation'
                                    - 'name'
                                    - 'createdAt'
                                    - 'updatedAt'
                              hasMore:
                                type: 'boolean'
                              path:
                                type: 'string'
                            required:
                              - 'type'
                              - 'data'
                              - 'hasMore'
                              - 'path'
                          lineItems:
                            type: 'object'
                            properties:
                              type:
                                const: 'list'
                                type: 'string'
                              data:
                                type: 'array'
                                items:
                                  additionalProperties: false
                                  type: 'object'
                                  properties:
                                    id:
                                      type: 'string'
                                    organisation:
                                      type: 'string'
                                    name:
                                      type: 'string'
                                    slug:
                                      type: 'string'
                                    stripeProductId:
                                      type: 'string'
                                    meterId:
                                      type:
                                        - 'string'
                                        - 'null'
                                    nickname:
                                      type: 'string'
                                    priceType:
                                      allOf:
                                        - additionalProperties: false
                                          anyOf:
                                            - const: 'metered'
                                              type: 'string'
                                            - const: 'per_seat'
                                              type: 'string'
                                            - const: 'flat_rate'
                                              type: 'string'
                                        - anyOf:
                                            - const: 'metered'
                                              type: 'string'
                                            - const: 'per_seat'
                                              type: 'string'
                                            - const: 'flat_rate'
                                              type: 'string'
                                    intervalType:
                                      allOf:
                                        - additionalProperties: false
                                          anyOf:
                                            - const: 'one_off'
                                              type: 'string'
                                            - const: 'recurring'
                                              type: 'string'
                                        - anyOf:
                                            - const: 'one_off'
                                              type: 'string'
                                            - const: 'recurring'
                                              type: 'string'
                                    billingScheme:
                                      allOf:
                                        - additionalProperties: false
                                          anyOf:
                                            - const: 'fixed'
                                              type: 'string'
                                            - const: 'per_unit'
                                              type: 'string'
                                            - const: 'tiered'
                                              type: 'string'
                                            - const: 'flat_rate'
                                              type: 'string'
                                        - anyOf:
                                            - const: 'flat_rate'
                                              type: 'string'
                                            - const: 'fixed'
                                              type: 'string'
                                            - const: 'per_unit'
                                              type: 'string'
                                            - const: 'tiered'
                                              type: 'string'
                                    tiersMode:
                                      allOf:
                                        - anyOf:
                                            - type: 'null'
                                            - additionalProperties: false
                                              anyOf:
                                                - const: 'graduated'
                                                  type: 'string'
                                                - const: 'volume'
                                                  type: 'string'
                                        - anyOf:
                                            - type: 'null'
                                            - anyOf:
                                                - const: 'graduated'
                                                  type: 'string'
                                                - const: 'volume'
                                                  type: 'string'
                                    minQuantity:
                                      type: 'integer'
                                    maxQuantity:
                                      type: 'integer'
                                    isActive:
                                      type: 'boolean'
                                    planId:
                                      type: 'string'
                                    allowChangingQuantity:
                                      type: 'boolean'
                                    archivedAt:
                                      type:
                                        - 'string'
                                        - 'null'
                                    unitLabel:
                                      type:
                                        - 'string'
                                        - 'null'
                                    createdAt:
                                      type: 'string'
                                    updatedAt:
                                      type: 'string'
                                  required:
                                    - 'id'
                                    - 'organisation'
                                    - 'name'
                                    - 'slug'
                                    - 'stripeProductId'
                                    - 'meterId'
                                    - 'nickname'
                                    - 'priceType'
                                    - 'intervalType'
                                    - 'billingScheme'
                                    - 'tiersMode'
                                    - 'minQuantity'
                                    - 'maxQuantity'
                                    - 'isActive'
                                    - 'planId'
                                    - 'allowChangingQuantity'
                                    - 'archivedAt'
                                    - 'unitLabel'
                                    - 'createdAt'
                                    - 'updatedAt'
                              hasMore:
                                type: 'boolean'
                              path:
                                type: 'string'
                            required:
                              - 'type'
                              - 'data'
                              - 'hasMore'
                              - 'path'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'name'
                          - 'isActive'
                          - 'productId'
                          - 'tierTagId'
                          - 'trialPeriodDays'
                          - 'archivedAt'
                          - 'createdAt'
                          - 'updatedAt'
                          - 'entitlements'
                          - 'lineItems'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'ownerId'
                      - 'groupId'
                      - 'subscriptionId'
                      - 'planId'
                      - 'seats'
                      - 'status'
                      - 'createdAt'
                      - 'updatedAt'
                      - 'subscriptionPlanLineItems'
                      - 'subscription'
                      - 'plan'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
          required:
            - 'id'
            - 'organisation'
            - 'ownerId'
            - 'name'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    CreateGroupResponseSchema:
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            ownerId:
              type: 'string'
            name:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'organisation'
            - 'ownerId'
            - 'name'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetLineItemListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              name:
                type: 'string'
              slug:
                type: 'string'
              stripeProductId:
                type: 'string'
              meterId:
                type:
                  - 'string'
                  - 'null'
              nickname:
                type: 'string'
              priceType:
                allOf:
                  - additionalProperties: false
                    anyOf:
                      - const: 'metered'
                        type: 'string'
                      - const: 'per_seat'
                        type: 'string'
                      - const: 'flat_rate'
                        type: 'string'
                  - anyOf:
                      - const: 'metered'
                        type: 'string'
                      - const: 'per_seat'
                        type: 'string'
                      - const: 'flat_rate'
                        type: 'string'
              intervalType:
                allOf:
                  - additionalProperties: false
                    anyOf:
                      - const: 'one_off'
                        type: 'string'
                      - const: 'recurring'
                        type: 'string'
                  - anyOf:
                      - const: 'one_off'
                        type: 'string'
                      - const: 'recurring'
                        type: 'string'
              billingScheme:
                allOf:
                  - additionalProperties: false
                    anyOf:
                      - const: 'fixed'
                        type: 'string'
                      - const: 'per_unit'
                        type: 'string'
                      - const: 'tiered'
                        type: 'string'
                      - const: 'flat_rate'
                        type: 'string'
                  - anyOf:
                      - const: 'flat_rate'
                        type: 'string'
                      - const: 'fixed'
                        type: 'string'
                      - const: 'per_unit'
                        type: 'string'
                      - const: 'tiered'
                        type: 'string'
              tiersMode:
                allOf:
                  - anyOf:
                      - type: 'null'
                      - additionalProperties: false
                        anyOf:
                          - const: 'graduated'
                            type: 'string'
                          - const: 'volume'
                            type: 'string'
                  - anyOf:
                      - type: 'null'
                      - anyOf:
                          - const: 'graduated'
                            type: 'string'
                          - const: 'volume'
                            type: 'string'
              minQuantity:
                type: 'integer'
              maxQuantity:
                type: 'integer'
              isActive:
                type: 'boolean'
              planId:
                type: 'string'
              allowChangingQuantity:
                type: 'boolean'
              archivedAt:
                type:
                  - 'string'
                  - 'null'
              unitLabel:
                type:
                  - 'string'
                  - 'null'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
            required:
              - 'id'
              - 'organisation'
              - 'name'
              - 'slug'
              - 'stripeProductId'
              - 'meterId'
              - 'nickname'
              - 'priceType'
              - 'intervalType'
              - 'billingScheme'
              - 'tiersMode'
              - 'minQuantity'
              - 'maxQuantity'
              - 'isActive'
              - 'planId'
              - 'allowChangingQuantity'
              - 'archivedAt'
              - 'unitLabel'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetLineItemDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            name:
              type: 'string'
            slug:
              type: 'string'
            stripeProductId:
              type: 'string'
            meterId:
              type:
                - 'string'
                - 'null'
            nickname:
              type: 'string'
            priceType:
              allOf:
                - additionalProperties: false
                  anyOf:
                    - const: 'metered'
                      type: 'string'
                    - const: 'per_seat'
                      type: 'string'
                    - const: 'flat_rate'
                      type: 'string'
                - anyOf:
                    - const: 'metered'
                      type: 'string'
                    - const: 'per_seat'
                      type: 'string'
                    - const: 'flat_rate'
                      type: 'string'
            intervalType:
              allOf:
                - additionalProperties: false
                  anyOf:
                    - const: 'one_off'
                      type: 'string'
                    - const: 'recurring'
                      type: 'string'
                - anyOf:
                    - const: 'one_off'
                      type: 'string'
                    - const: 'recurring'
                      type: 'string'
            billingScheme:
              allOf:
                - additionalProperties: false
                  anyOf:
                    - const: 'fixed'
                      type: 'string'
                    - const: 'per_unit'
                      type: 'string'
                    - const: 'tiered'
                      type: 'string'
                    - const: 'flat_rate'
                      type: 'string'
                - anyOf:
                    - const: 'flat_rate'
                      type: 'string'
                    - const: 'fixed'
                      type: 'string'
                    - const: 'per_unit'
                      type: 'string'
                    - const: 'tiered'
                      type: 'string'
            tiersMode:
              allOf:
                - anyOf:
                    - type: 'null'
                    - additionalProperties: false
                      anyOf:
                        - const: 'graduated'
                          type: 'string'
                        - const: 'volume'
                          type: 'string'
                - anyOf:
                    - type: 'null'
                    - anyOf:
                        - const: 'graduated'
                          type: 'string'
                        - const: 'volume'
                          type: 'string'
            minQuantity:
              type: 'integer'
            maxQuantity:
              type: 'integer'
            isActive:
              type: 'boolean'
            planId:
              type: 'string'
            allowChangingQuantity:
              type: 'boolean'
            archivedAt:
              type:
                - 'string'
                - 'null'
            unitLabel:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            prices:
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    additionalProperties: false
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      stripePriceId:
                        type: 'string'
                      interval:
                        allOf:
                          - anyOf:
                              - type: 'null'
                              - additionalProperties: false
                                anyOf:
                                  - const: 'day'
                                    type: 'string'
                                  - const: 'week'
                                    type: 'string'
                                  - const: 'month'
                                    type: 'string'
                                  - const: 'year'
                                    type: 'string'
                          - anyOf:
                              - type: 'null'
                              - anyOf:
                                  - const: 'day'
                                    type: 'string'
                                  - const: 'week'
                                    type: 'string'
                                  - const: 'month'
                                    type: 'string'
                                  - const: 'year'
                                    type: 'string'
                      intervalCount:
                        type:
                          - 'integer'
                          - 'null'
                      lineItemId:
                        type: 'string'
                      archivedAt:
                        type:
                          - 'string'
                          - 'null'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'stripePriceId'
                      - 'interval'
                      - 'intervalCount'
                      - 'lineItemId'
                      - 'archivedAt'
                      - 'createdAt'
                      - 'updatedAt'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
          required:
            - 'id'
            - 'organisation'
            - 'name'
            - 'slug'
            - 'stripeProductId'
            - 'meterId'
            - 'nickname'
            - 'priceType'
            - 'intervalType'
            - 'billingScheme'
            - 'tiersMode'
            - 'minQuantity'
            - 'maxQuantity'
            - 'isActive'
            - 'planId'
            - 'allowChangingQuantity'
            - 'archivedAt'
            - 'unitLabel'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    UpdateLineItemResponseSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            name:
              type: 'string'
            slug:
              type: 'string'
            stripeProductId:
              type: 'string'
            meterId:
              type:
                - 'string'
                - 'null'
            nickname:
              type: 'string'
            priceType:
              allOf:
                - additionalProperties: false
                  anyOf:
                    - const: 'metered'
                      type: 'string'
                    - const: 'per_seat'
                      type: 'string'
                    - const: 'flat_rate'
                      type: 'string'
                - anyOf:
                    - const: 'metered'
                      type: 'string'
                    - const: 'per_seat'
                      type: 'string'
                    - const: 'flat_rate'
                      type: 'string'
            intervalType:
              allOf:
                - additionalProperties: false
                  anyOf:
                    - const: 'one_off'
                      type: 'string'
                    - const: 'recurring'
                      type: 'string'
                - anyOf:
                    - const: 'one_off'
                      type: 'string'
                    - const: 'recurring'
                      type: 'string'
            billingScheme:
              allOf:
                - additionalProperties: false
                  anyOf:
                    - const: 'fixed'
                      type: 'string'
                    - const: 'per_unit'
                      type: 'string'
                    - const: 'tiered'
                      type: 'string'
                    - const: 'flat_rate'
                      type: 'string'
                - anyOf:
                    - const: 'flat_rate'
                      type: 'string'
                    - const: 'fixed'
                      type: 'string'
                    - const: 'per_unit'
                      type: 'string'
                    - const: 'tiered'
                      type: 'string'
            tiersMode:
              allOf:
                - anyOf:
                    - type: 'null'
                    - additionalProperties: false
                      anyOf:
                        - const: 'graduated'
                          type: 'string'
                        - const: 'volume'
                          type: 'string'
                - anyOf:
                    - type: 'null'
                    - anyOf:
                        - const: 'graduated'
                          type: 'string'
                        - const: 'volume'
                          type: 'string'
            minQuantity:
              type: 'integer'
            maxQuantity:
              type: 'integer'
            isActive:
              type: 'boolean'
            planId:
              type: 'string'
            allowChangingQuantity:
              type: 'boolean'
            archivedAt:
              type:
                - 'string'
                - 'null'
            unitLabel:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'organisation'
            - 'name'
            - 'slug'
            - 'stripeProductId'
            - 'meterId'
            - 'nickname'
            - 'priceType'
            - 'intervalType'
            - 'billingScheme'
            - 'tiersMode'
            - 'minQuantity'
            - 'maxQuantity'
            - 'isActive'
            - 'planId'
            - 'allowChangingQuantity'
            - 'archivedAt'
            - 'unitLabel'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetMembershipListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              granteeId:
                type: 'string'
              groupId:
                type: 'string'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
              group:
                additionalProperties: false
                type: 'object'
                properties:
                  id:
                    type: 'string'
                  organisation:
                    type: 'string'
                  ownerId:
                    type: 'string'
                  name:
                    type:
                      - 'string'
                      - 'null'
                  createdAt:
                    type: 'string'
                  updatedAt:
                    type: 'string'
                required:
                  - 'id'
                  - 'organisation'
                  - 'ownerId'
                  - 'name'
                  - 'createdAt'
                  - 'updatedAt'
            required:
              - 'id'
              - 'organisation'
              - 'granteeId'
              - 'groupId'
              - 'createdAt'
              - 'updatedAt'
        previousCursor:
          type:
            - 'string'
            - 'null'
        nextCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'previousCursor'
        - 'nextCursor'
        - 'hasMore'
    GetMembershipDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            granteeId:
              type: 'string'
            groupId:
              type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            group:
              additionalProperties: false
              type: 'object'
              properties:
                id:
                  type: 'string'
                organisation:
                  type: 'string'
                ownerId:
                  type: 'string'
                name:
                  type:
                    - 'string'
                    - 'null'
                createdAt:
                  type: 'string'
                updatedAt:
                  type: 'string'
              required:
                - 'id'
                - 'organisation'
                - 'ownerId'
                - 'name'
                - 'createdAt'
                - 'updatedAt'
          required:
            - 'id'
            - 'organisation'
            - 'granteeId'
            - 'groupId'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetMetersListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              slug:
                type: 'string'
              name:
                type: 'string'
              stripeMeterId:
                type: 'string'
              organisation:
                type: 'string'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
            required:
              - 'id'
              - 'slug'
              - 'name'
              - 'stripeMeterId'
              - 'organisation'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetOwnerListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              value:
                type: 'string'
              stripeCustomerId:
                type:
                  - 'string'
                  - 'null'
              emailAddress:
                type:
                  - 'string'
                  - 'null'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
              subscriptions:
                additionalProperties: false
                type: 'object'
                properties:
                  type:
                    const: 'list'
                    type: 'string'
                  data:
                    type: 'array'
                    items:
                      additionalProperties: false
                      type: 'object'
                      properties:
                        id:
                          type: 'string'
                        organisation:
                          type: 'string'
                        stripeSubscriptionId:
                          type:
                            - 'string'
                            - 'null'
                        ownerId:
                          type: 'string'
                        status:
                          type: 'string'
                        customerId:
                          type:
                            - 'string'
                            - 'null'
                        interval:
                          allOf:
                            - anyOf:
                                - type: 'null'
                                - additionalProperties: false
                                  anyOf:
                                    - const: 'day'
                                      type: 'string'
                                    - const: 'week'
                                      type: 'string'
                                    - const: 'month'
                                      type: 'string'
                                    - const: 'year'
                                      type: 'string'
                            - anyOf:
                                - type: 'null'
                                - anyOf:
                                    - const: 'day'
                                      type: 'string'
                                    - const: 'week'
                                      type: 'string'
                                    - const: 'month'
                                      type: 'string'
                                    - const: 'year'
                                      type: 'string'
                        intervalCount:
                          type:
                            - 'integer'
                            - 'null'
                        currencyShortCode:
                          type:
                            - 'string'
                            - 'null'
                        cancelAtPeriodEnd:
                          type: 'boolean'
                        isPerpetual:
                          type: 'boolean'
                        isSalableOnly:
                          type: 'boolean'
                        startDate:
                          type: 'string'
                        cancelledAt:
                          type:
                            - 'string'
                            - 'null'
                        createdAt:
                          type: 'string'
                        updatedAt:
                          type: 'string'
                      required:
                        - 'id'
                        - 'organisation'
                        - 'stripeSubscriptionId'
                        - 'ownerId'
                        - 'status'
                        - 'customerId'
                        - 'interval'
                        - 'intervalCount'
                        - 'currencyShortCode'
                        - 'cancelAtPeriodEnd'
                        - 'isPerpetual'
                        - 'isSalableOnly'
                        - 'startDate'
                        - 'cancelledAt'
                        - 'createdAt'
                        - 'updatedAt'
                  hasMore:
                    type: 'boolean'
                  path:
                    type: 'string'
                required:
                  - 'type'
                  - 'data'
                  - 'hasMore'
                  - 'path'
              receipts:
                additionalProperties: false
                type: 'object'
                properties:
                  type:
                    const: 'list'
                    type: 'string'
                  data:
                    type: 'array'
                    items:
                      additionalProperties: false
                      type: 'object'
                      properties:
                        id:
                          type: 'string'
                        organisation:
                          type: 'string'
                        ownerId:
                          type: 'string'
                        subscriptionId:
                          type:
                            - 'string'
                            - 'null'
                        createdAt:
                          type: 'string'
                        updatedAt:
                          type: 'string'
                      required:
                        - 'id'
                        - 'organisation'
                        - 'ownerId'
                        - 'subscriptionId'
                        - 'createdAt'
                        - 'updatedAt'
                  hasMore:
                    type: 'boolean'
                  path:
                    type: 'string'
                required:
                  - 'type'
                  - 'data'
                  - 'hasMore'
                  - 'path'
            required:
              - 'id'
              - 'organisation'
              - 'value'
              - 'stripeCustomerId'
              - 'emailAddress'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetOwnerDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            value:
              type: 'string'
            stripeCustomerId:
              type:
                - 'string'
                - 'null'
            emailAddress:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            carts:
              additionalProperties: false
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    additionalProperties: false
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      ownerId:
                        type: 'string'
                      currency:
                        type:
                          - 'string'
                          - 'null'
                      interval:
                        allOf:
                          - anyOf:
                              - type: 'null'
                              - additionalProperties: false
                                anyOf:
                                  - const: 'day'
                                    type: 'string'
                                  - const: 'week'
                                    type: 'string'
                                  - const: 'month'
                                    type: 'string'
                                  - const: 'year'
                                    type: 'string'
                          - anyOf:
                              - type: 'null'
                              - anyOf:
                                  - const: 'day'
                                    type: 'string'
                                  - const: 'week'
                                    type: 'string'
                                  - const: 'month'
                                    type: 'string'
                                  - const: 'year'
                                    type: 'string'
                      intervalCount:
                        type:
                          - 'integer'
                          - 'null'
                      status:
                        allOf:
                          - additionalProperties: false
                            anyOf:
                              - const: 'active'
                                type: 'string'
                              - const: 'abandoned'
                                type: 'string'
                              - const: 'complete'
                                type: 'string'
                          - anyOf:
                              - const: 'active'
                                type: 'string'
                              - const: 'abandoned'
                                type: 'string'
                              - const: 'complete'
                                type: 'string'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'ownerId'
                      - 'currency'
                      - 'interval'
                      - 'intervalCount'
                      - 'status'
                      - 'createdAt'
                      - 'updatedAt'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
            subscriptions:
              additionalProperties: false
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    additionalProperties: false
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      stripeSubscriptionId:
                        type:
                          - 'string'
                          - 'null'
                      ownerId:
                        type: 'string'
                      status:
                        type: 'string'
                      customerId:
                        type:
                          - 'string'
                          - 'null'
                      interval:
                        allOf:
                          - anyOf:
                              - type: 'null'
                              - additionalProperties: false
                                anyOf:
                                  - const: 'day'
                                    type: 'string'
                                  - const: 'week'
                                    type: 'string'
                                  - const: 'month'
                                    type: 'string'
                                  - const: 'year'
                                    type: 'string'
                          - anyOf:
                              - type: 'null'
                              - anyOf:
                                  - const: 'day'
                                    type: 'string'
                                  - const: 'week'
                                    type: 'string'
                                  - const: 'month'
                                    type: 'string'
                                  - const: 'year'
                                    type: 'string'
                      intervalCount:
                        type:
                          - 'integer'
                          - 'null'
                      currencyShortCode:
                        type:
                          - 'string'
                          - 'null'
                      cancelAtPeriodEnd:
                        type: 'boolean'
                      isPerpetual:
                        type: 'boolean'
                      isSalableOnly:
                        type: 'boolean'
                      startDate:
                        type: 'string'
                      cancelledAt:
                        type:
                          - 'string'
                          - 'null'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'stripeSubscriptionId'
                      - 'ownerId'
                      - 'status'
                      - 'customerId'
                      - 'interval'
                      - 'intervalCount'
                      - 'currencyShortCode'
                      - 'cancelAtPeriodEnd'
                      - 'isPerpetual'
                      - 'isSalableOnly'
                      - 'startDate'
                      - 'cancelledAt'
                      - 'createdAt'
                      - 'updatedAt'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
            groups:
              additionalProperties: false
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    additionalProperties: false
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      ownerId:
                        type: 'string'
                      name:
                        type:
                          - 'string'
                          - 'null'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'ownerId'
                      - 'name'
                      - 'createdAt'
                      - 'updatedAt'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
          required:
            - 'id'
            - 'organisation'
            - 'value'
            - 'stripeCustomerId'
            - 'emailAddress'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetPaymentIntegrationListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              accountId:
                type:
                  - 'string'
                  - 'null'
              country:
                type:
                  - 'string'
                  - 'null'
              status:
                additionalProperties: false
                anyOf:
                  - const: 'pending'
                    type: 'string'
                  - const: 'active'
                    type: 'string'
                  - const: 'cancelled'
                    type: 'string'
              organisation:
                type: 'string'
              accountType:
                additionalProperties: false
                anyOf:
                  - const: 'oauth'
                    type: 'string'
                  - const: 'standard'
                    type: 'string'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
            required:
              - 'id'
              - 'accountId'
              - 'country'
              - 'status'
              - 'organisation'
              - 'accountType'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GenerateOnboardingLinkResponseSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            url:
              type: 'string'
          required:
            - 'url'
      required:
        - 'type'
        - 'data'
    GetPriceListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              stripePriceId:
                type: 'string'
              interval:
                allOf:
                  - anyOf:
                      - type: 'null'
                      - additionalProperties: false
                        anyOf:
                          - const: 'day'
                            type: 'string'
                          - const: 'week'
                            type: 'string'
                          - const: 'month'
                            type: 'string'
                          - const: 'year'
                            type: 'string'
                  - anyOf:
                      - type: 'null'
                      - anyOf:
                          - const: 'day'
                            type: 'string'
                          - const: 'week'
                            type: 'string'
                          - const: 'month'
                            type: 'string'
                          - const: 'year'
                            type: 'string'
              intervalCount:
                type:
                  - 'integer'
                  - 'null'
              lineItemId:
                type: 'string'
              archivedAt:
                type:
                  - 'string'
                  - 'null'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
            required:
              - 'id'
              - 'organisation'
              - 'stripePriceId'
              - 'interval'
              - 'intervalCount'
              - 'lineItemId'
              - 'archivedAt'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetPriceDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            stripePriceId:
              type: 'string'
            interval:
              allOf:
                - anyOf:
                    - type: 'null'
                    - additionalProperties: false
                      anyOf:
                        - const: 'day'
                          type: 'string'
                        - const: 'week'
                          type: 'string'
                        - const: 'month'
                          type: 'string'
                        - const: 'year'
                          type: 'string'
                - anyOf:
                    - type: 'null'
                    - anyOf:
                        - const: 'day'
                          type: 'string'
                        - const: 'week'
                          type: 'string'
                        - const: 'month'
                          type: 'string'
                        - const: 'year'
                          type: 'string'
            intervalCount:
              type:
                - 'integer'
                - 'null'
            lineItemId:
              type: 'string'
            archivedAt:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'organisation'
            - 'stripePriceId'
            - 'interval'
            - 'intervalCount'
            - 'lineItemId'
            - 'archivedAt'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetReceiptListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              ownerId:
                type: 'string'
              subscriptionId:
                type:
                  - 'string'
                  - 'null'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
              owner:
                additionalProperties: false
                type: 'object'
                properties:
                  id:
                    type: 'string'
                  organisation:
                    type: 'string'
                  value:
                    type: 'string'
                  stripeCustomerId:
                    type:
                      - 'string'
                      - 'null'
                  emailAddress:
                    type:
                      - 'string'
                      - 'null'
                  createdAt:
                    type: 'string'
                  updatedAt:
                    type: 'string'
                required:
                  - 'id'
                  - 'organisation'
                  - 'value'
                  - 'stripeCustomerId'
                  - 'emailAddress'
                  - 'createdAt'
                  - 'updatedAt'
            required:
              - 'id'
              - 'organisation'
              - 'ownerId'
              - 'subscriptionId'
              - 'createdAt'
              - 'updatedAt'
        previousCursor:
          type:
            - 'string'
            - 'null'
        nextCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'previousCursor'
        - 'nextCursor'
        - 'hasMore'
    GetReceiptDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            ownerId:
              type: 'string'
            subscriptionId:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            owner:
              additionalProperties: false
              type: 'object'
              properties:
                id:
                  type: 'string'
                organisation:
                  type: 'string'
                value:
                  type: 'string'
                stripeCustomerId:
                  type:
                    - 'string'
                    - 'null'
                emailAddress:
                  type:
                    - 'string'
                    - 'null'
                createdAt:
                  type: 'string'
                updatedAt:
                  type: 'string'
              required:
                - 'id'
                - 'organisation'
                - 'value'
                - 'stripeCustomerId'
                - 'emailAddress'
                - 'createdAt'
                - 'updatedAt'
            receiptItems:
              additionalProperties: false
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      quantity:
                        type: 'integer'
                      organisation:
                        type: 'string'
                      lineItemStripeProductId:
                        type: 'string'
                      receiptId:
                        type: 'string'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                      lineItem:
                        additionalProperties: false
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          name:
                            type: 'string'
                          slug:
                            type: 'string'
                          stripeProductId:
                            type: 'string'
                          meterId:
                            type:
                              - 'string'
                              - 'null'
                          nickname:
                            type: 'string'
                          priceType:
                            allOf:
                              - additionalProperties: false
                                anyOf:
                                  - const: 'metered'
                                    type: 'string'
                                  - const: 'per_seat'
                                    type: 'string'
                                  - const: 'flat_rate'
                                    type: 'string'
                              - anyOf:
                                  - const: 'metered'
                                    type: 'string'
                                  - const: 'per_seat'
                                    type: 'string'
                                  - const: 'flat_rate'
                                    type: 'string'
                          intervalType:
                            allOf:
                              - additionalProperties: false
                                anyOf:
                                  - const: 'one_off'
                                    type: 'string'
                                  - const: 'recurring'
                                    type: 'string'
                              - anyOf:
                                  - const: 'one_off'
                                    type: 'string'
                                  - const: 'recurring'
                                    type: 'string'
                          billingScheme:
                            allOf:
                              - additionalProperties: false
                                anyOf:
                                  - const: 'fixed'
                                    type: 'string'
                                  - const: 'per_unit'
                                    type: 'string'
                                  - const: 'tiered'
                                    type: 'string'
                                  - const: 'flat_rate'
                                    type: 'string'
                              - anyOf:
                                  - const: 'flat_rate'
                                    type: 'string'
                                  - const: 'fixed'
                                    type: 'string'
                                  - const: 'per_unit'
                                    type: 'string'
                                  - const: 'tiered'
                                    type: 'string'
                          tiersMode:
                            allOf:
                              - anyOf:
                                  - type: 'null'
                                  - additionalProperties: false
                                    anyOf:
                                      - const: 'graduated'
                                        type: 'string'
                                      - const: 'volume'
                                        type: 'string'
                              - anyOf:
                                  - type: 'null'
                                  - anyOf:
                                      - const: 'graduated'
                                        type: 'string'
                                      - const: 'volume'
                                        type: 'string'
                          minQuantity:
                            type: 'integer'
                          maxQuantity:
                            type: 'integer'
                          isActive:
                            type: 'boolean'
                          planId:
                            type: 'string'
                          allowChangingQuantity:
                            type: 'boolean'
                          archivedAt:
                            type:
                              - 'string'
                              - 'null'
                          unitLabel:
                            type:
                              - 'string'
                              - 'null'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'name'
                          - 'slug'
                          - 'stripeProductId'
                          - 'meterId'
                          - 'nickname'
                          - 'priceType'
                          - 'intervalType'
                          - 'billingScheme'
                          - 'tiersMode'
                          - 'minQuantity'
                          - 'maxQuantity'
                          - 'isActive'
                          - 'planId'
                          - 'allowChangingQuantity'
                          - 'archivedAt'
                          - 'unitLabel'
                          - 'createdAt'
                          - 'updatedAt'
                    required:
                      - 'id'
                      - 'quantity'
                      - 'organisation'
                      - 'lineItemStripeProductId'
                      - 'receiptId'
                      - 'createdAt'
                      - 'updatedAt'
                      - 'lineItem'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
          required:
            - 'id'
            - 'organisation'
            - 'ownerId'
            - 'subscriptionId'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    BatchReceiptActionsResponseSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            total:
              type: 'number'
            succeeded:
              type: 'number'
            failed:
              type: 'number'
            skipped:
              type: 'number'
            results:
              type: 'array'
              items:
                additionalProperties: false
                type: 'object'
                properties:
                  id:
                    type: 'string'
                  status:
                    anyOf:
                      - const: 'succeeded'
                        type: 'string'
                      - const: 'failed'
                        type: 'string'
                      - const: 'skipped'
                        type: 'string'
                  reason:
                    type: 'string'
                required:
                  - 'id'
                  - 'status'
          required:
            - 'total'
            - 'succeeded'
            - 'failed'
            - 'skipped'
            - 'results'
      required:
        - 'type'
        - 'data'
    GetSigningKeySchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            publicKey: {}
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'organisation'
            - 'publicKey'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    CreateAccountSessionResponseSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            clientSecret:
              type: 'string'
          required:
            - 'clientSecret'
      required:
        - 'type'
        - 'data'
    GetSubscriptionDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            stripeSubscriptionId:
              type:
                - 'string'
                - 'null'
            ownerId:
              type: 'string'
            status:
              type: 'string'
            customerId:
              type:
                - 'string'
                - 'null'
            interval:
              allOf:
                - anyOf:
                    - type: 'null'
                    - additionalProperties: false
                      anyOf:
                        - const: 'day'
                          type: 'string'
                        - const: 'week'
                          type: 'string'
                        - const: 'month'
                          type: 'string'
                        - const: 'year'
                          type: 'string'
                - anyOf:
                    - type: 'null'
                    - anyOf:
                        - const: 'day'
                          type: 'string'
                        - const: 'week'
                          type: 'string'
                        - const: 'month'
                          type: 'string'
                        - const: 'year'
                          type: 'string'
            intervalCount:
              type:
                - 'integer'
                - 'null'
            currencyShortCode:
              type:
                - 'string'
                - 'null'
            cancelAtPeriodEnd:
              type: 'boolean'
            isPerpetual:
              type: 'boolean'
            isSalableOnly:
              type: 'boolean'
            startDate:
              type: 'string'
            cancelledAt:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            subscriptionPlans:
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      ownerId:
                        type: 'string'
                      groupId:
                        type: 'string'
                      subscriptionId:
                        type: 'string'
                      planId:
                        type:
                          - 'string'
                          - 'null'
                      seats:
                        type: 'integer'
                      status:
                        allOf:
                          - additionalProperties: false
                            anyOf:
                              - const: 'active'
                                type: 'string'
                              - const: 'inactive'
                                type: 'string'
                          - anyOf:
                              - const: 'active'
                                type: 'string'
                              - const: 'inactive'
                                type: 'string'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                      plan:
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          name:
                            type: 'string'
                          isActive:
                            type: 'boolean'
                          productId:
                            type: 'string'
                          tierTagId:
                            anyOf: &ref_4
                              - type: 'null'
                              - type: 'string'
                          trialPeriodDays:
                            anyOf: &ref_5
                              - type: 'null'
                              - type: 'integer'
                          archivedAt:
                            anyOf: &ref_6
                              - type: 'null'
                              - type: 'string'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                          tierTag:
                            anyOf:
                              - type: 'null'
                              - &ref_7
                                additionalProperties: false
                                type: 'object'
                                properties: *ref_0
                                required: *ref_1
                        required:
                          - 'id'
                          - 'organisation'
                          - 'name'
                          - 'isActive'
                          - 'productId'
                          - 'tierTagId'
                          - 'trialPeriodDays'
                          - 'archivedAt'
                          - 'createdAt'
                          - 'updatedAt'
                          - 'tierTag'
                        type:
                          - 'object'
                          - 'null'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'ownerId'
                      - 'groupId'
                      - 'subscriptionId'
                      - 'planId'
                      - 'seats'
                      - 'status'
                      - 'createdAt'
                      - 'updatedAt'
                      - 'plan'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
            owner:
              additionalProperties: false
              type: 'object'
              properties:
                id:
                  type: 'string'
                organisation:
                  type: 'string'
                value:
                  type: 'string'
                stripeCustomerId:
                  type:
                    - 'string'
                    - 'null'
                emailAddress:
                  type:
                    - 'string'
                    - 'null'
                createdAt:
                  type: 'string'
                updatedAt:
                  type: 'string'
              required:
                - 'id'
                - 'organisation'
                - 'value'
                - 'stripeCustomerId'
                - 'emailAddress'
                - 'createdAt'
                - 'updatedAt'
          required:
            - 'id'
            - 'organisation'
            - 'stripeSubscriptionId'
            - 'ownerId'
            - 'status'
            - 'customerId'
            - 'interval'
            - 'intervalCount'
            - 'currencyShortCode'
            - 'cancelAtPeriodEnd'
            - 'isPerpetual'
            - 'isSalableOnly'
            - 'startDate'
            - 'cancelledAt'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    CreatePortalResponseSchema:
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            url:
              type: 'string'
          required:
            - 'url'
      required:
        - 'type'
        - 'data'
    BatchSubscriptionActionsResponseSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            total:
              type: 'number'
            succeeded:
              type: 'number'
            failed:
              type: 'number'
            skipped:
              type: 'number'
            results:
              type: 'array'
              items:
                additionalProperties: false
                type: 'object'
                properties:
                  id:
                    type: 'string'
                  status:
                    anyOf:
                      - const: 'succeeded'
                        type: 'string'
                      - const: 'failed'
                        type: 'string'
                      - const: 'skipped'
                        type: 'string'
                  reason:
                    type: 'string'
                required:
                  - 'id'
                  - 'status'
          required:
            - 'total'
            - 'succeeded'
            - 'failed'
            - 'skipped'
            - 'results'
      required:
        - 'type'
        - 'data'
    GetSubscriptionListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              stripeSubscriptionId:
                type:
                  - 'string'
                  - 'null'
              ownerId:
                type: 'string'
              status:
                type: 'string'
              customerId:
                type:
                  - 'string'
                  - 'null'
              interval:
                allOf:
                  - anyOf:
                      - type: 'null'
                      - additionalProperties: false
                        anyOf:
                          - const: 'day'
                            type: 'string'
                          - const: 'week'
                            type: 'string'
                          - const: 'month'
                            type: 'string'
                          - const: 'year'
                            type: 'string'
                  - anyOf:
                      - type: 'null'
                      - anyOf:
                          - const: 'day'
                            type: 'string'
                          - const: 'week'
                            type: 'string'
                          - const: 'month'
                            type: 'string'
                          - const: 'year'
                            type: 'string'
              intervalCount:
                type:
                  - 'integer'
                  - 'null'
              currencyShortCode:
                type:
                  - 'string'
                  - 'null'
              cancelAtPeriodEnd:
                type: 'boolean'
              isPerpetual:
                type: 'boolean'
              isSalableOnly:
                type: 'boolean'
              startDate:
                type: 'string'
              cancelledAt:
                type:
                  - 'string'
                  - 'null'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
              subscriptionPlans:
                type: 'object'
                properties:
                  type:
                    const: 'list'
                    type: 'string'
                  data:
                    type: 'array'
                    items:
                      type: 'object'
                      properties:
                        id:
                          type: 'string'
                        organisation:
                          type: 'string'
                        ownerId:
                          type: 'string'
                        groupId:
                          type: 'string'
                        subscriptionId:
                          type: 'string'
                        planId:
                          type:
                            - 'string'
                            - 'null'
                        seats:
                          type: 'integer'
                        status:
                          allOf:
                            - additionalProperties: false
                              anyOf:
                                - const: 'active'
                                  type: 'string'
                                - const: 'inactive'
                                  type: 'string'
                            - anyOf:
                                - const: 'active'
                                  type: 'string'
                                - const: 'inactive'
                                  type: 'string'
                        createdAt:
                          type: 'string'
                        updatedAt:
                          type: 'string'
                        plan:
                          properties:
                            id:
                              type: 'string'
                            organisation:
                              type: 'string'
                            name:
                              type: 'string'
                            isActive:
                              type: 'boolean'
                            productId:
                              type: 'string'
                            tierTagId:
                              anyOf: *ref_4
                            trialPeriodDays:
                              anyOf: *ref_5
                            archivedAt:
                              anyOf: *ref_6
                            createdAt:
                              type: 'string'
                            updatedAt:
                              type: 'string'
                            tierTag:
                              anyOf:
                                - type: 'null'
                                - *ref_7
                          required:
                            - 'id'
                            - 'organisation'
                            - 'name'
                            - 'isActive'
                            - 'productId'
                            - 'tierTagId'
                            - 'trialPeriodDays'
                            - 'archivedAt'
                            - 'createdAt'
                            - 'updatedAt'
                            - 'tierTag'
                          type:
                            - 'object'
                            - 'null'
                      required:
                        - 'id'
                        - 'organisation'
                        - 'ownerId'
                        - 'groupId'
                        - 'subscriptionId'
                        - 'planId'
                        - 'seats'
                        - 'status'
                        - 'createdAt'
                        - 'updatedAt'
                        - 'plan'
                  hasMore:
                    type: 'boolean'
                  path:
                    type:
                      - 'string'
                      - 'null'
                required:
                  - 'type'
                  - 'data'
                  - 'hasMore'
                  - 'path'
              owner:
                additionalProperties: false
                type: 'object'
                properties:
                  id:
                    type: 'string'
                  organisation:
                    type: 'string'
                  value:
                    type: 'string'
                  stripeCustomerId:
                    type:
                      - 'string'
                      - 'null'
                  emailAddress:
                    type:
                      - 'string'
                      - 'null'
                  createdAt:
                    type: 'string'
                  updatedAt:
                    type: 'string'
                required:
                  - 'id'
                  - 'organisation'
                  - 'value'
                  - 'stripeCustomerId'
                  - 'emailAddress'
                  - 'createdAt'
                  - 'updatedAt'
            required:
              - 'id'
              - 'organisation'
              - 'stripeSubscriptionId'
              - 'ownerId'
              - 'status'
              - 'customerId'
              - 'interval'
              - 'intervalCount'
              - 'currencyShortCode'
              - 'cancelAtPeriodEnd'
              - 'isPerpetual'
              - 'isSalableOnly'
              - 'startDate'
              - 'cancelledAt'
              - 'createdAt'
              - 'updatedAt'
        previousCursor:
          type:
            - 'string'
            - 'null'
        nextCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'previousCursor'
        - 'nextCursor'
        - 'hasMore'
    GetSubscriptionPlanListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              ownerId:
                type: 'string'
              groupId:
                type: 'string'
              subscriptionId:
                type: 'string'
              planId:
                type:
                  - 'string'
                  - 'null'
              seats:
                type: 'integer'
              status:
                allOf:
                  - additionalProperties: false
                    anyOf:
                      - const: 'active'
                        type: 'string'
                      - const: 'inactive'
                        type: 'string'
                  - anyOf:
                      - const: 'active'
                        type: 'string'
                      - const: 'inactive'
                        type: 'string'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
              subscriptionPlanLineItems:
                additionalProperties: false
                type: 'object'
                properties:
                  type:
                    const: 'list'
                    type: 'string'
                  data:
                    type: 'array'
                    items:
                      type: 'object'
                      properties:
                        id:
                          type: 'string'
                        organisation:
                          type: 'string'
                        subscriptionPlanId:
                          type: 'string'
                        lineItemStripeProductId:
                          type: 'string'
                        type:
                          allOf:
                            - additionalProperties: false
                              anyOf:
                                - const: 'unit'
                                  type: 'string'
                                - const: 'metered'
                                  type: 'string'
                            - anyOf:
                                - const: 'unit'
                                  type: 'string'
                                - const: 'metered'
                                  type: 'string'
                        quantity:
                          type: 'integer'
                        usageId:
                          type:
                            - 'string'
                            - 'null'
                        stripeSubscriptionItemId:
                          type:
                            - 'string'
                            - 'null'
                        stripePriceId:
                          type:
                            - 'string'
                            - 'null'
                        expiryDate:
                          type:
                            - 'string'
                            - 'null'
                        createdAt:
                          type: 'string'
                        updatedAt:
                          type: 'string'
                        lineItem:
                          additionalProperties: false
                          type: 'object'
                          properties:
                            id:
                              type: 'string'
                            organisation:
                              type: 'string'
                            name:
                              type: 'string'
                            slug:
                              type: 'string'
                            stripeProductId:
                              type: 'string'
                            meterId:
                              type:
                                - 'string'
                                - 'null'
                            nickname:
                              type: 'string'
                            priceType:
                              allOf:
                                - additionalProperties: false
                                  anyOf:
                                    - const: 'metered'
                                      type: 'string'
                                    - const: 'per_seat'
                                      type: 'string'
                                    - const: 'flat_rate'
                                      type: 'string'
                                - anyOf:
                                    - const: 'metered'
                                      type: 'string'
                                    - const: 'per_seat'
                                      type: 'string'
                                    - const: 'flat_rate'
                                      type: 'string'
                            intervalType:
                              allOf:
                                - additionalProperties: false
                                  anyOf:
                                    - const: 'one_off'
                                      type: 'string'
                                    - const: 'recurring'
                                      type: 'string'
                                - anyOf:
                                    - const: 'one_off'
                                      type: 'string'
                                    - const: 'recurring'
                                      type: 'string'
                            billingScheme:
                              allOf:
                                - additionalProperties: false
                                  anyOf:
                                    - const: 'fixed'
                                      type: 'string'
                                    - const: 'per_unit'
                                      type: 'string'
                                    - const: 'tiered'
                                      type: 'string'
                                    - const: 'flat_rate'
                                      type: 'string'
                                - anyOf:
                                    - const: 'flat_rate'
                                      type: 'string'
                                    - const: 'fixed'
                                      type: 'string'
                                    - const: 'per_unit'
                                      type: 'string'
                                    - const: 'tiered'
                                      type: 'string'
                            tiersMode:
                              allOf:
                                - anyOf:
                                    - type: 'null'
                                    - additionalProperties: false
                                      anyOf:
                                        - const: 'graduated'
                                          type: 'string'
                                        - const: 'volume'
                                          type: 'string'
                                - anyOf:
                                    - type: 'null'
                                    - anyOf:
                                        - const: 'graduated'
                                          type: 'string'
                                        - const: 'volume'
                                          type: 'string'
                            minQuantity:
                              type: 'integer'
                            maxQuantity:
                              type: 'integer'
                            isActive:
                              type: 'boolean'
                            planId:
                              type: 'string'
                            allowChangingQuantity:
                              type: 'boolean'
                            archivedAt:
                              type:
                                - 'string'
                                - 'null'
                            unitLabel:
                              type:
                                - 'string'
                                - 'null'
                            createdAt:
                              type: 'string'
                            updatedAt:
                              type: 'string'
                          required:
                            - 'id'
                            - 'organisation'
                            - 'name'
                            - 'slug'
                            - 'stripeProductId'
                            - 'meterId'
                            - 'nickname'
                            - 'priceType'
                            - 'intervalType'
                            - 'billingScheme'
                            - 'tiersMode'
                            - 'minQuantity'
                            - 'maxQuantity'
                            - 'isActive'
                            - 'planId'
                            - 'allowChangingQuantity'
                            - 'archivedAt'
                            - 'unitLabel'
                            - 'createdAt'
                            - 'updatedAt'
                      required:
                        - 'id'
                        - 'organisation'
                        - 'subscriptionPlanId'
                        - 'lineItemStripeProductId'
                        - 'type'
                        - 'quantity'
                        - 'usageId'
                        - 'stripeSubscriptionItemId'
                        - 'stripePriceId'
                        - 'expiryDate'
                        - 'createdAt'
                        - 'updatedAt'
                        - 'lineItem'
                  hasMore:
                    type: 'boolean'
                  path:
                    type: 'string'
                required:
                  - 'type'
                  - 'data'
                  - 'hasMore'
                  - 'path'
              plan:
                additionalProperties: false
                type: 'object'
                properties:
                  id:
                    type: 'string'
                  organisation:
                    type: 'string'
                  name:
                    type: 'string'
                  isActive:
                    type: 'boolean'
                  productId:
                    type: 'string'
                  tierTagId:
                    type:
                      - 'string'
                      - 'null'
                  trialPeriodDays:
                    type:
                      - 'integer'
                      - 'null'
                  archivedAt:
                    type:
                      - 'string'
                      - 'null'
                  createdAt:
                    type: 'string'
                  updatedAt:
                    type: 'string'
                required:
                  - 'id'
                  - 'organisation'
                  - 'name'
                  - 'isActive'
                  - 'productId'
                  - 'tierTagId'
                  - 'trialPeriodDays'
                  - 'archivedAt'
                  - 'createdAt'
                  - 'updatedAt'
            required:
              - 'id'
              - 'organisation'
              - 'ownerId'
              - 'groupId'
              - 'subscriptionId'
              - 'planId'
              - 'seats'
              - 'status'
              - 'createdAt'
              - 'updatedAt'
        previousCursor:
          type:
            - 'string'
            - 'null'
        nextCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'previousCursor'
        - 'nextCursor'
        - 'hasMore'
    GetSubscriptionPlanDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            ownerId:
              type: 'string'
            groupId:
              type: 'string'
            subscriptionId:
              type: 'string'
            planId:
              type:
                - 'string'
                - 'null'
            seats:
              type: 'integer'
            status:
              allOf:
                - additionalProperties: false
                  anyOf:
                    - const: 'active'
                      type: 'string'
                    - const: 'inactive'
                      type: 'string'
                - anyOf:
                    - const: 'active'
                      type: 'string'
                    - const: 'inactive'
                      type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            owner:
              additionalProperties: false
              type: 'object'
              properties:
                id:
                  type: 'string'
                organisation:
                  type: 'string'
                value:
                  type: 'string'
                stripeCustomerId:
                  type:
                    - 'string'
                    - 'null'
                emailAddress:
                  type:
                    - 'string'
                    - 'null'
                createdAt:
                  type: 'string'
                updatedAt:
                  type: 'string'
              required:
                - 'id'
                - 'organisation'
                - 'value'
                - 'stripeCustomerId'
                - 'emailAddress'
                - 'createdAt'
                - 'updatedAt'
            group:
              additionalProperties: false
              type: 'object'
              properties:
                id:
                  type: 'string'
                organisation:
                  type: 'string'
                ownerId:
                  type: 'string'
                name:
                  type:
                    - 'string'
                    - 'null'
                createdAt:
                  type: 'string'
                updatedAt:
                  type: 'string'
              required:
                - 'id'
                - 'organisation'
                - 'ownerId'
                - 'name'
                - 'createdAt'
                - 'updatedAt'
            subscription:
              additionalProperties: false
              type: 'object'
              properties:
                id:
                  type: 'string'
                organisation:
                  type: 'string'
                stripeSubscriptionId:
                  type:
                    - 'string'
                    - 'null'
                ownerId:
                  type: 'string'
                status:
                  type: 'string'
                customerId:
                  type:
                    - 'string'
                    - 'null'
                interval:
                  allOf:
                    - anyOf:
                        - type: 'null'
                        - additionalProperties: false
                          anyOf:
                            - const: 'day'
                              type: 'string'
                            - const: 'week'
                              type: 'string'
                            - const: 'month'
                              type: 'string'
                            - const: 'year'
                              type: 'string'
                    - anyOf:
                        - type: 'null'
                        - anyOf:
                            - const: 'day'
                              type: 'string'
                            - const: 'week'
                              type: 'string'
                            - const: 'month'
                              type: 'string'
                            - const: 'year'
                              type: 'string'
                intervalCount:
                  type:
                    - 'integer'
                    - 'null'
                currencyShortCode:
                  type:
                    - 'string'
                    - 'null'
                cancelAtPeriodEnd:
                  type: 'boolean'
                isPerpetual:
                  type: 'boolean'
                isSalableOnly:
                  type: 'boolean'
                startDate:
                  type: 'string'
                cancelledAt:
                  type:
                    - 'string'
                    - 'null'
                createdAt:
                  type: 'string'
                updatedAt:
                  type: 'string'
              required:
                - 'id'
                - 'organisation'
                - 'stripeSubscriptionId'
                - 'ownerId'
                - 'status'
                - 'customerId'
                - 'interval'
                - 'intervalCount'
                - 'currencyShortCode'
                - 'cancelAtPeriodEnd'
                - 'isPerpetual'
                - 'isSalableOnly'
                - 'startDate'
                - 'cancelledAt'
                - 'createdAt'
                - 'updatedAt'
            plan:
              properties: &ref_10
                id:
                  type: 'string'
                organisation:
                  type: 'string'
                name:
                  type: 'string'
                isActive:
                  type: 'boolean'
                productId:
                  type: 'string'
                tierTagId:
                  anyOf: *ref_4
                trialPeriodDays:
                  anyOf: *ref_5
                archivedAt:
                  anyOf: *ref_6
                createdAt:
                  type: 'string'
                updatedAt:
                  type: 'string'
                entitlements:
                  type: 'object'
                  properties:
                    type:
                      const: 'list'
                      type: 'string'
                    data:
                      type: 'array'
                      items:
                        additionalProperties: false
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          name:
                            type: 'string'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'name'
                          - 'createdAt'
                          - 'updatedAt'
                    hasMore:
                      type: 'boolean'
                    path:
                      type: 'string'
                  required:
                    - 'type'
                    - 'data'
                    - 'hasMore'
                    - 'path'
              required: &ref_11
                - 'id'
                - 'organisation'
                - 'name'
                - 'isActive'
                - 'productId'
                - 'tierTagId'
                - 'trialPeriodDays'
                - 'archivedAt'
                - 'createdAt'
                - 'updatedAt'
                - 'entitlements'
              type:
                - 'object'
                - 'null'
            subscriptionPlanLineItems:
              additionalProperties: false
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      subscriptionPlanId:
                        type: 'string'
                      lineItemStripeProductId:
                        type: 'string'
                      type:
                        allOf:
                          - additionalProperties: false
                            anyOf:
                              - const: 'unit'
                                type: 'string'
                              - const: 'metered'
                                type: 'string'
                          - anyOf:
                              - const: 'unit'
                                type: 'string'
                              - const: 'metered'
                                type: 'string'
                      quantity:
                        type: 'integer'
                      usageId:
                        type:
                          - 'string'
                          - 'null'
                      stripeSubscriptionItemId:
                        type:
                          - 'string'
                          - 'null'
                      stripePriceId:
                        type:
                          - 'string'
                          - 'null'
                      expiryDate:
                        type:
                          - 'string'
                          - 'null'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                      lineItem:
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          name:
                            type: 'string'
                          slug:
                            type: 'string'
                          stripeProductId:
                            type: 'string'
                          meterId:
                            type:
                              - 'string'
                              - 'null'
                          nickname:
                            type: 'string'
                          priceType:
                            allOf:
                              - additionalProperties: false
                                anyOf:
                                  - const: 'metered'
                                    type: 'string'
                                  - const: 'per_seat'
                                    type: 'string'
                                  - const: 'flat_rate'
                                    type: 'string'
                              - anyOf:
                                  - const: 'metered'
                                    type: 'string'
                                  - const: 'per_seat'
                                    type: 'string'
                                  - const: 'flat_rate'
                                    type: 'string'
                          intervalType:
                            allOf:
                              - additionalProperties: false
                                anyOf:
                                  - const: 'one_off'
                                    type: 'string'
                                  - const: 'recurring'
                                    type: 'string'
                              - anyOf:
                                  - const: 'one_off'
                                    type: 'string'
                                  - const: 'recurring'
                                    type: 'string'
                          billingScheme:
                            allOf:
                              - additionalProperties: false
                                anyOf:
                                  - const: 'fixed'
                                    type: 'string'
                                  - const: 'per_unit'
                                    type: 'string'
                                  - const: 'tiered'
                                    type: 'string'
                                  - const: 'flat_rate'
                                    type: 'string'
                              - anyOf:
                                  - const: 'flat_rate'
                                    type: 'string'
                                  - const: 'fixed'
                                    type: 'string'
                                  - const: 'per_unit'
                                    type: 'string'
                                  - const: 'tiered'
                                    type: 'string'
                          tiersMode:
                            allOf:
                              - anyOf:
                                  - type: 'null'
                                  - additionalProperties: false
                                    anyOf:
                                      - const: 'graduated'
                                        type: 'string'
                                      - const: 'volume'
                                        type: 'string'
                              - anyOf:
                                  - type: 'null'
                                  - anyOf:
                                      - const: 'graduated'
                                        type: 'string'
                                      - const: 'volume'
                                        type: 'string'
                          minQuantity:
                            type: 'integer'
                          maxQuantity:
                            type: 'integer'
                          isActive:
                            type: 'boolean'
                          planId:
                            type: 'string'
                          allowChangingQuantity:
                            type: 'boolean'
                          archivedAt:
                            type:
                              - 'string'
                              - 'null'
                          unitLabel:
                            type:
                              - 'string'
                              - 'null'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                          meter:
                            additionalProperties: false
                            properties: *ref_2
                            required: *ref_3
                            type:
                              - 'object'
                              - 'null'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'name'
                          - 'slug'
                          - 'stripeProductId'
                          - 'meterId'
                          - 'nickname'
                          - 'priceType'
                          - 'intervalType'
                          - 'billingScheme'
                          - 'tiersMode'
                          - 'minQuantity'
                          - 'maxQuantity'
                          - 'isActive'
                          - 'planId'
                          - 'allowChangingQuantity'
                          - 'archivedAt'
                          - 'unitLabel'
                          - 'createdAt'
                          - 'updatedAt'
                          - 'meter'
                      usage:
                        properties: &ref_12
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          ownerId:
                            type: 'string'
                          meterSlug:
                            type: 'string'
                          stripeSubscriptionItemId:
                            anyOf:
                              - type: 'null'
                              - type: 'string'
                          inactiveAt:
                            anyOf:
                              - type: 'null'
                              - type: 'string'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                          records:
                            type: 'object'
                            properties:
                              type:
                                const: 'list'
                                type: 'string'
                              data:
                                type: 'array'
                                items:
                                  additionalProperties: false
                                  type: 'object'
                                  properties:
                                    id:
                                      type: 'string'
                                    organisation:
                                      type: 'string'
                                    ownerId:
                                      type: 'string'
                                    usageId:
                                      type: 'string'
                                    status:
                                      allOf:
                                        - additionalProperties: false
                                          anyOf:
                                            - const: 'recorded'
                                              type: 'string'
                                            - const: 'current'
                                              type: 'string'
                                            - const: 'final'
                                              type: 'string'
                                        - anyOf:
                                            - const: 'current'
                                              type: 'string'
                                            - const: 'recorded'
                                              type: 'string'
                                            - const: 'final'
                                              type: 'string'
                                    count:
                                      type: 'integer'
                                    recordedAt:
                                      anyOf:
                                        - type: 'null'
                                        - type: 'string'
                                    createdAt:
                                      type: 'string'
                                    updatedAt:
                                      type: 'string'
                                  required:
                                    - 'id'
                                    - 'organisation'
                                    - 'ownerId'
                                    - 'usageId'
                                    - 'status'
                                    - 'count'
                                    - 'recordedAt'
                                    - 'createdAt'
                                    - 'updatedAt'
                              hasMore:
                                type: 'boolean'
                              path:
                                type: 'string'
                            required:
                              - 'type'
                              - 'data'
                              - 'hasMore'
                              - 'path'
                        required: &ref_13
                          - 'id'
                          - 'organisation'
                          - 'ownerId'
                          - 'meterSlug'
                          - 'stripeSubscriptionItemId'
                          - 'inactiveAt'
                          - 'createdAt'
                          - 'updatedAt'
                          - 'records'
                        type:
                          - 'object'
                          - 'null'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'subscriptionPlanId'
                      - 'lineItemStripeProductId'
                      - 'type'
                      - 'quantity'
                      - 'usageId'
                      - 'stripeSubscriptionItemId'
                      - 'stripePriceId'
                      - 'expiryDate'
                      - 'createdAt'
                      - 'updatedAt'
                      - 'lineItem'
                      - 'usage'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
          required:
            - 'id'
            - 'organisation'
            - 'ownerId'
            - 'groupId'
            - 'subscriptionId'
            - 'planId'
            - 'seats'
            - 'status'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetSubscriptionPlanLineItemSchema:
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            subscriptionPlanId:
              type: 'string'
            lineItemStripeProductId:
              type: 'string'
            type:
              allOf:
                - additionalProperties: false
                  anyOf:
                    - const: 'unit'
                      type: 'string'
                    - const: 'metered'
                      type: 'string'
                - anyOf:
                    - const: 'unit'
                      type: 'string'
                    - const: 'metered'
                      type: 'string'
            quantity:
              type: 'integer'
            usageId:
              type:
                - 'string'
                - 'null'
            stripeSubscriptionItemId:
              type:
                - 'string'
                - 'null'
            stripePriceId:
              type:
                - 'string'
                - 'null'
            expiryDate:
              type:
                - 'string'
                - 'null'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            subscriptionPlan:
              type: 'object'
              properties:
                id:
                  type: 'string'
                organisation:
                  type: 'string'
                ownerId:
                  type: 'string'
                groupId:
                  type: 'string'
                subscriptionId:
                  type: 'string'
                planId:
                  type:
                    - 'string'
                    - 'null'
                seats:
                  type: 'integer'
                status:
                  allOf:
                    - additionalProperties: false
                      anyOf:
                        - const: 'active'
                          type: 'string'
                        - const: 'inactive'
                          type: 'string'
                    - anyOf:
                        - const: 'active'
                          type: 'string'
                        - const: 'inactive'
                          type: 'string'
                createdAt:
                  type: 'string'
                updatedAt:
                  type: 'string'
                subscription:
                  additionalProperties: false
                  type: 'object'
                  properties:
                    id:
                      type: 'string'
                    organisation:
                      type: 'string'
                    stripeSubscriptionId:
                      type:
                        - 'string'
                        - 'null'
                    ownerId:
                      type: 'string'
                    status:
                      type: 'string'
                    customerId:
                      type:
                        - 'string'
                        - 'null'
                    interval:
                      allOf:
                        - anyOf:
                            - type: 'null'
                            - additionalProperties: false
                              anyOf:
                                - const: 'day'
                                  type: 'string'
                                - const: 'week'
                                  type: 'string'
                                - const: 'month'
                                  type: 'string'
                                - const: 'year'
                                  type: 'string'
                        - anyOf:
                            - type: 'null'
                            - anyOf:
                                - const: 'day'
                                  type: 'string'
                                - const: 'week'
                                  type: 'string'
                                - const: 'month'
                                  type: 'string'
                                - const: 'year'
                                  type: 'string'
                    intervalCount:
                      type:
                        - 'integer'
                        - 'null'
                    currencyShortCode:
                      type:
                        - 'string'
                        - 'null'
                    cancelAtPeriodEnd:
                      type: 'boolean'
                    isPerpetual:
                      type: 'boolean'
                    isSalableOnly:
                      type: 'boolean'
                    startDate:
                      type: 'string'
                    cancelledAt:
                      type:
                        - 'string'
                        - 'null'
                    createdAt:
                      type: 'string'
                    updatedAt:
                      type: 'string'
                  required:
                    - 'id'
                    - 'organisation'
                    - 'stripeSubscriptionId'
                    - 'ownerId'
                    - 'status'
                    - 'customerId'
                    - 'interval'
                    - 'intervalCount'
                    - 'currencyShortCode'
                    - 'cancelAtPeriodEnd'
                    - 'isPerpetual'
                    - 'isSalableOnly'
                    - 'startDate'
                    - 'cancelledAt'
                    - 'createdAt'
                    - 'updatedAt'
              required:
                - 'id'
                - 'organisation'
                - 'ownerId'
                - 'groupId'
                - 'subscriptionId'
                - 'planId'
                - 'seats'
                - 'status'
                - 'createdAt'
                - 'updatedAt'
                - 'subscription'
            lineItem:
              type: 'object'
              properties:
                id:
                  type: 'string'
                organisation:
                  type: 'string'
                name:
                  type: 'string'
                slug:
                  type: 'string'
                stripeProductId:
                  type: 'string'
                meterId:
                  type:
                    - 'string'
                    - 'null'
                nickname:
                  type: 'string'
                priceType:
                  allOf:
                    - additionalProperties: false
                      anyOf:
                        - const: 'metered'
                          type: 'string'
                        - const: 'per_seat'
                          type: 'string'
                        - const: 'flat_rate'
                          type: 'string'
                    - anyOf:
                        - const: 'metered'
                          type: 'string'
                        - const: 'per_seat'
                          type: 'string'
                        - const: 'flat_rate'
                          type: 'string'
                intervalType:
                  allOf:
                    - additionalProperties: false
                      anyOf:
                        - const: 'one_off'
                          type: 'string'
                        - const: 'recurring'
                          type: 'string'
                    - anyOf:
                        - const: 'one_off'
                          type: 'string'
                        - const: 'recurring'
                          type: 'string'
                billingScheme:
                  allOf:
                    - additionalProperties: false
                      anyOf:
                        - const: 'fixed'
                          type: 'string'
                        - const: 'per_unit'
                          type: 'string'
                        - const: 'tiered'
                          type: 'string'
                        - const: 'flat_rate'
                          type: 'string'
                    - anyOf:
                        - const: 'flat_rate'
                          type: 'string'
                        - const: 'fixed'
                          type: 'string'
                        - const: 'per_unit'
                          type: 'string'
                        - const: 'tiered'
                          type: 'string'
                tiersMode:
                  allOf:
                    - anyOf:
                        - type: 'null'
                        - additionalProperties: false
                          anyOf:
                            - const: 'graduated'
                              type: 'string'
                            - const: 'volume'
                              type: 'string'
                    - anyOf:
                        - type: 'null'
                        - anyOf:
                            - const: 'graduated'
                              type: 'string'
                            - const: 'volume'
                              type: 'string'
                minQuantity:
                  type: 'integer'
                maxQuantity:
                  type: 'integer'
                isActive:
                  type: 'boolean'
                planId:
                  type: 'string'
                allowChangingQuantity:
                  type: 'boolean'
                archivedAt:
                  type:
                    - 'string'
                    - 'null'
                unitLabel:
                  type:
                    - 'string'
                    - 'null'
                createdAt:
                  type: 'string'
                updatedAt:
                  type: 'string'
                prices:
                  type: 'object'
                  properties:
                    type:
                      const: 'list'
                      type: 'string'
                    data:
                      type: 'array'
                      items:
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          stripePriceId:
                            type: 'string'
                          interval:
                            allOf:
                              - anyOf:
                                  - type: 'null'
                                  - additionalProperties: false
                                    anyOf:
                                      - const: 'day'
                                        type: 'string'
                                      - const: 'week'
                                        type: 'string'
                                      - const: 'month'
                                        type: 'string'
                                      - const: 'year'
                                        type: 'string'
                              - anyOf:
                                  - type: 'null'
                                  - anyOf:
                                      - const: 'day'
                                        type: 'string'
                                      - const: 'week'
                                        type: 'string'
                                      - const: 'month'
                                        type: 'string'
                                      - const: 'year'
                                        type: 'string'
                          intervalCount:
                            type:
                              - 'integer'
                              - 'null'
                          lineItemId:
                            type: 'string'
                          archivedAt:
                            type:
                              - 'string'
                              - 'null'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                          currencyOptions:
                            type: 'object'
                            properties:
                              type:
                                const: 'list'
                                type: 'string'
                              data:
                                type: 'array'
                                items:
                                  type: 'object'
                                  properties:
                                    id:
                                      type: 'string'
                                    organisation:
                                      type: 'string'
                                    currency:
                                      type: 'string'
                                    unitAmount:
                                      type:
                                        - 'number'
                                        - 'null'
                                    priceId:
                                      type: 'string'
                                    isDefault:
                                      type: 'boolean'
                                    createdAt:
                                      type: 'string'
                                    updatedAt:
                                      type: 'string'
                                    tiers:
                                      type: 'object'
                                      properties:
                                        type:
                                          const: 'list'
                                          type: 'string'
                                        data:
                                          type: 'array'
                                          items:
                                            additionalProperties: false
                                            type: 'object'
                                            properties:
                                              id:
                                                type: 'string'
                                              organisation:
                                                type: 'string'
                                              upTo:
                                                type: 'string'
                                              flatAmount:
                                                type:
                                                  - 'number'
                                                  - 'null'
                                              unitAmount:
                                                type: 'number'
                                              currencyOptionId:
                                                type: 'string'
                                              createdAt:
                                                type: 'string'
                                              updatedAt:
                                                type: 'string'
                                            required:
                                              - 'id'
                                              - 'organisation'
                                              - 'upTo'
                                              - 'flatAmount'
                                              - 'unitAmount'
                                              - 'currencyOptionId'
                                              - 'createdAt'
                                              - 'updatedAt'
                                        hasMore:
                                          type: 'boolean'
                                        path:
                                          type: 'string'
                                      required:
                                        - 'type'
                                        - 'data'
                                        - 'hasMore'
                                        - 'path'
                                  required:
                                    - 'id'
                                    - 'organisation'
                                    - 'currency'
                                    - 'unitAmount'
                                    - 'priceId'
                                    - 'isDefault'
                                    - 'createdAt'
                                    - 'updatedAt'
                                    - 'tiers'
                              hasMore:
                                type: 'boolean'
                              path:
                                type: 'string'
                            required:
                              - 'type'
                              - 'data'
                              - 'hasMore'
                              - 'path'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'stripePriceId'
                          - 'interval'
                          - 'intervalCount'
                          - 'lineItemId'
                          - 'archivedAt'
                          - 'createdAt'
                          - 'updatedAt'
                          - 'currencyOptions'
                    hasMore:
                      type: 'boolean'
                    path:
                      type: 'string'
                  required:
                    - 'type'
                    - 'data'
                    - 'hasMore'
                    - 'path'
              required:
                - 'id'
                - 'organisation'
                - 'name'
                - 'slug'
                - 'stripeProductId'
                - 'meterId'
                - 'nickname'
                - 'priceType'
                - 'intervalType'
                - 'billingScheme'
                - 'tiersMode'
                - 'minQuantity'
                - 'maxQuantity'
                - 'isActive'
                - 'planId'
                - 'allowChangingQuantity'
                - 'archivedAt'
                - 'unitLabel'
                - 'createdAt'
                - 'updatedAt'
                - 'prices'
          required:
            - 'id'
            - 'organisation'
            - 'subscriptionPlanId'
            - 'lineItemStripeProductId'
            - 'type'
            - 'quantity'
            - 'usageId'
            - 'stripeSubscriptionItemId'
            - 'stripePriceId'
            - 'expiryDate'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetSubscriptionInvoicesSchema:
      additionalProperties: false
      type: 'object'
      properties:
        data:
          type: 'array'
          items:
            type: 'object'
            properties:
              id:
                type: 'string'
              object:
                type: 'string'
              account_country:
                type: 'string'
              account_name:
                type: 'string'
              account_tax_ids:
                type: 'null'
              amount_due:
                type: 'integer'
              amount_overpaid:
                type: 'integer'
              amount_paid:
                type: 'integer'
              amount_remaining:
                type: 'integer'
              amount_shipping:
                type: 'integer'
              application:
                type: 'string'
              application_fee_amount:
                type: 'null'
              attempt_count:
                type: 'integer'
              attempted:
                type: 'boolean'
              auto_advance:
                type: 'boolean'
              automatic_tax:
                type: 'object'
                properties:
                  disabled_reason:
                    type: 'null'
                  enabled:
                    type: 'boolean'
                  liability:
                    type: 'null'
                  provider:
                    type: 'null'
                  status:
                    type: 'null'
                required:
                  - 'disabled_reason'
                  - 'enabled'
                  - 'liability'
                  - 'provider'
                  - 'status'
              automatically_finalizes_at:
                type: 'null'
              billing_reason:
                type: 'string'
              charge:
                type: 'null'
              collection_method:
                type: 'string'
              created:
                type: 'integer'
              currency:
                type: 'string'
              custom_fields:
                type: 'null'
              customer:
                type: 'string'
              customer_address:
                type: 'object'
                properties:
                  city:
                    type: 'null'
                  country:
                    type: 'string'
                  line1:
                    type: 'null'
                  line2:
                    type: 'null'
                  postal_code:
                    type: 'string'
                  state:
                    type: 'null'
                required:
                  - 'city'
                  - 'country'
                  - 'line1'
                  - 'line2'
                  - 'postal_code'
                  - 'state'
              customer_email:
                type: 'string'
              customer_name:
                type: 'string'
              customer_phone:
                type: 'null'
              customer_shipping:
                type: 'null'
              customer_tax_exempt:
                type: 'string'
              customer_tax_ids:
                type: 'array'
                items: {}
              default_payment_method:
                type: 'null'
              default_source:
                type: 'null'
              default_tax_rates:
                type: 'array'
                items: {}
              description:
                type: 'null'
              discount:
                type: 'null'
              discounts:
                type: 'array'
                items: {}
              due_date:
                type: 'null'
              effective_at:
                type: 'integer'
              ending_balance:
                type: 'integer'
              footer:
                type: 'null'
              from_invoice:
                type: 'null'
              hosted_invoice_url:
                type: 'string'
              invoice_pdf:
                type: 'string'
              issuer:
                type: 'object'
                properties:
                  type:
                    type: 'string'
                required:
                  - 'type'
              last_finalization_error:
                type: 'null'
              latest_revision:
                type: 'null'
              lines:
                type: 'object'
                properties:
                  object:
                    type: 'string'
                  data:
                    type: 'array'
                    items:
                      type: 'object'
                      properties:
                        id:
                          type: 'string'
                        object:
                          type: 'string'
                        amount:
                          type: 'integer'
                        amount_excluding_tax:
                          type: 'integer'
                        currency:
                          type: 'string'
                        description:
                          type: 'string'
                        discount_amounts:
                          type: 'array'
                          items: {}
                        discountable:
                          type: 'boolean'
                        discounts:
                          type: 'array'
                          items: {}
                        invoice:
                          type: 'string'
                        invoice_item:
                          type: 'string'
                        livemode:
                          type: 'boolean'
                        metadata:
                          type: 'object'
                          properties: {}
                        parent:
                          type: 'object'
                          properties:
                            invoice_item_details:
                              type: 'null'
                            subscription_item_details:
                              type: 'object'
                              properties:
                                invoice_item:
                                  type: 'string'
                                proration:
                                  type: 'boolean'
                                proration_details:
                                  type: 'object'
                                  properties:
                                    credited_items:
                                      type: 'object'
                                      properties:
                                        invoice:
                                          type: 'string'
                                        invoice_line_items:
                                          type: 'array'
                                          items:
                                            type: 'string'
                                      required:
                                        - 'invoice'
                                        - 'invoice_line_items'
                                  required:
                                    - 'credited_items'
                                subscription:
                                  type: 'string'
                                subscription_item:
                                  type: 'string'
                              required:
                                - 'invoice_item'
                                - 'proration'
                                - 'proration_details'
                                - 'subscription'
                                - 'subscription_item'
                            type:
                              type: 'string'
                          required:
                            - 'invoice_item_details'
                            - 'subscription_item_details'
                            - 'type'
                        period:
                          type: 'object'
                          properties:
                            end:
                              type: 'integer'
                            start:
                              type: 'integer'
                          required:
                            - 'end'
                            - 'start'
                        plan:
                          type: 'object'
                          properties:
                            id:
                              type: 'string'
                            object:
                              type: 'string'
                            active:
                              type: 'boolean'
                            aggregate_usage:
                              type: 'null'
                            amount:
                              type: 'integer'
                            amount_decimal:
                              type: 'string'
                            billing_scheme:
                              type: 'string'
                            created:
                              type: 'integer'
                            currency:
                              type: 'string'
                            interval:
                              type: 'string'
                            interval_count:
                              type: 'integer'
                            livemode:
                              type: 'boolean'
                            metadata:
                              type: 'object'
                              properties: {}
                            meter:
                              type: 'null'
                            nickname:
                              type: 'string'
                            product:
                              type: 'string'
                            tiers_mode:
                              type: 'null'
                            transform_usage:
                              type: 'null'
                            trial_period_days:
                              type: 'null'
                            usage_type:
                              type: 'string'
                          required:
                            - 'id'
                            - 'object'
                            - 'active'
                            - 'aggregate_usage'
                            - 'amount'
                            - 'amount_decimal'
                            - 'billing_scheme'
                            - 'created'
                            - 'currency'
                            - 'interval'
                            - 'interval_count'
                            - 'livemode'
                            - 'metadata'
                            - 'meter'
                            - 'nickname'
                            - 'product'
                            - 'tiers_mode'
                            - 'transform_usage'
                            - 'trial_period_days'
                            - 'usage_type'
                        pretax_credit_amounts:
                          type: 'array'
                          items: {}
                        price:
                          type: 'object'
                          properties:
                            id:
                              type: 'string'
                            object:
                              type: 'string'
                            active:
                              type: 'boolean'
                            billing_scheme:
                              type: 'string'
                            created:
                              type: 'integer'
                            currency:
                              type: 'string'
                            custom_unit_amount:
                              type: 'null'
                            livemode:
                              type: 'boolean'
                            lookup_key:
                              type: 'null'
                            metadata:
                              type: 'object'
                              properties: {}
                            nickname:
                              type: 'string'
                            product:
                              type: 'string'
                            recurring:
                              type: 'object'
                              properties:
                                aggregate_usage:
                                  type: 'null'
                                interval:
                                  type: 'string'
                                interval_count:
                                  type: 'integer'
                                meter:
                                  type: 'null'
                                trial_period_days:
                                  type: 'null'
                                usage_type:
                                  type: 'string'
                              required:
                                - 'aggregate_usage'
                                - 'interval'
                                - 'interval_count'
                                - 'meter'
                                - 'trial_period_days'
                                - 'usage_type'
                            tax_behavior:
                              type: 'string'
                            tiers_mode:
                              type: 'null'
                            transform_quantity:
                              type: 'null'
                            type:
                              type: 'string'
                            unit_amount:
                              type: 'integer'
                            unit_amount_decimal:
                              type: 'string'
                          required:
                            - 'id'
                            - 'object'
                            - 'active'
                            - 'billing_scheme'
                            - 'created'
                            - 'currency'
                            - 'custom_unit_amount'
                            - 'livemode'
                            - 'lookup_key'
                            - 'metadata'
                            - 'nickname'
                            - 'product'
                            - 'recurring'
                            - 'tax_behavior'
                            - 'tiers_mode'
                            - 'transform_quantity'
                            - 'type'
                            - 'unit_amount'
                            - 'unit_amount_decimal'
                        pricing:
                          type: 'object'
                          properties:
                            price_details:
                              type: 'object'
                              properties:
                                price:
                                  type: 'string'
                                product:
                                  type: 'string'
                              required:
                                - 'price'
                                - 'product'
                            type:
                              type: 'string'
                            unit_amount_decimal:
                              type: 'null'
                          required:
                            - 'price_details'
                            - 'type'
                            - 'unit_amount_decimal'
                        proration:
                          type: 'boolean'
                        proration_details:
                          type: 'object'
                          properties:
                            credited_items:
                              type: 'object'
                              properties:
                                invoice:
                                  type: 'string'
                                invoice_line_items:
                                  type: 'array'
                                  items:
                                    type: 'string'
                              required:
                                - 'invoice'
                                - 'invoice_line_items'
                          required:
                            - 'credited_items'
                        quantity:
                          type: 'integer'
                        subscription:
                          type: 'string'
                        subscription_item:
                          type: 'string'
                        tax_amounts:
                          type: 'array'
                          items: {}
                        tax_rates:
                          type: 'array'
                          items: {}
                        taxes:
                          type: 'array'
                          items: {}
                        type:
                          type: 'string'
                        unit_amount_excluding_tax:
                          type: 'string'
                      required:
                        - 'id'
                        - 'object'
                        - 'amount'
                        - 'amount_excluding_tax'
                        - 'currency'
                        - 'description'
                        - 'discount_amounts'
                        - 'discountable'
                        - 'discounts'
                        - 'invoice'
                        - 'invoice_item'
                        - 'livemode'
                        - 'metadata'
                        - 'parent'
                        - 'period'
                        - 'plan'
                        - 'pretax_credit_amounts'
                        - 'price'
                        - 'pricing'
                        - 'proration'
                        - 'proration_details'
                        - 'quantity'
                        - 'subscription'
                        - 'subscription_item'
                        - 'tax_amounts'
                        - 'tax_rates'
                        - 'taxes'
                        - 'type'
                        - 'unit_amount_excluding_tax'
                  has_more:
                    type: 'boolean'
                  total_count:
                    type: 'integer'
                  url:
                    type: 'string'
                required:
                  - 'object'
                  - 'data'
                  - 'has_more'
                  - 'total_count'
                  - 'url'
              livemode:
                type: 'boolean'
              metadata:
                type: 'object'
                properties: {}
              next_payment_attempt:
                type: 'null'
              number:
                type: 'string'
              on_behalf_of:
                type: 'null'
              paid:
                type: 'boolean'
              paid_out_of_band:
                type: 'boolean'
              parent:
                type: 'object'
                properties:
                  quote_details:
                    type: 'null'
                  subscription_details:
                    type: 'object'
                    properties:
                      metadata:
                        type: 'object'
                        properties:
                          granteeId:
                            type: 'string'
                          member:
                            type: 'string'
                        required:
                          - 'granteeId'
                          - 'member'
                      subscription:
                        type: 'string'
                    required:
                      - 'metadata'
                      - 'subscription'
                  type:
                    type: 'string'
                required:
                  - 'quote_details'
                  - 'subscription_details'
                  - 'type'
              payment_intent:
                type: 'null'
              payment_settings:
                type: 'object'
                properties:
                  default_mandate:
                    type: 'null'
                  payment_method_options:
                    type: 'object'
                    properties:
                      acss_debit:
                        type: 'null'
                      bancontact:
                        type: 'null'
                      card:
                        type: 'object'
                        properties:
                          request_three_d_secure:
                            type: 'string'
                        required:
                          - 'request_three_d_secure'
                      customer_balance:
                        type: 'null'
                      konbini:
                        type: 'null'
                      sepa_debit:
                        type: 'null'
                      us_bank_account:
                        type: 'null'
                    required:
                      - 'acss_debit'
                      - 'bancontact'
                      - 'card'
                      - 'customer_balance'
                      - 'konbini'
                      - 'sepa_debit'
                      - 'us_bank_account'
                  payment_method_types:
                    type: 'null'
                required:
                  - 'default_mandate'
                  - 'payment_method_options'
                  - 'payment_method_types'
              period_end:
                type: 'integer'
              period_start:
                type: 'integer'
              post_payment_credit_notes_amount:
                type: 'integer'
              pre_payment_credit_notes_amount:
                type: 'integer'
              quote:
                type: 'null'
              receipt_number:
                type: 'null'
              rendering:
                type: 'null'
              shipping_cost:
                type: 'null'
              shipping_details:
                type: 'null'
              starting_balance:
                type: 'integer'
              statement_descriptor:
                type: 'null'
              status:
                anyOf:
                  - const: 'draft'
                    type: 'string'
                  - const: 'open'
                    type: 'string'
                  - const: 'paid'
                    type: 'string'
                  - const: 'uncollectible'
                    type: 'string'
                  - const: 'void'
                    type: 'string'
              status_transitions:
                type: 'object'
                properties:
                  finalized_at:
                    type: 'integer'
                  marked_uncollectible_at:
                    type: 'null'
                  paid_at:
                    type: 'integer'
                  voided_at:
                    type: 'null'
                required:
                  - 'finalized_at'
                  - 'marked_uncollectible_at'
                  - 'paid_at'
                  - 'voided_at'
              subscription:
                type: 'string'
              subscription_details:
                type: 'object'
                properties:
                  metadata:
                    type: 'object'
                    properties:
                      granteeId:
                        type: 'string'
                      member:
                        type: 'string'
                    required:
                      - 'granteeId'
                      - 'member'
                required:
                  - 'metadata'
              subtotal:
                type: 'integer'
              subtotal_excluding_tax:
                type: 'integer'
              tax:
                type: 'null'
              test_clock:
                type: 'null'
              total:
                type: 'integer'
              total_discount_amounts:
                type: 'array'
                items: {}
              total_excluding_tax:
                type: 'integer'
              total_pretax_credit_amounts:
                type: 'array'
                items: {}
              total_tax_amounts:
                type: 'array'
                items: {}
              total_taxes:
                type: 'array'
                items: {}
              transfer_data:
                type: 'null'
              webhooks_delivered_at:
                type: 'integer'
            required:
              - 'id'
              - 'object'
              - 'account_country'
              - 'account_name'
              - 'account_tax_ids'
              - 'amount_due'
              - 'amount_overpaid'
              - 'amount_paid'
              - 'amount_remaining'
              - 'amount_shipping'
              - 'application'
              - 'application_fee_amount'
              - 'attempt_count'
              - 'attempted'
              - 'auto_advance'
              - 'automatic_tax'
              - 'automatically_finalizes_at'
              - 'billing_reason'
              - 'charge'
              - 'collection_method'
              - 'created'
              - 'currency'
              - 'custom_fields'
              - 'customer'
              - 'customer_address'
              - 'customer_email'
              - 'customer_name'
              - 'customer_phone'
              - 'customer_shipping'
              - 'customer_tax_exempt'
              - 'customer_tax_ids'
              - 'default_payment_method'
              - 'default_source'
              - 'default_tax_rates'
              - 'description'
              - 'discount'
              - 'discounts'
              - 'due_date'
              - 'effective_at'
              - 'ending_balance'
              - 'footer'
              - 'from_invoice'
              - 'hosted_invoice_url'
              - 'invoice_pdf'
              - 'issuer'
              - 'last_finalization_error'
              - 'latest_revision'
              - 'lines'
              - 'livemode'
              - 'metadata'
              - 'next_payment_attempt'
              - 'number'
              - 'on_behalf_of'
              - 'paid'
              - 'paid_out_of_band'
              - 'parent'
              - 'payment_intent'
              - 'payment_settings'
              - 'period_end'
              - 'period_start'
              - 'post_payment_credit_notes_amount'
              - 'pre_payment_credit_notes_amount'
              - 'quote'
              - 'receipt_number'
              - 'rendering'
              - 'shipping_cost'
              - 'shipping_details'
              - 'starting_balance'
              - 'statement_descriptor'
              - 'status'
              - 'status_transitions'
              - 'subscription'
              - 'subscription_details'
              - 'subtotal'
              - 'subtotal_excluding_tax'
              - 'tax'
              - 'test_clock'
              - 'total'
              - 'total_discount_amounts'
              - 'total_excluding_tax'
              - 'total_pretax_credit_amounts'
              - 'total_tax_amounts'
              - 'total_taxes'
              - 'transfer_data'
              - 'webhooks_delivered_at'
      required:
        - 'data'
    GetTierListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              upTo:
                type: 'string'
              flatAmount:
                type:
                  - 'number'
                  - 'null'
              unitAmount:
                type: 'number'
              currencyOptionId:
                type: 'string'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
            required:
              - 'id'
              - 'organisation'
              - 'upTo'
              - 'flatAmount'
              - 'unitAmount'
              - 'currencyOptionId'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetTierDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            upTo:
              type: 'string'
            flatAmount:
              type:
                - 'number'
                - 'null'
            unitAmount:
              type: 'number'
            currencyOptionId:
              type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'organisation'
            - 'upTo'
            - 'flatAmount'
            - 'unitAmount'
            - 'currencyOptionId'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetTierTagsListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              name:
                type: 'string'
              organisation:
                type: 'string'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
            required:
              - 'id'
              - 'name'
              - 'organisation'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    CreateTierTagSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            name:
              type: 'string'
            organisation:
              type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'name'
            - 'organisation'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetWebhookListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            type: 'object'
            properties:
              id:
                type: 'string'
              url:
                type: 'string'
              organisation:
                type: 'string'
              secret: {}
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
              eventTypes:
                additionalProperties: false
                type: 'object'
                properties:
                  type:
                    const: 'list'
                    type: 'string'
                  data:
                    type: 'array'
                    items:
                      additionalProperties: false
                      type: 'object'
                      properties:
                        id:
                          type: 'string'
                        event:
                          allOf:
                            - additionalProperties: false
                              anyOf:
                                - const: 'subscription_created'
                                  type: 'string'
                                - const: 'subscription_updated'
                                  type: 'string'
                                - const: 'subscription_cancelled'
                                  type: 'string'
                                - const: 'usage_finalised'
                                  type: 'string'
                                - const: 'usage_recorded'
                                  type: 'string'
                                - const: 'receipt_created'
                                  type: 'string'
                                - const: 'owner_updated'
                                  type: 'string'
                            - anyOf:
                                - const: 'subscription_created'
                                  type: 'string'
                                - const: 'subscription_updated'
                                  type: 'string'
                                - const: 'subscription_cancelled'
                                  type: 'string'
                                - const: 'usage_finalised'
                                  type: 'string'
                                - const: 'usage_recorded'
                                  type: 'string'
                                - const: 'receipt_created'
                                  type: 'string'
                                - const: 'owner_updated'
                                  type: 'string'
                        webhookId:
                          type: 'string'
                        organisation:
                          type: 'string'
                        deletedAt:
                          type:
                            - 'string'
                            - 'null'
                        createdAt:
                          type: 'string'
                        updatedAt:
                          type: 'string'
                      required:
                        - 'id'
                        - 'event'
                        - 'webhookId'
                        - 'organisation'
                        - 'deletedAt'
                        - 'createdAt'
                        - 'updatedAt'
                  hasMore:
                    type: 'boolean'
                  path:
                    type: 'string'
                required:
                  - 'type'
                  - 'data'
                  - 'hasMore'
                  - 'path'
            required:
              - 'id'
              - 'url'
              - 'organisation'
              - 'secret'
              - 'createdAt'
              - 'updatedAt'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetWebhookDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            url:
              type: 'string'
            organisation:
              type: 'string'
            secret: {}
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            eventTypes:
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    additionalProperties: false
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      event:
                        allOf:
                          - additionalProperties: false
                            anyOf:
                              - const: 'subscription_created'
                                type: 'string'
                              - const: 'subscription_updated'
                                type: 'string'
                              - const: 'subscription_cancelled'
                                type: 'string'
                              - const: 'usage_finalised'
                                type: 'string'
                              - const: 'usage_recorded'
                                type: 'string'
                              - const: 'receipt_created'
                                type: 'string'
                              - const: 'owner_updated'
                                type: 'string'
                          - anyOf:
                              - const: 'subscription_created'
                                type: 'string'
                              - const: 'subscription_updated'
                                type: 'string'
                              - const: 'subscription_cancelled'
                                type: 'string'
                              - const: 'usage_finalised'
                                type: 'string'
                              - const: 'usage_recorded'
                                type: 'string'
                              - const: 'receipt_created'
                                type: 'string'
                              - const: 'owner_updated'
                                type: 'string'
                      webhookId:
                        type: 'string'
                      organisation:
                        type: 'string'
                      deletedAt:
                        type:
                          - 'string'
                          - 'null'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                    required:
                      - 'id'
                      - 'event'
                      - 'webhookId'
                      - 'organisation'
                      - 'deletedAt'
                      - 'createdAt'
                      - 'updatedAt'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
            destinations:
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      eventId:
                        type: 'string'
                      webhookId:
                        type: 'string'
                      organisation:
                        type: 'string'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                      event:
                        additionalProperties: false
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          type:
                            type: 'string'
                          payload: {}
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'type'
                          - 'payload'
                          - 'createdAt'
                          - 'updatedAt'
                    required:
                      - 'id'
                      - 'eventId'
                      - 'webhookId'
                      - 'organisation'
                      - 'createdAt'
                      - 'updatedAt'
                      - 'event'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
          required:
            - 'id'
            - 'url'
            - 'organisation'
            - 'secret'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    CreateWebhookRequestResponseSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          additionalProperties: false
          type: 'object'
          properties:
            id:
              type: 'string'
            url:
              type: 'string'
            organisation:
              type: 'string'
            secret: {}
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
          required:
            - 'id'
            - 'url'
            - 'organisation'
            - 'secret'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    GetAiMessageListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            additionalProperties: false
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              conversationId:
                type: 'string'
              role:
                type: 'string'
              status:
                additionalProperties: false
                anyOf:
                  - const: 'pending'
                    type: 'string'
                  - const: 'responded'
                    type: 'string'
              createdAt:
                type: 'string'
              content:
                type: 'string'
              data:
                properties: &ref_8
                  type:
                    const: 'PRICING_MODEL'
                    type: 'string'
                  payload:
                    type: 'object'
                    properties:
                      productName:
                        minLength: 1
                        type: 'string'
                      plans:
                        minItems: 1
                        type: 'array'
                        items:
                          additionalProperties: false
                          type: 'object'
                          properties:
                            id:
                              type: 'string'
                            name:
                              minLength: 1
                              type: 'string'
                            isActive:
                              type: 'boolean'
                            tierTag:
                              anyOf:
                                - type: 'null'
                                - type: 'string'
                            archivedAt:
                              anyOf:
                                - type: 'null'
                                - type: 'Date'
                            trialPeriodDays:
                              anyOf:
                                - type: 'null'
                                - minimum: 1
                                  maximum: 730
                                  type: 'number'
                            lineItems:
                              type: 'array'
                              items:
                                discriminator: 'priceType'
                                anyOf:
                                  - additionalProperties: false
                                    type: 'object'
                                    properties:
                                      name:
                                        minLength: 1
                                        type: 'string'
                                      slug:
                                        minLength: 1
                                        pattern: '^[a-z0-9_]+$'
                                        type: 'string'
                                      nickname:
                                        default: ''
                                        type: 'string'
                                      priceType:
                                        const: 'flat_rate'
                                        type: 'string'
                                      intervalType:
                                        not: {}
                                      billingScheme:
                                        not: {}
                                      isActive:
                                        default: true
                                        type: 'boolean'
                                      maxQuantity:
                                        multipleOf: 1
                                        minimum: 1
                                        type: 'number'
                                      allowChangingQuantity:
                                        default: false
                                        type: 'boolean'
                                      tiersMode:
                                        type: 'null'
                                      minQuantity:
                                        multipleOf: 1
                                        minimum: 1
                                        type: 'number'
                                      meterSlug:
                                        type: 'null'
                                      unitLabel:
                                        type: 'null'
                                      id:
                                        type: 'string'
                                      archivedAt:
                                        anyOf:
                                          - type: 'null'
                                          - type: 'Date'
                                      prices:
                                        type: 'array'
                                        items:
                                          allOf:
                                            - discriminator: 'interval'
                                              anyOf:
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      type: 'null'
                                                    intervalCount:
                                                      type: 'null'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      const: 'day'
                                                      type: 'string'
                                                    intervalCount:
                                                      minimum: 1
                                                      maximum: 1095
                                                      type: 'number'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      const: 'week'
                                                      type: 'string'
                                                    intervalCount:
                                                      minimum: 1
                                                      maximum: 156
                                                      type: 'number'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      const: 'month'
                                                      type: 'string'
                                                    intervalCount:
                                                      minimum: 1
                                                      maximum: 36
                                                      type: 'number'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      const: 'year'
                                                      type: 'string'
                                                    intervalCount:
                                                      minimum: 1
                                                      maximum: 3
                                                      type: 'number'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                            - type: 'object'
                                              properties:
                                                id:
                                                  minLength: 1
                                                  type: 'string'
                                                currencyOptions:
                                                  minItems: 1
                                                  type: 'array'
                                                  items:
                                                    additionalProperties: false
                                                    type: 'object'
                                                    properties:
                                                      currency:
                                                        not: {}
                                                      unitAmount:
                                                        anyOf:
                                                          - type: 'null'
                                                          - minimum: 0
                                                            type: 'number'
                                                      tiers:
                                                        type: 'array'
                                                        items:
                                                          additionalProperties: false
                                                          type: 'object'
                                                          properties:
                                                            upTo:
                                                              type: 'string'
                                                            flatAmount:
                                                              anyOf:
                                                                - type: 'null'
                                                                - minimum: 0
                                                                  type: 'number'
                                                            unitAmount:
                                                              minimum: 0
                                                              type: 'number'
                                                            id:
                                                              minLength: 1
                                                              type: 'string'
                                                          required:
                                                            - 'upTo'
                                                            - 'flatAmount'
                                                            - 'unitAmount'
                                                    required:
                                                      - 'currency'
                                                      - 'unitAmount'
                                                archivedAt:
                                                  anyOf:
                                                    - type: 'null'
                                                    - type: 'Date'
                                              required:
                                                - 'currencyOptions'
                                    required:
                                      - 'name'
                                      - 'slug'
                                      - 'priceType'
                                      - 'intervalType'
                                      - 'billingScheme'
                                      - 'maxQuantity'
                                      - 'allowChangingQuantity'
                                      - 'tiersMode'
                                      - 'minQuantity'
                                  - additionalProperties: false
                                    type: 'object'
                                    properties:
                                      name:
                                        minLength: 1
                                        type: 'string'
                                      slug:
                                        minLength: 1
                                        pattern: '^[a-z0-9_]+$'
                                        type: 'string'
                                      nickname:
                                        default: ''
                                        type: 'string'
                                      priceType:
                                        const: 'per_seat'
                                        type: 'string'
                                      intervalType:
                                        not: {}
                                      billingScheme:
                                        not: {}
                                      isActive:
                                        default: true
                                        type: 'boolean'
                                      maxQuantity:
                                        multipleOf: 1
                                        minimum: 1
                                        type: 'number'
                                      allowChangingQuantity:
                                        default: false
                                        type: 'boolean'
                                      tiersMode:
                                        anyOf:
                                          - type: 'null'
                                          - not: {}
                                      minQuantity:
                                        multipleOf: 1
                                        minimum: 1
                                        type: 'number'
                                      meterSlug:
                                        type: 'null'
                                      unitLabel:
                                        type: 'null'
                                      id:
                                        type: 'string'
                                      archivedAt:
                                        anyOf:
                                          - type: 'null'
                                          - type: 'Date'
                                      prices:
                                        type: 'array'
                                        items:
                                          allOf:
                                            - discriminator: 'interval'
                                              anyOf:
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      type: 'null'
                                                    intervalCount:
                                                      type: 'null'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      const: 'day'
                                                      type: 'string'
                                                    intervalCount:
                                                      minimum: 1
                                                      maximum: 1095
                                                      type: 'number'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      const: 'week'
                                                      type: 'string'
                                                    intervalCount:
                                                      minimum: 1
                                                      maximum: 156
                                                      type: 'number'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      const: 'month'
                                                      type: 'string'
                                                    intervalCount:
                                                      minimum: 1
                                                      maximum: 36
                                                      type: 'number'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      const: 'year'
                                                      type: 'string'
                                                    intervalCount:
                                                      minimum: 1
                                                      maximum: 3
                                                      type: 'number'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                            - type: 'object'
                                              properties:
                                                id:
                                                  minLength: 1
                                                  type: 'string'
                                                currencyOptions:
                                                  minItems: 1
                                                  type: 'array'
                                                  items:
                                                    additionalProperties: false
                                                    type: 'object'
                                                    properties:
                                                      currency:
                                                        not: {}
                                                      unitAmount:
                                                        anyOf:
                                                          - type: 'null'
                                                          - minimum: 0
                                                            type: 'number'
                                                      tiers:
                                                        type: 'array'
                                                        items:
                                                          additionalProperties: false
                                                          type: 'object'
                                                          properties:
                                                            upTo:
                                                              type: 'string'
                                                            flatAmount:
                                                              anyOf:
                                                                - type: 'null'
                                                                - minimum: 0
                                                                  type: 'number'
                                                            unitAmount:
                                                              minimum: 0
                                                              type: 'number'
                                                            id:
                                                              minLength: 1
                                                              type: 'string'
                                                          required:
                                                            - 'upTo'
                                                            - 'flatAmount'
                                                            - 'unitAmount'
                                                    required:
                                                      - 'currency'
                                                      - 'unitAmount'
                                                archivedAt:
                                                  anyOf:
                                                    - type: 'null'
                                                    - type: 'Date'
                                              required:
                                                - 'currencyOptions'
                                    required:
                                      - 'name'
                                      - 'slug'
                                      - 'priceType'
                                      - 'intervalType'
                                      - 'billingScheme'
                                      - 'maxQuantity'
                                      - 'allowChangingQuantity'
                                      - 'tiersMode'
                                      - 'minQuantity'
                                  - additionalProperties: false
                                    type: 'object'
                                    properties:
                                      name:
                                        minLength: 1
                                        type: 'string'
                                      slug:
                                        minLength: 1
                                        pattern: '^[a-z0-9_]+$'
                                        type: 'string'
                                      nickname:
                                        default: ''
                                        type: 'string'
                                      priceType:
                                        const: 'metered'
                                        type: 'string'
                                      intervalType:
                                        not: {}
                                      billingScheme:
                                        not: {}
                                      isActive:
                                        default: true
                                        type: 'boolean'
                                      maxQuantity:
                                        multipleOf: 1
                                        minimum: 1
                                        type: 'number'
                                      allowChangingQuantity:
                                        default: false
                                        type: 'boolean'
                                      meterSlug:
                                        minLength: 1
                                        pattern: '^[a-z0-9_]+$'
                                        type: 'string'
                                      tiersMode:
                                        anyOf:
                                          - type: 'null'
                                          - not: {}
                                      minQuantity:
                                        multipleOf: 1
                                        minimum: 1
                                        type: 'number'
                                      unitLabel:
                                        anyOf:
                                          - type: 'null'
                                          - type: 'string'
                                      id:
                                        type: 'string'
                                      archivedAt:
                                        anyOf:
                                          - type: 'null'
                                          - type: 'Date'
                                      prices:
                                        type: 'array'
                                        items:
                                          allOf:
                                            - discriminator: 'interval'
                                              anyOf:
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      type: 'null'
                                                    intervalCount:
                                                      type: 'null'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      const: 'day'
                                                      type: 'string'
                                                    intervalCount:
                                                      minimum: 1
                                                      maximum: 1095
                                                      type: 'number'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      const: 'week'
                                                      type: 'string'
                                                    intervalCount:
                                                      minimum: 1
                                                      maximum: 156
                                                      type: 'number'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      const: 'month'
                                                      type: 'string'
                                                    intervalCount:
                                                      minimum: 1
                                                      maximum: 36
                                                      type: 'number'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                                - type: 'object'
                                                  properties:
                                                    defaultCurrency:
                                                      not: {}
                                                    interval:
                                                      const: 'year'
                                                      type: 'string'
                                                    intervalCount:
                                                      minimum: 1
                                                      maximum: 3
                                                      type: 'number'
                                                  required:
                                                    - 'defaultCurrency'
                                                    - 'interval'
                                                    - 'intervalCount'
                                            - type: 'object'
                                              properties:
                                                id:
                                                  minLength: 1
                                                  type: 'string'
                                                currencyOptions:
                                                  minItems: 1
                                                  type: 'array'
                                                  items:
                                                    additionalProperties: false
                                                    type: 'object'
                                                    properties:
                                                      currency:
                                                        not: {}
                                                      unitAmount:
                                                        anyOf:
                                                          - type: 'null'
                                                          - minimum: 0
                                                            type: 'number'
                                                      tiers:
                                                        type: 'array'
                                                        items:
                                                          additionalProperties: false
                                                          type: 'object'
                                                          properties:
                                                            upTo:
                                                              type: 'string'
                                                            flatAmount:
                                                              anyOf:
                                                                - type: 'null'
                                                                - minimum: 0
                                                                  type: 'number'
                                                            unitAmount:
                                                              minimum: 0
                                                              type: 'number'
                                                            id:
                                                              minLength: 1
                                                              type: 'string'
                                                          required:
                                                            - 'upTo'
                                                            - 'flatAmount'
                                                            - 'unitAmount'
                                                    required:
                                                      - 'currency'
                                                      - 'unitAmount'
                                                archivedAt:
                                                  anyOf:
                                                    - type: 'null'
                                                    - type: 'Date'
                                              required:
                                                - 'currencyOptions'
                                    required:
                                      - 'name'
                                      - 'slug'
                                      - 'priceType'
                                      - 'intervalType'
                                      - 'billingScheme'
                                      - 'maxQuantity'
                                      - 'allowChangingQuantity'
                                      - 'meterSlug'
                                      - 'tiersMode'
                                      - 'minQuantity'
                            entitlementNames:
                              description: 'Array of entitlement names (lowercase with underscores, e.g. "api_access"). These will be created if they do not exist.'
                              type: 'array'
                              items:
                                type: 'string'
                          required:
                            - 'name'
                            - 'entitlementNames'
                    required:
                      - 'productName'
                      - 'plans'
                required: &ref_9
                  - 'type'
                  - 'payload'
                type:
                  - 'object'
                  - 'null'
            required:
              - 'id'
              - 'organisation'
              - 'conversationId'
              - 'role'
              - 'status'
              - 'createdAt'
              - 'content'
              - 'data'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetAiConversationListSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'list'
          type: 'string'
        data:
          type: 'array'
          items:
            type: 'object'
            properties:
              id:
                type: 'string'
              organisation:
                type: 'string'
              createdAt:
                type: 'string'
              updatedAt:
                type: 'string'
              summary:
                type:
                  - 'string'
                  - 'null'
            required:
              - 'id'
              - 'organisation'
              - 'createdAt'
              - 'updatedAt'
              - 'summary'
        nextCursor:
          type:
            - 'string'
            - 'null'
        previousCursor:
          type:
            - 'string'
            - 'null'
        hasMore:
          type: 'boolean'
      required:
        - 'type'
        - 'data'
        - 'nextCursor'
        - 'previousCursor'
        - 'hasMore'
    GetAIConversationDetailSchema:
      additionalProperties: false
      type: 'object'
      properties:
        type:
          const: 'object'
          type: 'string'
        data:
          type: 'object'
          properties:
            id:
              type: 'string'
            organisation:
              type: 'string'
            createdAt:
              type: 'string'
            updatedAt:
              type: 'string'
            messages:
              type: 'object'
              properties:
                type:
                  const: 'list'
                  type: 'string'
                data:
                  type: 'array'
                  items:
                    additionalProperties: false
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      conversationId:
                        type: 'string'
                      role:
                        type: 'string'
                      status:
                        additionalProperties: false
                        anyOf:
                          - const: 'pending'
                            type: 'string'
                          - const: 'responded'
                            type: 'string'
                      createdAt:
                        type: 'string'
                      content:
                        type: 'string'
                      data:
                        properties: *ref_8
                        required: *ref_9
                        type:
                          - 'object'
                          - 'null'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'conversationId'
                      - 'role'
                      - 'status'
                      - 'createdAt'
                      - 'content'
                      - 'data'
                hasMore:
                  type: 'boolean'
                path:
                  type: 'string'
              required:
                - 'type'
                - 'data'
                - 'hasMore'
                - 'path'
          required:
            - 'id'
            - 'organisation'
            - 'createdAt'
            - 'updatedAt'
      required:
        - 'type'
        - 'data'
    CopyToLiveModeSchema:
      additionalProperties: false
      type: 'object'
      properties:
        id:
          type: 'string'
      required:
        - 'id'
    CopyProductToLiveModeRequestSchema:
      type: 'object'
      properties:
        id:
          type: 'string'
          description: 'The ID of the test mode product to copy to live mode.'
      required:
        - 'id'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    CreateProductRequestSchema:
      type: 'object'
      properties:
        name:
          type: 'string'
          minLength: 1
          description: 'The name of the product.'
        isActive:
          type: 'boolean'
      required:
        - 'name'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    UpdateProductRequestSchema:
      type: 'object'
      properties:
        name:
          type: 'string'
          minLength: 1
          description: 'The name of the product.'
        isActive:
          type: 'boolean'
          description: 'Whether the product is active. When `false`, the product and its plans will not be available for new subscriptions.'
        settings:
          type: 'object'
          properties:
            cancelUrl:
              type: 'string'
              format: 'uri'
              description: 'URL to redirect customers to if they abandon checkout.'
            successUrl:
              type: 'string'
              format: 'uri'
              description: 'URL to redirect customers to after a successful checkout.'
            allowPromoCodes:
              type: 'boolean'
              description: 'Whether to allow customers to enter promotional codes during checkout.'
            automaticTax:
              type: 'boolean'
              description: 'Whether to enable automatic tax calculation based on customer location.'
            collectBillingAddress:
              type: 'boolean'
              description: 'Whether to collect the customer''s billing address during checkout.'
            collectShippingAddress:
              type: 'boolean'
              description: 'Whether to collect the customer''s shipping address during checkout.'
            cardPrefillPreference:
              type: 'string'
              enum:
                - 'none'
                - 'always'
                - 'choice'
              description: 'Controls whether to prefill the customer''s saved card details at checkout. One of `none`, `always`, `choice`.'
            pastDueEntitlements:
              type: 'boolean'
              description: 'Whether customers with past due subscriptions retain their entitlements.'
          additionalProperties: false
          description: 'Product settings to update.'
      required:
        - 'name'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    UpdateLineItemRequestSchema:
      anyOf:
        - type: 'object'
          properties:
            name:
              type: 'string'
              minLength: 1
            slug:
              type: 'string'
              minLength: 1
              pattern: '^[a-z0-9_]+$'
            nickname:
              type: 'string'
              default: ''
            priceType:
              type: 'string'
              const: 'flat_rate'
            intervalType:
              type: 'string'
              enum:
                - 'one_off'
                - 'recurring'
            billingScheme:
              type: 'string'
              enum:
                - 'fixed'
                - 'per_unit'
                - 'tiered'
                - 'flat_rate'
            isActive:
              type: 'boolean'
              default: true
            maxQuantity:
              type: 'integer'
              minimum: 1
            allowChangingQuantity:
              type: 'boolean'
              default: false
            tiersMode:
              type: 'null'
            minQuantity:
              type: 'integer'
              minimum: 1
            meterSlug:
              type: 'null'
            unitLabel:
              type: 'null'
          required:
            - 'name'
            - 'slug'
            - 'priceType'
            - 'intervalType'
            - 'billingScheme'
            - 'maxQuantity'
            - 'tiersMode'
            - 'minQuantity'
          additionalProperties: false
        - type: 'object'
          properties:
            name:
              type: 'string'
              minLength: 1
            slug:
              type: 'string'
              minLength: 1
              pattern: '^[a-z0-9_]+$'
            nickname:
              type: 'string'
              default: ''
            priceType:
              type: 'string'
              const: 'per_seat'
            intervalType:
              type: 'string'
              enum:
                - 'one_off'
                - 'recurring'
            billingScheme:
              type: 'string'
              enum:
                - 'fixed'
                - 'per_unit'
                - 'tiered'
                - 'flat_rate'
            isActive:
              type: 'boolean'
              default: true
            maxQuantity:
              type: 'integer'
              minimum: 1
            allowChangingQuantity:
              type: 'boolean'
              default: false
            tiersMode:
              enum:
                - 'graduated'
                - 'volume'
              type:
                - 'string'
                - 'null'
            minQuantity:
              type: 'integer'
              minimum: 1
            meterSlug:
              type: 'null'
            unitLabel:
              type: 'null'
          required:
            - 'name'
            - 'slug'
            - 'priceType'
            - 'intervalType'
            - 'billingScheme'
            - 'maxQuantity'
            - 'tiersMode'
            - 'minQuantity'
          additionalProperties: false
        - type: 'object'
          properties:
            name:
              type: 'string'
              minLength: 1
            slug:
              type: 'string'
              minLength: 1
              pattern: '^[a-z0-9_]+$'
            nickname:
              type: 'string'
              default: ''
            priceType:
              type: 'string'
              const: 'metered'
            intervalType:
              type: 'string'
              enum:
                - 'one_off'
                - 'recurring'
            billingScheme:
              type: 'string'
              enum:
                - 'fixed'
                - 'per_unit'
                - 'tiered'
                - 'flat_rate'
            isActive:
              type: 'boolean'
              default: true
            maxQuantity:
              type: 'integer'
              minimum: 1
            allowChangingQuantity:
              type: 'boolean'
              default: false
            meterSlug:
              type: 'string'
              minLength: 1
              pattern: '^[a-z0-9_]+$'
            tiersMode:
              enum:
                - 'graduated'
                - 'volume'
              type:
                - 'string'
                - 'null'
            minQuantity:
              type: 'integer'
              minimum: 1
            unitLabel:
              type:
                - 'string'
                - 'null'
          required:
            - 'name'
            - 'slug'
            - 'priceType'
            - 'intervalType'
            - 'billingScheme'
            - 'maxQuantity'
            - 'meterSlug'
            - 'tiersMode'
            - 'minQuantity'
          additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    UpdateEntitlementRequestSchema:
      type: 'object'
      properties:
        name:
          type: 'string'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    SavePlanRequestSchema:
      type: 'object'
      properties:
        id:
          type: 'string'
        productId:
          type: 'string'
        name:
          type: 'string'
          minLength: 1
        entitlements:
          type: 'array'
          items:
            type: 'string'
        isActive:
          type: 'boolean'
        tierTag:
          type:
            - 'string'
            - 'null'
        archivedAt:
          type:
            - 'string'
            - 'null'
          format: 'date-time'
        trialPeriodDays:
          type:
            - 'number'
            - 'null'
          minimum: 1
          maximum: 730
        lineItems:
          type: 'array'
          items:
            type: 'object'
            properties:
              name:
                type: 'string'
                minLength: 1
              slug:
                type: 'string'
                minLength: 1
                pattern: '^[a-z0-9_]+$'
              nickname:
                type: 'string'
                default: ''
              priceType:
                type: 'string'
                enum:
                  - 'flat_rate'
                  - 'per_seat'
                  - 'metered'
              intervalType:
                type: 'string'
                enum:
                  - 'one_off'
                  - 'recurring'
              billingScheme:
                type: 'string'
                enum:
                  - 'fixed'
                  - 'per_unit'
                  - 'tiered'
                  - 'flat_rate'
              isActive:
                type: 'boolean'
                default: true
              maxQuantity:
                type: 'integer'
                minimum: 1
              allowChangingQuantity:
                type: 'boolean'
                default: false
              tiersMode:
                type:
                  - 'string'
                  - 'null'
                enum:
                  - 'graduated'
                  - 'volume'
              minQuantity:
                type: 'integer'
                minimum: 1
              meterSlug:
                type:
                  - 'string'
                  - 'null'
                minLength: 1
                pattern: '^[a-z0-9_]+$'
              unitLabel:
                type:
                  - 'string'
                  - 'null'
              id:
                type: 'string'
              archivedAt:
                type:
                  - 'string'
                  - 'null'
                format: 'date-time'
              prices:
                type: 'array'
                items:
                  allOf:
                    - type: 'object'
                      properties:
                        defaultCurrency:
                          type: 'string'
                          enum:
                            - 'USD'
                            - 'AED'
                            - 'AFN'
                            - 'ALL'
                            - 'AMD'
                            - 'ANG'
                            - 'AOA'
                            - 'ARS'
                            - 'AUD'
                            - 'AWG'
                            - 'AZN'
                            - 'BAM'
                            - 'BBD'
                            - 'BDT'
                            - 'BGN'
                            - 'BIF'
                            - 'BMD'
                            - 'BND'
                            - 'BOB'
                            - 'BRL'
                            - 'BSD'
                            - 'BWP'
                            - 'BYN'
                            - 'BZD'
                            - 'CAD'
                            - 'CDF'
                            - 'CHF'
                            - 'CLP'
                            - 'CNY'
                            - 'COP'
                            - 'CRC'
                            - 'CVE'
                            - 'CZK'
                            - 'DJF'
                            - 'DKK'
                            - 'DOP'
                            - 'DZD'
                            - 'EGP'
                            - 'ETB'
                            - 'EUR'
                            - 'FJD'
                            - 'FKP'
                            - 'GBP'
                            - 'GEL'
                            - 'GIP'
                            - 'GMD'
                            - 'GNF'
                            - 'GTQ'
                            - 'GYD'
                            - 'HKD'
                            - 'HNL'
                            - 'HTG'
                            - 'HUF'
                            - 'IDR'
                            - 'ILS'
                            - 'INR'
                            - 'ISK'
                            - 'JMD'
                            - 'JPY'
                            - 'KES'
                            - 'KGS'
                            - 'KHR'
                            - 'KMF'
                            - 'KRW'
                            - 'KYD'
                            - 'KZT'
                            - 'LAK'
                            - 'LBP'
                            - 'LKR'
                            - 'LRD'
                            - 'LSL'
                            - 'MAD'
                            - 'MDL'
                            - 'MGA'
                            - 'MKD'
                            - 'MMK'
                            - 'MNT'
                            - 'MOP'
                            - 'MUR'
                            - 'MVR'
                            - 'MWK'
                            - 'MXN'
                            - 'MYR'
                            - 'MZN'
                            - 'NAD'
                            - 'NGN'
                            - 'NIO'
                            - 'NOK'
                            - 'NPR'
                            - 'NZD'
                            - 'PAB'
                            - 'PEN'
                            - 'PGK'
                            - 'PHP'
                            - 'PKR'
                            - 'PLN'
                            - 'PYG'
                            - 'QAR'
                            - 'RON'
                            - 'RSD'
                            - 'RUB'
                            - 'RWF'
                            - 'SAR'
                            - 'SBD'
                            - 'SCR'
                            - 'SEK'
                            - 'SGD'
                            - 'SHP'
                            - 'SLE'
                            - 'SOS'
                            - 'SRD'
                            - 'STD'
                            - 'SZL'
                            - 'THB'
                            - 'TJS'
                            - 'TOP'
                            - 'TRY'
                            - 'TTD'
                            - 'TWD'
                            - 'TZS'
                            - 'UAH'
                            - 'UGX'
                            - 'UYU'
                            - 'UZS'
                            - 'VND'
                            - 'VUV'
                            - 'WST'
                            - 'XAF'
                            - 'XCD'
                            - 'XCG'
                            - 'XOF'
                            - 'XPF'
                            - 'YER'
                            - 'ZAR'
                            - 'ZMW'
                            - 'BHD'
                            - 'KWD'
                            - 'OMR'
                        interval:
                          type:
                            - 'string'
                            - 'null'
                          enum:
                            - 'day'
                            - 'week'
                            - 'month'
                            - 'year'
                        intervalCount:
                          type:
                            - 'number'
                            - 'null'
                          minimum: 1
                          maximum: 1095
                      required:
                        - 'defaultCurrency'
                        - 'interval'
                        - 'intervalCount'
                    - type: 'object'
                      properties:
                        id:
                          type: 'string'
                          minLength: 1
                        currencyOptions:
                          type: 'array'
                          items:
                            type: 'object'
                            properties:
                              currency:
                                type: 'string'
                                enum:
                                  - 'USD'
                                  - 'AED'
                                  - 'AFN'
                                  - 'ALL'
                                  - 'AMD'
                                  - 'ANG'
                                  - 'AOA'
                                  - 'ARS'
                                  - 'AUD'
                                  - 'AWG'
                                  - 'AZN'
                                  - 'BAM'
                                  - 'BBD'
                                  - 'BDT'
                                  - 'BGN'
                                  - 'BIF'
                                  - 'BMD'
                                  - 'BND'
                                  - 'BOB'
                                  - 'BRL'
                                  - 'BSD'
                                  - 'BWP'
                                  - 'BYN'
                                  - 'BZD'
                                  - 'CAD'
                                  - 'CDF'
                                  - 'CHF'
                                  - 'CLP'
                                  - 'CNY'
                                  - 'COP'
                                  - 'CRC'
                                  - 'CVE'
                                  - 'CZK'
                                  - 'DJF'
                                  - 'DKK'
                                  - 'DOP'
                                  - 'DZD'
                                  - 'EGP'
                                  - 'ETB'
                                  - 'EUR'
                                  - 'FJD'
                                  - 'FKP'
                                  - 'GBP'
                                  - 'GEL'
                                  - 'GIP'
                                  - 'GMD'
                                  - 'GNF'
                                  - 'GTQ'
                                  - 'GYD'
                                  - 'HKD'
                                  - 'HNL'
                                  - 'HTG'
                                  - 'HUF'
                                  - 'IDR'
                                  - 'ILS'
                                  - 'INR'
                                  - 'ISK'
                                  - 'JMD'
                                  - 'JPY'
                                  - 'KES'
                                  - 'KGS'
                                  - 'KHR'
                                  - 'KMF'
                                  - 'KRW'
                                  - 'KYD'
                                  - 'KZT'
                                  - 'LAK'
                                  - 'LBP'
                                  - 'LKR'
                                  - 'LRD'
                                  - 'LSL'
                                  - 'MAD'
                                  - 'MDL'
                                  - 'MGA'
                                  - 'MKD'
                                  - 'MMK'
                                  - 'MNT'
                                  - 'MOP'
                                  - 'MUR'
                                  - 'MVR'
                                  - 'MWK'
                                  - 'MXN'
                                  - 'MYR'
                                  - 'MZN'
                                  - 'NAD'
                                  - 'NGN'
                                  - 'NIO'
                                  - 'NOK'
                                  - 'NPR'
                                  - 'NZD'
                                  - 'PAB'
                                  - 'PEN'
                                  - 'PGK'
                                  - 'PHP'
                                  - 'PKR'
                                  - 'PLN'
                                  - 'PYG'
                                  - 'QAR'
                                  - 'RON'
                                  - 'RSD'
                                  - 'RUB'
                                  - 'RWF'
                                  - 'SAR'
                                  - 'SBD'
                                  - 'SCR'
                                  - 'SEK'
                                  - 'SGD'
                                  - 'SHP'
                                  - 'SLE'
                                  - 'SOS'
                                  - 'SRD'
                                  - 'STD'
                                  - 'SZL'
                                  - 'THB'
                                  - 'TJS'
                                  - 'TOP'
                                  - 'TRY'
                                  - 'TTD'
                                  - 'TWD'
                                  - 'TZS'
                                  - 'UAH'
                                  - 'UGX'
                                  - 'UYU'
                                  - 'UZS'
                                  - 'VND'
                                  - 'VUV'
                                  - 'WST'
                                  - 'XAF'
                                  - 'XCD'
                                  - 'XCG'
                                  - 'XOF'
                                  - 'XPF'
                                  - 'YER'
                                  - 'ZAR'
                                  - 'ZMW'
                                  - 'BHD'
                                  - 'KWD'
                                  - 'OMR'
                              unitAmount:
                                type:
                                  - 'number'
                                  - 'null'
                                minimum: 0
                              tiers:
                                type: 'array'
                                items:
                                  type: 'object'
                                  properties:
                                    upTo:
                                      type: 'string'
                                    flatAmount:
                                      type:
                                        - 'number'
                                        - 'null'
                                      minimum: 0
                                    unitAmount:
                                      type: 'number'
                                      minimum: 0
                                    id:
                                      type: 'string'
                                      minLength: 1
                                  required:
                                    - 'upTo'
                                    - 'flatAmount'
                                    - 'unitAmount'
                                  additionalProperties: false
                            required:
                              - 'currency'
                              - 'unitAmount'
                            additionalProperties: false
                          minItems: 1
                        archivedAt:
                          type:
                            - 'string'
                            - 'null'
                          format: 'date-time'
                      required:
                        - 'currencyOptions'
            required:
              - 'name'
              - 'slug'
              - 'priceType'
              - 'intervalType'
              - 'billingScheme'
              - 'maxQuantity'
              - 'tiersMode'
              - 'minQuantity'
      required:
        - 'productId'
        - 'name'
        - 'entitlements'
      additionalProperties: false
    CreateWebhookRequestSchema:
      type: 'object'
      properties:
        url:
          type: 'string'
          minLength: 1
          format: 'uri'
        events:
          type: 'array'
          items:
            type: 'string'
            enum:
              - 'subscription_created'
              - 'subscription_updated'
              - 'subscription_cancelled'
              - 'usage_finalised'
              - 'usage_recorded'
              - 'receipt_created'
              - 'owner_updated'
          minItems: 1
      required:
        - 'url'
        - 'events'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    UpdateWebhookRequestSchema:
      type: 'object'
      properties:
        url:
          type: 'string'
          minLength: 1
          format: 'uri'
        events:
          type: 'array'
          items:
            type: 'string'
            enum:
              - 'subscription_created'
              - 'subscription_updated'
              - 'subscription_cancelled'
              - 'usage_finalised'
              - 'usage_recorded'
              - 'receipt_created'
              - 'owner_updated'
          minItems: 1
      required:
        - 'url'
        - 'events'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    CreateGranteeRequestSchema:
      type: 'object'
      properties:
        name:
          type: 'string'
        granteeId:
          type: 'string'
      required:
        - 'granteeId'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    UpdateGranteeRequestSchema:
      type: 'object'
      properties:
        granteeId:
          type: 'string'
          minLength: 1
        name:
          type:
            - 'string'
            - 'null'
      required:
        - 'granteeId'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    ManageGranteesRequestSchema:
      type: 'array'
      items:
        anyOf:
          - type: 'object'
            properties:
              granteeId:
                type: 'string'
              type:
                type: 'string'
                const: 'add'
              name:
                type: 'string'
            required:
              - 'granteeId'
              - 'type'
            additionalProperties: false
          - type: 'object'
            properties:
              granteeId:
                type: 'string'
              type:
                type: 'string'
                const: 'remove'
            required:
              - 'granteeId'
              - 'type'
            additionalProperties: false
          - type: 'object'
            properties:
              granteeId:
                type: 'string'
              type:
                type: 'string'
                const: 'replace'
              name:
                type: 'string'
              newGranteeId:
                type: 'string'
            required:
              - 'granteeId'
              - 'type'
              - 'newGranteeId'
            additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    CreateCartRequestSchema:
      type: 'object'
      properties:
        owner:
          type: 'string'
        interval:
          enum:
            - 'day'
            - 'week'
            - 'month'
            - 'year'
          type:
            - 'string'
            - 'null'
        intervalCount:
          type:
            - 'number'
            - 'null'
        currency:
          type: 'string'
          enum:
            - 'USD'
            - 'AED'
            - 'AFN'
            - 'ALL'
            - 'AMD'
            - 'ANG'
            - 'AOA'
            - 'ARS'
            - 'AUD'
            - 'AWG'
            - 'AZN'
            - 'BAM'
            - 'BBD'
            - 'BDT'
            - 'BGN'
            - 'BIF'
            - 'BMD'
            - 'BND'
            - 'BOB'
            - 'BRL'
            - 'BSD'
            - 'BWP'
            - 'BYN'
            - 'BZD'
            - 'CAD'
            - 'CDF'
            - 'CHF'
            - 'CLP'
            - 'CNY'
            - 'COP'
            - 'CRC'
            - 'CVE'
            - 'CZK'
            - 'DJF'
            - 'DKK'
            - 'DOP'
            - 'DZD'
            - 'EGP'
            - 'ETB'
            - 'EUR'
            - 'FJD'
            - 'FKP'
            - 'GBP'
            - 'GEL'
            - 'GIP'
            - 'GMD'
            - 'GNF'
            - 'GTQ'
            - 'GYD'
            - 'HKD'
            - 'HNL'
            - 'HTG'
            - 'HUF'
            - 'IDR'
            - 'ILS'
            - 'INR'
            - 'ISK'
            - 'JMD'
            - 'JPY'
            - 'KES'
            - 'KGS'
            - 'KHR'
            - 'KMF'
            - 'KRW'
            - 'KYD'
            - 'KZT'
            - 'LAK'
            - 'LBP'
            - 'LKR'
            - 'LRD'
            - 'LSL'
            - 'MAD'
            - 'MDL'
            - 'MGA'
            - 'MKD'
            - 'MMK'
            - 'MNT'
            - 'MOP'
            - 'MUR'
            - 'MVR'
            - 'MWK'
            - 'MXN'
            - 'MYR'
            - 'MZN'
            - 'NAD'
            - 'NGN'
            - 'NIO'
            - 'NOK'
            - 'NPR'
            - 'NZD'
            - 'PAB'
            - 'PEN'
            - 'PGK'
            - 'PHP'
            - 'PKR'
            - 'PLN'
            - 'PYG'
            - 'QAR'
            - 'RON'
            - 'RSD'
            - 'RUB'
            - 'RWF'
            - 'SAR'
            - 'SBD'
            - 'SCR'
            - 'SEK'
            - 'SGD'
            - 'SHP'
            - 'SLE'
            - 'SOS'
            - 'SRD'
            - 'STD'
            - 'SZL'
            - 'THB'
            - 'TJS'
            - 'TOP'
            - 'TRY'
            - 'TTD'
            - 'TWD'
            - 'TZS'
            - 'UAH'
            - 'UGX'
            - 'UYU'
            - 'UZS'
            - 'VND'
            - 'VUV'
            - 'WST'
            - 'XAF'
            - 'XCD'
            - 'XCG'
            - 'XOF'
            - 'XPF'
            - 'YER'
            - 'ZAR'
            - 'ZMW'
            - 'BHD'
            - 'KWD'
            - 'OMR'
      required:
        - 'owner'
        - 'interval'
        - 'intervalCount'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    UpdateCartRequestSchema:
      type: 'object'
      properties:
        currency:
          enum:
            - 'USD'
            - 'AED'
            - 'AFN'
            - 'ALL'
            - 'AMD'
            - 'ANG'
            - 'AOA'
            - 'ARS'
            - 'AUD'
            - 'AWG'
            - 'AZN'
            - 'BAM'
            - 'BBD'
            - 'BDT'
            - 'BGN'
            - 'BIF'
            - 'BMD'
            - 'BND'
            - 'BOB'
            - 'BRL'
            - 'BSD'
            - 'BWP'
            - 'BYN'
            - 'BZD'
            - 'CAD'
            - 'CDF'
            - 'CHF'
            - 'CLP'
            - 'CNY'
            - 'COP'
            - 'CRC'
            - 'CVE'
            - 'CZK'
            - 'DJF'
            - 'DKK'
            - 'DOP'
            - 'DZD'
            - 'EGP'
            - 'ETB'
            - 'EUR'
            - 'FJD'
            - 'FKP'
            - 'GBP'
            - 'GEL'
            - 'GIP'
            - 'GMD'
            - 'GNF'
            - 'GTQ'
            - 'GYD'
            - 'HKD'
            - 'HNL'
            - 'HTG'
            - 'HUF'
            - 'IDR'
            - 'ILS'
            - 'INR'
            - 'ISK'
            - 'JMD'
            - 'JPY'
            - 'KES'
            - 'KGS'
            - 'KHR'
            - 'KMF'
            - 'KRW'
            - 'KYD'
            - 'KZT'
            - 'LAK'
            - 'LBP'
            - 'LKR'
            - 'LRD'
            - 'LSL'
            - 'MAD'
            - 'MDL'
            - 'MGA'
            - 'MKD'
            - 'MMK'
            - 'MNT'
            - 'MOP'
            - 'MUR'
            - 'MVR'
            - 'MWK'
            - 'MXN'
            - 'MYR'
            - 'MZN'
            - 'NAD'
            - 'NGN'
            - 'NIO'
            - 'NOK'
            - 'NPR'
            - 'NZD'
            - 'PAB'
            - 'PEN'
            - 'PGK'
            - 'PHP'
            - 'PKR'
            - 'PLN'
            - 'PYG'
            - 'QAR'
            - 'RON'
            - 'RSD'
            - 'RUB'
            - 'RWF'
            - 'SAR'
            - 'SBD'
            - 'SCR'
            - 'SEK'
            - 'SGD'
            - 'SHP'
            - 'SLE'
            - 'SOS'
            - 'SRD'
            - 'STD'
            - 'SZL'
            - 'THB'
            - 'TJS'
            - 'TOP'
            - 'TRY'
            - 'TTD'
            - 'TWD'
            - 'TZS'
            - 'UAH'
            - 'UGX'
            - 'UYU'
            - 'UZS'
            - 'VND'
            - 'VUV'
            - 'WST'
            - 'XAF'
            - 'XCD'
            - 'XCG'
            - 'XOF'
            - 'XPF'
            - 'YER'
            - 'ZAR'
            - 'ZMW'
            - 'BHD'
            - 'KWD'
            - 'OMR'
          type:
            - 'string'
            - 'null'
        owner:
          type: 'string'
          minLength: 1
        cartItems:
          type: 'array'
          items:
            type: 'object'
            properties:
              id:
                type: 'string'
              granteeId:
                type: 'string'
              metadata:
                type: 'object'
                additionalProperties:
                  type: 'object'
                  properties:
                    quantity:
                      type: 'number'
                  required:
                    - 'quantity'
                  additionalProperties: false
            required:
              - 'id'
            additionalProperties: false
      required:
        - 'currency'
        - 'owner'
        - 'cartItems'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    GenerateCheckoutLinkRequestSchema:
      type: 'object'
      properties:
        email:
          type: 'string'
          format: 'email'
        cancelUrl:
          type: 'string'
          format: 'uri'
        successUrl:
          type: 'string'
          format: 'uri'
        allowPromoCodes:
          type: 'boolean'
        automaticTax:
          type: 'boolean'
        collectBillingAddress:
          type: 'boolean'
        collectShippingAddress:
          type: 'boolean'
        cardPrefillPreference:
          type: 'string'
          enum:
            - 'none'
            - 'always'
            - 'choice'
        trialPeriodDays:
          type: 'number'
          minimum: 1
          maximum: 730
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    CreateGroupRequestSchema:
      type: 'object'
      properties:
        name:
          type: 'string'
        owner:
          type: 'string'
          minLength: 1
        grantees:
          type: 'array'
          items:
            type: 'object'
            properties:
              granteeId:
                type: 'string'
              name:
                type: 'string'
                description: 'Name of the grantee, only applicable when creating new grantees.'
            required:
              - 'granteeId'
            additionalProperties: false
          description: 'Create new or connect existing grantees to the group. To connect an existing grantee use it''s granteeId value.'
      required:
        - 'owner'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    UpdateGroupRequestSchema:
      type: 'object'
      properties:
        grantees:
          type: 'array'
          items:
            type: 'object'
            properties:
              id:
                type: 'string'
              granteeId:
                type: 'string'
                minLength: 1
              name:
                type:
                  - 'string'
                  - 'null'
            required:
              - 'id'
              - 'granteeId'
            additionalProperties: false
        name:
          type:
            - 'string'
            - 'null'
        id:
          type: 'string'
      required:
        - 'grantees'
        - 'id'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    CreateEntitlementRequestSchema:
      type: 'object'
      properties:
        name:
          allOf:
            - type: 'string'
            - type: 'string'
              minLength: 1
              pattern: '^[a-z_]+$'
      required:
        - 'name'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    BatchSubscriptionActionsRequestSchema:
      type: 'object'
      properties:
        action:
          type: 'string'
          enum:
            - 'cancel'
            - 'enable-auto-renew'
            - 'disable-auto-renew'
            - 'delete'
          description: 'The action to perform on all provided subscriptions. One of `cancel`, `enable-auto-renew`, `disable-auto-renew`, `delete`. The `delete` action is only available in test mode.'
        subscriptionIds:
          type: 'array'
          items:
            type: 'string'
            minLength: 1
          minItems: 1
          maxItems: 100
          description: 'The IDs of the subscriptions to apply the action to. Maximum of 100 IDs per request.'
      required:
        - 'action'
        - 'subscriptionIds'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    BatchCartActionsRequestSchema:
      type: 'object'
      properties:
        action:
          type: 'string'
          enum:
            - 'abandon'
        cartIds:
          type: 'array'
          items:
            type: 'string'
            minLength: 1
          minItems: 1
          maxItems: 100
      required:
        - 'action'
        - 'cartIds'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    BatchReceiptActionsRequestSchema:
      type: 'object'
      properties:
        action:
          type: 'string'
          enum:
            - 'delete'
        receiptIds:
          type: 'array'
          items:
            type: 'string'
            minLength: 1
          minItems: 1
          maxItems: 100
      required:
        - 'action'
        - 'receiptIds'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    CreatePortalRequestSchema:
      type: 'object'
      properties:
        returnUrl:
          type: 'string'
          description: 'The URL to redirect customers to after they have finished managing their subscription in the portal.'
        features:
          type: 'object'
          properties:
            paymentMethodUpdate:
              type: 'object'
              properties:
                enabled:
                  type: 'boolean'
                  description: 'Whether to enable this feature in the portal.'
              required:
                - 'enabled'
              additionalProperties: false
              description: 'Enables a customer to update their payment card details.'
            customerUpdate:
              type: 'object'
              properties:
                enabled:
                  type: 'boolean'
                  description: 'Whether to enable this feature in the portal.'
                allowedUpdates:
                  type: 'array'
                  items:
                    type: 'string'
                    enum:
                      - 'name'
                      - 'email'
                      - 'address'
                      - 'phone'
                      - 'shipping'
                  description: 'The customer fields that can be updated. Accepted values: `name`, `email`, `address`, `phone`, `shipping`.'
              required:
                - 'enabled'
                - 'allowedUpdates'
              additionalProperties: false
              description: 'Enables a customer to update their personal information.'
            subscriptionCancel:
              type: 'object'
              properties:
                enabled:
                  type: 'boolean'
                  description: 'Whether to enable this feature in the portal.'
                when:
                  type: 'string'
                  enum:
                    - 'now'
                    - 'end'
                  description: '`now` cancels the subscription immediately. `end` schedules cancellation at the end of the current billing period.'
              required:
                - 'enabled'
                - 'when'
              additionalProperties: false
              description: 'Enables a customer to cancel their subscription.'
            invoiceHistory:
              type: 'object'
              properties:
                enabled:
                  type: 'boolean'
                  description: 'Whether to enable this feature in the portal.'
              required:
                - 'enabled'
              additionalProperties: false
              description: 'Enables a customer to view their invoice history.'
          additionalProperties: false
          description: 'The portal features to enable for this session.'
      required:
        - 'features'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    UpdateSubscriptionItemsRequestSchema:
      type: 'object'
      properties:
        items:
          type: 'array'
          items:
            anyOf:
              - type: 'object'
                properties:
                  planId:
                    type: 'string'
                    description: 'The ID of the plan to act on.'
                  action:
                    type: 'string'
                    const: 'remove'
                    description: 'Remove the specified plan from the subscription.'
                required:
                  - 'planId'
                  - 'action'
                additionalProperties: false
              - type: 'object'
                properties:
                  planId:
                    type: 'string'
                    description: 'The ID of the plan to act on.'
                  metadata:
                    type: 'object'
                    additionalProperties:
                      type: 'object'
                      properties:
                        quantity:
                          type: 'number'
                      required:
                        - 'quantity'
                      additionalProperties: false
                    description: 'Per-line-item quantity overrides, keyed by line item ID.'
                  action:
                    type: 'string'
                    const: 'add'
                    description: 'Add a new plan to the subscription.'
                  grantee:
                    type: 'string'
                    description: 'Your internal identifier for the entity that will receive access to the added plan. Required for non-per-seat plans.'
                required:
                  - 'planId'
                  - 'action'
                additionalProperties: false
              - type: 'object'
                properties:
                  planId:
                    type: 'string'
                    description: 'The ID of the plan to act on.'
                  metadata:
                    type: 'object'
                    additionalProperties:
                      type: 'object'
                      properties:
                        quantity:
                          type: 'number'
                      required:
                        - 'quantity'
                      additionalProperties: false
                    description: 'Per-line-item quantity overrides, keyed by line item ID.'
                  action:
                    type: 'string'
                    const: 'replace'
                    description: 'Replace the specified plan with a different plan, preserving the existing grantee group.'
                  newPlanId:
                    type: 'string'
                    description: 'The ID of the plan to replace the existing plan with.'
                required:
                  - 'planId'
                  - 'action'
                  - 'newPlanId'
                additionalProperties: false
          description: 'The list of plan changes to apply to the subscription.'
        proration:
          type: 'string'
          enum:
            - 'always_invoice'
            - 'create_prorations'
            - 'none'
          description: 'Controls how Stripe handles proration when items change mid-billing-period. Required for paid subscriptions; not applicable to Salable-only subscriptions. One of `always_invoice`, `create_prorations`, `none`.'
      required:
        - 'items'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    PlanRequestSchema:
      type: 'object'
      properties:
        name:
          type: 'string'
        isActive:
          type: 'boolean'
        tierTag:
          type:
            - 'string'
            - 'null'
        trialPeriodDays:
          minimum: 1
          maximum: 730
          type:
            - 'number'
            - 'null'
      required:
        - 'name'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    UpdateOwnerRequestSchema:
      type: 'object'
      properties:
        owner:
          type: 'string'
          minLength: 1
        email:
          anyOf:
            - anyOf:
                - not: {}
                - type: 'string'
                  format: 'email'
            - type: 'string'
              const: ''
      required:
        - 'owner'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    CreateTierTagRequestSchema:
      type: 'object'
      properties:
        name:
          type: 'string'
          minLength: 1
          pattern: '^[a-z]+(_[a-z]+)*$'
      required:
        - 'name'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    RecordUsageRequestSchema:
      type: 'object'
      properties:
        owner:
          type: 'string'
        meterSlug:
          type: 'string'
          pattern: '^[a-z0-9_]+$'
        increment:
          type: 'number'
          minimum: 1
      required:
        - 'owner'
        - 'meterSlug'
        - 'increment'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    CreateCartItemRequestSchema:
      type: 'object'
      properties:
        planId:
          type: 'string'
        cartId:
          type: 'string'
        grantee:
          type: 'string'
        interval:
          enum:
            - 'day'
            - 'week'
            - 'month'
            - 'year'
          type:
            - 'string'
            - 'null'
        intervalCount:
          type:
            - 'number'
            - 'null'
        metadata:
          type: 'object'
          additionalProperties:
            type: 'object'
            properties:
              quantity:
                type: 'number'
                description: 'Not applicable to metered line items and per seat line items with billing scheme flat rate.'
            required:
              - 'quantity'
            additionalProperties: false
          description: 'Optionally set config for each cart item by using the line item slug as the key in the object'
      required:
        - 'planId'
        - 'cartId'
        - 'interval'
        - 'intervalCount'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
    UpdateSubscriptionPlanLineItemSchema:
      type: 'object'
      properties:
        quantity:
          type: 'number'
          description: 'The new quantity for this subscription plan line item. Must be within the line item''s minimum and maximum allowed quantities, and cannot be less than the number of current grantees on the attached group.'
        proration:
          type: 'string'
          enum:
            - 'always_invoice'
            - 'create_prorations'
            - 'none'
          description: 'Controls how Stripe handles proration when the quantity changes mid-billing-period. One of `always_invoice`, `create_prorations`, `none`.'
      required:
        - 'quantity'
      additionalProperties: false
      $schema: 'http://json-schema.org/draft-07/schema#'
security:
  - BearerAuth: []
paths:
  /api/ai/conversations:
    get:
      tags:
        - 'AI Conversations'
      summary: 'List AI Conversations'
      operationId: 'listAiConversations'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved AI conversations'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAiConversationListSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/ai/conversations/{id}:
    get:
      tags:
        - 'AI Conversations'
      summary: 'Retrieve AI Conversation'
      operationId: 'retrieveAiConversation'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'messages'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved AI conversation'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAIConversationDetailSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'AI conversation not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/ai/messages:
    get:
      tags:
        - 'AI Messages'
      summary: 'List AI Messages'
      operationId: 'listAiMessages'
      parameters:
        - name: 'conversationId'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved AI messages'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAiMessageListSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/api-keys:
    get:
      summary: 'List Api Keys'
      tags:
        - 'API Keys'
      operationId: 'listApiKeys'
      parameters:
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved API keys'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetApiKeyListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    post:
      tags:
        - 'API Keys'
      summary: 'Create API key'
      operationId: 'createApiKey'
      responses:
        '201':
          description: 'Successfully created API key'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateApiKeyResponseSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/api-keys/{id}:
    get:
      tags:
        - 'API Keys'
      operationId: 'retrieveApiKey'
      summary: 'Retrieve API Key'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '200':
          description: 'Successfully retrieved API key'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetApiKeyDetailSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'API key not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    delete:
      tags:
        - 'API Keys'
      operationId: 'deleteApiKey'
      summary: 'Delete API Key'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully deleted API key'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'API key not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/cart-items:
    post:
      tags:
        - 'Cart Items'
      summary: 'Create Cart Item'
      operationId: 'createCartItem'
      description: 'Create a cart item which will be linked to a plan. The plan is a collection of line items. To set metadata for a specific line item, use the metadata object with the key as the line item slug.'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCartItemRequestSchema'
      responses:
        '201':
          description: 'Successfully created cart item'
          content:
            application/json:
              schema:
                type: 'object'
                properties:
                  type:
                    const: 'object'
                    type: 'string'
                  data:
                    additionalProperties: false
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      cartId:
                        type: 'string'
                      planId:
                        type: 'string'
                      metadata:
                        anyOf:
                          - type: 'null'
                          - {}
                      granteeId:
                        type:
                          - 'string'
                          - 'null'
                      groupId:
                        type:
                          - 'string'
                          - 'null'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'cartId'
                      - 'planId'
                      - 'metadata'
                      - 'granteeId'
                      - 'groupId'
                      - 'createdAt'
                      - 'updatedAt'
                required:
                  - 'type'
                  - 'data'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/cart-items/{id}:
    delete:
      tags:
        - 'Cart Items'
      summary: 'Delete Cart'
      operationId: 'deleteCart'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully deleted cart item'
        '400':
          description: 'Invalid request'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Cart item not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/carts:
    post:
      tags:
        - 'Carts'
      summary: 'Create Cart'
      operationId: 'createCart'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCartRequestSchema'
      responses:
        '201':
          description: 'Successfully created cart'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCartResponseSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    get:
      tags:
        - 'Carts'
      summary: 'List Carts'
      operationId: 'listCarts'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'owner'
          style: 'form'
          explode: false
        - name: 'status'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'active'
                - 'abandoned'
                - 'complete'
          style: 'form'
          explode: false
        - name: 'ownerId'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
          style: 'form'
          explode: false
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
        - name: 'search'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Search by cart id'
      responses:
        '200':
          description: 'Successfully retrieved carts'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCartListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/carts/batch:
    post:
      tags:
        - 'Carts'
      summary: 'Batch Cart Actions'
      description: 'Perform batch actions on multiple carts. Currently supports abandoning active carts. Returns detailed results for each cart including success, failure, or skip status.'
      operationId: 'batchCartActions'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCartActionsRequestSchema'
      responses:
        '200':
          description: 'Batch action completed. Check the response for individual cart results.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchCartActionsResponseSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Some carts belong to a different organisation'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Some carts were not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/carts/{id}:
    get:
      tags:
        - 'Carts'
      summary: 'Retrieve Cart'
      operationId: 'retrieveCart'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '200':
          description: 'Successfully retrieved cart'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCartDetailSchema'
        '400':
          description: 'Invalid request'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Cart not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    put:
      tags:
        - 'Carts'
      summary: 'Update Cart'
      operationId: 'updateCart'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCartRequestSchema'
      responses:
        '204':
          description: 'Successfully updated cart'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Cart not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    delete:
      tags:
        - 'Carts'
      summary: 'Abandon Cart'
      operationId: 'abandonCart'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully abandoned cart'
        '400':
          description: 'Invalid request'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Cart not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/carts/{id}/checkout:
    post:
      tags:
        - 'Carts'
      summary: 'Generate Checkout Link'
      operationId: 'generateCheckoutLink'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateCheckoutLinkRequestSchema'
      responses:
        '200':
          description: 'Successfully generated checkout link'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateCheckoutLinkSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Cart not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/checkout:
    post:
      tags:
        - 'Checkout'
      summary: 'Generate Quick Checkout Link'
      operationId: 'generateQuickCheckoutLink'
      requestBody:
        content:
          application/json:
            schema:
              type: 'object'
              properties:
                planId:
                  type: 'string'
                  description: 'The unique identifier of the plan to checkout'
                owner:
                  type: 'string'
                  description: 'The unique identifier for the owner who will purchase the subscription'
                grantee:
                  type: 'string'
                  description: 'The unique identifier for the grantee who will receive access. Can be an individual grantee ID or a group ID (starting with grp_). If not provided, a new group will be created for the owner.'
                interval:
                  enum:
                    - 'day'
                    - 'week'
                    - 'month'
                    - 'year'
                  type:
                    - 'string'
                    - 'null'
                  description: 'The billing interval for recurring charges (e.g., month, year). Required for subscription mode. Set to null for one-time payments.'
                intervalCount:
                  type:
                    - 'number'
                    - 'null'
                  description: 'The number of intervals between billings. For example, intervalCount of 3 with interval of month represents billing every 3 months.'
                currency:
                  type: 'string'
                  enum:
                    - 'USD'
                    - 'AED'
                    - 'AFN'
                    - 'ALL'
                    - 'AMD'
                    - 'ANG'
                    - 'AOA'
                    - 'ARS'
                    - 'AUD'
                    - 'AWG'
                    - 'AZN'
                    - 'BAM'
                    - 'BBD'
                    - 'BDT'
                    - 'BGN'
                    - 'BIF'
                    - 'BMD'
                    - 'BND'
                    - 'BOB'
                    - 'BRL'
                    - 'BSD'
                    - 'BWP'
                    - 'BYN'
                    - 'BZD'
                    - 'CAD'
                    - 'CDF'
                    - 'CHF'
                    - 'CLP'
                    - 'CNY'
                    - 'COP'
                    - 'CRC'
                    - 'CVE'
                    - 'CZK'
                    - 'DJF'
                    - 'DKK'
                    - 'DOP'
                    - 'DZD'
                    - 'EGP'
                    - 'ETB'
                    - 'EUR'
                    - 'FJD'
                    - 'FKP'
                    - 'GBP'
                    - 'GEL'
                    - 'GIP'
                    - 'GMD'
                    - 'GNF'
                    - 'GTQ'
                    - 'GYD'
                    - 'HKD'
                    - 'HNL'
                    - 'HTG'
                    - 'HUF'
                    - 'IDR'
                    - 'ILS'
                    - 'INR'
                    - 'ISK'
                    - 'JMD'
                    - 'JPY'
                    - 'KES'
                    - 'KGS'
                    - 'KHR'
                    - 'KMF'
                    - 'KRW'
                    - 'KYD'
                    - 'KZT'
                    - 'LAK'
                    - 'LBP'
                    - 'LKR'
                    - 'LRD'
                    - 'LSL'
                    - 'MAD'
                    - 'MDL'
                    - 'MGA'
                    - 'MKD'
                    - 'MMK'
                    - 'MNT'
                    - 'MOP'
                    - 'MUR'
                    - 'MVR'
                    - 'MWK'
                    - 'MXN'
                    - 'MYR'
                    - 'MZN'
                    - 'NAD'
                    - 'NGN'
                    - 'NIO'
                    - 'NOK'
                    - 'NPR'
                    - 'NZD'
                    - 'PAB'
                    - 'PEN'
                    - 'PGK'
                    - 'PHP'
                    - 'PKR'
                    - 'PLN'
                    - 'PYG'
                    - 'QAR'
                    - 'RON'
                    - 'RSD'
                    - 'RUB'
                    - 'RWF'
                    - 'SAR'
                    - 'SBD'
                    - 'SCR'
                    - 'SEK'
                    - 'SGD'
                    - 'SHP'
                    - 'SLE'
                    - 'SOS'
                    - 'SRD'
                    - 'STD'
                    - 'SZL'
                    - 'THB'
                    - 'TJS'
                    - 'TOP'
                    - 'TRY'
                    - 'TTD'
                    - 'TWD'
                    - 'TZS'
                    - 'UAH'
                    - 'UGX'
                    - 'UYU'
                    - 'UZS'
                    - 'VND'
                    - 'VUV'
                    - 'WST'
                    - 'XAF'
                    - 'XCD'
                    - 'XCG'
                    - 'XOF'
                    - 'XPF'
                    - 'YER'
                    - 'ZAR'
                    - 'ZMW'
                    - 'BHD'
                    - 'KWD'
                    - 'OMR'
                  description: 'The three-letter ISO currency code (e.g., USD, GBP, EUR). If not provided the checkout will use geolocation. For geolocation to work all line item prices on the plan must have the same default currency.'
                metadata:
                  type: 'object'
                  additionalProperties:
                    type: 'object'
                    properties:
                      quantity:
                        type: 'number'
                        description: 'Not applicable to metered line items and per seat line items with billing scheme fixed.'
                    required:
                      - 'quantity'
                    additionalProperties: false
                  description: 'Optionally set config for each line item by using the line item slug as the key in the object.'
                email:
                  type: 'string'
                  format: 'email'
                  description: 'The email address of the customer. If the owner already exists in the system and does not have a Stripe email it will be used to either create or update the Stripe customer record.'
                cancelUrl:
                  type: 'string'
                  format: 'uri'
                  description: 'The URL to redirect the customer to if they cancel the checkout. If not provided, falls back to the product default setting.'
                successUrl:
                  type: 'string'
                  format: 'uri'
                  description: 'The URL to redirect the customer to after successful payment. If not provided, falls back to the product default setting.'
                allowPromoCodes:
                  type: 'boolean'
                  description: 'Whether to allow customers to enter promotional codes during checkout. Defaults to product setting if not specified.'
                automaticTax:
                  type: 'boolean'
                  description: 'Whether to enable automatic tax calculation based on customer location. Defaults to product setting if not specified.'
                collectBillingAddress:
                  type: 'boolean'
                  description: 'Whether to collect the customer billing address during checkout. Defaults to product setting if not specified.'
                collectShippingAddress:
                  type: 'boolean'
                  description: 'Whether to collect the customer shipping address during checkout. Defaults to product setting if not specified.'
                cardPrefillPreference:
                  type: 'string'
                  enum:
                    - 'none'
                    - 'always'
                    - 'choice'
                  description: 'Controls how saved payment methods are handled. Options: "always" (always save), "choice" (customer chooses), "none" (never save). Defaults to product setting if not specified.'
                trialPeriodDays:
                  type: 'number'
                  minimum: 1
                  maximum: 730
                  description: 'The number of days for the trial period on subscription. If not provided, falls back to the plan default trial period.'
              required:
                - 'planId'
                - 'owner'
                - 'interval'
                - 'intervalCount'
              additionalProperties: false
              $schema: 'http://json-schema.org/draft-07/schema#'
      responses:
        '200':
          description: 'Successfully generated checkout link'
          content:
            application/json:
              schema:
                type: 'object'
                properties:
                  type:
                    const: 'object'
                    type: 'string'
                  data:
                    type: 'object'
                    properties:
                      url:
                        type: 'string'
                    required:
                      - 'url'
                required:
                  - 'type'
                  - 'data'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Resource not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/currency-options:
    get:
      summary: 'List Currency Options'
      tags:
        - 'Currency Options'
      operationId: 'listCurrencyOptions'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'priceId'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'tiers'
          style: 'form'
          explode: false
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved currency options.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCurrencyOptionsListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/currency-options/{id}:
    get:
      tags:
        - 'Currency Options'
      operationId: 'retrieveCurrencyOption'
      summary: 'Retrieve Currency Option'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'tiers'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved currency option'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCurrencyOptionDetailSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Currency option not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/destinations:
    get:
      tags:
        - 'Destinations'
      summary: 'List Destinations'
      operationId: 'listDestinations'
      description: 'A paginated endpoint that returns a list of event destinations.'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'eventId'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved event destinations'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDestinationListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Webhook destination event not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/destinations/{id}:
    get:
      tags:
        - 'Events'
      summary: 'Retrieve Destination'
      operationId: 'retrieveDestination'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'attempts'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved event destination'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDestinationDetailSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Webhook destination event not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    post:
      tags:
        - 'Events'
      summary: 'Resend Webhook Event'
      description: 'Creates a new attempt or updates an existing pending attempt for a webhook event'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully resent webhook event'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Webhook destination event not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/entitlements:
    get:
      tags:
        - 'Entitlements'
      summary: 'List Entitlements'
      operationId: 'listEntitlements'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'planId'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'search'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved entitlements'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEntitlementsListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    post:
      tags:
        - 'Entitlements'
      summary: 'Create Entitlement'
      operationId: 'createEntitlement'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEntitlementRequestSchema'
      responses:
        '201':
          description: 'Successfully created entitlement'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateEntitlementResponseSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/entitlements/check:
    get:
      tags:
        - 'Entitlements'
      parameters:
        - name: 'granteeId'
          in: 'query'
          required: true
          schema:
            type: 'string'
        - name: 'owner'
          in: 'query'
          required: false
          schema:
            type: 'string'
      summary: 'Check Entitlements'
      operationId: 'checkEntitlements'
      description: 'Unlock features in your product by checking what the grantee has access to.'
      responses:
        '200':
          description: 'Successfully retrieved entitlements'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckEntitlementsSchema'
        '400':
          description: 'Bad request - validation error or signing key not configured'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Grantee or owner not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/entitlements/{id}:
    get:
      tags:
        - 'Entitlements'
      summary: 'Retrieve Entitlement'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      operationId: 'retrieveEntitlement'
      responses:
        '200':
          description: 'Successfully retrieved entitlement'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEntitlementDetailSchema'
        '400':
          description: 'Invalid ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Entitlement not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    put:
      tags:
        - 'Entitlements'
      summary: 'Update Entitlement'
      operationId: 'updateEntitlement'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEntitlementRequestSchema'
      responses:
        '204':
          description: 'Successfully updated entitlement'
        '400':
          description: 'Invalid ID or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Entitlement not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    delete:
      tags:
        - 'Entitlements'
      summary: 'Delete Entitlement'
      operationId: 'deleteEntitlement'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully deleted entitlement'
        '400':
          description: 'Invalid ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Entitlement not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/event-attempts:
    get:
      tags:
        - 'Events'
      summary: 'List Event Attempts'
      operationId: 'listEventAttempts'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'destinationId'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved webhook destination event with attempts'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventAttemptsListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Webhook destination event not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    post:
      tags:
        - 'Events'
      summary: 'Resend Webhook Event'
      description: 'Creates a new attempt or updates an existing pending attempt for a webhook event'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully resent webhook event'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Webhook destination event not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/events:
    get:
      tags:
        - 'Events'
      summary: 'List Events'
      operationId: 'listEvents'
      description: 'Response is sorted by createdAt in descending order.'
      parameters:
        - name: 'types'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'subscription_created'
                - 'subscription_updated'
                - 'subscription_cancelled'
                - 'usage_finalised'
                - 'usage_recorded'
                - 'receipt_created'
                - 'owner_updated'
          style: 'form'
          explode: false
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved webhook events'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/events/{id}:
    get:
      tags:
        - 'Events'
      summary: 'Retrieve Event'
      operationId: 'retrieveEvent'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'destinations'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved event'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventDetailSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Webhook event not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/grantees:
    get:
      tags:
        - 'Grantees'
      summary: 'List Grantees'
      operationId: 'listGrantees'
      parameters:
        - name: 'groupId'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved grantees'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetGranteeListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    post:
      tags:
        - 'Grantees'
      summary: 'Create Grantee'
      operationId: 'createGrantee'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGranteeRequestSchema'
      responses:
        '200':
          description: 'Successfully created grantee'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateGranteeResponseSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/grantees/{id}:
    get:
      tags:
        - 'Grantees'
      summary: 'Retrieve Grantee'
      operationId: 'retrieveGrantee'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'memberships'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved grantee'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetGranteeDetailSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Grantee not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    put:
      tags:
        - 'Grantees'
      summary: 'Update Grantee'
      operationId: 'updateGrantee'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateGranteeRequestSchema'
      responses:
        '204':
          description: 'Successfully updated grantee'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Grantee not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    delete:
      tags:
        - 'Grantees'
      summary: 'Delete Grantee'
      operationId: 'deleteGrantee'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully deleted grantee'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Grantee not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/groups:
    get:
      tags:
        - 'Groups'
      summary: 'List Groups'
      operationId: 'listGroups'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'owner'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'owner'
          style: 'form'
          explode: false
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved groups'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetGroupsListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    post:
      tags:
        - 'Groups'
      summary: 'Create a new group'
      operationId: 'createGroup'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGroupRequestSchema'
      responses:
        '200':
          description: 'Successfully created group'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateGroupResponseSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/groups/{id}:
    get:
      tags:
        - 'Groups'
      summary: 'Retrieve Group'
      operationId: 'retrieveGroup'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'owner'
                - 'memberships'
                - 'subscriptionPlans'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved grantee group'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetGroupDetailSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Grantee group not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    put:
      tags:
        - 'Groups'
      summary: 'Update Group'
      operationId: 'updateGroup'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateGroupRequestSchema'
      responses:
        '204':
          description: 'Successfully updated group'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Grantee group not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    delete:
      tags:
        - 'Groups'
      summary: 'Delete Group'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      operationId: 'deleteGroup'
      responses:
        '204':
          description: 'Successfully deleted group'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Grantee group not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/groups/{id}/grantees:
    post:
      tags:
        - 'Groups'
      summary: 'Manage Group Memberships'
      operationId: 'manageGrantees'
      description: 'Add, remove, or replace grantees in a grantee group.'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ManageGranteesRequestSchema'
      responses:
        '204':
          description: 'Successfully managed grantees in the grantee group'
        '400':
          description: 'Invalid request, validation error, or operation-specific error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Grantee group not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/line-items:
    get:
      tags:
        - 'Line Items'
      summary: 'List Line Items'
      operationId: 'listLineItems'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'planId'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'search'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved line items'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLineItemListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/line-items/{id}:
    get:
      tags:
        - 'Line Items'
      summary: 'Retrieve Line Item'
      operationId: 'retrieveLineItem'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'prices'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved line item'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLineItemDetailSchema'
        '400':
          description: 'Invalid ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Line item not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    put:
      tags:
        - 'Line Items'
      summary: 'Update Line Item'
      operationId: 'updateLineItem'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLineItemRequestSchema'
      responses:
        '200':
          description: 'Successfully updated line item'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateLineItemResponseSchema'
        '400':
          description: 'Invalid ID or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Line item not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    delete:
      tags:
        - 'Line Items'
      summary: 'Delete Line Item'
      operationId: 'deleteLineItem'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully deleted line item'
        '400':
          description: 'Invalid ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Line item not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/line-items/{id}/archive:
    post:
      tags:
        - 'Line Items'
      summary: 'Archive Line Item'
      description: 'Archives a line item. Archived line items cannot be modified. Cannot archive a line item if its parent plan or product is already archived.'
      operationId: 'archiveLineItem'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully archived line item'
        '400':
          description: 'Invalid request (line item already archived, parent plan or product is archived, no payment integration, or payment integration not onboarded)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, line item belongs to another organisation'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Line item not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/memberships:
    get:
      tags:
        - 'Memberships'
      summary: 'List Memberships'
      operationId: 'listMemberships'
      parameters:
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'group'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully returns paginated memberships list'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMembershipListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/memberships/{id}:
    get:
      tags:
        - 'Memberships'
      summary: 'Retrieve Memberships'
      operationId: 'retrieveMemberships'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'group'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved membership'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMembershipDetailSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Membership not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/meters:
    get:
      tags:
        - 'Meters'
      summary: 'List Meters'
      operationId: 'listMeters'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'search'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved meters'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMetersListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/owners:
    get:
      tags:
        - 'Owners'
      summary: 'List Owners'
      operationId: 'listOwners'
      parameters:
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'subscriptions'
                - 'receipts'
          style: 'form'
          explode: false
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'search'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
        - name: 'stripeCustomerId'
          in: 'query'
          required: false
          schema:
            type: 'string'
      responses:
        '200':
          description: 'Successfully retrieved owners'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOwnerListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/owners/{id}:
    delete:
      tags:
        - 'Owners'
      summary: 'Delete Owner'
      operationId: 'deleteOwner'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully deleted owner'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Owner not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '409':
          description: 'Owner has attached subscriptions or receipts and cannot be deleted'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    get:
      tags:
        - 'Owners'
      summary: 'Retrieve Owner'
      operationId: 'retrieveOwner'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'carts'
                - 'subscriptions'
                - 'groups'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved owner'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOwnerDetailSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Owner not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    put:
      tags:
        - 'Owners'
      summary: 'Update Owner'
      operationId: 'updateOwner'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOwnerRequestSchema'
      responses:
        '204':
          description: 'Successfully updated owner'
        '400':
          description: 'Invalid request, validation error, or duplicate owner value'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Owner not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/payment-integrations:
    get:
      tags:
        - 'Payment Integrations'
      summary: 'List Payment Integrations'
      operationId: 'listPaymentIntegrations'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved payment integrations'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPaymentIntegrationListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    post:
      tags:
        - 'Payment Integrations'
      summary: 'Create Payment Integration'
      operationId: 'createPaymentIntegration'
      description: 'Create a new Stripe standard account for the organisation'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: 'object'
              properties:
                emailAddress:
                  type: 'string'
                  format: 'email'
                  description: 'Email address for the Stripe account'
              required:
                - 'emailAddress'
      responses:
        '204':
          description: 'Successfully created payment integration'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/payment-integrations/{id}:
    delete:
      tags:
        - 'Payment Integrations'
      summary: 'Delete Payment Integration'
      operationId: 'deletePaymentIntegration'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully deleted payment integration'
        '400':
          description: 'Invalid request'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Payment integration not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/payment-integrations/{id}/onboarding:
    post:
      tags:
        - 'Payment Integrations'
      summary: 'Create Onboarding Link'
      operationId: 'createOnboardingLink'
      description: 'Generate a new Stripe onboarding link for an existing payment integration'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '200':
          description: 'Successfully generated onboarding link'
          content:
            application/json:
              schema: '#/components/schemas/GenerateOnboardingLinkResponseSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required permissions'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Payment integration not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/plans:
    get:
      tags:
        - 'Plans'
      summary: 'List Plans'
      operationId: 'listPlans'
      parameters:
        - name: 'currency'
          in: 'query'
          required: false
          schema:
            type: 'string'
            enum:
              - 'USD'
              - 'AED'
              - 'AFN'
              - 'ALL'
              - 'AMD'
              - 'ANG'
              - 'AOA'
              - 'ARS'
              - 'AUD'
              - 'AWG'
              - 'AZN'
              - 'BAM'
              - 'BBD'
              - 'BDT'
              - 'BGN'
              - 'BIF'
              - 'BMD'
              - 'BND'
              - 'BOB'
              - 'BRL'
              - 'BSD'
              - 'BWP'
              - 'BYN'
              - 'BZD'
              - 'CAD'
              - 'CDF'
              - 'CHF'
              - 'CLP'
              - 'CNY'
              - 'COP'
              - 'CRC'
              - 'CVE'
              - 'CZK'
              - 'DJF'
              - 'DKK'
              - 'DOP'
              - 'DZD'
              - 'EGP'
              - 'ETB'
              - 'EUR'
              - 'FJD'
              - 'FKP'
              - 'GBP'
              - 'GEL'
              - 'GIP'
              - 'GMD'
              - 'GNF'
              - 'GTQ'
              - 'GYD'
              - 'HKD'
              - 'HNL'
              - 'HTG'
              - 'HUF'
              - 'IDR'
              - 'ILS'
              - 'INR'
              - 'ISK'
              - 'JMD'
              - 'JPY'
              - 'KES'
              - 'KGS'
              - 'KHR'
              - 'KMF'
              - 'KRW'
              - 'KYD'
              - 'KZT'
              - 'LAK'
              - 'LBP'
              - 'LKR'
              - 'LRD'
              - 'LSL'
              - 'MAD'
              - 'MDL'
              - 'MGA'
              - 'MKD'
              - 'MMK'
              - 'MNT'
              - 'MOP'
              - 'MUR'
              - 'MVR'
              - 'MWK'
              - 'MXN'
              - 'MYR'
              - 'MZN'
              - 'NAD'
              - 'NGN'
              - 'NIO'
              - 'NOK'
              - 'NPR'
              - 'NZD'
              - 'PAB'
              - 'PEN'
              - 'PGK'
              - 'PHP'
              - 'PKR'
              - 'PLN'
              - 'PYG'
              - 'QAR'
              - 'RON'
              - 'RSD'
              - 'RUB'
              - 'RWF'
              - 'SAR'
              - 'SBD'
              - 'SCR'
              - 'SEK'
              - 'SGD'
              - 'SHP'
              - 'SLE'
              - 'SOS'
              - 'SRD'
              - 'STD'
              - 'SZL'
              - 'THB'
              - 'TJS'
              - 'TOP'
              - 'TRY'
              - 'TTD'
              - 'TWD'
              - 'TZS'
              - 'UAH'
              - 'UGX'
              - 'UYU'
              - 'UZS'
              - 'VND'
              - 'VUV'
              - 'WST'
              - 'XAF'
              - 'XCD'
              - 'XCG'
              - 'XOF'
              - 'XPF'
              - 'YER'
              - 'ZAR'
              - 'ZMW'
              - 'BHD'
              - 'KWD'
              - 'OMR'
        - name: 'interval'
          in: 'query'
          required: false
          schema:
            type: 'string'
            enum:
              - 'day'
              - 'week'
              - 'month'
              - 'year'
              - 'one_off'
        - name: 'intervalCount'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'productId'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'search'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'includeFilterOptions'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'isActive'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'includeArchived'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'entitlements'
                - 'lineItems'
                - 'product'
                - 'tierTag'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved plans'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPlanListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    post:
      tags:
        - 'Plans'
      summary: 'Create Plan'
      operationId: 'createPlan'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlanRequestSchema'
      responses:
        '201':
          description: 'Successfully created plan'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePlanResponseSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/plans/save:
    post:
      tags:
        - 'Plans'
      summary: 'Save Plan'
      operationId: 'savePlan'
      description: 'Create or update a plan with complex nested data including line items, prices, currency options, and tiers'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SavePlanRequestSchema'
      responses:
        '201':
          description: 'Successfully saved plan'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavePlanResponseSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/plans/{id}:
    get:
      tags:
        - 'Plans'
      summary: 'Retrieve Plan'
      operationId: 'retrievePlan'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'entitlements'
                - 'lineItems'
                - 'product'
                - 'subscriptionPlans'
                - 'tierTag'
          style: 'form'
          explode: false
        - name: 'includeArchived'
          in: 'query'
          required: false
          schema:
            type: 'string'
            enum:
              - 'true'
              - 'false'
      responses:
        '200':
          description: 'Successfully retrieved plan'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPlanDetailSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required permissions'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Plan not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    put:
      tags:
        - 'Plans'
      summary: 'Update Plan'
      operationId: 'updatePlan'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlanRequestSchema'
      responses:
        '200':
          description: 'Successfully updated plan'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatePlanResponseSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required permissions'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Plan not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    delete:
      tags:
        - 'Plans'
      summary: 'Delete Plan'
      operationId: 'deletePlan'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully deleted plan'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required permissions'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Plan not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/plans/{id}/archive:
    post:
      tags:
        - 'Plans'
      summary: 'Archive Plan'
      description: 'Archives a plan. Archived plans cannot be modified. Cannot archive a plan if its parent product is already archived.'
      operationId: 'archivePlan'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully archived plan'
        '400':
          description: 'Invalid request (plan already archived, parent product is archived, or validation error)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, plan belongs to another organisation'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Plan not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/prices:
    get:
      tags:
        - 'Prices'
      summary: 'List Prices'
      operationId: 'listPrices'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved prices'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPriceListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/prices/{id}:
    get:
      tags:
        - 'Prices'
      summary: 'Retrieve Price'
      operationId: 'retrievePrice'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '200':
          description: 'Successfully retrieved price'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPriceDetailSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required permissions'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Price not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    delete:
      tags:
        - 'Prices'
      summary: 'Delete Price'
      operationId: 'deletePrice'
      parameters:
        - name: 'id'
          in: 'path'
          required: true
          schema:
            type: 'string'
          description: 'Price ID'
      responses:
        '204':
          description: 'Successfully deleted price'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required permissions'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Price not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/prices/{id}/archive:
    post:
      tags:
        - 'Prices'
      summary: 'Archive Price'
      description: 'Archives a price. Archived prices cannot be modified. Cannot archive a price if its parent line item, plan, or product is already archived. Cannot archive the last active price on a line item.'
      operationId: 'archivePrice'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully archived price'
        '400':
          description: 'Invalid request (price already archived, parent line item/plan/product is archived, is the last active price on a line item, no payment integration, or payment integration not onboarded)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, price belongs to another organisation'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Price not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/products:
    post:
      tags:
        - 'Products'
      summary: 'Create Product'
      operationId: 'createProduct'
      description: 'Creates a new product.'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProductRequestSchema'
      responses:
        '201':
          description: 'Successfully created product'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateProductResponseSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    get:
      tags:
        - 'Products'
      operationId: 'listProducts'
      summary: 'List Products'
      description: 'Returns a list of your products. The products are returned sorted by `createdAt`, with the most recently created products appearing first.'
      parameters:
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'plans'
                - 'settings'
          description: 'Expand related resources inline. Accepts a comma-separated list. Supported values: `plans`, `settings`.'
          style: 'form'
          explode: false
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Return records before this cursor for backwards pagination. Use the `previousCursor` from a previous response.'
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Return records after this cursor for forward pagination. Use the `nextCursor` from a previous response.'
        - name: 'search'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Filter products by name.'
        - name: 'includeArchived'
          in: 'query'
          required: false
          schema:
            type: 'string'
            enum:
              - 'true'
              - 'false'
          description: 'When set to `true`, includes archived products in the results. Defaults to `false`.'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Retrieves product list'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetProductListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/products/copy-to-live-mode:
    post:
      tags:
        - 'Products'
      summary: 'Copy Product to Live Mode'
      operationId: 'copyProductToLiveMode'
      description: 'Copies a test mode product and all its associated plans, line items, prices, and entitlements to live mode. This endpoint must be called using a test mode API key.'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CopyProductToLiveModeRequestSchema'
      responses:
        '201':
          description: 'Successfully copied product to live mode'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CopyToLiveModeSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Product not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/products/export/{id}:
    get:
      tags:
        - 'Products'
      summary: 'Export Product as YAML'
      operationId: 'exportProduct'
      description: 'Exports a product and all its associated plans, line items, prices, and entitlements as a YAML file.'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '200':
          description: 'Successfully exported product'
          content:
            text/yaml:
              schema:
                type: 'string'
                format: 'binary'
        '400':
          description: 'Invalid request'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Product not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/products/import:
    post:
      tags:
        - 'Products'
      summary: 'Import Product from YAML'
      operationId: 'importProduct'
      description: 'Imports a product from a YAML file. Only `.yaml` and `.yml` files are accepted. Only one file can be submitted per request.'
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: 'object'
              properties:
                file:
                  type: 'string'
                  format: 'binary'
                  description: 'YAML file containing product definition'
              required:
                - 'file'
      responses:
        '201':
          description: 'Successfully imported product'
        '400':
          description: 'Invalid request or file not provided'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/products/{id}:
    get:
      tags:
        - 'Products'
      summary: 'Retrieve Product'
      operationId: 'retrieveProduct'
      description: 'Retrieves the details of an existing product.'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'settings'
                - 'plans'
          description: 'Expand related resources inline. Accepts a comma-separated list. Supported values: `settings`, `plans`.'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved product'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetProductDetailSchema'
        '400':
          description: 'Invalid request'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Product not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    put:
      tags:
        - 'Products'
      summary: 'Update Product'
      operationId: 'updateProduct'
      description: 'Updates the specified product. Only the fields provided in the request body will be updated.'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProductRequestSchema'
      responses:
        '200':
          description: 'Successfully updated product'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateProductResponseSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Product not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    delete:
      tags:
        - 'Products'
      summary: 'Delete Product'
      operationId: 'deleteProduct'
      description: 'Permanently deletes a product. A product cannot be deleted if it has been subscribed to.'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully deleted product'
        '400':
          description: 'Invalid request'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Product not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/products/{id}/archive:
    post:
      tags:
        - 'Products'
      summary: 'Archive Product'
      description: 'Archives a product. Archived products are excluded from list responses by default, cannot be modified, and will not accept new subscriptions. Active subscriptions will remain unaffected.'
      operationId: 'archiveProduct'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully archived product'
        '400':
          description: 'Invalid request (product already archived or validation error)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, product belongs to another organisation'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Product not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/receipts:
    get:
      tags:
        - 'Receipts'
      summary: 'List Receipts'
      operationId: 'listReceipts'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'subscriptionId'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'search'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'sort'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'owner'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
          style: 'form'
          explode: false
        - name: 'lineItems'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
          style: 'form'
          explode: false
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'owner'
          style: 'form'
          explode: false
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved receipts'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetReceiptListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/receipts/batch:
    post:
      tags:
        - 'Receipts'
      summary: 'Batch Receipt Actions'
      description: 'Perform batch actions on multiple receipts. Currently supports deleting receipts (test mode only). Returns detailed results for each receipt including success or failure status.'
      operationId: 'batchReceiptActions'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchReceiptActionsRequestSchema'
      responses:
        '200':
          description: 'Batch action completed. Check the response for individual receipt results.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchReceiptActionsResponseSchema'
        '400':
          description: 'Invalid request (validation error or not in test mode)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Some receipts belong to a different organisation'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Some receipts were not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/receipts/{id}:
    get:
      tags:
        - 'Receipts'
      summary: 'Retrieve Receipt'
      operationId: 'retrieveReceipt'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'owner'
                - 'receiptItems'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved receipt'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetReceiptDetailSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Receipt not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    delete:
      tags:
        - 'Receipts'
      summary: 'Delete Receipt'
      description: 'Permanently deletes a receipt and its associated receipt items. This endpoint is only available in test mode.'
      operationId: 'deleteReceipt'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully deleted receipt'
        '400':
          description: 'Invalid request (validation error or not in test mode)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, resource belongs to another organization'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Receipt not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/signing-keys:
    get:
      summary: 'Get Signing Key'
      tags:
        - 'Signing Keys'
      operationId: 'getSigningKey'
      description: 'Returns the signing key for the organisation. If no signing key exists, one will be automatically created and returned.'
      responses:
        '200':
          description: 'Successfully retrieved signing key'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSigningKeySchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/stripe/account-session:
    post:
      tags:
        - 'Stripe'
      summary: 'Create Account Session'
      operationId: 'createStripeAccountSession'
      description: 'Creates a Stripe account session for a connected account'
      responses:
        '200':
          description: 'Successfully created account session'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAccountSessionResponseSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/subscriptions:
    post:
      tags:
        - 'Subscriptions'
      summary: 'Create Salable Only Subscription'
      operationId: 'createSalableOnlySubscription'
      description: 'Creates a Salable Only Subscription'
      requestBody:
        content:
          application/json:
            schema:
              type: 'object'
              properties:
                plans:
                  type: 'array'
                  items:
                    type: 'object'
                    properties:
                      planId:
                        type: 'string'
                        minLength: 1
                        description: 'The ID of the plan to subscribe to.'
                      metadata:
                        type: 'object'
                        additionalProperties:
                          type: 'object'
                          properties:
                            quantity:
                              type: 'number'
                          required:
                            - 'quantity'
                          additionalProperties: false
                        description: 'Per-line-item quantity overrides, keyed by line item slug. Only applicable to non-metered line items with a maxQuantity more than 1.'
                    required:
                      - 'planId'
                    additionalProperties: false
                  description: 'The plans to include in this subscription. At least one plan is required.'
                owner:
                  type: 'string'
                  minLength: 1
                  description: 'An owner is an identifier used to scope Subscriptions, carts, and usage records in Salable. Typically a user ID for individual subscriptions or organization ID for team subscriptions.'
                grantee:
                  type: 'string'
                  minLength: 1
                  description: 'A grantee is any entity that receives access to features or entitlements through a Subscription. These can represent users, teams, projects, boards, workspaces, or any other entity in your application that needs feature access.'
                interval:
                  type: 'string'
                  enum:
                    - 'day'
                    - 'week'
                    - 'month'
                    - 'year'
                  description: 'The billing interval for the subscription. One of `day`, `week`, `month`, `year`.'
                intervalCount:
                  type: 'number'
                  description: 'The number of intervals between each billing cycle. For example, `2` with interval `month` means every 2 months.'
                expiryDate:
                  type: 'string'
                  format: 'date-time'
                  description: 'A fixed date on which the subscription expires. Cannot be used together with `isPerpetual`.'
                isPerpetual:
                  type: 'boolean'
                  description: 'When `true`, the subscription never expires. Cannot be used together with `expiryDate` or `cancelAtPeriodEnd`.'
                cancelAtPeriodEnd:
                  type: 'boolean'
                  description: 'When `true`, the subscription will be cancelled at the end of the current billing period rather than renewing.'
              required:
                - 'plans'
                - 'owner'
                - 'interval'
                - 'intervalCount'
              additionalProperties: false
              $schema: 'http://json-schema.org/draft-07/schema#'
      responses:
        '201':
          description: 'Successfully created subscription'
          content:
            application/json:
              schema:
                type: 'object'
                properties:
                  type:
                    const: 'object'
                    type: 'string'
                  data:
                    additionalProperties: false
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      stripeSubscriptionId:
                        type:
                          - 'string'
                          - 'null'
                      ownerId:
                        type: 'string'
                      status:
                        type: 'string'
                      customerId:
                        type:
                          - 'string'
                          - 'null'
                      interval:
                        allOf:
                          - anyOf:
                              - type: 'null'
                              - additionalProperties: false
                                anyOf:
                                  - const: 'day'
                                    type: 'string'
                                  - const: 'week'
                                    type: 'string'
                                  - const: 'month'
                                    type: 'string'
                                  - const: 'year'
                                    type: 'string'
                          - anyOf:
                              - type: 'null'
                              - anyOf:
                                  - const: 'day'
                                    type: 'string'
                                  - const: 'week'
                                    type: 'string'
                                  - const: 'month'
                                    type: 'string'
                                  - const: 'year'
                                    type: 'string'
                      intervalCount:
                        type:
                          - 'integer'
                          - 'null'
                      currencyShortCode:
                        type:
                          - 'string'
                          - 'null'
                      cancelAtPeriodEnd:
                        type: 'boolean'
                      isPerpetual:
                        type: 'boolean'
                      isSalableOnly:
                        type: 'boolean'
                      startDate:
                        type: 'string'
                      cancelledAt:
                        type:
                          - 'string'
                          - 'null'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'stripeSubscriptionId'
                      - 'ownerId'
                      - 'status'
                      - 'customerId'
                      - 'interval'
                      - 'intervalCount'
                      - 'currencyShortCode'
                      - 'cancelAtPeriodEnd'
                      - 'isPerpetual'
                      - 'isSalableOnly'
                      - 'startDate'
                      - 'cancelledAt'
                      - 'createdAt'
                      - 'updatedAt'
                required:
                  - 'type'
                  - 'data'
        '400':
          description: 'Invalid request'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    get:
      tags:
        - 'Subscriptions'
      summary: 'List Subscriptions'
      operationId: 'listSubscriptions'
      description: 'Returns a list of your subscriptions. The subscriptions are returned sorted by creation date, with the most recently created subscriptions appearing first.'
      parameters:
        - name: 'owner'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Returns only subscriptions belonging to this owner.'
        - name: 'id'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Returns only the subscription with this exact ID.'
        - name: 'products'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
          description: 'Accepts a comma-separated list. Returns subscriptions that include a plan belonging to any of the specified products.'
          style: 'form'
          explode: false
        - name: 'plans'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
          description: 'Accepts a comma-separated list. Returns subscriptions that include any of the specified plans.'
          style: 'form'
          explode: false
        - name: 'priceId'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Returns subscriptions that include a subscription plan line item linked to this price.'
        - name: 'stripePriceId'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Returns subscriptions that include a subscription plan line item with this Stripe price ID.'
        - name: 'status'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Accepts a comma-separated list of statuses (eg `active,canceled`).'
        - name: 'sort'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Sort results by a field and direction. Format: `field:direction` (eg `createdAt:asc`).'
        - name: 'search'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Search across subscription IDs, Stripe subscription IDs, owner values, plan IDs, plan names, product IDs, product names, price IDs, and Stripe price IDs.'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'owner'
                - 'subscriptionPlans'
          description: 'Expand related resources inline. Accepts a comma-separated list. Supported values: `owner`, `subscriptionPlans`.'
          style: 'form'
          explode: false
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Return records before this cursor for backwards pagination. Use the `previousCursor` from a previous response.'
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Return records after this cursor for forward pagination. Use the `nextCursor` from a previous response.'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved subscriptions'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSubscriptionListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/subscriptions/{id}:
    get:
      tags:
        - 'Subscriptions'
      summary: 'Retrieve Subscription'
      operationId: 'retrieveSubscription'
      description: 'Retrieves the details of a subscription.'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'owner'
                - 'subscriptionPlans'
          description: 'Expand related resources inline. Accepts a comma-separated list. Supported values: `owner`, `subscriptionPlans`.'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved subscription'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSubscriptionDetailSchema'
        '400':
          description: 'Invalid request'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Subscription not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    delete:
      tags:
        - 'Subscriptions'
      summary: 'Delete Subscription'
      description: 'Permanently deletes a subscription. This endpoint is only available in test mode. For recurring subscriptions that are not already canceled, this will first cancel the subscription on Stripe before deleting it.'
      operationId: 'deleteSubscription'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully deleted subscription'
        '400':
          description: 'Invalid request (not in test mode, no payment integration, or payment integration not onboarded)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Subscription not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/subscriptions/{id}/items:
    put:
      tags:
        - 'Subscriptions'
      summary: 'Update Subscription Items'
      operationId: 'updateSubscriptionItems'
      description: 'Add, remove or replace items on a subscription.'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscriptionItemsRequestSchema'
      responses:
        '204':
          description: 'Successfully update subscription items'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Subscription not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/subscriptions/{id}/auto-renew:
    put:
      tags:
        - 'Subscriptions'
      summary: 'Update Subscription Auto Renew'
      operationId: 'updateSubscriptionAutoRenew'
      description: 'Enables or disables auto-renew for a subscription. Disabling auto-renew will cancel the subscription at the end of the current billing period. Does not apply to perpetual subscriptions.'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'status'
          in: 'query'
          required: true
          schema:
            type: 'string'
            enum:
              - 'enable'
              - 'disable'
          description: 'Whether to enable or disable auto-renew. Use `enable` to resume renewal at period end, or `disable` to cancel at period end.'
      responses:
        '204':
          description: 'Successfully updated subscription''s auto renew'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Subscription not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/subscriptions/{id}/invoices:
    get:
      tags:
        - 'Subscriptions'
      summary: 'List Subscription Invoices'
      operationId: 'listSubscriptionInvoices'
      description: 'Returns a list of invoices for the specified subscription, including an upcoming invoice preview if the subscription is active and not set to cancel at period end. Not available for Salable-only or perpetual subscriptions.'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'id'
          in: 'query'
          required: true
          schema:
            type: 'string'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'discounts'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully fetched subscription''s invoices'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSubscriptionInvoicesSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Subscription not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/subscriptions/{id}/portal:
    post:
      tags:
        - 'Subscriptions'
      summary: 'Create Subscription Portal'
      operationId: 'createSubscriptionPortal'
      description: 'Creates a Stripe billing portal session for the specified subscription, returning a URL to redirect the customer to. The portal features available are configured per request.'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePortalRequestSchema'
      responses:
        '200':
          description: 'Successfully created subscription portal'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePortalResponseSchema'
        '400':
          description: 'Invalid request'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Subscription not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/subscriptions/{id}/cancel:
    post:
      tags:
        - 'Subscriptions'
      summary: 'Cancel Subscription'
      description: 'Cancels a subscription but keeps the record. For recurring subscriptions, this cancels the subscription on Stripe with proration. For perpetual subscriptions, this updates the local status to canceled.'
      operationId: 'cancelSubscription'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully canceled subscription'
        '400':
          description: 'Invalid request (subscription already canceled, no payment integration, or payment integration not onboarded)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, subscription belongs to another organisation'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Subscription not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/subscriptions/batch:
    post:
      tags:
        - 'Subscriptions'
      summary: 'Batch Subscription Actions'
      description: 'Perform batch actions on multiple subscriptions. Supports cancel, enable-auto-renew, disable-auto-renew, and delete (test mode only).'
      operationId: 'batchSubscriptionActions'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchSubscriptionActionsRequestSchema'
      responses:
        '200':
          description: 'Batch action completed. Check the response for individual subscription results.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchSubscriptionActionsResponseSchema'
        '400':
          description: 'Invalid request (validation error, delete in live mode, missing payment integration, or payment integration not onboarded)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Some subscriptions not found or belong to another organisation'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '429':
          description: 'Rate limit exceeded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/subscription-plans:
    get:
      tags:
        - 'Subscription Plans'
      summary: 'List Subscription Plans'
      operationId: 'listSubscriptionPlans'
      description: 'Returns a list of subscription plans. Each subscription plan represents a plan that a subscription is currently enrolled in. Subscription plans are returned sorted by creation date, with the most recently created appearing first.'
      parameters:
        - name: 'owner'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Returns only subscription plans belonging to this owner.'
        - name: 'status'
          in: 'query'
          required: false
          schema:
            type: 'string'
            enum:
              - 'active'
              - 'inactive'
          description: 'Defaults to `active`.'
        - name: 'plans'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Accepts a comma-separated list. Returns subscription plans linked to any of the specified plans.'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'subscriptionPlanLineItems'
                - 'plan'
          description: 'Expand related resources inline. Accepts a comma-separated list. Supported values: `subscriptionPlanLineItems`, `plan`.'
          style: 'form'
          explode: false
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Return records before this cursor for backwards pagination. Use the `previousCursor` from a previous response.'
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'Return records after this cursor for forward pagination. Use the `nextCursor` from a previous response.'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully fetched subscription plan'
          content:
            application/json:
              schema:
                additionalProperties: false
                type: 'object'
                properties:
                  type:
                    const: 'list'
                    type: 'string'
                  data:
                    type: 'array'
                    items:
                      additionalProperties: false
                      type: 'object'
                      properties:
                        id:
                          type: 'string'
                        organisation:
                          type: 'string'
                        ownerId:
                          type: 'string'
                        groupId:
                          type: 'string'
                        subscriptionId:
                          type: 'string'
                        planId:
                          type:
                            - 'string'
                            - 'null'
                        seats:
                          type: 'integer'
                        status:
                          allOf:
                            - additionalProperties: false
                              anyOf:
                                - const: 'active'
                                  type: 'string'
                                - const: 'inactive'
                                  type: 'string'
                            - anyOf:
                                - const: 'active'
                                  type: 'string'
                                - const: 'inactive'
                                  type: 'string'
                        createdAt:
                          type: 'string'
                        updatedAt:
                          type: 'string'
                        subscriptionPlanLineItems:
                          additionalProperties: false
                          type: 'object'
                          properties:
                            type:
                              const: 'list'
                              type: 'string'
                            data:
                              type: 'array'
                              items:
                                type: 'object'
                                properties:
                                  id:
                                    type: 'string'
                                  organisation:
                                    type: 'string'
                                  subscriptionPlanId:
                                    type: 'string'
                                  lineItemStripeProductId:
                                    type: 'string'
                                  type:
                                    allOf:
                                      - additionalProperties: false
                                        anyOf:
                                          - const: 'unit'
                                            type: 'string'
                                          - const: 'metered'
                                            type: 'string'
                                      - anyOf:
                                          - const: 'unit'
                                            type: 'string'
                                          - const: 'metered'
                                            type: 'string'
                                  quantity:
                                    type: 'integer'
                                  usageId:
                                    type:
                                      - 'string'
                                      - 'null'
                                  stripeSubscriptionItemId:
                                    type:
                                      - 'string'
                                      - 'null'
                                  stripePriceId:
                                    type:
                                      - 'string'
                                      - 'null'
                                  expiryDate:
                                    type:
                                      - 'string'
                                      - 'null'
                                  createdAt:
                                    type: 'string'
                                  updatedAt:
                                    type: 'string'
                                  lineItem:
                                    additionalProperties: false
                                    type: 'object'
                                    properties:
                                      id:
                                        type: 'string'
                                      organisation:
                                        type: 'string'
                                      name:
                                        type: 'string'
                                      slug:
                                        type: 'string'
                                      stripeProductId:
                                        type: 'string'
                                      meterId:
                                        type:
                                          - 'string'
                                          - 'null'
                                      nickname:
                                        type: 'string'
                                      priceType:
                                        allOf:
                                          - additionalProperties: false
                                            anyOf:
                                              - const: 'metered'
                                                type: 'string'
                                              - const: 'per_seat'
                                                type: 'string'
                                              - const: 'flat_rate'
                                                type: 'string'
                                          - anyOf:
                                              - const: 'metered'
                                                type: 'string'
                                              - const: 'per_seat'
                                                type: 'string'
                                              - const: 'flat_rate'
                                                type: 'string'
                                      intervalType:
                                        allOf:
                                          - additionalProperties: false
                                            anyOf:
                                              - const: 'one_off'
                                                type: 'string'
                                              - const: 'recurring'
                                                type: 'string'
                                          - anyOf:
                                              - const: 'one_off'
                                                type: 'string'
                                              - const: 'recurring'
                                                type: 'string'
                                      billingScheme:
                                        allOf:
                                          - additionalProperties: false
                                            anyOf:
                                              - const: 'fixed'
                                                type: 'string'
                                              - const: 'per_unit'
                                                type: 'string'
                                              - const: 'tiered'
                                                type: 'string'
                                              - const: 'flat_rate'
                                                type: 'string'
                                          - anyOf:
                                              - const: 'flat_rate'
                                                type: 'string'
                                              - const: 'fixed'
                                                type: 'string'
                                              - const: 'per_unit'
                                                type: 'string'
                                              - const: 'tiered'
                                                type: 'string'
                                      tiersMode:
                                        allOf:
                                          - anyOf:
                                              - type: 'null'
                                              - additionalProperties: false
                                                anyOf:
                                                  - const: 'graduated'
                                                    type: 'string'
                                                  - const: 'volume'
                                                    type: 'string'
                                          - anyOf:
                                              - type: 'null'
                                              - anyOf:
                                                  - const: 'graduated'
                                                    type: 'string'
                                                  - const: 'volume'
                                                    type: 'string'
                                      minQuantity:
                                        type: 'integer'
                                      maxQuantity:
                                        type: 'integer'
                                      isActive:
                                        type: 'boolean'
                                      planId:
                                        type: 'string'
                                      allowChangingQuantity:
                                        type: 'boolean'
                                      archivedAt:
                                        type:
                                          - 'string'
                                          - 'null'
                                      unitLabel:
                                        type:
                                          - 'string'
                                          - 'null'
                                      createdAt:
                                        type: 'string'
                                      updatedAt:
                                        type: 'string'
                                    required:
                                      - 'id'
                                      - 'organisation'
                                      - 'name'
                                      - 'slug'
                                      - 'stripeProductId'
                                      - 'meterId'
                                      - 'nickname'
                                      - 'priceType'
                                      - 'intervalType'
                                      - 'billingScheme'
                                      - 'tiersMode'
                                      - 'minQuantity'
                                      - 'maxQuantity'
                                      - 'isActive'
                                      - 'planId'
                                      - 'allowChangingQuantity'
                                      - 'archivedAt'
                                      - 'unitLabel'
                                      - 'createdAt'
                                      - 'updatedAt'
                                required:
                                  - 'id'
                                  - 'organisation'
                                  - 'subscriptionPlanId'
                                  - 'lineItemStripeProductId'
                                  - 'type'
                                  - 'quantity'
                                  - 'usageId'
                                  - 'stripeSubscriptionItemId'
                                  - 'stripePriceId'
                                  - 'expiryDate'
                                  - 'createdAt'
                                  - 'updatedAt'
                                  - 'lineItem'
                            hasMore:
                              type: 'boolean'
                            path:
                              type: 'string'
                          required:
                            - 'type'
                            - 'data'
                            - 'hasMore'
                            - 'path'
                        plan:
                          additionalProperties: false
                          type: 'object'
                          properties:
                            id:
                              type: 'string'
                            organisation:
                              type: 'string'
                            name:
                              type: 'string'
                            isActive:
                              type: 'boolean'
                            productId:
                              type: 'string'
                            tierTagId:
                              type:
                                - 'string'
                                - 'null'
                            trialPeriodDays:
                              type:
                                - 'integer'
                                - 'null'
                            archivedAt:
                              type:
                                - 'string'
                                - 'null'
                            createdAt:
                              type: 'string'
                            updatedAt:
                              type: 'string'
                          required:
                            - 'id'
                            - 'organisation'
                            - 'name'
                            - 'isActive'
                            - 'productId'
                            - 'tierTagId'
                            - 'trialPeriodDays'
                            - 'archivedAt'
                            - 'createdAt'
                            - 'updatedAt'
                      required:
                        - 'id'
                        - 'organisation'
                        - 'ownerId'
                        - 'groupId'
                        - 'subscriptionId'
                        - 'planId'
                        - 'seats'
                        - 'status'
                        - 'createdAt'
                        - 'updatedAt'
                  previousCursor:
                    type:
                      - 'string'
                      - 'null'
                  nextCursor:
                    type:
                      - 'string'
                      - 'null'
                  hasMore:
                    type: 'boolean'
                required:
                  - 'type'
                  - 'data'
                  - 'previousCursor'
                  - 'nextCursor'
                  - 'hasMore'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Subscription plan not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/subscription-plans/{id}:
    get:
      tags:
        - 'Subscription Plans'
      summary: 'Retrieve Subscription Plan'
      operationId: 'retrieveSubscriptionPlan'
      description: 'Retrieves the details of an existing subscription plan.'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'plan'
                - 'subscription'
                - 'subscriptionPlanLineItems'
                - 'owner'
                - 'group'
          description: 'Expand related resources inline. Accepts a comma-separated list. Supported values: `plan`, `subscription`, `subscriptionPlanLineItems`, `owner`, `group`.'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieve subscription plan'
          content:
            application/json:
              schema:
                additionalProperties: false
                type: 'object'
                properties:
                  type:
                    const: 'object'
                    type: 'string'
                  data:
                    type: 'object'
                    properties:
                      id:
                        type: 'string'
                      organisation:
                        type: 'string'
                      ownerId:
                        type: 'string'
                      groupId:
                        type: 'string'
                      subscriptionId:
                        type: 'string'
                      planId:
                        type:
                          - 'string'
                          - 'null'
                      seats:
                        type: 'integer'
                      status:
                        allOf:
                          - additionalProperties: false
                            anyOf:
                              - const: 'active'
                                type: 'string'
                              - const: 'inactive'
                                type: 'string'
                          - anyOf:
                              - const: 'active'
                                type: 'string'
                              - const: 'inactive'
                                type: 'string'
                      createdAt:
                        type: 'string'
                      updatedAt:
                        type: 'string'
                      owner:
                        additionalProperties: false
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          value:
                            type: 'string'
                          stripeCustomerId:
                            type:
                              - 'string'
                              - 'null'
                          emailAddress:
                            type:
                              - 'string'
                              - 'null'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'value'
                          - 'stripeCustomerId'
                          - 'emailAddress'
                          - 'createdAt'
                          - 'updatedAt'
                      group:
                        additionalProperties: false
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          ownerId:
                            type: 'string'
                          name:
                            type:
                              - 'string'
                              - 'null'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'ownerId'
                          - 'name'
                          - 'createdAt'
                          - 'updatedAt'
                      subscription:
                        additionalProperties: false
                        type: 'object'
                        properties:
                          id:
                            type: 'string'
                          organisation:
                            type: 'string'
                          stripeSubscriptionId:
                            type:
                              - 'string'
                              - 'null'
                          ownerId:
                            type: 'string'
                          status:
                            type: 'string'
                          customerId:
                            type:
                              - 'string'
                              - 'null'
                          interval:
                            allOf:
                              - anyOf:
                                  - type: 'null'
                                  - additionalProperties: false
                                    anyOf:
                                      - const: 'day'
                                        type: 'string'
                                      - const: 'week'
                                        type: 'string'
                                      - const: 'month'
                                        type: 'string'
                                      - const: 'year'
                                        type: 'string'
                              - anyOf:
                                  - type: 'null'
                                  - anyOf:
                                      - const: 'day'
                                        type: 'string'
                                      - const: 'week'
                                        type: 'string'
                                      - const: 'month'
                                        type: 'string'
                                      - const: 'year'
                                        type: 'string'
                          intervalCount:
                            type:
                              - 'integer'
                              - 'null'
                          currencyShortCode:
                            type:
                              - 'string'
                              - 'null'
                          cancelAtPeriodEnd:
                            type: 'boolean'
                          isPerpetual:
                            type: 'boolean'
                          isSalableOnly:
                            type: 'boolean'
                          startDate:
                            type: 'string'
                          cancelledAt:
                            type:
                              - 'string'
                              - 'null'
                          createdAt:
                            type: 'string'
                          updatedAt:
                            type: 'string'
                        required:
                          - 'id'
                          - 'organisation'
                          - 'stripeSubscriptionId'
                          - 'ownerId'
                          - 'status'
                          - 'customerId'
                          - 'interval'
                          - 'intervalCount'
                          - 'currencyShortCode'
                          - 'cancelAtPeriodEnd'
                          - 'isPerpetual'
                          - 'isSalableOnly'
                          - 'startDate'
                          - 'cancelledAt'
                          - 'createdAt'
                          - 'updatedAt'
                      plan:
                        properties: *ref_10
                        required: *ref_11
                        type:
                          - 'object'
                          - 'null'
                      subscriptionPlanLineItems:
                        additionalProperties: false
                        type: 'object'
                        properties:
                          type:
                            const: 'list'
                            type: 'string'
                          data:
                            type: 'array'
                            items:
                              type: 'object'
                              properties:
                                id:
                                  type: 'string'
                                organisation:
                                  type: 'string'
                                subscriptionPlanId:
                                  type: 'string'
                                lineItemStripeProductId:
                                  type: 'string'
                                type:
                                  allOf:
                                    - additionalProperties: false
                                      anyOf:
                                        - const: 'unit'
                                          type: 'string'
                                        - const: 'metered'
                                          type: 'string'
                                    - anyOf:
                                        - const: 'unit'
                                          type: 'string'
                                        - const: 'metered'
                                          type: 'string'
                                quantity:
                                  type: 'integer'
                                usageId:
                                  type:
                                    - 'string'
                                    - 'null'
                                stripeSubscriptionItemId:
                                  type:
                                    - 'string'
                                    - 'null'
                                stripePriceId:
                                  type:
                                    - 'string'
                                    - 'null'
                                expiryDate:
                                  type:
                                    - 'string'
                                    - 'null'
                                createdAt:
                                  type: 'string'
                                updatedAt:
                                  type: 'string'
                                lineItem:
                                  type: 'object'
                                  properties:
                                    id:
                                      type: 'string'
                                    organisation:
                                      type: 'string'
                                    name:
                                      type: 'string'
                                    slug:
                                      type: 'string'
                                    stripeProductId:
                                      type: 'string'
                                    meterId:
                                      type:
                                        - 'string'
                                        - 'null'
                                    nickname:
                                      type: 'string'
                                    priceType:
                                      allOf:
                                        - additionalProperties: false
                                          anyOf:
                                            - const: 'metered'
                                              type: 'string'
                                            - const: 'per_seat'
                                              type: 'string'
                                            - const: 'flat_rate'
                                              type: 'string'
                                        - anyOf:
                                            - const: 'metered'
                                              type: 'string'
                                            - const: 'per_seat'
                                              type: 'string'
                                            - const: 'flat_rate'
                                              type: 'string'
                                    intervalType:
                                      allOf:
                                        - additionalProperties: false
                                          anyOf:
                                            - const: 'one_off'
                                              type: 'string'
                                            - const: 'recurring'
                                              type: 'string'
                                        - anyOf:
                                            - const: 'one_off'
                                              type: 'string'
                                            - const: 'recurring'
                                              type: 'string'
                                    billingScheme:
                                      allOf:
                                        - additionalProperties: false
                                          anyOf:
                                            - const: 'fixed'
                                              type: 'string'
                                            - const: 'per_unit'
                                              type: 'string'
                                            - const: 'tiered'
                                              type: 'string'
                                            - const: 'flat_rate'
                                              type: 'string'
                                        - anyOf:
                                            - const: 'flat_rate'
                                              type: 'string'
                                            - const: 'fixed'
                                              type: 'string'
                                            - const: 'per_unit'
                                              type: 'string'
                                            - const: 'tiered'
                                              type: 'string'
                                    tiersMode:
                                      allOf:
                                        - anyOf:
                                            - type: 'null'
                                            - additionalProperties: false
                                              anyOf:
                                                - const: 'graduated'
                                                  type: 'string'
                                                - const: 'volume'
                                                  type: 'string'
                                        - anyOf:
                                            - type: 'null'
                                            - anyOf:
                                                - const: 'graduated'
                                                  type: 'string'
                                                - const: 'volume'
                                                  type: 'string'
                                    minQuantity:
                                      type: 'integer'
                                    maxQuantity:
                                      type: 'integer'
                                    isActive:
                                      type: 'boolean'
                                    planId:
                                      type: 'string'
                                    allowChangingQuantity:
                                      type: 'boolean'
                                    archivedAt:
                                      type:
                                        - 'string'
                                        - 'null'
                                    unitLabel:
                                      type:
                                        - 'string'
                                        - 'null'
                                    createdAt:
                                      type: 'string'
                                    updatedAt:
                                      type: 'string'
                                    meter:
                                      additionalProperties: false
                                      properties: *ref_2
                                      required: *ref_3
                                      type:
                                        - 'object'
                                        - 'null'
                                  required:
                                    - 'id'
                                    - 'organisation'
                                    - 'name'
                                    - 'slug'
                                    - 'stripeProductId'
                                    - 'meterId'
                                    - 'nickname'
                                    - 'priceType'
                                    - 'intervalType'
                                    - 'billingScheme'
                                    - 'tiersMode'
                                    - 'minQuantity'
                                    - 'maxQuantity'
                                    - 'isActive'
                                    - 'planId'
                                    - 'allowChangingQuantity'
                                    - 'archivedAt'
                                    - 'unitLabel'
                                    - 'createdAt'
                                    - 'updatedAt'
                                    - 'meter'
                                usage:
                                  properties: *ref_12
                                  required: *ref_13
                                  type:
                                    - 'object'
                                    - 'null'
                              required:
                                - 'id'
                                - 'organisation'
                                - 'subscriptionPlanId'
                                - 'lineItemStripeProductId'
                                - 'type'
                                - 'quantity'
                                - 'usageId'
                                - 'stripeSubscriptionItemId'
                                - 'stripePriceId'
                                - 'expiryDate'
                                - 'createdAt'
                                - 'updatedAt'
                                - 'lineItem'
                                - 'usage'
                          hasMore:
                            type: 'boolean'
                          path:
                            type: 'string'
                        required:
                          - 'type'
                          - 'data'
                          - 'hasMore'
                          - 'path'
                    required:
                      - 'id'
                      - 'organisation'
                      - 'ownerId'
                      - 'groupId'
                      - 'subscriptionId'
                      - 'planId'
                      - 'seats'
                      - 'status'
                      - 'createdAt'
                      - 'updatedAt'
                required:
                  - 'type'
                  - 'data'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Subscription plan not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/subscription-plans/{id}/seats:
    put:
      tags:
        - 'Subscription Plans'
      summary: 'Update Subscription Plan Seats'
      operationId: 'updateSubscriptionPlanSeats'
      description: 'Updates the seat quantity on a per-seat subscription plan. The new quantity must be within the line item''s minimum and maximum limits and cannot be less than the number of current grantees on the group.'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: 'object'
              required:
                - 'quantity'
                - 'proration'
              properties:
                quantity:
                  type: 'number'
                  description: 'The new seat quantity. Must be within the line item''s minimum and maximum allowed quantities, and cannot be less than the number of current grantees on the group.'
                proration:
                  type: 'string'
                  enum:
                    - 'always_invoice'
                    - 'create_prorations'
                    - 'none'
                  description: 'Controls how Stripe handles proration when the seat quantity changes mid-billing-period. One of `always_invoice`, `create_prorations`, `none`.'
      responses:
        '204':
          description: 'Successfully updated subscription plan seats'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Subscription plan not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/subscription-plan-line-items/{id}:
    get:
      tags:
        - 'Subscription Plan Line Items'
      summary: 'Retrieve Subscription Plan Line Item'
      description: 'Retrieves the details of a subscription plan line item.'
      operationId: 'getSubscriptionPlanLineItem'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'lineItem'
                - 'subscriptionPlan'
          description: 'Expand related resources inline. Accepts a comma-separated list. Supported values: `lineItem`, `subscriptionPlan`.'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved subscription plan line item'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSubscriptionPlanLineItemSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Subscription plan line item not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    put:
      tags:
        - 'Subscription Plan Line Items'
      summary: 'Update Subscription Plan Line Item'
      description: 'Updates the quantity of a subscription plan line item. The new quantity must be within the line item''s configured minimum and maximum bounds, and cannot be lower than the current number of grantees on the attached group. For Stripe subscriptions, a proration behaviour must be specified.'
      operationId: 'updateSubscriptionPlanLineItem'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscriptionPlanLineItemSchema'
      responses:
        '204':
          description: 'Successfully updated subscription plan line item'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Subscription plan line item not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/subscription-plan-line-items/{id}/sync:
    put:
      tags:
        - 'Subscription Plan Line Items'
      summary: 'Sync Subscription Plan Line Item Price'
      description: 'Syncs a subscription plan line item to the latest available price for its associated line item. When synced, the corresponding Stripe subscription item is also updated to use the new price.'
      operationId: 'syncSubscriptionPlanLineItemPrice'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully synced subscription plan item price'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: 'Subscription plan line item not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/tier-tags:
    get:
      tags:
        - 'Tier Tags'
      summary: 'List Tier Tags'
      operationId: 'listTierTags'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'search'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully returns paginated tier tags list'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTierTagsListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    post:
      tags:
        - 'Tier Tags'
      summary: 'Create a new tier tag'
      operationId: 'createTierTag'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTierTagRequestSchema'
      responses:
        '200':
          description: 'Successfully created tier tag'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTierTagSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/tiers:
    get:
      tags:
        - 'Tiers'
      summary: 'List Tiers'
      operationId: 'listTiers'
      parameters:
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully returns paginated tiers list'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTierListSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/tiers/{id}:
    get:
      tags:
        - 'Tiers'
      summary: 'Retrieve Tier'
      operationId: 'retrieveTier'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '200':
          description: 'Successfully returns tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTierDetailSchema'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/usage-records:
    get:
      tags:
        - 'Usage Records'
      summary: 'List Usage Records'
      operationId: 'listUsageRecords'
      description: 'Response is sorted by createdAt in ascending order. The pagination is cursor based.'
      parameters:
        - name: 'before'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'after'
          in: 'query'
          required: false
          schema:
            type: 'string'
        - name: 'owner'
          in: 'query'
          required: true
          schema:
            type: 'string'
        - name: 'meterSlug'
          in: 'query'
          required: true
          schema:
            type: 'string'
        - name: 'status'
          in: 'query'
          required: true
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'recorded'
                - 'current'
                - 'final'
          style: 'form'
          explode: false
        - name: 'sort'
          in: 'query'
          required: false
          schema:
            type: 'string'
            enum:
              - 'asc'
              - 'desc'
        - name: 'limit'
          in: 'query'
          required: false
          schema:
            type: 'string'
          description: 'The number of records returned in a response. Value between 1 and 100. Defaults to 25.'
      responses:
        '200':
          description: 'Successfully retrieved usage records'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUsageListSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/usage/record:
    post:
      tags:
        - 'Usage'
      summary: 'Record usage'
      operationId: 'recordUsage'
      description: 'Increment usage on a line item for an owner. The request will be sent to a queue where it will be processed.'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordUsageRequestSchema'
      parameters:
        - $ref: '#/components/parameters/IdempotencyKeyHeaderParam'
      responses:
        '204':
          description: 'Request successfully sent to queue to be processed'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/webhooks:
    post:
      tags:
        - 'Webhooks'
      summary: 'Create Webhook Destination'
      operationId: 'createWebhookDestination'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequestSchema'
      responses:
        '201':
          description: 'Successfully created webhook destination'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWebhookRequestResponseSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    get:
      tags:
        - 'Webhooks'
      summary: 'List Webhook Destinations'
      operationId: 'listWebhookDestinations'
      description: 'Response is sorted by createdAt in descending order. The pagination is cursor based.'
      parameters:
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'destinations'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully retrieved webhook destinations'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhookListSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
  /api/webhooks/{id}:
    delete:
      tags:
        - 'Webhooks'
      summary: 'Delete Webhook Destination'
      operationId: 'deleteDestination'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      responses:
        '204':
          description: 'Successfully deleted webhook destination'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    patch:
      tags:
        - 'Webhooks'
      summary: 'Update Webhook Destination'
      operationId: 'updateDestination'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookRequestSchema'
      responses:
        '204':
          description: 'Successfully updated webhook destination'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
    get:
      tags:
        - 'Webhooks'
      summary: 'Retrieve Webhook Destination'
      operationId: 'retrieveDestination'
      description: 'Response is sorted by createdAt in descending order. The pagination is cursor based.'
      parameters:
        - $ref: '#/components/parameters/ResourceIdPathParam'
        - name: 'expand'
          in: 'query'
          required: false
          schema:
            type: 'array'
            items:
              type: 'string'
              enum:
                - 'eventTypes'
                - 'destinations'
          style: 'form'
          explode: false
      responses:
        '200':
          description: 'Successfully returns webhook destination'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWebhookDetailSchema'
        '400':
          description: 'Invalid request or validation error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: 'Unauthenticated, invalid or expired token'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: 'Unauthorized, missing required api key scopes to perform action'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '405':
          description: 'Method not allowed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: 'Internal server error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
