> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useinvent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Sub-Organization Billing Config

> Updates billing configuration for a sub-organization, including spending cap. Only parent organization admins can call this endpoint.



## OpenAPI

````yaml https://api.useinvent.com/openapi.json patch /orgs/{org_id}/orgs/{sub_org_id}/billing
openapi: 3.1.0
info:
  version: 1.0.0
  title: Invent API
servers:
  - url: https://api.useinvent.com
security:
  - bearerAuth: []
paths:
  /orgs/{org_id}/orgs/{sub_org_id}/billing:
    patch:
      tags:
        - Orgs Orgs
      summary: Update Sub-Organization Billing Config
      description: >-
        Updates billing configuration for a sub-organization, including spending
        cap. Only parent organization admins can call this endpoint.
      parameters:
        - schema:
            type: string
          required: true
          description: The ID of the parent organization
          name: org_id
          in: path
        - schema:
            type: string
          required: true
          description: The ID of the sub-organization
          name: sub_org_id
          in: path
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBillingConfigSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UpdateBillingConfigSchema'
      responses:
        '200':
          description: The sub-organization with updated billing config.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgSchema'
components:
  schemas:
    UpdateBillingConfigSchema:
      type: object
      properties:
        auto_recharge:
          type: object
          properties:
            enabled:
              type: boolean
              description: Flag to enable/disable auto reload
            recharge_threshold:
              type: number
              minimum: 5
              maximum: 500
              description: Threshold to auto reload credits at
            recharge_amount:
              type: number
              minimum: 5
              maximum: 500
              description: Amount to auto reload credits by
          required:
            - enabled
            - recharge_threshold
            - recharge_amount
        use_parent_balance:
          type: boolean
          description: Use the parent balance when it's a sub-org
        spending_cap:
          $ref: '#/components/schemas/SpendingCapConfigSchema'
      required:
        - auto_recharge
      description: Schema for updating payment configuration
    OrgSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the org
        name:
          type: string
          description: Name of the org
        verified:
          type: boolean
          description: Verification status of the org
        role:
          $ref: '#/components/schemas/OrgSystemRoleSchema'
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/OrgResolvedPermissionSchema'
          description: >-
            Effective permissions of the current user within the organization
            (`*` = full admin access)
        disabled:
          type: boolean
          description: Whether the org is disabled by the system
        type:
          $ref: '#/components/schemas/OrgTypeSchema'
        plan:
          $ref: '#/components/schemas/OrgSubscriptionPlanSchema'
        balance:
          type: number
          description: Current balance of the org
        promo_balance:
          type: number
          description: Current promotional balance of the org
        promo_balance_reset_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the promotional balance was last reset
        billing:
          $ref: '#/components/schemas/BillingConfigSchema'
        logo_url:
          type:
            - string
            - 'null'
          description: URL of the organization logo
        deleted:
          type: boolean
          description: Deletion status of the org
        features:
          $ref: '#/components/schemas/OrgFeaturesConfigSchema'
        config:
          $ref: '#/components/schemas/OrgConfigSchema'
        parent_org:
          $ref: '#/components/schemas/OrgPublicSchema'
        spending_cap_used:
          type: number
          description: Amount spent in the current month against the spending cap
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the org was created
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp when the org was last updated
      required:
        - id
        - name
        - verified
        - disabled
        - type
        - plan
        - balance
        - promo_balance
        - promo_balance_reset_at
        - billing
        - logo_url
        - deleted
        - spending_cap_used
        - created_at
        - updated_at
      description: Detailed information about an org (organization)
    SpendingCapConfigSchema:
      type: object
      properties:
        enabled:
          type: boolean
          description: Flag to enable/disable the monthly spending cap
        amount:
          type: number
          minimum: 0
          maximum: 100000
          description: Monthly spending limit in USD
        reset_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp of last accumulator reset
      required:
        - enabled
        - amount
      description: Schema for spending cap configuration
    OrgSystemRoleSchema:
      type: string
      enum:
        - ADMIN
        - DEVELOPER
        - MANAGER
        - STAFF
      description: A system role
    OrgResolvedPermissionSchema:
      type: string
      enum:
        - org:write
        - admin:write
        - members:read
        - members:invite
        - members:write
        - members.roles.system:write
        - inbox:read
        - inbox:write
        - analytics:read
        - contacts:read
        - contacts:write
        - segments:write
        - broadcasts:read
        - broadcasts:write
        - assistants:read
        - assistants:write
        - assistants.agents:write
        - knowledge:read
        - knowledge:write
        - skills:read
        - skills:write
        - workflows:write
        - connections:write
        - keys:write
        - tables:read
        - tables:write
        - tables.records:write
        - pages:read
        - pages:write
        - audit_logs:read
        - sso:write
        - domains:write
        - emails:write
        - billing:write
        - variables:write
        - templates:write
        - orgs:write
        - '*'
      description: >-
        A member's effective org permission: a `resource:action`, or `*` for
        full (admin) access.
    OrgTypeSchema:
      type: string
      enum:
        - PERSONAL
        - TEAM
      description: Type of the organization
    OrgSubscriptionPlanSchema:
      type: string
      enum:
        - free
        - business
      description: Type of subscription plan
    BillingConfigSchema:
      type: object
      properties:
        auto_recharge:
          type: object
          properties:
            enabled:
              type: boolean
              description: Flag to enable/disable auto reload
            recharge_threshold:
              type: number
              minimum: 5
              maximum: 500
              description: Threshold to auto reload credits at
            recharge_amount:
              type: number
              minimum: 5
              maximum: 500
              description: Amount to auto reload credits by
          required:
            - enabled
            - recharge_threshold
            - recharge_amount
        use_parent_balance:
          type: boolean
          description: Use the parent balance when it's a sub-org
        spending_cap:
          $ref: '#/components/schemas/SpendingCapConfigSchema'
        payment_method:
          $ref: '#/components/schemas/PaymentMethodSchema'
        last_low_balance_notification_at:
          type:
            - string
            - 'null'
          format: date-time
        last_out_of_balance_notification_at:
          type:
            - string
            - 'null'
          format: date-time
        last_spending_cap_notification_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - auto_recharge
      description: Schema for updating payment configuration
    OrgFeaturesConfigSchema:
      type: object
      properties:
        enterprise:
          type: boolean
        allow_overdraft:
          type: boolean
        workflows:
          type: boolean
        enable_japifon:
          type: boolean
        slack_access:
          type: boolean
        emails:
          type: boolean
        templates:
          type: boolean
        org_chats:
          type: boolean
      description: Org gate-keeping features configuration
    OrgConfigSchema:
      type: object
      properties:
        email:
          type: string
          maxLength: 128
          format: email
          description: Organization contact email
        address:
          type: string
          maxLength: 128
          description: Physical address
        terms_url:
          type: string
          maxLength: 1024
          format: uri
          description: Terms of service URL
        privacy_url:
          type: string
          maxLength: 1024
          format: uri
          description: Privacy policy URL
        access:
          $ref: '#/components/schemas/OrgAccessConfigSchema'
        modules:
          $ref: '#/components/schemas/OrgModulesConfigSchema'
      description: Organization configuration settings
    OrgPublicSchema:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the org
        name:
          type: string
          description: Name of the org
        verified:
          type: boolean
          description: Verification status of the org
        logo_url:
          type:
            - string
            - 'null'
          description: URL of the organization logo
        plan:
          $ref: '#/components/schemas/OrgSubscriptionPlanSchema'
        config:
          $ref: '#/components/schemas/OrgConfigSchema'
        features:
          $ref: '#/components/schemas/OrgFeaturesConfigSchema'
        parent_org_id:
          type: string
          description: ID of the parent organization if this is a sub-org
      required:
        - id
        - name
        - verified
        - logo_url
      description: Public information about an org (organization)
    PaymentMethodSchema:
      type: object
      properties:
        type:
          type: string
        payment_method_id:
          type: string
        brand:
          type: string
        last4:
          type: string
        inactive:
          type: boolean
        failed_at:
          type: string
          format: date-time
        failed_message:
          type: string
      required:
        - type
        - payment_method_id
      description: Schema for a payment method
    OrgAccessConfigSchema:
      type: object
      properties:
        session_ttl_seconds:
          anyOf:
            - type: number
              enum:
                - 0
            - type: integer
              minimum: 60
              maximum: 315360000
          description: >-
            Session lifetime in seconds for SSO logins. Use 0 to disable
            expiration (session never expires). Any non-zero value must be at
            least 60 seconds. Defaults to 0 (disabled).
        allow_google:
          type: boolean
          description: >-
            Whether Google sign-in is allowed for users whose email matches an
            SSO domain on this org (verified, with or without IdP). Defaults to
            true when unset.
        allow_microsoft:
          type: boolean
          description: >-
            Whether Microsoft sign-in is allowed for users whose email matches
            an SSO domain on this org (verified, with or without IdP). Defaults
            to true when unset.
        allow_email_code:
          type: boolean
          description: >-
            Whether email code sign-in is allowed for users whose email matches
            an SSO domain on this org (verified, with or without IdP). Defaults
            to true when unset.
        allow_invites:
          type: boolean
          description: >-
            Whether org admins can manually invite new members. Org-wide toggle,
            does not require a verified domain. Defaults to true when unset.
      description: >-
        Org-wide access policy. Governs how users authenticate and join the org.
        Only applies when at least one verified SSO is enabled.
    OrgModulesConfigSchema:
      type: object
      properties:
        enable_inbox:
          type: boolean
        enable_analytics:
          type: boolean
        enable_assistants:
          type: boolean
        enable_knowledge_base:
          type: boolean
        enable_broadcasts:
          type: boolean
        enable_workflows:
          type: boolean
        enable_audience:
          type: boolean
        enable_tables:
          type: boolean
        enable_pages:
          type: boolean
        enable_balance_credits:
          type: boolean
      description: >-
        Per-module visibility toggles. Honored on sub-orgs only; ignored on
        parent orgs. Missing keys default to enabled on the client.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Bearer token authentication using your API key

````