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

> Create a new subscription under a pricing template and plan. `connectionInputs` must match the custom fields defined on the pricing template. `postType` must match the template's setting.



## OpenAPI

````yaml POST /billspree/connections/make-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/make-connections:
    post:
      tags:
        - Subscriptions
      summary: Create Subscription
      description: >-
        Create a new subscription under a pricing template and plan.
        `connectionInputs` must match the custom fields defined on the pricing
        template. `postType` must match the template's setting.
      operationId: makeConnection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConnectionRequest'
            example:
              method: Create
              action: Create Subscription
              apiVersion: v2
              batchUpload: false
              connection:
                serviceCode: DEMO-001
                tariffCode: DemoPlan
                batchCode: null
                addonTariffLabels: []
                connectionRefNo: null
                description: null
                postType: Post Subscription
                paymentMethod: null
                projectName: null
                connectionInputs:
                  - name: MeterNo
                    value: '12345'
                meteredConnectionInputs: []
                unmeteredInputs: []
                meters: []
                accounts: []
                users: []
                variants: []
                address: null
      responses:
        '200':
          description: Subscription created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
              example:
                success: true
                statusCode: 200
                message: Request Succeeded.
                error: null
                data: {}
components:
  schemas:
    CreateConnectionRequest:
      type: object
      required:
        - method
        - action
        - apiVersion
        - connection
      properties:
        method:
          type: string
          description: Always `"Create"`
          example: Create
        action:
          type: string
          description: Always `"Create Subscription"`
          example: Create Subscription
        apiVersion:
          type: string
          description: Always `"v2"`
          example: v2
        batchUpload:
          type: boolean
          description: '`false` for single subscription creation'
          example: false
        connection:
          $ref: '#/components/schemas/CreateConnectionPayload'
    GenericSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
        statusCode:
          type: integer
        message:
          type: string
        error:
          nullable: true
        data:
          type: object
    CreateConnectionPayload:
      type: object
      required:
        - serviceCode
        - tariffCode
        - postType
        - connectionInputs
        - meteredConnectionInputs
        - unmeteredInputs
      properties:
        serviceCode:
          type: string
          description: Pricing template to subscribe to
        tariffCode:
          type: string
          description: Pricing module (plan) to assign
        batchCode:
          type: string
          nullable: true
          description: Batch to assign this subscription to
        addonTariffLabels:
          type: array
          description: '`uniqueLabel` values of add-on pricing modules to attach'
          items:
            type: string
        connectionRefNo:
          type: string
          nullable: true
          description: External reference number
        description:
          type: string
          nullable: true
        postType:
          type: string
          description: >-
            Must match the template's `postType` — `"Post Subscription"` or
            `"Post Batch"`
        paymentMethod:
          type: string
          nullable: true
        projectName:
          type: string
          nullable: true
        connectionInputs:
          type: array
          description: >-
            Values for custom fields defined on the template — `[{ "name":
            "fieldName", "value": "..." }]`
          items:
            $ref: '#/components/schemas/ConnectionInput'
        meteredConnectionInputs:
          type: array
          description: Metered input values — `[]` if none
          items: {}
        unmeteredInputs:
          type: array
          description: Unmetered input values — `[]` if none
          items: {}
        meters:
          type: array
          description: 'Meter assignments — `[{ "meterNumber": 123, "initialReading": 0 }]`'
          items: {}
        accounts:
          type: array
          description: >-
            Component balance accounts — auto-built from template components if
            sent as `[]`
          items: {}
        users:
          type: array
          description: Users/owners to assign
          items: {}
        variants:
          type: array
          description: Variant IDs selected for this subscription
          items: {}
        address:
          $ref: '#/components/schemas/ConnectionAddress'
          nullable: true
          description: Customer address — `null` if not required
    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)

````