# Pharmacy

{% hint style="info" %}
Search is done based on parameters like State, LGA and specific location. Response from this API endpoint is paginated showing 15 pharmacies per page.
{% endhint %}

## Search Pharmacies

## SEARCH BY PHARMACY NAME

<mark style="color:blue;">`GET`</mark> `https://sandbox.insurpass.com/api/merchant/search_pharmacies?pharmacy_name=Jahban Pharmacy`

This endpoint will allow the Merchant to search for a pharmacy within their network by the name of the pharmacy.

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {$secret-key}/{$api-key} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "success": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 1387,
                "pharmacy_code": "WHP11424",
                "pharmacy_name": "Safari Pharmacy B & M",
                "state_of_premise": "Delta",
                "lga": "Udu",
                "pharmacy_address": "B&M Plaza, Opposite Fantasia, Before Police Post, Orhuwhorun Road, Igbogidi, Udu, Warri",
                "created_at": "2021-04-24T17:17:13.000000Z",
                "updated_at": "2021-04-24T17:17:13.000000Z"
            },
            {
                "id": 1388,
                "pharmacy_code": "WHP11425",
                "pharmacy_name": "Safari Pharmacy  Ovalaux Mall",
                "state_of_premise": "Delta",
                "lga": "Okpe",
                "pharmacy_address": "Ovalaux Mall, Km 4, Eku Osubi Road, by Lawfab Hotel, Osubi, Warri",
                "created_at": "2021-04-24T17:17:13.000000Z",
                "updated_at": "2021-04-24T17:17:13.000000Z"
            },
            {
                "id": 1384,
                "pharmacy_code": "WHP11421",
                "pharmacy_name": "Safari Pharmacy Ogunu",
                "state_of_premise": "Delta",
                "lga": "Warri South",
                "pharmacy_address": "46, Ogunu Road, Warri, Delta State",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1385,
                "pharmacy_code": "WHP11422",
                "pharmacy_name": "Safari Pharmacy Legacy House ",
                "state_of_premise": "Delta",
                "lga": "Uvwie",
                "pharmacy_address": "Legacy House, Airport Road, by Westend Hospital Junction, Ugborikoko, Warri\n",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1386,
                "pharmacy_code": "WHP11423",
                "pharmacy_name": "Safari Pharmacy Cedar House",
                "state_of_premise": "Delta",
                "lga": "Warri South",
                "pharmacy_address": "Cedar House, 41 Airport Road, by Edjeba Junction, Warri.",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1383,
                "pharmacy_code": "WHP11420",
                "pharmacy_name": "HYCARE PHARMACEUTICAL SERVICE LIMITED",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "28, Suncity Plaza, Lokogoma, Abuja",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1381,
                "pharmacy_code": "WHP11418",
                "pharmacy_name": "Vatican Pharma Consult",
                "state_of_premise": "Lagos",
                "lga": "Surulere",
                "pharmacy_address": "Number 5, Akerele Street, Surulere",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1382,
                "pharmacy_code": "WHP11419",
                "pharmacy_name": "Lamed Pharmacy",
                "state_of_premise": "Plateau",
                "lga": "Jos North",
                "pharmacy_address": "Steve Son, House Bukuru Expressway, Near PHC Clinic, Bukuru Jos, Plateau",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1380,
                "pharmacy_code": "WHP11417",
                "pharmacy_name": "Reinomed Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Shomolu",
                "pharmacy_address": "Number 24, Bajulaiye road, Shomolu, Lagos",
                "created_at": "2021-04-24T17:17:10.000000Z",
                "updated_at": "2021-04-24T17:17:10.000000Z"
            },
            {
                "id": 1378,
                "pharmacy_code": "WHP11415",
                "pharmacy_name": "Divine Care Pharmacy Thomas Estate",
                "state_of_premise": "Lagos",
                "lga": "Eti Osa",
                "pharmacy_address": "2, Ayodele Close, Thomas Estate, Ajah, Lagos",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1377,
                "pharmacy_code": "WHP11435",
                "pharmacy_name": "Skylark Pharmacy Wuse Zone 3",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "D9, Sky Memorial Complex, Michael Opara Street, Wuse.",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1379,
                "pharmacy_code": "WHP11416",
                "pharmacy_name": "Rozec Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Eti Osa",
                "pharmacy_address": "Association Road, Dolphin Estate, Ikoyi, Lagos",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1374,
                "pharmacy_code": "WHP11432",
                "pharmacy_name": "Niveron Pharmacy and Healthcare Ltd",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "24 Etsu Jetta Street, Phase 1 Jikwoyi,Abuja ",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            },
            {
                "id": 1376,
                "pharmacy_code": "WHP11434",
                "pharmacy_name": "Jaa-eez Pharmacy ",
                "state_of_premise": "Kano",
                "lga": "Kano Municipal",
                "pharmacy_address": "7, Tahir House, Zoo Road, Kano ",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            },
            {
                "id": 1375,
                "pharmacy_code": "WHP11433",
                "pharmacy_name": "Newton Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Ojo",
                "pharmacy_address": "Suite 3 & 4, Opposite Adoff Bus-Stop, Iba-LASU Express way, Lagos",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            }
        ],
        "first_page_url": "http://sandbox.insurpass.com/api/pharmacies?page=1",
        "from": 1,
        "last_page": 74,
        "last_page_url": "http://sandbox.insurpass.com/merchant/pharmacies?page=74",
        "next_page_url": "http://sandbox.insurpass.com/merchant/pharmacies?page=2",
        "path": "http://sandbox.insurpass.com/pharmacies",
        "per_page": 15,
        "prev_page_url": null,
        "to": 15,
        "total": 1097
    },
    "response_message": "Pharmacies retrieved successfully",
    "response_code": ""
}
```

{% endtab %}
{% endtabs %}

## SEARCH PHARMACY BY CODE

<mark style="color:blue;">`GET`</mark> `https://sandbox.insurpass.com/api/merchant/search_pharmacies?pharmacy_code=WHP10819`

