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

> Create a new subscription service contract on Cardano with customizable payment intervals and terms.

# Create a subscription service



## OpenAPI

````yaml cardano/managed-contracts-api/openapi.json post /contracts/subscription/createService
openapi: 3.0.3
info:
  title: Cardano - Managed Contracts API
  description: https://docs.gomaestro.org/getting-started
  contact:
    name: Maestro
    email: info@gomaestro.org
    url: https://gomaestro.org/
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.txt
  version: v1.9.0
servers:
  - url: https://mainnet.gomaestro-api.org/v1
    description: Cardano Mainnet
  - url: https://preprod.gomaestro-api.org/v1
    description: Cardano Preprod
  - url: https://preview.gomaestro-api.org/v1
    description: Cardano Preview
security:
  - api-key: []
paths:
  /contracts/subscription/createService:
    post:
      tags:
        - Subscription
      summary: Create a subscription service
      description: Create a new subscription service
      operationId: createService
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateServiceDto'
      responses:
        '202':
          description: Service created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
        '400':
          description: Error creating a subscription service
components:
  schemas:
    CreateServiceDto:
      type: object
      properties:
        merchant_address:
          type: string
          description: Merchant address
        selected_out_ref:
          $ref: '#/components/schemas/OutRef'
        service_fee_policyid:
          type: string
          description: Policy ID of the service fee
        service_fee_assetname:
          type: string
          description: Asset name of the service fee
        service_fee:
          type: integer
          description: Service fee amount
        penalty_fee_policyid:
          type: string
          description: Policy ID of the penalty fee
        penalty_fee_assetname:
          type: string
          description: Asset name of the penalty fee
        penalty_fee:
          type: integer
          description: Penalty fee amount
        interval_length:
          type: integer
          description: Length of the interval
        num_intervals:
          type: integer
          description: Number of intervals
        is_active:
          type: boolean
          description: Is the service active
      required:
        - service_fee
        - service_fee_quantity
        - penalty_fee
        - penalty_fee_quantity
        - interval_length
        - num_intervals
        - minimum_ada
        - is_active
    Transaction:
      type: object
      description: Unsigned transaction
      properties:
        cbor_hex:
          type: string
          description: CBOR hexadecimal representation of the transaction
        tx_hash:
          type: string
          description: Transaction hash
      required:
        - cbor_hex
        - tx_hash
    OutRef:
      type: object
      description: UTXO
      properties:
        tx_hash:
          type: string
          description: Transaction hash
        output_index:
          type: number
          description: Output index
      required:
        - tx_hash
        - output_index
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: api-key
      description: Project API Key

````