# Get Plans

**Method:** `GET`

**Path:** `/ps/api/v1/public/plans`

**Category:** Subscriptions - Plans

**Authentication:** Required

## Description

Retrieves all subscription plans. Supports filtering by plan_id,
date range, amount, frequency, and pagination.


## Query Parameters

- `plan_id` (`string`) — Filter by plan ID.
- `start_date` (`string`) — Filter plans with start date after this value (ISO 8601 UTC).
- `end_date` (`string`) — Filter plans with end date before this value (ISO 8601 UTC).
- `amount` (`integer`) — Filter by amount value.
- `amount_range` (`isMore | isLess | is Equal`) — Amount comparison operator.
- `frequency` (`string`) — Filter by billing frequency.
- `size` (`integer`) — Number of items per page.
- `page` (`integer`) — Page number.
- `sort` (`string`) — Sort field and direction.

## Responses

- `200` — Plans retrieved successfully.
- `500` — 

### Response Schema

- `links` (`object`) — Pagination links for navigation.
  - `first` (`object,null`)
    - `href` (`string`) — URL of the first page.

  - `self` (`object,null`)
    - `href` (`string`) — URL of the current page.

  - `next` (`object,null`)
    - `href` (`string`) — URL of the next page.

  - `last` (`object,null`)
    - `href` (`string`) — URL of the last page.


- `page` (`object`) — Page information for paginated responses.
  - `size` (`integer`) — Number of items per page.
  - `total_elements` (`integer`) — Total number of elements.
  - `total_pages` (`integer`) — Total number of pages.
  - `number` (`integer`) — Page number.

- `plans` (`PlanResponse[]`) — List of plan records.
  - `plan_id` (`string`) — Unique identifier for the subscription plan in the Pine Labs database.
  - `status` (`ACTIVE | INACTIVE | CREATED`) — Status of the plan. - ACTIVE: Plan creation completed and start time has passed. - INACTIVE: Plan is disabled or has exceeded its validity period. - CREATED: Plan creation completed but start time is in the future. 
  - `plan_name` (`string`) — Subscription plan name.
  - `plan_description` (`string`) — Corresponding description for a plan.
  - `frequency` (`Day | Week | Month | Year | Bi-Monthly | Quarterly | Half-Yearly | AS | OT | Not Applicable`) — Frequency of recurring transactions for this particular plan.
  - `amount` (`object`) — Monetary amount with currency for subscription-related APIs.
    - `value` (`integer`) **required** — Amount in the smallest currency unit (paisa for INR). Minimum ₹1 (100), maximum ₹10 lakh (100000000).
    - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

  - `max_limit_amount` (`object`) — Monetary amount with currency for subscription-related APIs.
    - `value` (`integer`) **required** — Amount in the smallest currency unit (paisa for INR). Minimum ₹1 (100), maximum ₹10 lakh (100000000).
    - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

  - `trial_period_in_days` (`integer`) — Duration of the trial period in days.
  - `start_date` (`string`) — The ISO 8601 UTC Timestamp when the subscription plan is active.
  - `end_date` (`string`) — The ISO 8601 UTC Timestamp when the subscription plan expires.
  - `merchant_metadata` (`object`) — Key-value pairs for additional information. Max 10 pairs, 256 chars each.
  - `merchant_plan_reference` (`string`) — Unique identifier of the merchant plan reference.
  - `created_at` (`string,null`) — ISO 8601 UTC Timestamp when the create plan request was received.
  - `modified_at` (`string,null`) — ISO 8601 UTC Timestamp when the plan was last updated.
  - `initial_debit_amount` (`object`) — Monetary amount with currency for subscription-related APIs.
    - `value` (`integer`) **required** — Amount in the smallest currency unit (paisa for INR). Minimum ₹1 (100), maximum ₹10 lakh (100000000).
    - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

  - `auto_debit_ot` (`string`) — Indicates whether auto-debit is enabled for one-time payments.


### Example Response

```json
{
  "links": {
    "first": {
      "href": "https://api.pluralpay.in/api/v1/public/{resource}/?size=10&page=0&sort=id,asc"
    },
    "self": {
      "href": "https://api.pluralpay.in/api/v1/public/{resource}/?size=10&page=0&sort=id,asc"
    },
    "next": {
      "href": "https://api.pluralpay.in/api/v1/public/{resource}/?size=10&page=0&sort=id,asc"
    },
    "last": {
      "href": "https://api.pluralpay.in/api/v1/public/{resource}/?size=10&page=0&sort=id,asc"
    }
  },
  "page": {
    "size": 10,
    "total_elements": 50,
    "total_pages": 5,
    "number": 1
  },
  "plans": [
    {
      "plan_id": "v1-plan-4405071524-aa-qlAtAf",
      "status": "ACTIVE",
      "plan_name": "Monthly Plan",
      "plan_description": "Diwali dhammaka plan intended to attract customers on diwali time",
      "frequency": "Day",
      "amount": {
        "value": 1000,
        "currency": "INR"
      },
      "max_limit_amount": {
        "value": 1000,
        "currency": "INR"
      },
      "trial_period_in_days": 1,
      "start_date": "2022-02-01T17:32:28Z",
      "end_date": "2022-10-21T17:32:28Z",
      "merchant_metadata": {
        "key1": "DD",
        "key2": "XOF"
      },
      "merchant_plan_reference": "1234567890",
      "created_at": "2022-10-21T17:32:28Z",
      "modified_at": "2022-10-21T17:32:28Z",
      "initial_debit_amount": {
        "value": 1000,
        "currency": "INR"
      },
      "auto_debit_ot": "false"
    }
  ]
}
```

---

Reference: https://localhost:3000/api/subscriptions-plans/list-plans