This endpoint will allow the user to search for a pharmacy within their network by using the code for the pharmacy

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {$secret-key}/{$api-key} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "success": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 1387,
                "pharmacy_code": "WHP11424",
                "pharmacy_name": "Safari Pharmacy B & M",
                "state_of_premise": "Delta",
                "lga": "Udu",
                "pharmacy_address": "B&M Plaza, Opposite Fantasia, Before Police Post, Orhuwhorun Road, Igbogidi, Udu, Warri",
                "created_at": "2021-04-24T17:17:13.000000Z",
                "updated_at": "2021-04-24T17:17:13.000000Z"
            },
            {
                "id": 1388,
                "pharmacy_code": "WHP11425",
                "pharmacy_name": "Safari Pharmacy  Ovalaux Mall",
                "state_of_premise": "Delta",
                "lga": "Okpe",
                "pharmacy_address": "Ovalaux Mall, Km 4, Eku Osubi Road, by Lawfab Hotel, Osubi, Warri",
                "created_at": "2021-04-24T17:17:13.000000Z",
                "updated_at": "2021-04-24T17:17:13.000000Z"
            },
            {
                "id": 1384,
                "pharmacy_code": "WHP11421",
                "pharmacy_name": "Safari Pharmacy Ogunu",
                "state_of_premise": "Delta",
                "lga": "Warri South",
                "pharmacy_address": "46, Ogunu Road, Warri, Delta State",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1385,
                "pharmacy_code": "WHP11422",
                "pharmacy_name": "Safari Pharmacy Legacy House ",
                "state_of_premise": "Delta",
                "lga": "Uvwie",
                "pharmacy_address": "Legacy House, Airport Road, by Westend Hospital Junction, Ugborikoko, Warri\n",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1386,
                "pharmacy_code": "WHP11423",
                "pharmacy_name": "Safari Pharmacy Cedar House",
                "state_of_premise": "Delta",
                "lga": "Warri South",
                "pharmacy_address": "Cedar House, 41 Airport Road, by Edjeba Junction, Warri.",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1383,
                "pharmacy_code": "WHP11420",
                "pharmacy_name": "HYCARE PHARMACEUTICAL SERVICE LIMITED",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "28, Suncity Plaza, Lokogoma, Abuja",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1381,
                "pharmacy_code": "WHP11418",
                "pharmacy_name": "Vatican Pharma Consult",
                "state_of_premise": "Lagos",
                "lga": "Surulere",
                "pharmacy_address": "Number 5, Akerele Street, Surulere",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1382,
                "pharmacy_code": "WHP11419",
                "pharmacy_name": "Lamed Pharmacy",
                "state_of_premise": "Plateau",
                "lga": "Jos North",
                "pharmacy_address": "Steve Son, House Bukuru Expressway, Near PHC Clinic, Bukuru Jos, Plateau",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1380,
                "pharmacy_code": "WHP11417",
                "pharmacy_name": "Reinomed Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Shomolu",
                "pharmacy_address": "Number 24, Bajulaiye road, Shomolu, Lagos",
                "created_at": "2021-04-24T17:17:10.000000Z",
                "updated_at": "2021-04-24T17:17:10.000000Z"
            },
            {
                "id": 1378,
                "pharmacy_code": "WHP11415",
                "pharmacy_name": "Divine Care Pharmacy Thomas Estate",
                "state_of_premise": "Lagos",
                "lga": "Eti Osa",
                "pharmacy_address": "2, Ayodele Close, Thomas Estate, Ajah, Lagos",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1377,
                "pharmacy_code": "WHP11435",
                "pharmacy_name": "Skylark Pharmacy Wuse Zone 3",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "D9, Sky Memorial Complex, Michael Opara Street, Wuse.",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1379,
                "pharmacy_code": "WHP11416",
                "pharmacy_name": "Rozec Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Eti Osa",
                "pharmacy_address": "Association Road, Dolphin Estate, Ikoyi, Lagos",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1374,
                "pharmacy_code": "WHP11432",
                "pharmacy_name": "Niveron Pharmacy and Healthcare Ltd",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "24 Etsu Jetta Street, Phase 1 Jikwoyi,Abuja ",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            },
            {
                "id": 1376,
                "pharmacy_code": "WHP11434",
                "pharmacy_name": "Jaa-eez Pharmacy ",
                "state_of_premise": "Kano",
                "lga": "Kano Municipal",
                "pharmacy_address": "7, Tahir House, Zoo Road, Kano ",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            },
            {
                "id": 1375,
                "pharmacy_code": "WHP11433",
                "pharmacy_name": "Newton Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Ojo",
                "pharmacy_address": "Suite 3 & 4, Opposite Adoff Bus-Stop, Iba-LASU Express way, Lagos",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            }
        ],
        "first_page_url": "http://fruiti-api.test/api/pharmacies?page=1",
        "from": 1,
        "last_page": 74,
        "last_page_url": "http://sandbox.insurpass.com/api/merchant/pharmacies?page=74",
        "next_page_url": "http://sandbox.insurpass.com/api/merchant/pharmacies?page=2",
        "path": "http://sandbox.insurpass.com/api/pharmacies",
        "per_page": 15,
        "prev_page_url": null,
        "to": 15,
        "total": 1097
    },
    "response_message": "Pharmacies retrieved successfully",
    "response_code": ""
}
```

{% endtab %}
{% endtabs %}

## SEARCH PHARMACY BY STATE OF PREMISE

<mark style="color:blue;">`GET`</mark> `https://sandbox.insurpass.com/api/merchant/search_pharmacies?state_of_premise=F.C.T`

