> ## Documentation Index
> Fetch the complete documentation index at: https://sure-917046f5-mintlify-docs-update-1787370068234.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create recurring transaction



## OpenAPI

````yaml /openapi.yaml post /api/v1/recurring_transactions
openapi: 3.0.3
info:
  title: Sure API
  version: v1
  description: OpenAPI documentation generated from executable request specs.
servers:
  - url: https://app.sure.am
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
paths:
  /api/v1/recurring_transactions:
    post:
      tags:
        - Recurring Transactions
      summary: Create recurring transaction
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                recurring_transaction:
                  type: object
                  properties:
                    account_id:
                      type: string
                      format: uuid
                      nullable: true
                    merchant_id:
                      type: string
                      format: uuid
                      nullable: true
                    name:
                      type: string
                      nullable: true
                    amount:
                      type: number
                    currency:
                      type: string
                    expected_day_of_month:
                      type: integer
                      minimum: 1
                      maximum: 31
                    last_occurrence_date:
                      type: string
                      format: date
                    next_expected_date:
                      type: string
                      format: date
                    status:
                      type: string
                      enum:
                        - active
                        - inactive
                    occurrence_count:
                      type: integer
                      minimum: 0
                    manual:
                      type: boolean
                    expected_amount_min:
                      type: number
                      nullable: true
                    expected_amount_max:
                      type: number
                      nullable: true
                    expected_amount_avg:
                      type: number
                      nullable: true
                  required:
                    - amount
                    - currency
                    - expected_day_of_month
                    - last_occurrence_date
                    - next_expected_date
                  anyOf:
                    - required:
                        - name
                    - required:
                        - merchant_id
              required:
                - recurring_transaction
        required: true
      responses:
        '201':
          description: recurring transaction created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecurringTransaction'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: forbidden - requires read_write scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: account not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: validation error - negative occurrence count
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
components:
  schemas:
    RecurringTransaction:
      type: object
      required:
        - id
        - amount
        - amount_cents
        - currency
        - expected_day_of_month
        - last_occurrence_date
        - next_expected_date
        - status
        - occurrence_count
        - manual
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        amount:
          type: string
        amount_cents:
          type: integer
          description: Amount in currency minor units
        currency:
          type: string
        expected_day_of_month:
          type: integer
          minimum: 1
          maximum: 31
        last_occurrence_date:
          type: string
          format: date
        next_expected_date:
          type: string
          format: date
        status:
          type: string
          enum:
            - active
            - inactive
        occurrence_count:
          type: integer
          minimum: 0
        name:
          type: string
          nullable: true
        manual:
          type: boolean
        expected_amount_min:
          type: string
          nullable: true
        expected_amount_min_cents:
          type: integer
          nullable: true
          description: Minimum expected amount in currency minor units
        expected_amount_max:
          type: string
          nullable: true
        expected_amount_max_cents:
          type: integer
          nullable: true
          description: Maximum expected amount in currency minor units
        expected_amount_avg:
          type: string
          nullable: true
        expected_amount_avg_cents:
          type: integer
          nullable: true
          description: Average expected amount in currency minor units
        account:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Account'
        merchant:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Merchant'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
          nullable: true
        details:
          oneOf:
            - type: array
              items:
                type: string
            - type: object
          nullable: true
        errors:
          type: array
          items:
            type: string
          nullable: true
          description: >-
            Validation error messages (alternative to details used by trades,
            valuations, etc.)
    Account:
      type: object
      required:
        - id
        - name
        - account_type
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        account_type:
          type: string
          nullable: true
        status:
          type: string
    Merchant:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: X-Api-Key
      in: header
      description: API key for authentication. Generate one from your account settings.

````