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

# Create Billing Group

> Single endpoint for creating, listing, and retrieving Billing Groups. The `method`/`action` fields in the request body select the operation.



## OpenAPI

````yaml POST /billspree/billing-groups
openapi: 3.1.0
info:
  title: Billspree API
  description: REST API for Billspree — billing, AR management, and workspace operations.
  version: 1.0.0
servers:
  - url: https://{workspace}.spreesuite.com
    variables:
      workspace:
        default: your-workspace
        description: Your organization's subdomain (e.g. demo → demo.spreesuite.com)
security:
  - apiKeyAuth: []
paths:
  /billspree/billing-groups:
    post:
      tags:
        - Billing Groups
      summary: Manage Billing Groups
      description: >-
        Single endpoint for creating, listing, and retrieving Billing Groups.
        The `method`/`action` fields in the request body select the operation.
      operationId: manageBillingGroups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingGroupRequest'
            examples:
              create:
                summary: Create Billing Group
                value:
                  name: North Region
                  billingPeriodID: null
                  method: Create
                  action: Add Billing Group
                  apiVersion: v2
              list:
                summary: List Billing Groups
                value:
                  method: Retrieve
                  action: List Billing Groups
                  apiVersion: v2
              get:
                summary: Get Billing Group
                value:
                  billingGroupID: 123
                  method: Retrieve
                  action: Get Billing Group
                  apiVersion: v2
      responses:
        '200':
          description: Request succeeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingGroupResponse'
              examples:
                create:
                  summary: Create Billing Group response
                  value:
                    success: true
                    statusCode: 200
                    message: Request Succeeded.
                    error: null
                    data: {}
                list:
                  summary: List Billing Groups response
                  value:
                    success: true
                    statusCode: 200
                    message: Request Succeeded.
                    error: null
                    data:
                      - billingGroupID: 123
                        name: North Region
                        billingPeriodID: null
                get:
                  summary: Get Billing Group response
                  value:
                    success: true
                    statusCode: 200
                    message: Request Succeeded.
                    error: null
                    data:
                      billingGroup:
                        billingGroupID: 123
                        name: North Region
                        billingPeriodID: null
                      connectionGroups:
                        - connectionGroupID: 456
                          connectionGroupLabel: BA-001
                          type: Residential
                          serviceCode: DEMO-001
                          tariffLabel: DemoPlan
components:
  schemas:
    BillingGroupRequest:
      oneOf:
        - $ref: '#/components/schemas/CreateBillingGroupRequest'
        - $ref: '#/components/schemas/ListBillingGroupsRequest'
        - $ref: '#/components/schemas/GetBillingGroupRequest'
    BillingGroupResponse:
      oneOf:
        - $ref: '#/components/schemas/GenericSuccessResponse'
        - $ref: '#/components/schemas/ListBillingGroupsResponse'
        - $ref: '#/components/schemas/GetBillingGroupResponse'
    CreateBillingGroupRequest:
      type: object
      required:
        - name
        - method
        - action
        - apiVersion
      properties:
        name:
          type: string
          description: Required.
        billingPeriodID:
          type: integer
          nullable: true
        method:
          type: string
          example: Create
        action:
          type: string
          example: Add Billing Group
        apiVersion:
          type: string
          example: v2
    ListBillingGroupsRequest:
      type: object
      required:
        - method
        - action
        - apiVersion
      properties:
        method:
          type: string
          example: Retrieve
        action:
          type: string
          example: List Billing Groups
        apiVersion:
          type: string
          example: v2
    GetBillingGroupRequest:
      type: object
      required:
        - billingGroupID
        - method
        - action
        - apiVersion
      properties:
        billingGroupID:
          type: integer
        method:
          type: string
          example: Retrieve
        action:
          type: string
          example: Get Billing Group
        apiVersion:
          type: string
          example: v2
    GenericSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
        message:
          type: string
        statusCode:
          type: integer
        error:
          nullable: true
    ListBillingGroupsResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: array
          items:
            $ref: '#/components/schemas/BillingGroupSummary'
        message:
          type: string
        statusCode:
          type: integer
        error:
          nullable: true
    GetBillingGroupResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            billingGroup:
              $ref: '#/components/schemas/BillingGroupDetail'
            connectionGroups:
              type: array
              items:
                $ref: '#/components/schemas/BillingGroupConnectionSummary'
        message:
          type: string
        statusCode:
          type: integer
        error:
          nullable: true
    BillingGroupSummary:
      type: object
      properties:
        billingGroupID:
          type: integer
        name:
          type: string
        billingPeriodID:
          type: integer
          nullable: true
    BillingGroupDetail:
      type: object
      description: Other group fields may be present beyond these.
      properties:
        billingGroupID:
          type: integer
        name:
          type: string
        billingPeriodID:
          type: integer
          nullable: true
      additionalProperties: true
    BillingGroupConnectionSummary:
      type: object
      properties:
        connectionGroupID:
          type: integer
        connectionGroupLabel:
          type: string
        type:
          type: string
        serviceCode:
          type: string
        tariffLabel:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Auth token returned from the login endpoint. Send as: `Authorization:
        <token>` (no Bearer prefix)

````