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

# Create Subscription

> Creates a new recurring donation subscription for a donor.



## OpenAPI

````yaml https://server.stage.overflow.co/api/docs/openapi.json post /api/v3/subscriptions/{donorId}
openapi: 3.0.0
info:
  title: Overflow Open API
  description: |

    The documentation for the Overflow Open APIs.

    To access the OpenAPI spec in JSON/YAML format, navigate to:

    * `/api/docs/openapi.json`
    * `/api/docs/openapi.yaml`
  version: '3.0'
  contact: {}
servers:
  - url: https://server.stage.overflow.co
    description: API server
security: []
tags: []
paths:
  /api/v3/subscriptions/{donorId}:
    post:
      tags:
        - Subscriptions
      summary: Create Subscription
      description: Creates a new recurring donation subscription for a donor.
      operationId: OpenApiSubscriptionsController_createSubscription
      parameters:
        - name: donorId
          required: true
          in: path
          description: The Id of the donor to create the subscription for.
          schema:
            example: 2ea1ae03ca521e437db76d76
            type: string
      requestBody:
        required: true
        description: Subscription creation details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubscriptionRequest'
      responses:
        '201':
          description: Subscription created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSubscriptionResponse'
        '400':
          description: Invalid request parameters
        '404':
          description: Resource not found
        '500':
          description: Internal server error
      security:
        - ClientId: []
          ApiKey: []
components:
  schemas:
    CreateSubscriptionRequest:
      type: object
      properties:
        paymentMethodId:
          type: string
          description: Id of the payment method.
          example: 6710f34fd5061afeec3eab57
        amount:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: Subscription amount in dollars.
          example: 50
        frequency:
          type: string
          enum:
            - two-weeks
            - 1st-15th
            - month
            - one-time
            - week
          description: Recurring frequency for the subscription.
          example: month
        startDate:
          type: string
          format: date-time
          description: ISO 8601 date string when the subscription should start.
          example: '2025-01-15T05:00:00.000Z'
        timezone:
          type: string
          description: >-
            Timezone for the subscription start date. Defaults to UTC if not
            provided.
          example: America/Chicago
        anonymous:
          type: boolean
          description: Whether the donor wants the contribution to be anonymous.
          example: false
        campaignId:
          type: string
          description: Id of the campaign to allocate funds to
          example: 7710f34fd5061afeec3eab78
        subcampaignId:
          type: string
          description: Id of the subcampaign for more specific allocation.
          example: 7710f34fd5061afeec3eab79
        donorNotes:
          type: string
          description: Notes from the donor.
          example: Happy to support this cause!
      required:
        - paymentMethodId
        - amount
        - frequency
    CreateSubscriptionResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              description: Subscription Id.
              example: 6710f34fd5061afeec3eab57
            donorId:
              type: string
              description: Id of the Donor Profile.
              example: 6710f34fd5061afeec3eab57
            createdAt:
              type: string
              format: date-time
              description: Subscription created at.
              example: '2025-01-01T00:00:00.000Z'
            updatedAt:
              type: string
              format: date-time
              description: Subscription updated at.
              example: '2025-01-01T00:00:00.000Z'
            startDate:
              type: string
              format: date-time
              description: Subscription start date.
              example: '2025-01-01T00:00:00.000Z'
            status:
              type: string
              enum:
                - active
                - failed
                - inactive
                - paused
                - pending
                - recreated
              description: Subscription status.
              example: active
            amount:
              type: number
              description: Subscription amount.
              example: 50
            donorCoveredFees:
              default: false
              type: boolean
              description: Whether the donor is covering fees.
              example: false
            anonymous:
              type: boolean
              description: Whether the donor wants the subscription to be anonymous.
              example: false
            frequency:
              type: string
              enum:
                - biweekly
                - monthly
                - weekly
              description: Subscription frequency.
              example: weekly
            nextPaymentDate:
              type: string
              format: date-time
              nullable: true
              description: Subscription next payment date.
              example: '2025-01-01T00:00:00.000Z'
            paymentMethod:
              type: object
              properties:
                id:
                  type: string
                holderName:
                  type: string
                type:
                  type: string
                  enum:
                    - bank
                    - card
                    - wallet
                last4:
                  type: string
                expiration:
                  type: string
              required:
                - id
                - type
                - last4
                - expiration
              description: Subscription payment method.
              example:
                id: 6710f34fd5061afeec3eab57
                holderName: John Doe
                type: card
                last4: '4242'
                expiration: 12/2025
            campaign:
              type: object
              properties:
                id:
                  type: string
                name:
                  type: string
              required:
                - id
                - name
              nullable: true
              description: Campaign details for the contribution
              example:
                id: 7710f34fd5061afeec3eab78
                name: Mission 2025
            subcampaign:
              type: object
              properties:
                id:
                  type: string
                name:
                  type: string
              required:
                - id
                - name
              nullable: true
              description: Subcampaign details for the contribution
              example:
                id: 7710f34fd5061afeec3eab79
                name: Toy Drive
            metadata:
              type: object
              additionalProperties:
                type: string
              nullable: true
              description: Merchant-defined metadata.
              example:
                orderId: abc-123
            locationId:
              type: string
              nullable: true
              description: Id of the Location associated with the subscription.
              example: 6710f34fd5061afeec3eab57
          required:
            - id
            - donorId
            - createdAt
            - updatedAt
            - startDate
            - status
            - amount
            - anonymous
            - frequency
            - nextPaymentDate
            - paymentMethod
            - campaign
            - subcampaign
          description: The subscription that was created
      required:
        - data
  securitySchemes:
    ClientId:
      type: apiKey
      in: header
      name: x-client-id
      description: Client ID for API authentication
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key for API authentication

````