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

# Get subscription details

> Returns one subscription's details, including the invoices generated from it so far.



## OpenAPI

````yaml get /v2/subscriptions/{subscription_hash_id}
openapi: 3.0.1
info:
  title: SwipeAPI
  version: '2.0'
  description: >-
    The Swipe Partner API — invoicing, payments, and GST compliance for your
    application. Create GST invoices and other documents, manage customers,
    vendors, products and inventory, record payments, and generate e-invoices
    and e-way bills.


    - Docs & guides: https://developers.getswipe.in

    - Quickstart: https://developers.getswipe.in/quickstart

    - Rate limit: 1 request/second per API key

    - All dates are DD-MM-YYYY
servers:
  - url: https://app.getswipe.in/api/partner
security:
  - bearerAuth: []
paths:
  /v2/subscriptions/{subscription_hash_id}:
    parameters:
      - name: subscription_hash_id
        in: path
        description: The hash id of the document
        required: true
        schema:
          type: string
    get:
      tags:
        - Subscriptions V2
      summary: Get subscription details
      description: >-
        Returns one subscription's details, including the invoices generated
        from it so far.
      operationId: get_subscription
      parameters:
        - name: num_records
          in: query
          description: Number of records to fetch(max 100)
          schema:
            type: string
            default: 10
        - name: page
          in: query
          description: Page number
          schema:
            type: integer
            default: 1
      responses:
        '200':
          description: Subscription fetched successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSubscriptionInvoicesV2'
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionErrorResponseV2'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionErrorResponseV2'
        '404':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionErrorResponseV2'
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionErrorResponseV2'
components:
  schemas:
    GetSubscriptionInvoicesV2:
      properties:
        success:
          type: boolean
          description: Success flag
          example: true
        message:
          type: string
          description: Message
          example: Details Fetched
        error_code:
          type: string
          description: Error code
          example: ''
        errors:
          type: object
          description: Error details
        data:
          $ref: '#/components/schemas/SubscriptionDataV2'
      type: object
    SubscriptionErrorResponseV2:
      properties:
        success:
          type: boolean
          default: true
          example: true
        message:
          type: string
          description: Success Message
          example: Message
        error_code:
          type: string
          description: Error Code
          example: ''
        errors:
          type: object
          description: Error details
        data:
          type: object
          description: Data
      type: object
    SubscriptionDataV2:
      properties:
        invoices:
          type: array
          description: List of invoices
          items:
            $ref: '#/components/schemas/InvoiceV2'
        upcoming_date:
          type: string
          description: Upcoming Date
          example: 10 June 2024
        repeat_every:
          type: integer
          description: Repeat Every
          example: 1
        repeat_unit:
          type: string
          description: Repeat Unit
          example: months
        last_created:
          type: string
          description: Last Created Date
          example: 10 June 2024
        total_records:
          type: integer
          description: Total number of records
          example: 10
      type: object
    InvoiceV2:
      properties:
        name:
          type: string
          description: Customer Name
          example: CUST123
        id:
          type: string
          description: Customer ID
          example: Cust123
        serial_number:
          type: string
          description: Serial Number
          example: INV-123
        status:
          type: string
          description: Status
          example: active
          enum:
            - paid
            - pending
            - cancelled
        hash_id:
          type: string
          description: Hash ID
          example: SUB123
        record_time:
          type: string
          description: Record Time
          example: 10 June 2024
        total_amount:
          type: number
          description: Total Amount
          example: 1000
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is an API key from the [API
        Integration](https://app.getswipe.in/user?tab=api_integration) section
        of your dashboard. Keys are scoped to the company they are generated in
        — for testing, [add a separate test
        company](https://community.getswipe.in/t/how-to-add-new-company-on-web/1191)
        and generate the key there, so requests never touch your real books.

````