This endpoint will allow a user to search for pharmacies within a particular state of premise.

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {$secret-key}/{$api-key} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "success": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 1387,
                "pharmacy_code": "WHP11424",
                "pharmacy_name": "Safari Pharmacy B & M",
                "state_of_premise": "Delta",
                "lga": "Udu",
                "pharmacy_address": "B&M Plaza, Opposite Fantasia, Before Police Post, Orhuwhorun Road, Igbogidi, Udu, Warri",
                "created_at": "2021-04-24T17:17:13.000000Z",
                "updated_at": "2021-04-24T17:17:13.000000Z"
            },
            {
                "id": 1388,
                "pharmacy_code": "WHP11425",
                "pharmacy_name": "Safari Pharmacy  Ovalaux Mall",
                "state_of_premise": "Delta",
                "lga": "Okpe",
                "pharmacy_address": "Ovalaux Mall, Km 4, Eku Osubi Road, by Lawfab Hotel, Osubi, Warri",
                "created_at": "2021-04-24T17:17:13.000000Z",
                "updated_at": "2021-04-24T17:17:13.000000Z"
            },
            {
                "id": 1384,
                "pharmacy_code": "WHP11421",
                "pharmacy_name": "Safari Pharmacy Ogunu",
                "state_of_premise": "Delta",
                "lga": "Warri South",
                "pharmacy_address": "46, Ogunu Road, Warri, Delta State",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1385,
                "pharmacy_code": "WHP11422",
                "pharmacy_name": "Safari Pharmacy Legacy House ",
                "state_of_premise": "Delta",
                "lga": "Uvwie",
                "pharmacy_address": "Legacy House, Airport Road, by Westend Hospital Junction, Ugborikoko, Warri\n",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1386,
                "pharmacy_code": "WHP11423",
                "pharmacy_name": "Safari Pharmacy Cedar House",
                "state_of_premise": "Delta",
                "lga": "Warri South",
                "pharmacy_address": "Cedar House, 41 Airport Road, by Edjeba Junction, Warri.",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1383,
                "pharmacy_code": "WHP11420",
                "pharmacy_name": "HYCARE PHARMACEUTICAL SERVICE LIMITED",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "28, Suncity Plaza, Lokogoma, Abuja",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1381,
                "pharmacy_code": "WHP11418",
                "pharmacy_name": "Vatican Pharma Consult",
                "state_of_premise": "Lagos",
                "lga": "Surulere",
                "pharmacy_address": "Number 5, Akerele Street, Surulere",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1382,
                "pharmacy_code": "WHP11419",
                "pharmacy_name": "Lamed Pharmacy",
                "state_of_premise": "Plateau",
                "lga": "Jos North",
                "pharmacy_address": "Steve Son, House Bukuru Expressway, Near PHC Clinic, Bukuru Jos, Plateau",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1380,
                "pharmacy_code": "WHP11417",
                "pharmacy_name": "Reinomed Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Shomolu",
                "pharmacy_address": "Number 24, Bajulaiye road, Shomolu, Lagos",
                "created_at": "2021-04-24T17:17:10.000000Z",
                "updated_at": "2021-04-24T17:17:10.000000Z"
            },
            {
                "id": 1378,
                "pharmacy_code": "WHP11415",
                "pharmacy_name": "Divine Care Pharmacy Thomas Estate",
                "state_of_premise": "Lagos",
                "lga": "Eti Osa",
                "pharmacy_address": "2, Ayodele Close, Thomas Estate, Ajah, Lagos",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1377,
                "pharmacy_code": "WHP11435",
                "pharmacy_name": "Skylark Pharmacy Wuse Zone 3",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "D9, Sky Memorial Complex, Michael Opara Street, Wuse.",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1379,
                "pharmacy_code": "WHP11416",
                "pharmacy_name": "Rozec Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Eti Osa",
                "pharmacy_address": "Association Road, Dolphin Estate, Ikoyi, Lagos",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1374,
                "pharmacy_code": "WHP11432",
                "pharmacy_name": "Niveron Pharmacy and Healthcare Ltd",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "24 Etsu Jetta Street, Phase 1 Jikwoyi,Abuja ",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            },
            {
                "id": 1376,
                "pharmacy_code": "WHP11434",
                "pharmacy_name": "Jaa-eez Pharmacy ",
                "state_of_premise": "Kano",
                "lga": "Kano Municipal",
                "pharmacy_address": "7, Tahir House, Zoo Road, Kano ",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            },
            {
                "id": 1375,
                "pharmacy_code": "WHP11433",
                "pharmacy_name": "Newton Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Ojo",
                "pharmacy_address": "Suite 3 & 4, Opposite Adoff Bus-Stop, Iba-LASU Express way, Lagos",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            }
        ],
        "first_page_url": "http://sandbox.insurpass.com/api/pharmacies?page=1",
        "from": 1,
        "last_page": 74,
        "last_page_url": "http://sandbox.insurpass.com/merchant/pharmacies?page=74",
        "next_page_url": "http://sandbox.insurpass.com/merchant/pharmacies?page=2",
        "path": "http://sandbox.insurpass.com/pharmacies",
        "per_page": 15,
        "prev_page_url": null,
        "to": 15,
        "total": 1097
    },
    "response_message": "Pharmacies retrieved successfully",
    "response_code": ""
}
```

{% endtab %}
{% endtabs %}

## SEARCH BY PHARMACY LGA

<mark style="color:blue;">`GET`</mark> `https://sandbox.insurpass.com/api/merchant/search_pharmacies?lga=Abuja Municipal`

