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

# Fetch Plan

This API is used to fetch details of a subscription plan.

### Request Body

```json theme={null}
{
  "plan_id": "string", // ID of the subscription plan to fetch
  "hash": "string" // Calculated hash for request validation
}
```

### Responses

#### 200 OK

```json theme={null}
{
  "status": true,
  "plan": {
    "id": "string",
    "name": "string",
    "amount": "integer",
    "currency": "string",
    "interval": "string"
  },
  "message": "Plan fetched successfully"
}
```

#### 400 Bad Request

```json theme={null}
{
  "status": false,
  "error": {
    "message": "Invalid request",
    "code": 400
  }
}
```


## OpenAPI

````yaml POST /api/v1/subscription/plan/fetch
openapi: 3.1.0
info:
  title: Orchestration
  version: '1'
servers:
  - url: https://api.paytring.com
security:
  - sec0: []
paths:
  /api/v1/subscription/plan/fetch:
    post:
      summary: Fetch Plan
      operationId: fetch-plan
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - key
                - id
                - hash
              properties:
                key:
                  type: string
                  description: Merchant key, available in dashboard profile section
                id:
                  type: string
                  description: Plan id provided by paytring.
                hash:
                  type: string
                  description: >-
                    to be calculated by key sort of all non-object key values of
                    this request
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: '{}'
              schema:
                type: object
                properties: {}
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "status": false,
                        "error": {
                            "message": "Hash is not verified",
                            "code": 204
                        }
                    }
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                    default: true
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Hash is not verified
                      code:
                        type: integer
                        example: 204
                        default: 0
      deprecated: false
      security: []
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````