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

# Fetch Single Subscription Details

***

## icon: calendar-search

# Fetch Subscription

Use the Fetch Subscription API to retrieve the details of a specific subscription using its unique KwikPaisa Neo Bank generated `mandate_id`.

This API returns subscription information, including the associated customer and plan IDs, payment method, billing details, payment cycle counts, authorization URL, current status, and merchant-defined metadata.

***

## Endpoint

```text theme={null}
GET /api/v3/pg/subscription/{subscription_id}
```

***

#### To view all available base URLs and environments, refer to:

➡️ [API Resources](https://docs.kwikpaisa.com/guide/quick-start/api-resources.md)

#### This endpoint requires standard KwikPaisa Neo Bank authentication headers.

Refer to:

➡️ [Headers](https://docs.kwikpaisa.com/guide/authentication/headers.md)\
➡️ [Signature Generation](https://docs.kwikpaisa.com/guide/authentication/signature.md)\
➡️ [Timestamp Validation](https://docs.kwikpaisa.com/guide/authentication/timestamp.md)

***

## Request Parameters

| Parameter | Type | Required | Description |
| :- | :- | :- | :- |
| `subscription_id` | String | Yes | Unique KwikPaisa Neo Bank subscription/mandate ID (`mand_...`) passed in the URL path |

***

## Example cURL Request

```text theme={null}
curl --request GET \
--url https://sandbox.kwikpaisa.com/api/v3/pg/subscription/mand_0112f7c3-cda2-4405-b4f6-c0c5f2a97b17 \
--header "Accept: application/json" \
--header "X-API-KEY: pk_test_xxxxxxxxx" \
--header "X-TIMESTAMP: GENERATED_TIMESTAMP" \
--header "X-SIGNATURE: GENERATED_SIGNATURE"
```

***

## Signature Generation

For this GET request, generate the signature using an empty payload.

```text theme={null}
$timestamp = time();
$payload = [];

$sortPayload = function ($data) use (&$sortPayload) {
    if (!is_array($data)) {
        return $data;
    }

    ksort($data);

    foreach ($data as $key => $value) {
        $data[$key] = $sortPayload($value);
    }

    return $data;
};

$sortedPayload = $sortPayload($payload);
$jsonPayload = json_encode($sortedPayload, JSON_UNESCAPED_SLASHES);

$signature = hash_hmac(
    'sha256',
    $jsonPayload . $timestamp,
    $secretKey
);
```

***

## Example Success Response

```text theme={null}
{
  "status": true,
  "message": "Subscription fetched successfully.",
  "data": {
    "mandate_id": "mand_0112f7c3-cda2-4405-b4f6-c0c5f2a97b17",
    "customer_id": "cust_d71f980e-4b3f-4e9b-9d14-7cfa92fd9134",
    "plan_id": "plan_7ec2fc01-2361-45ea-945b-936d88251844",
    "type": "upi",
    "reference_id": "1794406777",
    "amount_type": "fixed",
    "amount": "699.00",
    "currency": "INR",
    "frequency": "monthly",
    "interval_count": 1,
    "quantity": 1,
    "total_cycles": 12,
    "start_date": null,
    "end_date": null,
    "start_at": null,
    "paid_count": 0,
    "remaining_count": 12,
    "authorization_url": null,
    "status": "revoked",
    "metadata": {
      "purpose": "subscription",
      "package": "gold",
      "addons": [
        {
          "item": {
            "name": "Delivery charges",
            "amount": 3000,
            "currency": "INR"
          }
        }
      ]
    },
    "created_at": "2026-11-11T14:19:38.000000Z",
    "updated_at": "2026-11-11T14:37:12.000000Z"
  }
}
```

***

## Response Parameters

| Parameter | Description |
| :- | :- |
| `status` | Indicates whether the subscription was fetched successfully |
| `message` | API response message |
| `data.mandate_id` | Unique KwikPaisa Neo Bank generated subscription/mandate ID |
| `data.customer_id` | Associated customer ID |
| `data.plan_id` | Associated subscription plan ID |
| `data.type` | Subscription payment method |
| `data.reference_id` | Merchant-provided subscription reference ID |
| `data.amount_type` | Subscription amount type |
| `data.amount` | Subscription amount |
| `data.currency` | Subscription currency |
| `data.frequency` | Billing frequency |
| `data.interval_count` | Number of frequency intervals between billing cycles |
| `data.quantity` | Subscription plan quantity |
| `data.total_cycles` | Total number of billing cycles |
| `data.start_date` | Requested subscription start date |
| `data.end_date` | Requested subscription end date |
| `data.start_at` | Actual subscription start timestamp |
| `data.paid_count` | Number of successfully paid billing cycles |
| `data.remaining_count` | Number of remaining billing cycles |
| `data.authorization_url` | Customer authorization URL, when available |
| `data.status` | Current subscription status |
| `data.metadata` | Merchant-defined subscription information |
| `data.created_at` | Subscription creation timestamp |
| `data.updated_at` | Subscription last update timestamp |

***

## Subscription Status

The supplied response demonstrates the following status:

| Status | Description |
| :- | :- |
| `revoked` | Subscription has been cancelled or revoked |

Other possible statuses should be interpreted according to the subscription lifecycle.

***

## Important Notes

* Provide a valid `subscription_id` in the endpoint URL.
* The subscription ID must be generated by KwikPaisa Neo Bank during subscription creation.
* The API retrieves the subscription associated with the authenticated merchant account.
* Use `mandate_id` for subsequent subscription operations, including cancellation and invoice retrieval.
* `paid_count` represents successfully paid billing cycles.
* `remaining_count` represents the remaining billing cycles.
* `authorization_url` may be null when an authorization URL has not been generated.
* `metadata` contains merchant-defined subscription information and may be null.
* Generate API signatures on your server only.
* Never expose your secret key in frontend applications.
* Use HTTPS for all API requests.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.