top of page

Seena API Documentation

Introduction

Our API interface is used to integrate Seena's services with client's projects. The API is designed for developers and is accompanied by detailed documentation.

Description

Seena’s REST API works over the HTTPS protocol . All answers return in the form of JSON structures.

Seena APIs

Base URL

All references to API requests in this document include the root URL: https://seenaapi.seenapay.com/sandbox/v1

Authorization

Once you have signed with Seena, you will be provided with API token (Authorization: Bearer your_token).

API token: You can authenticate with our API by providing the appropriate API token in the request Authorization header.

HTTP status code

Code 200 success    We will send it with all successful requests.

Code 400  error        We will send it with all failed requests.

API's

1. Add a doctor to Seena network

To add a doctor to Seena network, send a POST request to:    /doctors/add

Request body scheme

account_details    object

required

 

 

bank_details     object

required

 

 

clinic_details    object

required

Request example

{

    "account_details": {

        "first_name": "Arwa",

        "last_name": "Ahmed",

        "email": "test@gmail.com",

        "country_code": "EG",

        "phone": "01007132399"

    },

    "bank_details": {

        "account_number": "EG333333355555555555555",

        "bank_account_name": "Arwa Ahmed mohaamed ",

        "bank_id": "1",

        "branch": "Maadi"

    },

    "clinic_details": {

        "ar_name": "أسم العياده ",

        "en_name": "Clinic name"

    }

}

Response example    (HTTP status code 200)

{
   "msg": "Doctor Added Successfully",
   "status": "success",
   "code": 200,
   "data": {
       "user": {
           "first_name": "first_name",
           "last_name": "last_name",
           "email": "test.clinic@gmail.com",
           "phone": "01007138888",
           "countryID": 1,
           "role": "pending_clinic",
           "uid": "08204488f78bcfe365ac215913ecfc68",
           "id": 12628
       }
   }
}

Code                                 Description

200                                      Doctor Added Successfully

6001                                    Doctor has already been registered 

                                             for your account

400                                      This phone has already been taken.

2. Get a list of doctors

To get a list of your doctors on Seena network, send a Get request to     /doctors

Response example (HTTP status code 200)

{

    "msg": "list of doctors",

    "status": "success",

    "code": 200,

    "data": {

        "current_page": 1,

        "data": [

            {

                "uid": "acd9196ec8b7da29faa4397c8a9ab012",

                "first_name": "cool",

                "last_name": "test",

                "phone": "01554584906"

            },

        ],

        "first_page_url": "https://seenaapi.seenapay.com/sandbox/doctors?page=1",

        "from": 1,

        "last_page": 1,

        "last_page_url": "https://seenaapi.seenapay.com/sandbox/doctors?page=1",

        "next_page_url": null,

        "path": "https://seenaapi.seenapay.com/sandbox/doctors",

        "per_page": 15,

        "prev_page_url": null,

        "to": 1,

        "total": 1

    }

}

3. Add patient

To add a patient to Seena network, send a POST request to:    /doctors/add-patient

Request body scheme

doctor_id  String

required

 

phone  String

required

 

name  String

required

 

expected_cost  Float

required

Request example

{

    "doctor_id": "b362fe086148b859e48ea0ff205170e9",

    "phone": "01554584901",

    "name": " Patient  name",

    "expected_cost": "9000"

}

Response example  (HTTP status code 200)

{
   "msg": "Patient Added Successfully",
   "status": "success",
   "code": 200,
   "data": {
       "patient": {
           "phone": "01554584901",
           "name": "zcas",
           "expected_cost": "500",
           "platform_id": 1,
           "accountHolderID": 12628,
           "user_id": null,
           "clinic_id": 849,
           "uid": "903409ad54c1f9474c4a40d8b29772ac",
           "updated_at": "2023-07-09T14:37:24.000000Z",
           "created_at": "2023-07-09T14:37:24.000000Z",
           "id": 16601
       }
   }
}

Code                                 Description

200                                      Patient Added Successfully

400                                      Validation error Example(The phone field is                                                     required., doctor not found ) 

4. Get patients by doctor

To get a list of patients for specific doctor, send a GET request to:    /doctors/{{Doctor_uid}}/patients

Path param

Doctor_uid

 

Reference to doctor ID

Response example    (HTTP status code 200)

