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

# Update subscription template

> Updates supplied fields, preserving omitted fields. A supplied invoice schedule replaces the existing schedule. Requires a user OAuth token.



## OpenAPI

````yaml /openapi.yaml patch /v1/subscription-templates/{id}
openapi: 3.1.0
info:
  title: Quentli REST API
  version: 1.0.0
  description: OpenAPI spec for Quentli REST endpoints.
servers:
  - url: https://api.quentli.com
    description: Production API
  - url: https://api.staging.quentli.com
    description: Staging API for production-like validation
security:
  - organizationApiKey: []
  - oauthAccessToken: []
tags:
  - name: Auth
  - name: Management
  - name: Billing
  - name: Catalog
  - name: Customers
  - name: Invoices
  - name: Payment Methods
  - name: Payment Sessions
  - name: Payments
  - name: Subscriptions
  - name: Tax Invoices
  - name: Webhooks
  - name: Messaging
paths:
  /v1/subscription-templates/{id}:
    patch:
      tags:
        - Subscriptions
      summary: Update subscription template
      description: >-
        Updates supplied fields, preserving omitted fields. A supplied invoice
        schedule replaces the existing schedule. Requires a user OAuth token.
      operationId: subscription_templates_update
      parameters:
        - schema:
            type: string
            description: Identifier of the subscription template.
          required: true
          description: Identifier of the subscription template.
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscriptionTemplateArgs'
      responses:
        '200':
          description: Subscription template updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionTemplatePayload'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '403':
          description: Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '404':
          description: Subscription template not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
components:
  schemas:
    UpdateSubscriptionTemplateArgs:
      type: object
      properties:
        input:
          type: object
          properties:
            id:
              type: string
            data:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                sku:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                invoices:
                  type: array
                  items:
                    type: object
                    properties:
                      offset:
                        type: number
                        minimum: 0
                      offsetInterval:
                        type: string
                        enum:
                          - DAY
                          - WEEK
                          - FORTNIGHT
                          - MONTH
                          - YEAR
                      order:
                        type: number
                        minimum: 0
                      items:
                        type: array
                        items:
                          type: object
                          properties:
                            conceptId:
                              type: string
                            quantity:
                              type: number
                              minimum: 1
                          required:
                            - conceptId
                            - quantity
                    required:
                      - offset
                      - offsetInterval
                      - order
                      - items
          required:
            - id
            - data
      required:
        - input
      description: Request body for updating a subscription template.
    SubscriptionTemplatePayload:
      type: object
      properties:
        subscriptionTemplate:
          $ref: '#/components/schemas/SubscriptionTemplate'
      required:
        - subscriptionTemplate
      description: The created or updated subscription template.
    UserError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - error
      additionalProperties: false
      description: Standard user-facing error response envelope.
    SubscriptionTemplate:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the subscription template.
          example: st_1234567890abcdefghij
        createdAt:
          type: string
          format: date-time
          description: When the template was created.
        updatedAt:
          type: string
          format: date-time
          description: When the template was last updated.
        organizationId:
          type: string
          description: Organization that owns the template.
        name:
          type: string
          description: Name of the template.
          example: Colegiatura 2025
        sku:
          type:
            - string
            - 'null'
          description: Optional unique SKU.
          example: null
        active:
          type: boolean
          description: Whether the template is active.
        createdById:
          type: string
          description: User who created the template.
        updatedById:
          type:
            - string
            - 'null'
          description: User who last updated the template.
        invoices:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionTemplateInvoice'
          description: Invoice schedule, in order.
      required:
        - id
        - createdAt
        - updatedAt
        - organizationId
        - name
        - sku
        - active
        - createdById
        - updatedById
      description: A reusable schedule of invoices used to create subscriptions.
    SubscriptionTemplateInvoice:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the template invoice.
        order:
          type: integer
          description: Position of this invoice in the schedule.
          example: 0
        offset:
          type: integer
          description: Time after the subscription start when this invoice is due.
          example: 1
        offsetInterval:
          type: string
          enum:
            - DAY
            - WEEK
            - FORTNIGHT
            - MONTH
            - YEAR
          description: Unit of the offset.
        dueDate:
          type:
            - string
            - 'null'
          format: date-time
          description: Fixed due date, when the template uses one.
        expireDate:
          type:
            - string
            - 'null'
          format: date-time
          description: Fixed expiration date, when the template uses one.
        items:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Unique identifier of the template item.
              conceptId:
                type: string
                description: Payment concept billed by this item.
                example: pc_1234567890abcdefghij
              quantity:
                type: integer
                description: Number of units.
                example: 1
            required:
              - id
              - conceptId
              - quantity
      required:
        - id
        - order
        - offset
        - offsetInterval
        - dueDate
        - expireDate
        - items
      description: An invoice generated by a subscription template.
  securitySchemes:
    organizationApiKey:
      type: http
      scheme: bearer
      description: 'Organization API key using `Authorization: Bearer sk_...`.'
    oauthAccessToken:
      type: http
      scheme: bearer
      bearerFormat: OAuth 2.1
      description: 'OAuth access token using `Authorization: Bearer qoa_at_...`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.