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

# Create subscription

> Subscribe a buyer to a plan. This generates an acceptance link that the buyer must use to confirm and set up their payment method.



## OpenAPI

````yaml post /v1/stores/{store}/subscription-plans/{plan}/subscriptions
openapi: 3.1.0
info:
  version: 1.0.0
  title: Confío public api
servers:
  - description: Production
    url: https://api.confiopagos.com
  - description: Development
    url: https://api.dev.confiopagos.com
security:
  - bearerAuth: []
paths:
  /v1/stores/{store}/subscription-plans/{plan}/subscriptions:
    post:
      summary: Create subscription
      description: >-
        Subscribe a buyer to a plan. This generates an acceptance link that the
        buyer must use to confirm and set up their payment method.
      parameters:
        - schema:
            type: string
            example: 01G65Z755AFWAKHE12NY0CQ9FH
          required: true
          name: store
          in: path
        - schema:
            type: string
            example: 01JNRVWWHH68E76V3TMFFT6GHJ
          required: true
          name: plan
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubscriptionRequest'
      responses:
        '200':
          description: Successfully created subscription.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
components:
  schemas:
    CreateSubscriptionRequest:
      type: object
      properties:
        firstChargeAmountCents:
          type: number
          minimum: 0
          description: Optional first charge amount in cents (only for the first charge)
          example: 3000000
        redirectUri:
          type: string
          format: uri
          description: Optional redirect URI after subscription payment
          example: https://example.com/subscription-status
        buyer:
          type: object
          properties:
            email:
              type: string
              format: email
              description: Buyer email address
              example: buyer@example.com
            phoneNumber:
              type: string
              description: Buyer phone number (E.164 format)
              example: '+573215786325'
            firstName:
              type: string
              description: Buyer first name
              example: Santiago
            lastName:
              type: string
              description: Buyer last name
              example: García
          required:
            - email
            - phoneNumber
            - firstName
            - lastName
      required:
        - buyer
    Subscription:
      type: object
      properties:
        name:
          type: string
          description: Subscription's resource name
          example: >-
            stores/01JNRRDZDPH40DB2YRW329BFXM/subscription-plans/01JNRVWWHH68E76V3TMFFT6GHJ/subscriptions/01JNRVWWHH68E76V3TMFFT6GHJ
        firstChargeAmountCents:
          type: number
          description: Optional first charge amount in cents (only for the first charge)
          example: 3000000
        redirectUri:
          type: string
          format: uri
          description: Optional redirect URI after subscription payment
          example: https://example.com/subscription-status
        status:
          type: string
          enum:
            - PENDING_ACCEPTANCE
            - ACTIVE
            - TRIALING
            - PAST_DUE
            - CANCELED
            - SUSPENDED
          description: Subscription status
          example: PENDING_ACCEPTANCE
        buyer:
          type: object
          properties:
            email:
              type: string
              format: email
              description: Buyer email address
              example: buyer@example.com
            phoneNumber:
              type: string
              description: Buyer phone number (E.164 format)
              example: '+573215786325'
            firstName:
              type: string
              description: Buyer first name
              example: Santiago
            lastName:
              type: string
              description: Buyer last name
              example: García
          required:
            - email
            - phoneNumber
            - firstName
            - lastName
          description: Buyer information
        acceptanceUrl:
          type: string
          description: >-
            URL for buyer to accept the subscription (only available when status
            is PENDING_ACCEPTANCE)
          example: https://checkout.confiopagos.com/s/abc123token
        acceptanceTokenExpiresAt:
          type: string
          description: Expiration time of the acceptance token
          example: '2024-01-22T10:30:00Z'
        currentPeriodStart:
          type: string
          description: Start of current billing period
          example: '2024-01-15T10:30:00Z'
        currentPeriodEnd:
          type: string
          description: End of current billing period
          example: '2024-02-15T10:30:00Z'
        nextBillingTime:
          type: string
          description: Next billing date
          example: '2024-02-15T10:30:00Z'
        createTime:
          type: string
          description: Creation timestamp
          example: '2024-01-15T10:30:00Z'
      required:
        - name
        - status
        - buyer
        - createTime
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````