{

    "msg": "list of patients",

    "status": "success",

    "code": 200,

    "data": {

        "current_page": 1,

        "data": [

            {

                "uid": "6abf74d27f298602369add38f5f3635e",

                "doctor_uid": "b362fe086148b859e48ea0ff205170e9",

                "phone": "01007132399",

                "name": " Patient  name ",

                "expected_cost": "8000",

                "created_at": "2023-06-14T15:02:25.000000Z"

            },

            {

                "uid": "21b79813d00178979a3cc8f2c28d2fb2",

                "doctor_uid": "b362fe086148b859e48ea0ff205170e9",

                "phone": "01556684901",

                "name": " Patient  name 1",

                "expected_cost": "9000",

                "created_at": "2023-06-14T15:02:37.000000Z"

            }

        ],

        "first_page_url": "https://seenaapi.seenapay.com/sandbox/doctors/b362fe086148b859e48ea0ff205170e9/patients?page=1",

        "from": 1,

        "last_page": 1,

        "last_page_url": "https://seenaapi.seenapay.com/sandbox/doctors/b362fe086148b859e48ea0ff205170e9/patients?page=1",

        "next_page_url": null,

        "path": "https://seenaapi.seenapay.com/sandbox/doctors/b362fe086148b859e48ea0ff205170e9/patients",

        "per_page": 15,

        "prev_page_url": null,

        "to": 2,

        "total": 2

    }

}

5. Get patient's history

To get a patient's history, send a GET request to:    /doctors/patients/{{patient_uid}}

Path param

patient_uid

Reference to patient ID

Response example  (HTTP status code 200)

{

    "msg": "patient details",

    "status": "success",

    "code": 200,

    "data": {

        "uid": "21b79813d00178979a3cc8f2c28d2fb2",

        "doctor_first_name": "dr",

        "doctor_last_name": "Patient name",

        "phone": "01554584901",

        "name": "Test11",

        "expected_cost": "9000",

        "created_at": "2023-06-14T15:02:37.000000Z",

        "logs": [

            {

                "clinic_patients_ar_reason": "العميل في مرحله تجهيز الاوراق",

                "clinic_patients_en_reason": "preparing the required documents",

                "clinic_patients_status": {

                    "value": "waiting",

                    "valuear": "انتظار"

                },

                "created_at": "2023-06-14T15:03:54.000000Z"

            }

        ]

    }

}

6. Send payment request

To send a payment request to Seena network, send a POST request to:    /doctors/add-payment-request

Request body scheme

doctor_id  String

required

 

phone  String

required

 

price  Float

required & more than 500

 

Request example

{

    "doctor_id": "acd9196ec8b7da29faa4397c8a9ab012",

    "phone": "01007132399",

    "price": "500",

     "notes":"this payment request"

}

Response example  (HTTP status code 200)

{

    "msg": "Payment Request Added Successfully",

    "status": "success",

    "code": 200,

    "data": {

        "payment_request": {

            "price": "3001",

            "notes": "this payment request",

            "platform_id": 1,

            "user_id": 2418,

            "brand_id": 763,

            "uid": "6f763a007a28da42a7981cd686ea63dd",

            "created_by": 11706,

            "status": 1,

            "updated_at": "2023-07-11T15:38:47.000000Z",

            "created_at": "2023-07-11T15:38:47.000000Z",

            "id": 3304,

            "payment_link": "https://www.seenapay.com/pr/pay?token=64ad7787185a6"

        }

    }

}

Code                                 Description

200                                      Payment Request Added Successfully

400                                      Validation error Example (The phone field

                                             is required., doctor not found )

7. Get doctor payment request

To get payment requests for specific doctor, send a Get request to:    /doctors/{{doctor_uid}}/payment-requests

Path param

Doctor_uid

 

Reference to doctor ID

Response example   (HTTP status code 200)

{

    "msg": "payment requests",

    "status": "success",

    "code": 200,

    "data": {

        "current_page": 1,

        "data": [

            {

                "payment_request_uid": "766ec99c34a16605915cb3b670ca9678",

                "patient_uid": "dce48c227c55ac53dbb2a370eede6320",

                "patient_phone": "01007132399xxx",

                "doctor_uid": "b362fe086148b859e48ea0ff205170e9",

                "status": 1,

                "price": 3001,

                 "notes":"this payment request"

            },

            {

                "payment_request_uid": "066e1312d0f3c94cfd7678742d523304",

                "patient_uid": null,

                "patient_phone": "01007132399",

                "doctor_uid": "b362fe086148b859e48ea0ff205170e9",

                "status": 1,

                "price": 500,

                 "notes":"this payment request"

            }

        ],

        "first_page_url": "https://seenaapi.seenapay.com/sandbox/v1/doctors/b362fe086148b859e48ea0ff205170e9/payment-requests?page=1",

        "from": 1,

        "last_page": 1,

        "last_page_url": "https://seenaapi.seenapay.com/sandbox/v1/doctors/b362fe086148b859e48ea0ff205170e9/payment-requests?page=1",

        "next_page_url": null,

        "path": "https://seenaapi.seenapay.com/sandbox/v1/doctors/b362fe086148b859e48ea0ff205170e9/payment-requests",

        "per_page": 15,

        "prev_page_url": null,

        "to": 2,

        "total": 2

    }

}

Payment request status code

