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

# Create a recurring series

> Issues an invoice to a customer on a schedule: `weekly`, `biweekly`, `monthly` or `quarterly` from `startDate`, until `endDate` if you give one.

- Each invoice is issued at 09:00 UTC on its day and is due `dueDays` later.
- Monthly and quarterly series keep the start date's day, moved earlier in shorter months (the 31st becomes the 30th or 28th).
- A series starting today issues its first invoice straight away and returns it. If that first invoice fails, the series is cancelled and the error returned.

Requires the `invoices:write` scope.



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/invoice-series
openapi: 3.1.0
info:
  title: Talescria API
  version: 1.0.0
  description: >-
    Accounts, recipients, payments, transfers between your accounts, payment
    links, customers and invoices. Authenticate with an access token from your
    OAuth client.
servers:
  - url: https://api.talescria.com
    description: Production (test and live keys)
security:
  - bearerAuth: []
tags:
  - name: Accounts
    description: Your accounts and their balances.
  - name: Recipients
    description: People and businesses you pay, and where to pay them.
  - name: Payments
    description: Paying recipients, including across currencies.
  - name: Transfers
    description: Moving money between your own accounts.
  - name: Payment links
    description: Links anyone can open to pay you by card.
  - name: Customers
    description: People and businesses who pay you.
  - name: Invoices
    description: One-off invoices and recurring series.
paths:
  /v1/invoice-series:
    post:
      tags:
        - Invoices
      summary: Create a recurring series
      description: >-
        Issues an invoice to a customer on a schedule: `weekly`, `biweekly`,
        `monthly` or `quarterly` from `startDate`, until `endDate` if you give
        one.


        - Each invoice is issued at 09:00 UTC on its day and is due `dueDays`
        later.

        - Monthly and quarterly series keep the start date's day, moved earlier
        in shorter months (the 31st becomes the 30th or 28th).

        - A series starting today issues its first invoice straight away and
        returns it. If that first invoice fails, the series is cancelled and the
        error returned.


        Requires the `invoices:write` scope.
      operationId: createARecurringSeries
      parameters:
        - $ref: '#/components/parameters/IdempotencyKeyRequired'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - accountId
                - customerId
                - frequency
                - startDate
                - dueDays
                - notify
                - template
              properties:
                accountId:
                  type: string
                customerId:
                  type: string
                frequency:
                  type: string
                  enum:
                    - weekly
                    - biweekly
                    - monthly
                    - quarterly
                startDate:
                  type: string
                  format: date
                endDate:
                  type: string
                  format: date
                dueDays:
                  type: integer
                  minimum: 0
                  maximum: 365
                notify:
                  type: boolean
                  description: Email each issue to the customer.
                template:
                  type: object
                  required:
                    - lines
                  properties:
                    lines:
                      type: array
                      items:
                        type: object
                    tax:
                      type: object
                    memo:
                      type: string
                    poNumber:
                      type: string
                    internalNote:
                      type: string
                    cc:
                      type: array
                      items:
                        type: string
      responses:
        '201':
          description: The series, and today's invoice when it started today.
          content:
            application/json:
              schema:
                type: object
                properties:
                  series:
                    $ref: '#/components/schemas/InvoiceSeries'
                  invoice:
                    oneOf:
                      - $ref: '#/components/schemas/Invoice'
                      - type: 'null'
        '400':
          description: >-
            `VALIDATION`: A field is missing or malformed. `message` says which.


            `IDEMPOTENCY_KEY_REQUIRED`: This operation needs an
            `Idempotency-Key` header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            `UNAUTHENTICATED`: The access token is missing, expired or revoked.
            Get a new token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            `INSUFFICIENT_SCOPE`: Your API key lacks the scope this operation
            needs. The scope is named in `message` and the `WWW-Authenticate`
            header.


            `ENVIRONMENT_MISMATCH`: The request named a different environment
            from the key's.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            `IDEMPOTENCY_IN_PROGRESS`: A request with this `Idempotency-Key` is
            still running. Retry shortly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            `IDEMPOTENCY_KEY_REUSED`: This `Idempotency-Key` was used for a
            different request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: '`RATE_LIMITED`: Too many requests. Wait for `Retry-After` seconds.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: '`UPSTREAM_UNAVAILABLE`: Temporarily unavailable. Retry with backoff.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  parameters:
    IdempotencyKeyRequired:
      name: Idempotency-Key
      in: header
      required: true
      description: >-
        A unique key for this operation. Send the same key when you retry it.
        Kept for 24 hours.
      schema:
        type: string
        minLength: 8
        maxLength: 255
        pattern: ^[A-Za-z0-9_\-:.]+$
  schemas:
    InvoiceSeries:
      type: object
      properties:
        id:
          type: string
        number:
          type: string
          example: S-0001
        customer:
          type:
            - object
            - 'null'
        accountId:
          type: string
        currency:
          type: string
        amount:
          $ref: '#/components/schemas/Money'
        frequency:
          type: string
          enum:
            - weekly
            - biweekly
            - monthly
            - quarterly
        startDate:
          type: string
          format: date
        endDate:
          type:
            - string
            - 'null'
          format: date
        dueDays:
          type: integer
        notify:
          type: boolean
        status:
          type: string
          enum:
            - active
            - completed
            - cancelled
        nextIssueAt:
          type:
            - integer
            - 'null'
        issuedCount:
          type: integer
        lastError:
          type:
            - string
            - 'null'
          description: Why the last attempt failed, until one succeeds.
        template:
          type: object
        createdAt:
          type: integer
        updatedAt:
          type: integer
    Invoice:
      type: object
      required:
        - id
        - status
        - number
        - total
        - issuedAt
        - dueAt
        - url
        - document
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - unpaid
            - overdue
            - paid
            - void
          description: '`overdue` is unpaid past dueAt, and still payable.'
        number:
          type: string
          example: INV-0001
        total:
          $ref: '#/components/schemas/Money'
        issuedAt:
          type: integer
        dueAt:
          type: integer
        accountId:
          type:
            - string
            - 'null'
        customer:
          oneOf:
            - type: 'null'
            - type: object
              properties:
                id:
                  type: string
                name:
                  type: string
                email:
                  type: string
                deleted:
                  type: boolean
        paidAt:
          type:
            - integer
            - 'null'
        paymentInProgress:
          type: boolean
        url:
          type: string
          description: What the customer opens to see and pay it.
        document:
          type: object
          description: 'The document as issued: parties, lines, subtotal, tax, total, memo.'
        createdAt:
          type: integer
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Branch on this, not on `message`. See Errors.
            message:
              type: string
              description: For people. Wording can change.
    Money:
      type: object
      required:
        - minorUnits
        - currency
      properties:
        minorUnits:
          type: string
          pattern: ^-?\d+$
          description: Integer minor units as a string. Never a float.
          example: '125000'
        currency:
          type: string
          example: USD
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An access token (`at_test_…` or `at_live_…`) from `POST
        https://idp.talescria.com/oauth/token`.

````

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