This endpoint will allow a user search for Pharmacies around a particular LGA

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {$secret-key}/{$api-key} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "success": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 1387,
                "pharmacy_code": "WHP11424",
                "pharmacy_name": "Safari Pharmacy B & M",
                "state_of_premise": "Delta",
                "lga": "Udu",
                "pharmacy_address": "B&M Plaza, Opposite Fantasia, Before Police Post, Orhuwhorun Road, Igbogidi, Udu, Warri",
                "created_at": "2021-04-24T17:17:13.000000Z",
                "updated_at": "2021-04-24T17:17:13.000000Z"
            },
            {
                "id": 1388,
                "pharmacy_code": "WHP11425",
                "pharmacy_name": "Safari Pharmacy  Ovalaux Mall",
                "state_of_premise": "Delta",
                "lga": "Okpe",
                "pharmacy_address": "Ovalaux Mall, Km 4, Eku Osubi Road, by Lawfab Hotel, Osubi, Warri",
                "created_at": "2021-04-24T17:17:13.000000Z",
                "updated_at": "2021-04-24T17:17:13.000000Z"
            },
            {
                "id": 1384,
                "pharmacy_code": "WHP11421",
                "pharmacy_name": "Safari Pharmacy Ogunu",
                "state_of_premise": "Delta",
                "lga": "Warri South",
                "pharmacy_address": "46, Ogunu Road, Warri, Delta State",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1385,
                "pharmacy_code": "WHP11422",
                "pharmacy_name": "Safari Pharmacy Legacy House ",
                "state_of_premise": "Delta",
                "lga": "Uvwie",
                "pharmacy_address": "Legacy House, Airport Road, by Westend Hospital Junction, Ugborikoko, Warri\n",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1386,
                "pharmacy_code": "WHP11423",
                "pharmacy_name": "Safari Pharmacy Cedar House",
                "state_of_premise": "Delta",
                "lga": "Warri South",
                "pharmacy_address": "Cedar House, 41 Airport Road, by Edjeba Junction, Warri.",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1383,
                "pharmacy_code": "WHP11420",
                "pharmacy_name": "HYCARE PHARMACEUTICAL SERVICE LIMITED",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "28, Suncity Plaza, Lokogoma, Abuja",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1381,
                "pharmacy_code": "WHP11418",
                "pharmacy_name": "Vatican Pharma Consult",
                "state_of_premise": "Lagos",
                "lga": "Surulere",
                "pharmacy_address": "Number 5, Akerele Street, Surulere",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1382,
                "pharmacy_code": "WHP11419",
                "pharmacy_name": "Lamed Pharmacy",
                "state_of_premise": "Plateau",
                "lga": "Jos North",
                "pharmacy_address": "Steve Son, House Bukuru Expressway, Near PHC Clinic, Bukuru Jos, Plateau",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1380,
                "pharmacy_code": "WHP11417",
                "pharmacy_name": "Reinomed Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Shomolu",
                "pharmacy_address": "Number 24, Bajulaiye road, Shomolu, Lagos",
                "created_at": "2021-04-24T17:17:10.000000Z",
                "updated_at": "2021-04-24T17:17:10.000000Z"
            },
            {
                "id": 1378,
                "pharmacy_code": "WHP11415",
                "pharmacy_name": "Divine Care Pharmacy Thomas Estate",
                "state_of_premise": "Lagos",
                "lga": "Eti Osa",
                "pharmacy_address": "2, Ayodele Close, Thomas Estate, Ajah, Lagos",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1377,
                "pharmacy_code": "WHP11435",
                "pharmacy_name": "Skylark Pharmacy Wuse Zone 3",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "D9, Sky Memorial Complex, Michael Opara Street, Wuse.",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1379,
                "pharmacy_code": "WHP11416",
                "pharmacy_name": "Rozec Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Eti Osa",
                "pharmacy_address": "Association Road, Dolphin Estate, Ikoyi, Lagos",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1374,
                "pharmacy_code": "WHP11432",
                "pharmacy_name": "Niveron Pharmacy and Healthcare Ltd",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "24 Etsu Jetta Street, Phase 1 Jikwoyi,Abuja ",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            },
            {
                "id": 1376,
                "pharmacy_code": "WHP11434",
                "pharmacy_name": "Jaa-eez Pharmacy ",
                "state_of_premise": "Kano",
                "lga": "Kano Municipal",
                "pharmacy_address": "7, Tahir House, Zoo Road, Kano ",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            },
            {
                "id": 1375,
                "pharmacy_code": "WHP11433",
                "pharmacy_name": "Newton Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Ojo",
                "pharmacy_address": "Suite 3 & 4, Opposite Adoff Bus-Stop, Iba-LASU Express way, Lagos",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            }
        ],
        "first_page_url": "http://sandbox.insurpass.com/api/pharmacies?page=1",
        "from": 1,
        "last_page": 74,
        "last_page_url": "http://sandbox.insurpass.com/merchant/pharmacies?page=74",
        "next_page_url": "http://sandbox.insurpass.com/merchant/pharmacies?page=2",
        "path": "http://sandbox.insurpass.com/pharmacies",
        "per_page": 15,
        "prev_page_url": null,
        "to": 15,
        "total": 1097
    },
    "response_message": "Pharmacies retrieved successfully",
    "response_code": ""
}
```

{% endtab %}
{% endtabs %}

## SEARCH BY PHARMACY ADDRESS

<mark style="color:blue;">`GET`</mark> `https://sandbox.insurpass.com/api/merchant/search_pharmacies?pharmacy_address=Garki 2, Abuja`