Code              Description

   1                     PENDING

   2                     REJECTED

   3                     REJECTED BY USER

   4                     REJECTED BY MERCHANT

   5                     COMPLETED

   6                     REFUNDED

8. Payment request details

To get details for specific payment request, send a Get request to:  /doctors/payment-requests/{{payment_request_id}}

Path param

payment_request_id

Reference to payment request  ID

Response example (HTTP status code 200)

"msg": "payment request details",

    "status": "success",

    "code": 200,

    "data": {

        "patient_uid": null,

        "doctor_uid": "b362fe086148b859e48ea0ff205170e9",

        "patient_phone": "01007132399",

        "payment_request_uid": "066e1312d0f3c94cfd7678742d523304",

        "status": 1,

        "price": 500,

         "notes":"this payment request"

    }

}

}

9. Get patient payment request by phone

To get payment requests for specific patient, send a Get request to: /patients/payment-requests?phone=01007132399

Query param

Phone

Reference to  patient’s phone

Note

payment_link depended on is_expired

Response example   (HTTP status code 200)

{

    "msg": "list of patient payment requests",

    "status": "success",

    "code": 200,

    "data": {

        "current_page": 1,

        "data": [

            {

               "payment_request_uid": "e32e312110792507a09aa05e28320fd6",

                "patient_uid": "e32e312110792507a09aa05e28320fd6",

                "doctor_uid": "acd9196ec8b7da29faa4397c8a9ab012",

                "price": 3001,

                "status": 1,

                "payment_link": null,

                "is_expired": true

            },

            {

                " payment_request_uid ": "687ebd4587e5f531a5973ca2c21ba6ba",

                "patient_uid": "e32e312110792507a09aa05e28320fd6",

                "doctor_uid": "acd9196ec8b7da29faa4397c8a9ab012",

                "price": 3001,

                "status": 1,

                "payment_link": "https://www.seenapay.com/pr/pay?token=NGJmZTE4MTJmZjcwNDgwMTVlOTY4NTFkNWU3OWYxZjA=YjQ0MjdjODU1YjI2M2QxMTk0NzllMjIyMDk3NDlkZTc=YmZhY2EyNDBmNTJhYWNjOGFiNjRkYWFmMWMwOGU0MTc",

                "is_expired": false

            }

        ],

        "first_page_url": "https://seenaapi.seenapay.com/sandbox/v1/patients/payment-requests?page=1",

        "from": 1,

        "last_page": 1,

        "last_page_url": "https://seenaapi.seenapay.com/sandbox/v1/patients/payment-requests?page=1",

        "next_page_url": null,

        "path": "https://seenaapi.seenapay.com/sandbox/v1/patients/payment-requests",

        "per_page": 15,

        "prev_page_url": null,

        "to": 2,

        "total": 2

    }

}

10. Callback

After payment process we will send payment transaction details on your callback link

{

    "operation_code":7001,

    "status_code":200,

    "status_text":"success",

    "transaction":{

         "uid":"jdskcbdkjsbkdbskcbdajc",

         "status":5,

         "doctor_uid":"djcnjadnclndanclad",

         "user_id":"jdckjbdcjkbkbckbdkcbad",

         "amount":5000

    }

}

11. Get list of countries

To get a list of countries  on Seena network, send a Get request to:  /data/countries

Response example  (HTTP status code 200)

{

    "msg": "list of countries",

    "status": "success",

    "code": 200,

    "data": {

        "countries": [

            {

                "id": 1,

                "code": "EG"

            },

            {

                "id": 2,

                "code": "KSA"

            }

        ]

    }

}

12. Get list of country banks

To get a list of banks on Seena network, send a Get request to:  /data/countries/{{country_id]}/banks

Response example  (HTTP status code 200)

{

    "msg": "list of banks of country",

    "status": "success",

    "code": 200,

    "data": {

        "banks": [

            {

                "id": 1,

                "en_name": "CIB",

                "ar_name": "CIB"

            },

            {

                "id": 2,

                "en_name": "National Bank of Egypt",

                "ar_name": "الاهلي المصري"

            },

        ]

    }

}

13- Change active Status for doctor

To Change active Status for doctor , send a POST request to:    /doctors/{{Doctor_uid}}/change-active-status

Request body scheme

status String

required

 

0 Active

1 Deactivate

Request example

{

"status":0

}

Response example  (HTTP status code 200)

{

    "msg": "doctor not found",

    "status": "error",

    "code": 400,

    "data": null

}

14- Get doctor details

To get a doctor details on Seena network, send a Get request to:    doctors/{{Doctor_uid}}/details

Response example  (HTTP status code 200)

{

    "msg": "doctor details",

    "status": "success",

    "code": 200,

    "data": {

        "uid": "acd9196ec8b7da29faa4397c8a9ab012",

        "first_name": "cool",

        "last_name": "test",

        "phone": "01554584906",

        "is_active": 1

    }

}

bottom of page