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

# End Subscription Trial

> End a Subscription's trial immediately and start the paid subscription.
    The Subscription must be in trialing status.
    The first Invoice is created and charged right away using the payment method on file.
    The outcome (emails, webhooks, orders) is identical to the trial ending naturally.



## OpenAPI

````yaml /api-reference/api-docs.yaml patch /v0/subscriptions/{subscriptionIdOrNumber}/endTrial
openapi: 3.1.0
info:
  title: Fungies API v0
  version: 0.3.5
servers:
  - url: https://api.fungies.io
security: []
tags:
  - name: discounts
    description: Discounts related endpoints
  - name: keys
    description: Offer product keys related endpoints
  - name: orders
    description: Orders related endpoints
  - name: payments
    description: Payments related endpoints
  - name: offers
    description: Offers related endpoints
  - name: products
    description: Products related endpoints
  - name: subscriptions
    description: Subscriptions related endpoints
  - name: tax
    description: Tax calculation related endpoints
  - name: users
    description: Users related endpoints
  - name: variants
    description: Product variants related endpoints
  - name: plans
    description: Product plans related endpoints
  - name: elements
    description: Elements related endpoints
paths:
  /v0/subscriptions/{subscriptionIdOrNumber}/endTrial:
    patch:
      tags:
        - subscriptions
      summary: End Subscription Trial
      description: |-
        End a Subscription's trial immediately and start the paid subscription.
            The Subscription must be in trialing status.
            The first Invoice is created and charged right away using the payment method on file.
            The outcome (emails, webhooks, orders) is identical to the trial ending naturally.
      operationId: PatchV0SubscriptionsSubscriptionIdOrNumberEndTrial
      parameters:
        - name: subscriptionIdOrNumber
          in: path
          required: true
          description: Subscription ID or order number
          schema:
            $ref: >-
              #/components/schemas/PatchV0SubscriptionsSubscriptionIdOrNumberEndTrialParameterSubscriptionIdOrNumber
      requestBody:
        description: PATCH /v0/subscriptions/:subscriptionIdOrNumber/endTrial Request body
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/PatchV0SubscriptionsSubscriptionIdOrNumberEndTrialRequestBody
      responses:
        '200':
          description: >-
            PATCH /v0/subscriptions/:subscriptionIdOrNumber/endTrial Positive
            response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PatchV0SubscriptionsSubscriptionIdOrNumberEndTrialPositiveResponse
        '400':
          description: >-
            PATCH /v0/subscriptions/:subscriptionIdOrNumber/endTrial Negative
            response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PatchV0SubscriptionsSubscriptionIdOrNumberEndTrialNegativeResponse
              examples:
                example1:
                  value:
                    status: error
                    error:
                      message: Sample error message
      security:
        - APIKEY_1: []
          APIKEY_2: []
components:
  schemas:
    PatchV0SubscriptionsSubscriptionIdOrNumberEndTrialParameterSubscriptionIdOrNumber:
      type: string
      pattern: ^#?([0-9A-Za-z]{12,32}|[0-9]+)(-[0-9]+)?$
      description: Subscription ID or order number
    PatchV0SubscriptionsSubscriptionIdOrNumberEndTrialRequestBody:
      type: object
      properties: {}
      required: []
    PatchV0SubscriptionsSubscriptionIdOrNumberEndTrialPositiveResponse:
      type: object
      properties:
        status:
          type: string
          const: success
        data:
          type: object
          properties:
            success:
              type: boolean
            status:
              type: string
          required:
            - success
            - status
      required:
        - status
        - data
    PatchV0SubscriptionsSubscriptionIdOrNumberEndTrialNegativeResponse:
      type: object
      properties:
        status:
          type: string
          const: error
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - status
        - error
  securitySchemes:
    APIKEY_1:
      type: apiKey
      in: header
      name: x-fngs-public-key
    APIKEY_2:
      type: apiKey
      in: header
      name: x-fngs-secret-key

````