> ## Documentation Index
> Fetch the complete documentation index at: https://yn-c9bb3266.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Subscription

> Creates a new recurring subscription for a customer with a specified billing interval and amount.



## OpenAPI

````yaml POST /v1/subscriptions
openapi: 3.1.0
info:
  title: Yuno Payments API
  description: >-
    Yuno payment orchestration platform — unified REST API for payments,
    checkout sessions, customers, payment methods, subscriptions, payouts,
    marketplace transfers, and banking connectivity across Latin America.
  version: 1.0.0
  contact:
    name: Yuno Support
    email: support@y.uno
    url: https://docs.y.uno
  license:
    name: Proprietary
    url: https://y.uno
servers:
  - url: https://api-sandbox.y.uno
    description: Sandbox
  - url: https://api.y.uno
    description: Production
security:
  - publicApiKey: []
    privateSecretKey: []
paths:
  /v1/subscriptions:
    post:
      tags:
        - Subscriptions
      summary: Create subscription
      description: >-
        Creates a new recurring subscription for a customer with a specified
        billing interval and amount.
      operationId: createSubscription
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionRequest'
            example:
              customer_id: c9d0e1f2-3a4b-5c6d-7e8f-9a0b1c2d3e4f
              amount:
                currency: BRL
                value: 49.9
              country: BR
              interval: MONTHLY
              payment_method_id: pm_1a2b3c4d-5e6f-7890-abcd-ef1234567890
              description: Premium Plan - Monthly
      responses:
        '201':
          description: Subscription created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SubscriptionRequest:
      type: object
      required:
        - customer_id
        - amount
        - country
        - interval
      properties:
        customer_id:
          type: string
          format: uuid
          description: The customer for this subscription
          example: c9d0e1f2-3a4b-5c6d-7e8f-9a0b1c2d3e4f
        amount:
          $ref: '#/components/schemas/Amount'
        country:
          type: string
          description: ISO 3166-1 alpha-2 country code
          pattern: ^[A-Z]{2}$
          example: BR
        interval:
          type: string
          enum:
            - DAILY
            - WEEKLY
            - MONTHLY
            - YEARLY
          description: Billing interval
          example: MONTHLY
        payment_method_id:
          type: string
          format: uuid
          description: Enrolled payment method to charge
          example: pm_1a2b3c4d-5e6f-7890-abcd-ef1234567890
        description:
          type: string
          description: Subscription description
          example: Premium Plan - Monthly
        start_date:
          type: string
          format: date-time
          description: When to start billing
          example: '2026-03-01T00:00:00.000Z'
      example:
        customer_id: c9d0e1f2-3a4b-5c6d-7e8f-9a0b1c2d3e4f
        amount:
          currency: BRL
          value: 49.9
        country: BR
        interval: MONTHLY
        payment_method_id: pm_1a2b3c4d-5e6f-7890-abcd-ef1234567890
        description: Premium Plan - Monthly
        start_date: '2026-03-01T00:00:00.000Z'
    Subscription:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - ACTIVE
            - PAUSED
            - CANCELLED
            - PAST_DUE
            - EXPIRED
        amount:
          $ref: '#/components/schemas/Amount'
        interval:
          type: string
          enum:
            - DAILY
            - WEEKLY
            - MONTHLY
            - YEARLY
        next_payment_date:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      description: >-
        Standard error envelope returned by every Yuno service for any 4xx or
        5xx response. Top level. `code` is a stable SCREAMING_SNAKE_CASE
        identifier. `messages` is always an array of strings, even when there is
        only one entry. There is no `error` wrapper, no singular `message`, no
        `type`, no `details`. See the Error handling guide for the full code
        catalog.
      required:
        - code
        - messages
      properties:
        code:
          type: string
          description: >-
            Stable, machine readable identifier. Branch on this in your client.
            Common values include `BAD_REQUEST`, `VALIDATION_ERROR`,
            `INVALID_REQUEST`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`,
            `TOO_MANY_REQUESTS`, `INTERNAL_ERROR`, `BAD_GATEWAY`,
            `SERVICE_UNAVAILABLE`, plus business codes like
            `CUSTOMER_ID_DUPLICATED`, `RECIPIENT_NOT_FOUND`, `INVALID_STATE`,
            and the `PROVIDER_*` family for downstream provider errors.
          example: VALIDATION_ERROR
        messages:
          type: array
          description: >-
            Human readable details. Validation errors put one entry per failed
            field, formatted `"fieldName message"`.
          items:
            type: string
          example:
            - merchant_customer_id must not be blank
      example:
        code: VALIDATION_ERROR
        messages:
          - amount must be greater than 0
          - country must not be blank
    Amount:
      type: object
      required:
        - currency
        - value
      properties:
        currency:
          type: string
          description: ISO 4217 currency code
          example: BRL
        value:
          type: number
          description: >-
            Payment amount in major currency units (e.g., 150.00 means 150 BRL,
            not cents). For zero-decimal currencies like CLP and PYG, use whole
            numbers (e.g., 15000 means 15,000 CLP).
          example: 100
      example:
        currency: BRL
        value: 100
  securitySchemes:
    publicApiKey:
      type: apiKey
      in: header
      name: public-api-key
      description: Your public API key from the Yuno Dashboard
    privateSecretKey:
      type: apiKey
      in: header
      name: private-secret-key
      description: Your private secret key (server-side only)

````