This endpoint will allow a user to search for Pharmacies using the address of the Pharmacy

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {$secret-key}/{$api-key} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "success": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 1387,
                "pharmacy_code": "WHP11424",
                "pharmacy_name": "Safari Pharmacy B & M",
                "state_of_premise": "Delta",
                "lga": "Udu",
                "pharmacy_address": "B&M Plaza, Opposite Fantasia, Before Police Post, Orhuwhorun Road, Igbogidi, Udu, Warri",
                "created_at": "2021-04-24T17:17:13.000000Z",
                "updated_at": "2021-04-24T17:17:13.000000Z"
            },
            {
                "id": 1388,
                "pharmacy_code": "WHP11425",
                "pharmacy_name": "Safari Pharmacy  Ovalaux Mall",
                "state_of_premise": "Delta",
                "lga": "Okpe",
                "pharmacy_address": "Ovalaux Mall, Km 4, Eku Osubi Road, by Lawfab Hotel, Osubi, Warri",
                "created_at": "2021-04-24T17:17:13.000000Z",
                "updated_at": "2021-04-24T17:17:13.000000Z"
            },
            {
                "id": 1384,
                "pharmacy_code": "WHP11421",
                "pharmacy_name": "Safari Pharmacy Ogunu",
                "state_of_premise": "Delta",
                "lga": "Warri South",
                "pharmacy_address": "46, Ogunu Road, Warri, Delta State",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1385,
                "pharmacy_code": "WHP11422",
                "pharmacy_name": "Safari Pharmacy Legacy House ",
                "state_of_premise": "Delta",
                "lga": "Uvwie",
                "pharmacy_address": "Legacy House, Airport Road, by Westend Hospital Junction, Ugborikoko, Warri\n",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1386,
                "pharmacy_code": "WHP11423",
                "pharmacy_name": "Safari Pharmacy Cedar House",
                "state_of_premise": "Delta",
                "lga": "Warri South",
                "pharmacy_address": "Cedar House, 41 Airport Road, by Edjeba Junction, Warri.",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1383,
                "pharmacy_code": "WHP11420",
                "pharmacy_name": "HYCARE PHARMACEUTICAL SERVICE LIMITED",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "28, Suncity Plaza, Lokogoma, Abuja",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1381,
                "pharmacy_code": "WHP11418",
                "pharmacy_name": "Vatican Pharma Consult",
                "state_of_premise": "Lagos",
                "lga": "Surulere",
                "pharmacy_address": "Number 5, Akerele Street, Surulere",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1382,
                "pharmacy_code": "WHP11419",
                "pharmacy_name": "Lamed Pharmacy",
                "state_of_premise": "Plateau",
                "lga": "Jos North",
                "pharmacy_address": "Steve Son, House Bukuru Expressway, Near PHC Clinic, Bukuru Jos, Plateau",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1380,
                "pharmacy_code": "WHP11417",
                "pharmacy_name": "Reinomed Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Shomolu",
                "pharmacy_address": "Number 24, Bajulaiye road, Shomolu, Lagos",
                "created_at": "2021-04-24T17:17:10.000000Z",
                "updated_at": "2021-04-24T17:17:10.000000Z"
            },
            {
                "id": 1378,
                "pharmacy_code": "WHP11415",
                "pharmacy_name": "Divine Care Pharmacy Thomas Estate",
                "state_of_premise": "Lagos",
                "lga": "Eti Osa",
                "pharmacy_address": "2, Ayodele Close, Thomas Estate, Ajah, Lagos",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1377,
                "pharmacy_code": "WHP11435",
                "pharmacy_name": "Skylark Pharmacy Wuse Zone 3",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "D9, Sky Memorial Complex, Michael Opara Street, Wuse.",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1379,
                "pharmacy_code": "WHP11416",
                "pharmacy_name": "Rozec Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Eti Osa",
                "pharmacy_address": "Association Road, Dolphin Estate, Ikoyi, Lagos",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1374,
                "pharmacy_code": "WHP11432",
                "pharmacy_name": "Niveron Pharmacy and Healthcare Ltd",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "24 Etsu Jetta Street, Phase 1 Jikwoyi,Abuja ",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            },
            {
                "id": 1376,
                "pharmacy_code": "WHP11434",
                "pharmacy_name": "Jaa-eez Pharmacy ",
                "state_of_premise": "Kano",
                "lga": "Kano Municipal",
                "pharmacy_address": "7, Tahir House, Zoo Road, Kano ",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            },
            {
                "id": 1375,
                "pharmacy_code": "WHP11433",
                "pharmacy_name": "Newton Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Ojo",
                "pharmacy_address": "Suite 3 & 4, Opposite Adoff Bus-Stop, Iba-LASU Express way, Lagos",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            }
        ],
        "first_page_url": "http://sandbox.insurpass.com/api/pharmacies?page=1",
        "from": 1,
        "last_page": 74,
        "last_page_url": "http://sandbox.insurpass.com/merchant/pharmacies?page=74",
        "next_page_url": "http://sandbox.insurpass.com/merchant/pharmacies?page=2",
        "path": "http://sandbox.insurpass.com/pharmacies",
        "per_page": 15,
        "prev_page_url": null,
        "to": 15,
        "total": 1097
    },
    "response_message": "Pharmacies retrieved successfully",
    "response_code": ""
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PHP" %}
{% code overflow="wrap" lineNumbers="true" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/search?pharmacy_name=Jahban Pharmacy',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {{SECRETKEY}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endcode %}
{% endtab %}

{% tab title="NODE JS" %}
{% code overflow="wrap" lineNumbers="true" %}

```javascript
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/search?pharmacy_name=Jahban Pharmacy',
  headers: { 
    'Authorization': 'Bearer {{SECRETKEY}}'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endcode %}
{% endtab %}

{% tab title="CURL" %}
{% code overflow="wrap" %}

```clike
curl --location --request GET https://sandbox.insurpass.com/api/merchant/search_pharmacies?pharmacy_address=Garki 2, Abuja' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--data-raw ''
```

{% endcode %}
{% endtab %}
{% endtabs %}

## List all Pharmacies on Insurpass

## This endpoint returns a list of all the Pharmacies on Insurpass

<mark style="color:blue;">`GET`</mark> `https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/all`

This endpoint allows a merchant to request for all the pharmacies listed on Insurpass' network.

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {$secret-key}/{$api-key} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

{% tabs %}
{% tab title="200              " %}

```javascript
{
    "success": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 1387,
                "pharmacy_code": "WHP11424",
                "pharmacy_name": "Safari Pharmacy B & M",
                "state_of_premise": "Delta",
                "lga": "Udu",
                "pharmacy_address": "B&M Plaza, Opposite Fantasia, Before Police Post, Orhuwhorun Road, Igbogidi, Udu, Warri",
                "created_at": "2021-04-24T17:17:13.000000Z",
                "updated_at": "2021-04-24T17:17:13.000000Z"
            },
            {
                "id": 1388,
                "pharmacy_code": "WHP11425",
                "pharmacy_name": "Safari Pharmacy  Ovalaux Mall",
                "state_of_premise": "Delta",
                "lga": "Okpe",
                "pharmacy_address": "Ovalaux Mall, Km 4, Eku Osubi Road, by Lawfab Hotel, Osubi, Warri",
                "created_at": "2021-04-24T17:17:13.000000Z",
                "updated_at": "2021-04-24T17:17:13.000000Z"
            },
            {
                "id": 1384,
                "pharmacy_code": "WHP11421",
                "pharmacy_name": "Safari Pharmacy Ogunu",
                "state_of_premise": "Delta",
                "lga": "Warri South",
                "pharmacy_address": "46, Ogunu Road, Warri, Delta State",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1385,
                "pharmacy_code": "WHP11422",
                "pharmacy_name": "Safari Pharmacy Legacy House ",
                "state_of_premise": "Delta",
                "lga": "Uvwie",
                "pharmacy_address": "Legacy House, Airport Road, by Westend Hospital Junction, Ugborikoko, Warri\n",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1386,
                "pharmacy_code": "WHP11423",
                "pharmacy_name": "Safari Pharmacy Cedar House",
                "state_of_premise": "Delta",
                "lga": "Warri South",
                "pharmacy_address": "Cedar House, 41 Airport Road, by Edjeba Junction, Warri.",
                "created_at": "2021-04-24T17:17:12.000000Z",
                "updated_at": "2021-04-24T17:17:12.000000Z"
            },
            {
                "id": 1383,
                "pharmacy_code": "WHP11420",
                "pharmacy_name": "HYCARE PHARMACEUTICAL SERVICE LIMITED",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "28, Suncity Plaza, Lokogoma, Abuja",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1381,
                "pharmacy_code": "WHP11418",
                "pharmacy_name": "Vatican Pharma Consult",
                "state_of_premise": "Lagos",
                "lga": "Surulere",
                "pharmacy_address": "Number 5, Akerele Street, Surulere",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1382,
                "pharmacy_code": "WHP11419",
                "pharmacy_name": "Lamed Pharmacy",
                "state_of_premise": "Plateau",
                "lga": "Jos North",
                "pharmacy_address": "Steve Son, House Bukuru Expressway, Near PHC Clinic, Bukuru Jos, Plateau",
                "created_at": "2021-04-24T17:17:11.000000Z",
                "updated_at": "2021-04-24T17:17:11.000000Z"
            },
            {
                "id": 1380,
                "pharmacy_code": "WHP11417",
                "pharmacy_name": "Reinomed Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Shomolu",
                "pharmacy_address": "Number 24, Bajulaiye road, Shomolu, Lagos",
                "created_at": "2021-04-24T17:17:10.000000Z",
                "updated_at": "2021-04-24T17:17:10.000000Z"
            },
            {
                "id": 1378,
                "pharmacy_code": "WHP11415",
                "pharmacy_name": "Divine Care Pharmacy Thomas Estate",
                "state_of_premise": "Lagos",
                "lga": "Eti Osa",
                "pharmacy_address": "2, Ayodele Close, Thomas Estate, Ajah, Lagos",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1377,
                "pharmacy_code": "WHP11435",
                "pharmacy_name": "Skylark Pharmacy Wuse Zone 3",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "D9, Sky Memorial Complex, Michael Opara Street, Wuse.",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1379,
                "pharmacy_code": "WHP11416",
                "pharmacy_name": "Rozec Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Eti Osa",
                "pharmacy_address": "Association Road, Dolphin Estate, Ikoyi, Lagos",
                "created_at": "2021-04-24T17:17:09.000000Z",
                "updated_at": "2021-04-24T17:17:09.000000Z"
            },
            {
                "id": 1374,
                "pharmacy_code": "WHP11432",
                "pharmacy_name": "Niveron Pharmacy and Healthcare Ltd",
                "state_of_premise": "F.C.T",
                "lga": "AMAC",
                "pharmacy_address": "24 Etsu Jetta Street, Phase 1 Jikwoyi,Abuja ",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            },
            {
                "id": 1376,
                "pharmacy_code": "WHP11434",
                "pharmacy_name": "Jaa-eez Pharmacy ",
                "state_of_premise": "Kano",
                "lga": "Kano Municipal",
                "pharmacy_address": "7, Tahir House, Zoo Road, Kano ",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            },
            {
                "id": 1375,
                "pharmacy_code": "WHP11433",
                "pharmacy_name": "Newton Pharmacy",
                "state_of_premise": "Lagos",
                "lga": "Ojo",
                "pharmacy_address": "Suite 3 & 4, Opposite Adoff Bus-Stop, Iba-LASU Express way, Lagos",
                "created_at": "2021-04-24T17:17:08.000000Z",
                "updated_at": "2021-04-24T17:17:08.000000Z"
            }
        ],
        "first_page_url": "http://sandbox.insurpass.com/api/pharmacies?page=1",
        "from": 1,
        "last_page": 74,
        "last_page_url": "http://sandbox.insurpass.com/merchant/pharmacies?page=74",
        "next_page_url": "http://sandbox.insurpass.com/merchant/pharmacies?page=2",
        "path": "http://sandbox.insurpass.com/pharmacies",
        "per_page": 15,
        "prev_page_url": null,
        "to": 15,
        "total": 1097
    },
    "response_message": "Pharmacies retrieved successfully",
    "response_code": ""
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PHP" %}
{% code overflow="wrap" lineNumbers="true" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/all',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {{SECRETKEY}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endcode %}
{% endtab %}

{% tab title="NODE JS" %}
{% code overflow="wrap" lineNumbers="true" %}

```javascript
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/all',
  headers: { 
    'Authorization': 'Bearer {{SECRETKEY}}'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endcode %}
{% endtab %}

{% tab title="CURL" %}
{% code overflow="wrap" %}

```clike
curl --location --request GET https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/all' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--data-raw ''
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Request detail of Pharmacy

## This endpoint returns an object containing a single pharmacy&#x20;

<mark style="color:blue;">`GET`</mark> `https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/:pharmacy_id`

This endpoint allows a merchant to request for the details of a specific pharmacy's details.

#### Path Parameters

| Name         | Type   | Description                                                  |
| ------------ | ------ | ------------------------------------------------------------ |
| pharmacy\_id | String | The unique number that identifies the pharmacy- **20570819** |

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {$secret-key}/{$api-key} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "success": true,
    "data": {
        "id": 1,
        "pharmacy_code": "TESTCODE",
        "pharmacy_name": "Phamacy name 1",
        "state_of_premise": "lagos",
        "lga": "ikeja",
        "pharmacy_address": "No 12 opebi road",
        "created_at": "2021-04-14T11:41:09.000000Z",
        "updated_at": "2021-04-14T11:41:10.000000Z"
    },
    "message": "Pharmacy retrieved successfully"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PHP" %}
{% code overflow="wrap" lineNumbers="true" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/{pharmacy_id}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {{SECRETKEY}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endcode %}
{% endtab %}

{% tab title="NODE JS" %}

```javascript
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/{pharmacy_id}',
  headers: { 
    'Authorization': 'Bearer {{SECRETKEY}}'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}

{% tab title="CURL" %}
{% code overflow="wrap" %}

```clike
curl --location --request GET https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/:pharmacy_id' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--data-raw ''
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Send Pharmacy detail as SMS/Email to Principal customer

## This endpoint allows a customer to request the details of a pharmacy they want to visit sent to their email or SMS.

<mark style="color:green;">`POST`</mark> `https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/request_pharmacy`

This endpoint allows a customer to request the details of a pharmacy they want to visit sent to their email or SMS.

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {$secret-key}/{$api-key} |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

#### Request Body

| Name                                           | Type    | Description                          |
| ---------------------------------------------- | ------- | ------------------------------------ |
| pharmacy\_id<mark style="color:red;">\*</mark> | integer | ID gotten from GET Pharmacy - **55** |
| policy\_no<mark style="color:red;">\*</mark>   | integer | User's policy number - IN98570819    |

{% tabs %}
{% tab title="200 " %}

```javascript
{
"success": true,
"data": {}
"message": "Pharmacy booking successful, pharmacy details have been sent to
your email and phone number"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="NODE JS" %}
{% code overflow="wrap" lineNumbers="true" %}

```javascript
var axios = require('axios');
var data = JSON.stringify({
  "pharmacy_id": 55,
  "policy_no": "IN98570819"
});

var config = {
  method: 'post',
  url: 'https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/request_pharmacy',
  headers: { 
    'Authorization': 'Bearer {{SECRETKEY}}', 
    'Content-Type': 'application/json'
  },
  data: data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}
{% code overflow="wrap" lineNumbers="true" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/request_pharmacy',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "pharmacy_id": 55,
    "policy_no":"IN98570819"
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {{SECRETKEY}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endcode %}
{% endtab %}

{% tab title="CURL" %}
{% code overflow="wrap" %}

```clike
curl --location --request POST https://sandbox.insurpass.com/api/merchant/micro_health/pharmacy/request_pharmacy' \
--header 'Authorization: Bearer {{SECRETKEY}}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
    "pharmacy_id": 55,
    "policy_no":"IN98570819"
}''
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://milonics.gitbook.io/api-documentation/insurpass-api-reference/subscription/pharmacy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
