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

# Create a subscription plan

> The plan is created as a draft. Publish it (or use the merchant UI) before
customers can subscribe.



## OpenAPI

````yaml https://app.dimepayments.com/openapi.yaml post /api/subscription-plan/create
openapi: 3.0.3
info:
  title: Dime Payments API Documentation
  description: >-
    A simple, basic API for managing Merchants through Dime Payments. JSON based
    REST API
  version: 1.0.0
servers:
  - url: https://app.dimepayments.com
security:
  - default: []
tags:
  - name: Merchant management
    description: ''
  - name: Transaction management
    description: >-

      APIs for managing transactions.  Depending on API KEY permissions, one
      should be able to

      charge credit cards, ACH, Google/Apple Pay wallets along with other
      functions.
  - name: Addresses
    description: |-

      APIs for managing customer addresses
  - name: Customer management
    description: >-

      APIs for managing customers.  Depending on API KEY permissions, one should
      be able to

      list, create, update, and delete customers along with several other
      customer specific requests.
  - name: Deposit management
    description: ''
  - name: Invoice management
    description: >-

      APIs for managing invoices. Depending on API KEY permissions, one should
      be

      able to list, create, update, delete, and send invoices, manage their line

      items, and manage recurring-invoice schedules. Every request is scoped to
      a

      single Merchant via the required `data.sid`.
  - name: Payment Method management
    description: >-

      APIs for managing payment methods associated with customers.  Depending on
      API KEY permissions, one should be able to

      list, show, create, update, and delete payment methods.
  - name: Recurring Payments management
    description: >-

      APIs for managing recurring payments.  Depending on API KEY permissions,
      one should be able to

      create, edit, pause, cancel along with other functions.
  - name: Subscription Plans management
    description: >-

      Merchant-facing API for subscription plans (recurring offerings customers

      subscribe to). The merchant is identified by `data.sid`; the token must
      carry

      the matching `subscription-plan:*` ability. Mirrors the recurring-payment
      and

      invoice API controllers.
  - name: Subscriptions management
    description: >-

      Merchant-facing API for individual customer subscriptions (enrollments in
      a

      plan). The merchant is identified by `data.sid`; the token must carry the

      matching `subscription:*` ability. Lifecycle transitions delegate to the

      {@see \App\Actions\Subscription} action classes so the matching
      `SUBSCRIPTION_*`

      webhook always fires. Mirrors the recurring-payment and subscription-plan
      API

      controllers.
  - name: Zapier
    description: >-

      APIs for use through Zapier.  Depending on API KEY permissions, one should
      be able to

      see customers and transactions data.
paths:
  /api/subscription-plan/create:
    post:
      tags:
        - Subscription Plans management
      summary: Create a subscription plan
      description: >-
        The plan is created as a draft. Publish it (or use the merchant UI)
        before

        customers can subscribe.
      operationId: createASubscriptionPlan
      parameters: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  description: ''
                  example:
                    sid: 12345
                  properties:
                    sid:
                      type: integer
                      description: The merchant SID.
                      example: 12345
                    name:
                      type: string
                      description: The plan name.
                      example: Monthly Membership
                    description:
                      type: string
                      description: A description.
                      example: Full access, billed monthly.
                    recurrence_schedule:
                      type: string
                      description: >-
                        One of Weekly, Biweekly, FirstFifteenth, Monthly,
                        Yearly.
                      example: Monthly
                    allow_public:
                      type: boolean
                      description: List in the public catalog.
                      example: true
                    lines:
                      type: array
                      description: At least one line item.
                      example:
                        - []
                      items:
                        type: object
                        properties:
                          item_id:
                            type: integer
                            description: A catalog item id owned by the merchant.
                            example: 5
                          name:
                            type: string
                            description: ''
                            example: Base membership
                          quantity:
                            type: number
                            description: ''
                            example: 1
                          unit_price:
                            type: number
                            description: ''
                            example: 25
                        required:
                          - item_id
                          - name
                          - quantity
                          - unit_price
                  required:
                    - sid
                    - name
                    - recurrence_schedule
                    - lines
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: null
                    name: Community Circle 70546
                    description: Quos velit et fugiat sunt nihil accusantium harum.
                    recurrence_schedule: Monthly
                    status: active
                    subtotal: 0
                    total: 0
                    token: xR5JytNKinO7aYNGyIaCLL1q73UVpAjziOLXl5ca
                    public_url: >-
                      http://app.dimepayments.com/subscribe/xR5JytNKinO7aYNGyIaCLL1q73UVpAjziOLXl5ca
                    allow_public: true
                    created_at: null
                    items: []
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: null
                        nullable: true
                      name:
                        type: string
                        example: Community Circle 70546
                      description:
                        type: string
                        example: Quos velit et fugiat sunt nihil accusantium harum.
                      recurrence_schedule:
                        type: string
                        example: Monthly
                      status:
                        type: string
                        example: active
                      subtotal:
                        type: integer
                        example: 0
                      total:
                        type: integer
                        example: 0
                      token:
                        type: string
                        example: xR5JytNKinO7aYNGyIaCLL1q73UVpAjziOLXl5ca
                      public_url:
                        type: string
                        example: >-
                          http://app.dimepayments.com/subscribe/xR5JytNKinO7aYNGyIaCLL1q73UVpAjziOLXl5ca
                      allow_public:
                        type: boolean
                        example: true
                      created_at:
                        type: string
                        example: null
                        nullable: true
                      items:
                        type: array
                        example: []
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: >-
        You can retrieve your token by visiting your dashboard and clicking
        <b>Generate API token under your profile in top right</b>.

````