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

# Subscription Details API

> The Subscription Details API is used to retrieve detailed information about a specific subscription, including its current status, billing history, and upcoming payments.

### Key Points

<Info>
  ### Retrieve Detailed Subscription Data:

  * This API provides comprehensive information on an individual subscription, such as:

  * Subscription ID

  * Plan Name and Description

  * Status (active, expired, cancelled)

  * Start Date, End Date, and Next Billing Date

  * Cycle Interval (e.g., monthly, every 2 days)

  * Trial Period and Discount Information

  * Billing History: Details of past payments, including amounts and dates

  ### Subscription ID

  * The Subscription ID must be provided in the URL to retrieve the details of a specific subscription.
</Info>


## OpenAPI

````yaml api-reference/en/open-api-config/subscription/subscription-details.json GET /api/v1/server-to-server-interface/subscription/{subscription_id}
openapi: 3.0.1
info:
  title: Payment Options API
  description: API for generating Hosted Payment Page (HPP) links and processing payments.
  version: 1.0.0
servers:
  - url: https://api-dev.paymentoptions.com
security:
  - apiKeyAuth: []
    xApiKeyAuth: []
paths:
  /api/v1/server-to-server-interface/subscription/{subscription_id}:
    get:
      summary: Retrieve Subscription Details
      description: >-
        This endpoint retrieves detailed information about a specific
        subscription using its Subscription ID.
      operationId: getSubscriptionDetails
      parameters:
        - name: subscription_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 36
            description: The unique Subscription ID of the subscription.
          description: >-
            The Subscription ID of the subscription. Example:
            664dc930-88bd-4696-8807-5e0f1fedba0b.
      responses:
        '200':
          description: A successful response containing the subscription details.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the transaction was successful.
                    example: true
                  status_code:
                    type: integer
                    description: The HTTP status code of the response.
                    example: 200
                  is_live:
                    type: boolean
                    description: >-
                      Indicates if the transaction is live or a test
                      transaction.
                    example: false
                  subscription_details:
                    type: object
                    description: Details of the subscription.
                    properties:
                      id:
                        type: string
                        description: The Subscription ID.
                        example: 664dc930-88bd-4696-8807-5e0f1fedba0b
                      type:
                        type: string
                        description: The type of subscription (e.g., CYCLE or Unlimited).
                        example: CYCLE
                      max_cycle_count:
                        type: integer
                        description: The maximum number of billing cycles.
                        example: 10
                      status:
                        type: string
                        description: The status of the subscription.
                        example: ACTIVE
                      completed_payment_cycle:
                        type: integer
                        description: The number of completed payment cycles.
                        example: 1
                      last_payment_status:
                        type: string
                        description: >-
                          The status of the last payment made under this
                          subscription.
                        example: SUCCESSFUL
                      next_payment_date:
                        type: string
                        format: date-time
                        description: The next payment date of the subscription.
                        example: '2024-11-28T01:31:29.154Z'
                      next_payment_cycle:
                        type: integer
                        description: The next payment cycle number.
                        example: 2
                      subscription_plan_details:
                        type: object
                        description: Details of the subscription plan.
                        properties:
                          name:
                            type: string
                            description: The name of the subscription plan.
                            example: Three weeks plan
                          desc:
                            type: string
                            description: The description of the subscription plan.
                            example: Billed every two days
                          billing_cycle_type:
                            type: string
                            description: The type of billing cycle (e.g., DAYS or MONTHS).
                            example: DAYS
                          billing_cycle_interval:
                            type: integer
                            description: The interval between billing cycles.
                            example: 2
                          amount:
                            type: integer
                            description: The payment amount for the subscription plan.
                            example: 1000
                          ccy:
                            type: string
                            description: The currency of the subscription transaction.
                            example: JPY
                          trial_period_duration:
                            type: string
                            description: The duration of the trial period (if applicable).
                            example: ''
                          trial_period_duration_type:
                            type: string
                            description: >-
                              The type of trial period duration (e.g., DAYS or
                              MONTHS).
                            example: NONE
                          plan_discount_percentage:
                            type: number
                            description: The discount percentage for the subscription plan.
                            example: 10
                          plan_discount_duration:
                            type: integer
                            description: The duration of the discount in billing cycles.
                            example: 2
                      subscription_transaction_details:
                        type: array
                        description: A list of transaction details for the subscription.
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: >-
                                The Transaction ID of this subscription
                                transaction.
                              example: 359f39bd-673a-47b3-b9ec-cbd6cd313b8e
                            ref:
                              type: integer
                              description: The reference of the subscription transaction.
                              example: 74860
                            cycle:
                              type: integer
                              description: The payment cycle number of the transaction.
                              example: 1
                            status:
                              type: string
                              description: The status of the subscription transaction.
                              example: SUCCESSFUL
                            transaction_date:
                              type: string
                              format: date-time
                              description: The date of the subscription transaction.
                              example: '2024-11-26T01:31:29.000Z'
                            amount:
                              type: integer
                              description: The payment amount of the transaction.
                              example: 900
                            ccy:
                              type: string
                              description: The currency of the transaction.
                              example: JPY
                            event:
                              type: string
                              description: >-
                                The event type for the transaction (e.g.,
                                CAPTURED).
                              example: CAPTURED
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: Authorization
      in: header
      description: 'API Key for Authorization. Format: ''Basic YOUR_API_KEY_HERE'''
    xApiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: API Key specific to x-api-key.

````