> ## 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.

# Get Subscriptions

> Retrieve subscriptions with optional filtering by template, customer, status, or subscription number. Pass `filters.bills: true` or `filters.payments: true` to include related billing and payment data in the response.



## OpenAPI

````yaml POST /billspree/connections/get-connections
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/connections/get-connections:
    post:
      tags:
        - Subscriptions
      summary: Get Subscriptions
      description: >-
        Retrieve subscriptions with optional filtering by template, customer,
        status, or subscription number. Pass `filters.bills: true` or
        `filters.payments: true` to include related billing and payment data in
        the response.
      operationId: getConnections
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetConnectionsRequest'
            example:
              method: Retrieve
              action: Retrieve Subscriptions
              apiVersion: v2
              serviceCode: DEMO-001
              connectionNumber: null
              partyID: null
              subscriptionType: null
              status: null
              filters: null
              metaData: null
              page: null
      responses:
        '200':
          description: Subscriptions retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetConnectionsResponse'
              example:
                success: true
                statusCode: 200
                message: Request Succeeded.
                error: null
                data:
                  connections:
                    - id: 1
                      connectionNumber: CONN-001
                      connectionRefNo: REF-001
                      serviceCode: DEMO-001
                      tariffCode: DemoPlan
                      batchCode: null
                      status: Active
                      chargingType: Postpaid
                      postType: Post Subscription
                      connectionDate: '01012026'
                      description: null
                      paymentMethod: null
                      ts: 1
                      partyID: 5
                      partyName: John Doe
                      connectionInputs:
                        - name: MeterNo
                          value: '12345'
                      meteredConnectionInputs: []
                      unmeteredInputs: []
                      meters: []
                      accounts:
                        - title: Monthly Charge
                          balance: 0
                      address:
                        title: null
                        shopNo: null
                        buildingNo: null
                        buildingName: null
                        street: null
                        block: null
                        society: null
                        city: null
                        countryId: null
                      users: []
                      addOns: []
                      variants: []
                      bills: []
                      transfers: []
components:
  schemas:
    GetConnectionsRequest:
      type: object
      required:
        - method
        - action
        - apiVersion
      properties:
        method:
          type: string
          description: Always `"Retrieve"`
          example: Retrieve
        action:
          type: string
          description: Always `"Retrieve Subscriptions"`
          example: Retrieve Subscriptions
        apiVersion:
          type: string
          description: Always `"v2"`
          example: v2
        serviceCode:
          type: string
          nullable: true
          description: Filter by pricing template code — `null` returns all
        connectionNumber:
          type: string
          nullable: true
          description: Fetch a specific subscription by its number
        partyID:
          type: integer
          nullable: true
          description: Filter by customer/party ID
        subscriptionType:
          type: string
          nullable: true
          description: Filter by subscription type
        status:
          type: string
          nullable: true
          description: Filter by status — e.g. `"Active"`, `"Disconnected"`
        filters:
          type: object
          nullable: true
          description: >-
            Additional data to include — e.g. `{ "bills": true, "payments": true
            }`
        metaData:
          type: object
          nullable: true
          description: Extra metadata options for the query
        page:
          type: object
          nullable: true
          description: >-
            Pagination — e.g. `{ "pageNumber": 0, "size": 10 }`. `null` returns
            all
    GetConnectionsResponse:
      type: object
      properties:
        success:
          type: boolean
        statusCode:
          type: integer
        message:
          type: string
        error:
          nullable: true
        data:
          type: object
          properties:
            connections:
              type: array
              items:
                $ref: '#/components/schemas/Connection'
    Connection:
      type: object
      properties:
        id:
          type: integer
          description: Internal unique ID
        connectionNumber:
          type: string
          description: >-
            Subscription identifier — stable public reference used for billing,
            meter readings, and payments
        connectionRefNo:
          type: string
          nullable: true
          description: External reference number
        serviceCode:
          type: string
          description: Pricing template this subscription belongs to
        tariffCode:
          type: string
          description: Pricing module (plan) assigned to this subscription
        batchCode:
          type: string
          nullable: true
          description: Billing batch this subscription belongs to
        status:
          type: string
          description: >-
            `"Active"` or `"Disconnected"`. Disconnected subscriptions cannot be
            updated
        chargingType:
          type: string
          description: '`"Postpaid"` or `"Prepaid"`'
        postType:
          type: string
          description: '`"Post Subscription"` or `"Post Batch"`'
        connectionDate:
          type: string
          description: Subscription start date in `ddmmyyyy` format
        description:
          type: string
          nullable: true
        paymentMethod:
          type: string
          nullable: true
        ts:
          type: integer
          description: >-
            Version timestamp — always read from GET and send back on update, or
            the backend will reject the call
        partyID:
          type: integer
          description: Internal ID of the customer
        partyName:
          type: string
          description: Name of the customer
        connectionInputs:
          type: array
          description: Custom field values collected at subscription time
          items:
            $ref: '#/components/schemas/ConnectionInput'
        meteredConnectionInputs:
          type: array
          description: Metered usage input values
          items: {}
        unmeteredInputs:
          type: array
          description: Flat/unmetered input values
          items: {}
        meters:
          type: array
          description: Attached meters with readings
          items: {}
        accounts:
          type: array
          description: Component-level balance accounts
          items: {}
        addOns:
          type: array
          description: Add-on plans linked to this subscription
          items: {}
        variants:
          type: array
          description: Variant IDs selected for this subscription
          items: {}
        bills:
          type: array
          description: 'Associated bills — only present when `filters.bills: true` is passed'
          items: {}
        transfers:
          type: array
          description: Ownership transfer history
          items: {}
        address:
          $ref: '#/components/schemas/ConnectionAddress'
        users:
          type: array
          description: Users/owners assigned to this subscription
          items: {}
    ConnectionInput:
      type: object
      properties:
        name:
          type: string
          description: Field name as defined on the pricing template
        value:
          type: string
          description: Value for this field
    ConnectionAddress:
      type: object
      properties:
        title:
          type: string
          nullable: true
        shopNo:
          type: string
          nullable: true
        buildingNo:
          type: string
          nullable: true
        buildingName:
          type: string
          nullable: true
        street:
          type: string
          nullable: true
        block:
          type: string
          nullable: true
        society:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        countryId:
          type: integer
          nullable: true
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Auth token returned from the login endpoint. Send as: `Authorization:
        <token>` (no Bearer prefix)

````