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

# My Account - Get Single Subscription

> Retrieve detailed information about a specific customer subscription

<Warning>
  This endpoint is currently shown as a preview of what's currently in development and is subject to change.
</Warning>

<Info>
  This endpoint supports only the official [WooCommerce Subscriptions](https://woocommerce.com/products/woocommerce-subscriptions/) extension.
</Info>


## OpenAPI

````yaml api-reference/pre-release/openapi-spec-preview.yaml get /my-account/subscriptions/{id}
openapi: 3.0.3
info:
  title: CoCart Preview API
  description: >
    CoCart Preview provides enhanced REST API endpoints for WooCommerce headless
    e-commerce solutions.

    This API extends CoCart with additional functionality for checkout, customer
    account management, and order handling.


    ## Authentication


    The API supports multiple authentication methods:

    - **Cart Key**: For guest customers, pass the cart key via `Cart-Key` header
    or `cart_key` parameter

    - **Basic Auth**: For registered customers using username/password

    - **JWT**: For registered customers using JWT tokens (requires JWT plugin)

    - **Session**: For logged-in WordPress users


    ## Base URL


    All API endpoints are prefixed with `/wp-json/cocart/preview/`


    ## Response Format


    All responses follow the CoCart standard format with consistent error
    handling and data structure.
  termsOfService: http://cocartapi.com/terms-of-conditions-polar/
  contact:
    email: support@cocartapi.com
  license:
    name: GNU General Public License v3.0
    url: http://www.gnu.org/licenses/gpl-3.0.html
  version: 0.0.1
servers:
  - url: '{protocol}://{host}/wp-json/cocart/preview'
    description: API Preview
    variables:
      protocol:
        enum:
          - http
          - https
        default: https
      host:
        default: example-store.com
        description: Your store domain
security: []
tags:
  - name: Checkout
    description: Complete checkout process including payment and order creation
  - name: My Account
    description: Customer account information and profile management
  - name: My Orders
    description: Customer order history and details
  - name: My Downloads
    description: Customer digital downloads
  - name: My Subscriptions
    description: Customer subscription management
externalDocs:
  description: Find out more about CoCart API
  url: https://docs.cocartapi.com
paths:
  /my-account/subscriptions/{id}:
    get:
      tags:
        - My Subscriptions
      summary: Get specific subscription details
      description: Retrieve detailed information about a specific customer subscription
      operationId: getMySubscription
      parameters:
        - name: id
          in: path
          description: Unique identifier for the subscription
          required: true
          schema:
            type: integer
        - name: email
          in: query
          description: The subscription billing email address
          required: false
          schema:
            type: string
            format: email
      responses:
        '200':
          description: Subscription details retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSubscription'
              examples:
                subscription:
                  $ref: '#/components/examples/CustomerSubscriptionExample'
        '403':
          description: Forbidden - user must be logged in
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Subscription not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - basicAuth: []
        - bearerAuth: []
components:
  schemas:
    CustomerSubscription:
      type: object
      properties:
        subscription_number:
          type: string
          description: Subscription number
          example: '789'
        parent_order:
          type: string
          description: Parent order ID
          example: '456'
        order:
          type: string
          format: uri
          description: Link to parent order
          example: https://example.com/wp-json/cocart/preview/my-orders/456
        subscription_status:
          type: string
          description: Subscription status
          example: Active
        is_manual:
          type: boolean
          description: Whether subscription requires manual renewal
          example: false
        start_date:
          $ref: '#/components/schemas/DateInfo'
        last_order_date_created:
          $ref: '#/components/schemas/DateInfo'
        next_payment:
          $ref: '#/components/schemas/DateInfo'
        end_date:
          $ref: '#/components/schemas/DateInfo'
        trial_end:
          $ref: '#/components/schemas/DateInfo'
        payment:
          $ref: '#/components/schemas/PaymentInfo'
        billing_address:
          type: string
          description: Formatted billing address as comma-separated string
          example: John Doe, 123 Main St, Anytown, CA, 12345, US
        shipping_address:
          type: string
          description: Formatted shipping address as comma-separated string
          example: John Doe, 123 Main St, Anytown, CA, 12345, US
        notes:
          type: array
          description: Customer-facing subscription notes
          items:
            $ref: '#/components/schemas/OrderNote'
        actions:
          type: object
          description: >-
            Available subscription actions (view, suspend, reactivate, cancel,
            etc.)
          additionalProperties:
            $ref: '#/components/schemas/OrderAction'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Error code identifier
        message:
          type: string
          description: Human-readable error message
        data:
          type: object
          description: Additional error data
          properties:
            status:
              type: integer
              description: HTTP status code
    DateInfo:
      type: object
      properties:
        title:
          type: string
          description: Date field title
          example: Next payment date
        value:
          type: string
          description: Date field value
          example: January 15, 2025
    PaymentInfo:
      type: object
      properties:
        title:
          type: string
          description: Payment field title
          example: Payment
        value:
          type: string
          description: Payment field value
          example: Credit Card (Stripe)
    OrderNote:
      type: object
      properties:
        date:
          type: string
          description: Note date
        note:
          type: string
          description: Note content
    OrderAction:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: Action URL
        name:
          type: string
          description: Action name
  examples:
    CustomerSubscriptionExample:
      value:
        subscription_number: '123'
        parent_order: '456'
        order: https://example.com/wp-json/cocart/preview/my-account/orders/456
        subscription_status: Active
        is_manual: false
        start_date:
          title: Start date
          value: December 15, 2024
        last_order_date_created:
          title: Last order date
          value: December 15, 2024
        next_payment:
          title: Next payment date
          value: January 15, 2025
        end_date:
          title: End date
          value: N/A
        trial_end:
          title: Trial end date
          value: N/A
        payment:
          title: Payment
          value: Credit Card (Stripe)
        billing_address: John Doe, 123 Main St, Apt 4B, Anytown, CA, 12345, US
        shipping_address: John Doe, 123 Main St, Apt 4B, Anytown, CA, 12345, US
        notes:
          - date: December 15, 2024, 2:30pm
            note: Subscription activated successfully
        actions:
          suspend:
            url: >-
              https://example.com/wp-json/cocart/preview/my-account/subscriptions/123/on-hold
            name: Suspend
          cancel:
            url: >-
              https://example.com/wp-json/cocart/preview/my-account/subscriptions/123/cancel
            name: Cancel
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: WordPress username and password
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer authentication with JWT token
      bearerFormat: JWT

````