> ## 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 Subscription By Receipt ID

This API is used to fetch subscription details using the receipt ID.

### Request Body

```json theme={null}
{
  "key": "string", // Merchant key, available in dashboard profile section
  "id": "string", // Merchant reference subscription ID (receipt ID)
  "hash": "string" // Calculated hash for request validation
}
```

### Responses

#### 200 OK

```json theme={null}
{
  "status": true,
  "subscription": {
    "subscription_id": "string",
    "mer_reference_id": "string",
    "amount": 500,
    "currency": "USD",
    "subscription_status": "active",
    "pg": "string",
    "customer": {
      "name": "string",
      "email": "string",
      "phone": "string"
    }
  },
  "request_id": "string"
}
```

#### 400 Bad Request

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


## OpenAPI

````yaml POST /api/v1/subscription/subscription/fetch/receipt
openapi: 3.1.0
info:
  title: Orchestration
  version: '1'
servers:
  - url: https://api.paytring.com
security:
  - sec0: []
paths:
  /api/v1/subscription/subscription/fetch/receipt:
    post:
      summary: Fetch Subscription By Receipt ID
      operationId: fetch-subscription-by-receipt
      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: Merchant reference subscription id (receipt id)
                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: |-
                    {
                        "status": true,
                        "subscription": {
                            "subscription_id": "677361288237548476",
                            "mer_reference_id": "TXN934579",
                            "amount": 500,
                            "initial_amount": null,
                            "currency": "USD",
                            "subscription_status": "active",
                            "pg": "Transactbridge",
                            "customer": {
                                "name": "Preetam Sharma",
                                "email": "preetam@paytring.com",
                                "phone": "7027445661"
                            },
                            "notes": {
                                "udf1": "",
                                "udf2": "",
                                "udf3": "",
                                "udf4": "",
                                "udf5": "",
                                "udf6": "",
                                "udf8": "",
                                "udf9": "",
                                "udf10": ""
                            },
                            "billing_address": {
                                "firstname": "FirstName",
                                "lastname": "LastName",
                                "phone": "9999999999",
                                "line1": "",
                                "line2": "",
                                "city": "",
                                "state": "",
                                "country": "",
                                "zipcode": ""
                            },
                            "shipping_address": {
                                "firstname": "FirstName",
                                "lastname": "LastName",
                                "phone": "9999999999",
                                "line1": "",
                                "line2": "",
                                "city": "",
                                "state": "",
                                "country": "",
                                "zipcode": ""
                            }
                        },
                        "request_id": "66ebdb6678097"
                    }
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                    default: true
                  subscription:
                    type: object
                    properties:
                      subscription_id:
                        type: string
                        example: '677361288237548476'
                      mer_reference_id:
                        type: string
                        example: TXN934579
                      amount:
                        type: integer
                        example: 500
                        default: 0
                      initial_amount: {}
                      currency:
                        type: string
                        example: USD
                      subscription_status:
                        type: string
                        example: active
                      pg:
                        type: string
                        example: Transactbridge
                      customer:
                        type: object
                        properties:
                          name:
                            type: string
                            example: Preetam Sharma
                          email:
                            type: string
                            example: preetam@paytring.com
                          phone:
                            type: string
                            example: '7027445661'
                      notes:
                        type: object
                        properties:
                          udf1:
                            type: string
                            example: ''
                          udf2:
                            type: string
                            example: ''
                          udf3:
                            type: string
                            example: ''
                          udf4:
                            type: string
                            example: ''
                          udf5:
                            type: string
                            example: ''
                          udf6:
                            type: string
                            example: ''
                          udf8:
                            type: string
                            example: ''
                          udf9:
                            type: string
                            example: ''
                          udf10:
                            type: string
                            example: ''
                      billing_address:
                        type: object
                        properties:
                          firstname:
                            type: string
                            example: FirstName
                          lastname:
                            type: string
                            example: LastName
                          phone:
                            type: string
                            example: '9999999999'
                          line1:
                            type: string
                            example: ''
                          line2:
                            type: string
                            example: ''
                          city:
                            type: string
                            example: ''
                          state:
                            type: string
                            example: ''
                          country:
                            type: string
                            example: ''
                          zipcode:
                            type: string
                            example: ''
                      shipping_address:
                        type: object
                        properties:
                          firstname:
                            type: string
                            example: FirstName
                          lastname:
                            type: string
                            example: LastName
                          phone:
                            type: string
                            example: '9999999999'
                          line1:
                            type: string
                            example: ''
                          line2:
                            type: string
                            example: ''
                          city:
                            type: string
                            example: ''
                          state:
                            type: string
                            example: ''
                          country:
                            type: string
                            example: ''
                          zipcode:
                            type: string
                            example: ''
                  request_id:
                    type: string
                    example: 66ebdb6678097
        '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

````