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

# Create a plan



## OpenAPI

````yaml /openapi.json post /v1/plans
openapi: 3.1.0
info:
  title: Duro API
  version: 1.0.0
  description: >-
    Recovery-first subscription billing. Authenticate with a secret key
    (sk_test_ / sk_live_) as a bearer token. Amounts are in integer minor units
    (kobo).
servers:
  - url: https://api.useduro.com
    description: Production (live)
  - url: https://sandbox.useduro.com
    description: Sandbox (test)
security:
  - bearerAuth: []
tags:
  - name: Plans
  - name: Promo Codes
  - name: Payment Links
  - name: Customers
  - name: Transactions
  - name: Subscriptions
  - name: Invoices
  - name: Recovery
  - name: Settings
  - name: Analytics
  - name: Checkout
  - name: Events
  - name: OAuth
  - name: Customer Checkout
  - name: Customer Identity
  - name: Customer Portal
paths:
  /v1/plans:
    post:
      tags:
        - Plans
      summary: Create a plan
      operationId: createPlan
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlanCreate'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Plan'
        '422':
          $ref: '#/components/responses/Validation'
components:
  schemas:
    PlanCreate:
      type: object
      required:
        - name
        - amount
        - interval
      properties:
        name:
          type: string
          example: Pro Monthly
        amount:
          type: integer
          description: Minor units (kobo).
          example: 500000
        currency:
          type: string
          default: NGN
        interval:
          $ref: '#/components/schemas/Interval'
        intervalCount:
          type: integer
          default: 1
        trialDays:
          type: integer
          default: 0
        maxCycles:
          type: integer
          description: Stop after N successful charges. Omit for forever.
        reminderDays:
          type: array
          items:
            type: integer
        metadata:
          type: object
    Plan:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        amount:
          type: integer
        currency:
          type: string
        interval:
          $ref: '#/components/schemas/Interval'
        intervalCount:
          type: integer
        trialDays:
          type: integer
        maxCycles:
          type: integer
          nullable: true
        createdAt:
          type: string
          format: date-time
    Interval:
      type: string
      enum:
        - hour
        - day
        - week
        - month
        - quarter
        - biannual
        - year
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items:
                type: object
  responses:
    Validation:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A secret key (sk_test_… / sk_live_…), OAuth token, or identity token.

````