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

# Create Subscription

> Creates a recurring payment subscription. The first order is created immediately;
subsequent orders are triggered on the defined schedule.




## OpenAPI

````yaml POST /subscriptions
openapi: 3.1.0
info:
  title: Truust API
  version: '2.0'
  description: >
    The Truust API allows you to manage payment flows, orders, customers,
    wallets, and more.


    ## Authentication


    All authenticated endpoints require a Bearer token using your account's
    **Secret Key**.


    ```

    Authorization: Bearer {your_secret_key}

    ```


    Your API keys are available in the Dashboard under **Account Settings → API
    Developers**.
  contact:
    email: hello@truust.io
  license:
    name: Proprietary
servers:
  - url: https://{subdomain}.truust.io/2.0
    description: Production
    variables:
      subdomain:
        default: your-subdomain
        description: Your account subdomain
  - url: https://{subdomain}-sandbox.truust.io/2.0
    description: Sandbox
    variables:
      subdomain:
        default: your-subdomain
        description: Your account subdomain
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Manage your Truust account
  - name: Customers
    description: Manage buyers and sellers (end users)
  - name: Orders
    description: Create and manage escrow payment orders
  - name: Payins
    description: Manage incoming payments for orders
  - name: Payouts
    description: Manage outgoing payments from orders
  - name: Wallets
    description: Manage customer and account wallets
  - name: Bank Accounts
    description: Manage bank accounts for payouts
  - name: Cards
    description: Manage tokenized payment cards
  - name: Subscriptions
    description: Manage recurring payment subscriptions
  - name: Verifications
    description: KYC verification for customers and accounts
  - name: Bundles
    description: Manage product bundles for orders
  - name: Refunds
    description: View refund records
paths:
  /subscriptions:
    post:
      tags:
        - Subscriptions
      summary: Create subscription
      description: >
        Creates a recurring payment subscription. The first order is created
        immediately;

        subsequent orders are triggered on the defined schedule.
      operationId: createSubscription
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - buyer_id
                - seller_id
                - name
                - value
                - type
              example:
                buyer_id: 7485
                seller_id: 7485
                name: Subscription Test
                value: 10
                type: ADDON
              properties:
                buyer_id:
                  type: integer
                  description: Customer ID of the subscriber (buyer).
                  example: 42
                seller_id:
                  type: integer
                  description: Customer ID of the seller.
                name:
                  type: string
                  maxLength: 120
                  example: Monthly plan
                value:
                  type: number
                  minimum: 0
                  description: Recurring charge amount.
                  example: 9.99
                type:
                  type: string
                  description: Payment method type for the subscription (e.g. `CARD`).
                  example: CARD
                fee_value:
                  type: number
                  minimum: 0
                fee_percent:
                  type: number
                  minimum: 0
                  maximum: 100
                start_date:
                  type: string
                  format: date
                  description: >-
                    Date when the subscription starts. Defaults to creation date
                    if not provided.
                first_payment_value:
                  type: number
                  description: Amount for the first payment if different from `value`.
                times:
                  type: integer
                  description: Number of billing cycles. Leave null for indefinite.
                schedule:
                  type: string
                  description: >-
                    Cron expression or schedule descriptor (e.g. `monthly`,
                    `weekly`).
                auto_settle:
                  type: boolean
                tag:
                  type: string
                  maxLength: 100
                metadata:
                  type: object
                  additionalProperties: true
                order_metadata:
                  type: object
                  additionalProperties: true
                  description: Metadata applied to each generated order.
                buyer_confirmed_url:
                  type: string
                  format: uri
                buyer_denied_url:
                  type: string
                  format: uri
                seller_confirmed_url:
                  type: string
                  format: uri
                seller_denied_url:
                  type: string
                  format: uri
      responses:
        '200':
          description: Subscription created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    Subscription:
      type: object
      properties:
        id:
          type: integer
        self:
          type: string
        reference_id:
          type: string
          nullable: true
        name:
          type: string
        amount:
          type: number
        currency:
          type: string
          example: EUR
        type:
          type: string
          description: Payment method type for this subscription.
        status:
          type: string
          enum:
            - CREATED
            - ACTIVE
            - CANCELLED
            - EXPIRED
        metadata:
          type: object
          nullable: true
          additionalProperties: true
        published_at:
          type: string
          format: date-time
          nullable: true
        cancelled_at:
          type: string
          format: date-time
          nullable: true
        connections:
          $ref: '#/components/schemas/Connections'
    Connections:
      type: object
      description: Hypermedia links to related resources.
      additionalProperties:
        type: string
  responses:
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: The given data was invalid.
              errors:
                type: object
                additionalProperties:
                  type: array
                  items:
                    type: string
                example:
                  name:
                    - The name field is required.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use your account's **Secret Key** as the Bearer token.

````