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

# Publish Term

> Step 8 of the bill-run flow. Generates bill documents (PDF) using a print template. Term must be in `Posted` status before this step. Pass `billID` to publish a single bill only.



## OpenAPI

````yaml POST /billspree/terms/publish-term
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/terms/publish-term:
    post:
      tags:
        - Bill Run
      summary: Publish Term
      description: >-
        Step 8 of the bill-run flow. Generates bill documents (PDF) using a
        print template. Term must be in `Posted` status before this step. Pass
        `billID` to publish a single bill only.
      operationId: publishTerm
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishTermRequest'
            example:
              method: Update
              action: Publish Term
              apiVersion: v2
              operation: schedule
              data:
                termID: 5
                template_id: 12
                output_format: pdf
                billType: Batch billing
                sheduleTime: '2026-06-15T10:00:00'
              billID: null
      responses:
        '200':
          description: Publish job registered
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
components:
  schemas:
    PublishTermRequest:
      type: object
      required:
        - method
        - action
        - apiVersion
        - operation
        - data
      properties:
        method:
          type: string
          description: Always `"Update"`
          example: Update
        action:
          type: string
          description: Always `"Publish Term"`
          example: Publish Term
        apiVersion:
          type: string
          example: v2
        operation:
          type: string
          description: Always `"schedule"`
          example: schedule
        billID:
          type: integer
          nullable: true
          description: >-
            Pass a specific bill ID to publish a single bill only — `null` to
            publish all bills in the term
        data:
          type: object
          required:
            - termID
            - template_id
            - output_format
            - billType
            - sheduleTime
          properties:
            termID:
              type: integer
              description: Term to publish
            template_id:
              type: integer
              description: Print template ID — `templateID` from the pricing template
            output_format:
              type: string
              description: Always `"pdf"`
              example: pdf
            billType:
              type: string
              description: >-
                `"Batch billing"` for full term, `"Batch Summary"` for
                individual bill
            sheduleTime:
              type: string
              description: ISO datetime — pass current time to run immediately
    GenericSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
        statusCode:
          type: integer
        message:
          type: string
        error:
          nullable: true
        data:
          type: object
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Auth token returned from the login endpoint. Send as: `Authorization:
        <token>` (no Bearer prefix)

````