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

# Create recurring invoice schedule

> Create a recurring-invoice schedule (contract). Invoices are generated from the schedule's template on the cadence — occurrence N falls on StartDate plus N intervals (month-end clamped). With AutoSend each occurrence is generated and emailed in one step; otherwise occurrences land as Draft for review. Admin-gated because an AutoSend schedule sends email without further review.



## OpenAPI

````yaml post /recurring-invoices
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:
    post:
      tags:
        - RecurringInvoices
      summary: Create recurring invoice schedule
      description: >-
        Create a recurring-invoice schedule (contract). Invoices are generated
        from the schedule's template on the cadence — occurrence N falls on
        StartDate plus N intervals (month-end clamped). With AutoSend each
        occurrence is generated and emailed in one step; otherwise occurrences
        land as Draft for review. Admin-gated because an AutoSend schedule sends
        email without further review.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRecurringInvoiceScheduleRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecurringInvoiceScheduleResponse'
        '400':
          description: >-
            RecurringInvoice.MissingCustomerId — customer ID is required


            RecurringInvoice.InvalidCurrency — currency code is not valid


            RecurringInvoice.MissingStartDate — start date is required


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


            RecurringInvoice.InvalidTotalOccurrences — total occurrences must be
            at least 1


            RecurringInvoice.MissingLineItems — at least one line item is
            required


            Currency.NotFoundByCode — the specified currency is not supported
          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: >-
            Customer.NotFound — customer 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'
components:
  schemas:
    CreateRecurringInvoiceScheduleRequest:
      required:
        - customerId
        - currency
        - lineItems
      type: object
      properties:
        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
          description: >-
            Date of the first invoice. Subsequent occurrences fall on this date
            plus N intervals (month-end clamped).
          format: date-time
        cadence:
          $ref: '#/components/schemas/RecurrenceCadence'
        totalOccurrences:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          description: >-
            Total number of invoices to generate. Omit to run until paused or
            cancelled.
          format: int32
        autoSend:
          type: boolean
          description: >-
            True: each occurrence is generated and emailed in one step. False:
            occurrences land as Draft for review.
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/RecurringInvoiceLineItemRequest'
    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

````