> ## 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.

> Withdraw accumulated fees from subscription services to the service provider's wallet.

# Withdraw subscription fees



## OpenAPI

````yaml cardano/managed-contracts-api/openapi.json post /contracts/subscription/withdrawFees
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/withdrawFees:
    post:
      tags:
        - Subscription
      summary: Withdraw subscription fees
      description: Withdraw fees from a subscription
      operationId: withdrawFees
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MerchantWithdrawDto'
      responses:
        '202':
          description: Fees withdrawn successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
        '400':
          description: Error withdrawing fees
components:
  schemas:
    MerchantWithdrawDto:
      type: object
      properties:
        merchant_address:
          type: string
          description: Merchant address
        service_nft_tn:
          type: string
          description: Service NFT token name
        subscriber_nft_tn:
          type: string
          description: Subscriber NFT token name
        merchant_nft_tn:
          type: string
          description: Merchant NFT token name
        payment_nft_tn:
          type: string
          description: Payment NFT token name
        current_time:
          type: number
          description: Current timestamp
      required:
        - last_claimed
        - service_nft_tn
        - merchant_nft_tn
    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
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: api-key
      description: Project API Key

````