# Get all Plans

<mark style="color:blue;">**API for getting list of plans for a specific biller.This api has to be invoked if planMDM requirement is mandatory for the biller, it will return the list of plans**</mark>

| Endpoint                                                                                                                               |
| -------------------------------------------------------------------------------------------------------------------------------------- |
| **Request:&#x20;**<mark style="color:blue;">**GET /masters/plans?billerId=HUNG00000NATJL\&category=Music\&page=0\&pagesize=10**</mark> |

<mark style="color:blue;">**Request Parameters**</mark>

**The various parameters are explained below:**

| Parent Property/Element                | Property/Element Name | Mandatory | Data Type    | Description                             |
| -------------------------------------- | --------------------- | --------- | ------------ | --------------------------------------- |
| \[ROOT] (No parent property / element) | billerId              | M         | Alphanumeric | Fixed Length – 14                       |
|                                        | category              | C         | String       | Category of the Plan                    |
|                                        | amountInRupees        | C         | String       | Amount of the Plan                      |
|                                        | circle                | C         | String       | Circle of the Plan                      |
|                                        | page                  | C         | Numeric      | Page number for API Response Pagination |
|                                        | pagesize              | C         | Numeric      | Page Size for API Response Pagination   |

<mark style="color:blue;">**Request Parameters**</mark>

**The various parameters are explained below:**

| Parent Property/Element                | Property/Element Name | Mandatory | Data Type | Description                                                                                                                               |
| -------------------------------------- | --------------------- | --------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| plans                                  | planId                | M         | String    | A unique id to identify the plans                                                                                                         |
|                                        | description           | M         | String    | Description of the plan                                                                                                                   |
|                                        | billerId              | M         | String    | Biller id of fixed lenght                                                                                                                 |
|                                        | categoryType          | M         | String    |                                                                                                                                           |
|                                        | categorySubType       | M         | String    |                                                                                                                                           |
|                                        | amountInRupees        | M         | String    |                                                                                                                                           |
|                                        | effctvFrom            | M         | String    |                                                                                                                                           |
|                                        | effctvTo              | M         | String    |                                                                                                                                           |
|                                        | status                | M         | String    |                                                                                                                                           |
| additionalInfo                         | planAdditionalInfoId  | M         | UUID      |                                                                                                                                           |
|                                        | tags                  | M         | List      | Will be a list of additional ifos Eg: { "tagId":"d55aa58e-bf83-4273-80ee- 7bc8e7c4f1a2", "name": "Package Duration", "value": "1 Month" } |
| \[Root] (No parent property / element) | pageNo                | M         | Numeric   | Page number for API Response Pagination                                                                                                   |
|                                        | pageSize              | M         | Numeric   | Page Size for API Response Pagination                                                                                                     |
|                                        | totalElements         | M         | Numeric   |                                                                                                                                           |
|                                        | totalPages            | M         | Numeric   |                                                                                                                                           |
| generalResp                            | statusCode            | M         | Numeric   | 200- SUCCESS Other than 200-Failure                                                                                                       |
|                                        | status                | M         | String    | It is either “Success” or failure                                                                                                         |
|                                        | message               | M         | String    | Contains the reason message for failure / success                                                                                         |
|                                        | remarks               | C         | String    |                                                                                                                                           |

<mark style="color:blue;">**Json Formatted Response Example**</mark>

```json
    {
    "plansList": {
    "plans": [
    {
    "planId": "2862",
    "description": "Listen trending & popular Music, download songs, create your own playlist!", 
    "billerId": "HUNG00000NATJL",
    "categoryType": "Music", 
    "categorySubType": [], 
    "amountInRupees": 99, 
    "additionalInfo": {
    "planAdditionalInfoId": "cca72e87-e994-4409-87cb-a25b2a4598ba", 
    "tags": [
    {
    "tagId": "d55aa58e-bf83-4273-80ee-7bc8e7c4f1a2", 
    "name": "Package Duration",
    "value": "1 Month"
    }
    ]
    },
    "effctvFrom": "2021-10-26",
    "effctvTo": "2022-10-26",
    "status": "ACTIVE"
    },
    {
    "planId": "2863",
    "description": "Listen trending & popular Music, download songs, create your own playlist!", 
    "billerId": "HUNG00000NATJL",
    "categoryType": "Music",
    "categorySubType": [],
    "amountInRupees": 499, 
    "additionalInfo": {
    "planAdditionalInfoId": "cd5fb9d3-afc6-488f-a354-863241d0fae3", 
    "tags": [
    {
    "tagId": "ccf2d727-5081-46d4-9ff1-58caae26894a", 
    "name": "Package Duration",
    "value": "12 Months"
    }
    ]
    },
    "effctvFrom": "2021-10-26",
    "effctvTo": "2022-10-26",
    "status": "ACTIVE"
    }
    ]
    },
    "generalResp": { "statusCode": "200",
    "status": "success",
    "message": "Plans retrieved successfully", 
    "remarks": ""
    },
    "pageNo": 0,
    "pageSize": 10,
    "totalElements": 2,
    "totalPages": 1
    }    
```
