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

# Edit recurring invoice schedule

> Edit a schedule's template. Changes only affect future occurrences — already-generated invoices are untouched (edit a Draft occurrence via PATCH /invoices/{id}). Memo, AutoSend, TotalOccurrences, and LineItems are always editable; StartDate and Cadence only before the first invoice is generated. CustomerId and Currency are immutable — a different counterparty or currency is a new schedule.



## OpenAPI

````yaml patch /recurring-invoices/{id}
openapi: 3.1.1
info:
  title: Dolfin API
  description: >-
    Dolfin API for AR & AP. Authenticate using the `x-dolfin-api-key` header
    with the API key distributed to your organisation.
  version: v1
servers:
  - url: https://api.dolfinai.co
    description: Production
security:
  - {}
tags:
  - name: Webhooks
  - name: Users
  - name: TaxRates
  - name: Suppliers
  - name: Supplier Credit Notes
  - name: Bills
  - name: SpendCategories
  - name: Payables
  - name: RecurringInvoices
  - name: Receivables
  - name: Purchase Orders
  - name: Products
  - name: Payments
  - name: Invoices
  - name: Organisations
  - name: Members
  - name: MCP
  - name: Matching
  - name: Invoice Reminders
  - name: Industries
  - name: Gmail
  - name: Delivery Notes
  - name: Customers
  - name: Currencies
  - name: Credit Notes
  - name: Clients
  - name: ClientInvites
  - name: BankPayments
  - name: Bank details
  - name: Auth
  - name: ApprovalPolicies
  - name: ApiKeys
  - name: Agent
paths:
  /recurring-invoices/{id}:
    patch:
      tags:
        - RecurringInvoices
      summary: Edit recurring invoice schedule
      description: >-
        Edit a schedule's template. Changes only affect future occurrences —
        already-generated invoices are untouched (edit a Draft occurrence via
        PATCH /invoices/{id}). Memo, AutoSend, TotalOccurrences, and LineItems
        are always editable; StartDate and Cadence only before the first invoice
        is generated. CustomerId and Currency are immutable — a different
        counterparty or currency is a new schedule.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchRecurringInvoiceScheduleRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecurringInvoiceScheduleResponse'
        '400':
          description: >-
            RecurringInvoice.InvalidTotalOccurrences — total occurrences must be
            at least 1


            RecurringInvoice.MissingStartDate — start date is required


            RecurringInvoice.InvalidCadence — cadence must be Weekly, Monthly,
            Quarterly, or Annually


            RecurringInvoice.MissingLineItems — at least one line item is
            required
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: >-
            Organisation.InsufficientRole — caller's organisation role is below
            the level this action requires
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: >-
            RecurringInvoice.NotFound — schedule does not exist or belongs to a
            different organisation


            Organisation.NotFound — the organisation does not exist or could not
            be resolved


            Product.NotFound — a referenced product does not exist or belongs to
            a different organisation


            TaxRate.NotFound — a referenced tax rate does not exist or belongs
            to a different organisation
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: >-
            RecurringInvoice.Terminal — schedule is already Completed or
            Cancelled


            RecurringInvoice.AnchorLocked — StartDate/Cadence cannot change
            after the first invoice is generated


            RecurringInvoice.TotalOccurrencesBelowGenerated — total occurrences
            cannot be below the number already generated
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    PatchRecurringInvoiceScheduleRequest:
      type: object
      properties:
        memo:
          type:
            - 'null'
            - string
        autoSend:
          type:
            - 'null'
            - boolean
        totalOccurrences:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: >-
            Must be at least the number of occurrences already generated.
            Setting it equal completes the schedule.
          format: int32
        startDate:
          type:
            - 'null'
            - string
          description: Only editable before the first invoice is generated.
          format: date-time
        cadence:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/RecurrenceCadence'
              description: Only editable before the first invoice is generated.
        lineItems:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/RecurringInvoiceLineItemRequest'
          description: >-
            Full replacement of the line-item templates. Affects future
            occurrences only.
    RecurringInvoiceScheduleResponse:
      required:
        - currency
      type: object
      properties:
        id:
          type: string
          format: uuid
        organisationId:
          type: string
          format: uuid
        customerId:
          type: string
          format: uuid
        currency:
          type: string
          description: ISO 4217 currency code (e.g. GBP, USD, EUR)
        memo:
          type:
            - 'null'
            - string
        startDate:
          type: string
          format: date-time
        cadence:
          $ref: '#/components/schemas/RecurrenceCadence'
        totalOccurrences:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        occurrencesGenerated:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          format: int32
        nextRunAt:
          type:
            - 'null'
            - string
          description: >-
            When the next invoice will be generated. Null on Paused, Completed,
            and Cancelled schedules.
          format: date-time
        autoSend:
          type: boolean
        status:
          $ref: '#/components/schemas/RecurringScheduleStatus'
        lastGeneratedAt:
          type:
            - 'null'
            - string
          format: date-time
        createdAt:
          type: string
          format: date-time
        createdBy:
          type:
            - 'null'
            - string
          format: uuid
        updatedAt:
          type: string
          format: date-time
        updatedBy:
          type:
            - 'null'
            - string
          format: uuid
        customer:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CustomerResponse'
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/RecurringInvoiceLineItemResponse'
    ProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
    RecurrenceCadence:
      enum:
        - Weekly
        - Monthly
        - Quarterly
        - Annually
    RecurringInvoiceLineItemRequest:
      type: object
      properties:
        productId:
          type: string
          format: uuid
        quantity:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - number
            - string
          format: double
        taxRateId:
          type:
            - 'null'
            - string
          format: uuid
        unitPriceOverride:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: >-
            Fixed unit price billed on every occurrence — immune to product
            price changes. Omit to bill the product's then-current price.
          format: double
    RecurringScheduleStatus:
      enum:
        - Active
        - Paused
        - Completed
        - Cancelled
    CustomerResponse:
      required:
        - name
      type: object
      properties:
        id:
          type: string
          format: uuid
        organisationId:
          type: string
          format: uuid
        name:
          type: string
        email:
          type:
            - 'null'
            - string
        phone:
          type:
            - 'null'
            - string
        taxNumber:
          type:
            - 'null'
            - string
        addressLine1:
          type:
            - 'null'
            - string
        addressLine2:
          type:
            - 'null'
            - string
        city:
          type:
            - 'null'
            - string
        state:
          type:
            - 'null'
            - string
        postalCode:
          type:
            - 'null'
            - string
        country:
          type:
            - 'null'
            - string
          description: ISO 3166-1 alpha-2 country code (e.g. GB, US, DE)
        createdAt:
          type: string
          format: date-time
        createdBy:
          type:
            - 'null'
            - string
          format: uuid
        updatedAt:
          type: string
          format: date-time
        updatedBy:
          type:
            - 'null'
            - string
          format: uuid
    RecurringInvoiceLineItemResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        productId:
          type: string
          format: uuid
        productName:
          type:
            - 'null'
            - string
        quantity:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - number
            - string
          format: double
        taxRateId:
          type:
            - 'null'
            - string
          format: uuid
        unitPriceOverride:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          description: >-
            Fixed unit price billed on every occurrence. Null means the
            product's then-current price is billed.
          format: double

````