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

# Update Pricing Template

> Update an existing pricing template. The `code` field in the `service` object identifies which template to update — it cannot be changed.



## OpenAPI

````yaml POST /billspree/services/update-service
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/services/update-service:
    post:
      tags:
        - Pricing Templates
      summary: Update Pricing Template
      description: >-
        Update an existing pricing template. The `code` field in the `service`
        object identifies which template to update — it cannot be changed.
      operationId: updateService
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateServiceRequest'
            example:
              method: Update
              action: Update Package
              apiVersion: v2
              service:
                code: DEMO-001
                name: Demo Plan Updated
                serviceType: Sale
                chargingType: Postpaid
                postType: Post Subscription
                billingCycle: 4
                dueDateOffset: 15
                description: Updated description
                values: []
                components: []
                connectionInputs: []
                meteredInputs: []
                unmeteredInputs: []
                bankAccounts: []
                batches: []
                invoiceTemplate:
                  templateID: null
                emailTemplate:
                  templateID: null
      responses:
        '200':
          description: Pricing template updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
              example:
                success: true
                statusCode: 200
                message: Request Succeeded.
                error: null
                data: {}
components:
  schemas:
    UpdateServiceRequest:
      type: object
      required:
        - method
        - action
        - apiVersion
        - service
      properties:
        method:
          type: string
          description: Always `"Update"`
          example: Update
        action:
          type: string
          description: Always `"Update Package"`
          example: Update Package
        apiVersion:
          type: string
          description: Always `"v2"`
          example: v2
        service:
          $ref: '#/components/schemas/ServicePayload'
    GenericSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
        statusCode:
          type: integer
        message:
          type: string
        error:
          nullable: true
        data:
          type: object
    ServicePayload:
      type: object
      required:
        - code
        - name
        - serviceType
        - chargingType
        - postType
        - billingCycle
        - dueDateOffset
        - components
        - values
        - connectionInputs
        - meteredInputs
        - unmeteredInputs
        - bankAccounts
        - batches
        - invoiceTemplate
        - emailTemplate
      properties:
        code:
          type: string
          description: >-
            Unique identifier code for the template. Used as the key on updates
            — cannot be renamed
        name:
          type: string
          description: Display name of the pricing template
        serviceType:
          type: string
          description: Always `"Sale"` for Billspree (appCode 200)
          example: Sale
        chargingType:
          type: string
          description: '`"Postpaid"` or `"Prepaid"`'
          example: Postpaid
        postType:
          type: string
          description: >-
            `"Post Subscription"` or `"Post Batch"`. Defaults to `"Post
            Subscription"` if not provided on update
          example: Post Subscription
        billingCycle:
          type: integer
          description: >-
            Billing cycle lookup ID (e.g. `4` = monthly) — resolve via the
            lookups API
        dueDateOffset:
          type: integer
          description: Days after bill generation that payment is due
        description:
          type: string
          nullable: true
          description: Description of the template
        components:
          type: array
          description: >-
            Pricing components (charges) — flat fees, tiers, metered rates. Send
            `[]` for a template with no charges
          items: {}
        values:
          type: array
          description: Plan values/tiers. Send `[]` if unused
          items: {}
        connectionInputs:
          type: array
          description: >-
            Custom input fields shown to the user when subscribing to this
            template
          items: {}
        meteredInputs:
          type: array
          description: Metered usage input definitions
          items: {}
        unmeteredInputs:
          type: array
          description: Flat/unmetered input definitions
          items: {}
        bankAccounts:
          type: array
          description: Linked bank accounts for payment collection
          items: {}
        batches:
          type: array
          description: >-
            Billing batches — groups subscriptions for bulk billing runs. Send
            `[]` if unused
          items: {}
        invoiceTemplate:
          $ref: '#/components/schemas/TemplateRef'
          description: >-
            Linked bill print template. Pass `{ "templateID": null }` to leave
            unlinked
        emailTemplate:
          $ref: '#/components/schemas/TemplateRef'
          description: >-
            Linked email template for bill delivery. Pass `{ "templateID": null
            }` to leave unlinked
    TemplateRef:
      type: object
      properties:
        templateID:
          type: integer
          nullable: true
          description: ID of the linked template, or `null` if none
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Auth token returned from the login endpoint. Send as: `Authorization:
        <token>` (no Bearer prefix)

````