API Reference

Welcome to the corporate portal!

Corporate sign up

This endpoint allows you to sign up as a corporate from the corporate portal

URL: {{base_url}}v1/corporates/onboard
Method: POST

{
    "company_name": "Limann Ltd",
    "admin_email": "[email protected]",
    "tin_number": "1104384138",
    "address": "",
    "admin_phoneno": "050455639",
    "admin_first_name": "Akosua",
    "admin_last_name": "Akos"
}
{
    "message": "corporate signed up successfully",
    "successful": true,
    "returnedData": {
        "main_branch_id": 21,
        "uuid": "6b9d5969-265b-4519-9ab5-05ba73002cf1",
        "created_at": "2021-09-20T11:36:27.616646Z",
        "is_deleted": false,
        "modified_at": "2021-09-20T11:36:27.616660Z",
        "company_name": "Limann Ltd",
        "tin_number": 1104384138,
        "address": "",
        "admin_first_name": "Akosua",
        "admin_last_name": "Akos",
        "admin_email": "[email protected]",
        "admin_phoneno": "050455639",
        "state": "unverified",
        "authorizedBy": null,
        "user": 104
    }
}

Add a corporate employee

This endpoint allows you to add an employee of a company from the corporate portal

URL: {{base_url}}/v1/corporates/<main_branch_id>/employees
Method: POST

{
  "occupational_role": "1",
  "employee_tags": "23", 
  "maximum_dependents_allowed": "1", 
  "address": "15 hemingway", 
  "first_name": "Tim", //required
  "last_name": "Scott", //required
  "email": "[email protected]", //required
  "date_of_birth": "2021-09-01", //required
  "gender": "MALE", //required
  "mobile": "+233235124963", //required
  "company_id": "fd695ebb-5432-4e0d-9d59-5ac095638c0a" //required
}
{
  "data": {
    "id": 26,
    "userId": 91,
    "patientId": "e369f9ac-16b8-11ec-a25c-1bc9e4170062",
    "companyId": 17,
    "first_name": "Tim",
    "last_name": "Scott",
    "email": "[email protected]",
    "gender": "MALE",
    "credit_amount": null,
    "date_of_birth": "2021-09-01",
    "address": "15 hemingway",
    "mobile": "+233235124963",
    "occupational_role": "1",
    "maximum_dependents_allowed": 1,
    "department": null,
    "health_programme_detail": null,
    "employee_tags": "23"
  },
  "message": "Tim has been signed up successfully!",
  "errors": null,
  "success": true
}

Update Corporate

This endpoint allows a corporate to update their company profile

URL: {{base_url}}/v1/corporates/onboard/<main_branch_id>
Method: PATCH

{
    "message": "account updated successfully",
    "successful": true,
    "returnedData": {
        "main_branch_id": "fd695ebb-5432-4e0d-9d59-5ac095638c0a",
        "uuid": "d7c7c91d-0958-4a2a-9130-868d330f876b",
        "created_at": "2021-09-08T08:58:51.376505Z",
        "is_deleted": false,
        "modified_at": "2021-09-08T08:58:51.376521Z",
        "company_name": "Madakoraa",
        "tin_number": 1104384138,
        "address": "Atonso",
        "admin_first_name": "Akwasi",
        "admin_last_name": "Oppong",
        "admin_email": "[email protected]",
        "admin_phoneno": "0540452046",
        "state": "verified",
        "authorizedBy": null,
        "user": 9
    }
}
{
    "company_name":"Jacksons ltd",
    "address":"adenta mill 7"
}

Login into corporate portal

This endpoint allows a corporate admin to login into corporate account

URL: {{base_url}}/v1/corporates/auth
Method : POST

{
    "admin_email": "[email protected]",
    "admin_password": "sO8SkHZZnmvlDtAvECJU"
}
{
    "message": "admin authenticated successfully",
    "successful": true,
    "returnedData": {
        "main_branch_id": 5,
        "uuid": "d7c7c91d-0958-4a2a-9130-868d330f876b",
        "created_at": "2021-09-08T08:58:51.376505Z",
        "is_deleted": false,
        "modified_at": "2021-09-08T08:58:51.376521Z",
        "company_name": "Madakoraa",
        "tin_number": 1104384138,
        "address": "",
        "admin_first_name": "Akwasi",
        "admin_last_name": "Oppong",
        "admin_email": "[email protected]",
        "admin_phoneno": "0540452046",
        "state": "verified",
        "authorizedBy": null,
        "user": 9,
        "token": {
            "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTYzMjIyNDMzMiwianRpIjoiMzU5MzQ5ZGEzZmY0NDk3YWJkYTM1Y2M4ZTEyZTVhNDIiLCJ1c2VyX2lkIjo5fQ.rmGGtf36hqF3PPeAUXgiKCgF8imzAgOecPGaUVksvpU",
            "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjMyMTM5NzMyLCJqdGkiOiI2ODk1YjcyMGNlZjI0OWIwYTVhYjExNDI4YmIzYWIyZCIsInVzZXJfaWQiOjl9.JGJEmdlI0O8hKQpF-dFlSGdheSaGkPrqxUr4GqcJRyc"
        }
    }
}

Add an employee

This endpoint allows a corporate to add a corporate employee

URL: {{base_url}}/v1/corporates/<main_branch_id>/employees
Method: POST

{
    "company_id": "fd695ebb-5432-4e0d-9d59-5ac095638c0a",
    "first_name": "Owura Kwaku",
    "last_name": "Acheampong",
    "date_of_birth": "2021-09-19",
    "address": "Adenta",
    "mobile": "0594520468",
    "email": "[email protected]",
    "gender": "male",
    "occupational_role": "Developer",
    "maximum_dependents_allowed": 3,
    "department": "",
    "tag": "",
    "employee_tags": "junior"
}
{
    "data": {
        "id": 32,
        "userId": 105,
        "patientId": "c2e0d596-1a08-11ec-8a4f-a3692d1809ac",
        "companyId": 5,
        "first_name": "Owura Kwaku",
        "last_name": "Acheampong",
        "email": "[email protected]",
        "gender": "male",
        "credit_amount": null,
        "date_of_birth": "2021-09-19",
        "address": "Adenta",
        "mobile": "0594520468",
        "occupational_role": "Developer",
        "maximum_dependents_allowed": 3,
        "department": "",
        "health_programme_detail": null,
        "employee_tags": "junior"
    },
    "message": "Owura Kwaku has been signed up successfully!",
    "errors": null,
    "success": true
}

Get all corporate employees

This endpoint allows you to view employees of a company from the corporate portal

URL: {{base_url}}/v1/corporates/<main_branch_id>/employees
Method: GET

{
    "message": "Employee list returned successfully",
    "successful": true,
    "returnedData": [
        {
            "id": 8,
            "userId": 9,
            "patientId": "90126102-7c60-4b71-9441-e20150a8bb54",
            "companyId": "fd695ebb-5432-4e0d-9d59-5ac095638c0a",
            "first_name": "Akwasi",
            "last_name": "Oppong",
            "email": "[email protected]",
            "gender": null,
            "credit_amount": null,
            "date_of_birth": null,
            "address": "",
            "mobile": "0540452046",
            "occupational_role": "Administrator",
            "maximum_dependents_allowed": null,
            "department": null,
            "health_programme_detail": null,
            "employee_tags": null,
            "prepaidAccountDetails": {
                "id": 8,
                "created_at": "2021-09-08T08:58:51.391509Z",
                "is_deleted": false,
                "modified_at": "2021-09-08T08:58:51.391527Z",
                "uuid": "acd74106-c3e1-4111-aacb-b9a300550330",
                "companyName": "Madakoraa",
                "amount": "0.00",
                "benefitingPatientId": "90126102-7c60-4b71-9441-e20150a8bb54",
                "linkedHealthPolicy": null,
                "state": "limited-active",
                "relationshipWithPrimaryUser": "self",
                "accountCreatedBy": "Akwasi Oppong",
                "maximum_dependents_allowed": null,
                "companyId": 5,
                "primaryUserId": 9,
                "employee": null
            }
        }
    ]
}

Update an employee

This endpoint allows a corporate to update the details of an employee

URL: <base_url>/corporates/<organization_id>/employees/<employee_uuid>

Method: PATCH

{
  "first_name": "jean Baptiste",
  "last_name": "Tuyizere",
  "other_names": "None",
  "gender": "MALE",
  "maximum_dependents_allowed": 0,
  "address": "none",
  "date_of_birth": "2000-01-01",
  "is_active": true
}
{
    "success": true,
    "message": "Successfully updated employee",
    "data": {
        "uuid": "b2743db2-a5e3-4b8b-af34-6a44c84d3217",
        "first_name": "Jean baptiste",
        "last_name": "Tuyizere",
        "other_names": "None",
        "companyId": "25c92ebe-30fd-4cc4-bfcf-5958b77bd7e6",
        "occupational_role": "none",
        "employee_tags": "",
        "gender": "MALE",
        "maximum_dependents_allowed": 0,
        "address": "none",
        "date_of_birth": "2000-01-01",
        "email": "...",
        "mobile": "...",
        "department": "",
        "credit_amount": 0.0,
        "health_programme_detail": null,
        "patientId": 14496,
        "userId": "b6180d80-d4c4-4765-8563-6b98515ba730",
        "health_policy": "Standard policy",
        "contribution_type": "COINSURANCE",
        "contribution_value": "15.00",
        "contribution_currency": "GHS",
        "out_of_pocket_limit_amount": "0.00",
        "out_of_pocket_limit_currency": "GHS",
        "deductible_amount": "0.00",
        "deductible_currency": "GHS",
        "annual_limit_amount": "0.00",
        "annual_limit_currency": "GHS",
        "card_no": "45678492",
        "policy_holder": "Jean Baptiste Tuyizere",
        "beneficiaries": [
            {
                "id": 14618,
                "uuid": "7d42d037-ebe8-4bbc-8e3d-09cd725d1ee6",
                "account": 14593,
                "patient": 14496,
                "relationship": "SELF",
                "first_name": null,
                "last_name": null,
                "policy_name": null,
                "contribution_type": "COPAY",
                "out_of_pocket_limit_currency": "GHS",
                "contribution_value": "0.00",
                "contribution_currency": "GHS",
                "birth_date": null,
                "card_no": null,
                "policy_holder": null,
                "period_start": null,
                "period_end": null,
                "gender": "UNKNOWN"
            }
        ],
        "is_active": true
    },
    "errors": null
}

Deposit into prepaid account

This endpoint allows a corporate to deposit money into the their employee prepaid account

URL: {{base_url}}/v1/users/prepaid-accounts/8/deposit
Method: POST

{
    "amount": 1000
}
{
    "message": "account deposited successfully ",
    "successful": true,
    "returnedData": {
        "id": 8,
        "created_at": "2021-09-08T08:58:51.391509Z",
        "is_deleted": false,
        "modified_at": "2021-09-08T08:58:51.391527Z",
        "uuid": "acd74106-c3e1-4111-aacb-b9a300550330",
        "companyName": "Madakoraa",
        "amount": "1000.00",
        "benefitingPatientId": "90126102-7c60-4b71-9441-e20150a8bb54",
        "linkedHealthPolicy": null,
        "state": "limited-active",
        "relationshipWithPrimaryUser": "self",
        "accountCreatedBy": "Akwasi Oppong",
        "maximum_dependents_allowed": null,
        "companyId": 5,
        "primaryUserId": 9,
        "employee": null
    }
}

Get all bills

This endpoint allows a corporate to get all bills

URL: {{base_url}}/v1/corporates/17/bills
Method: GET

{
    "message": "could not find any bills",
    "successful": false,
    "returnedData": []
}

Get total bill

This endpoint allows a corporate to get their total bills

URL: {{base_url}}/v1/corporates/17/bills/total
Method: GET

{
    "message": "Total bills generated successfully",
    "successful": true,
    "returnedData": {
        "total_bill": null
    }
}

Get activities

This endpoint allows a corporate to get all activities

URL: {{base_url}}/v1/corporates/17/activities
Method: GET

{
    "message": "could not find any activities",
    "successful": false,
    "returnedData": []
}

Get patient account of employee of a corporate

This fetches a patient account of an employee who belongs to a particular corporate.

URL: {{baseURL}}/v1/corporates/<corporate_id>/patient-accounts?owner={user_uuid}

Method: GET

{
    "success": true,
    "message": "Account retrieved successfully",
    "data": {
        "id": 31,
        "uuid": "6af11211-0b87-4e96-adee-97a7ae5d83e3",
        "status": "ACTIVE",
        "account_type": "corporate-user",
        "managing_organization": "59c9e42c-b561-419f-b042-88f3ea861b43",
        "currency": "GHS",
        "service_period_start": "2021-10-07T21:56:19.643516Z",
        "service_period_end": null,
        "balance": "900.00",
        "limit": "0.00",
        "owner": 3
    },
    "errors": null
}

Deposit into patient account of employees(new)

This allows corporate admins to deposit money into the patient accounts of corporate employees

URL: {{baseURL}}/v1/corporates/{corporate_id}/patient-accounts/{patient_account_id}/deposit

Method: POST

{
    "amount":450,
    "currency":"GHS",
    "reference":"Akos",
    "reference_type":"BANK_TRANSFER",
    "comment":"" 
}
{
    "success": true,
    "message": "Account credited successfully",
    "data": {
        "id": 31,
        "uuid": "6af11211-0b87-4e96-adee-97a7ae5d83e3",
        "status": "ACTIVE",
        "account_type": "corporate-user",
        "managing_organization": "59c9e42c-b561-419f-b042-88f3ea861b43",
        "currency": "GHS",
        "service_period_start": "2021-10-07T21:56:19.643516Z",
        "service_period_end": null,
        "balance": "900.00",
        "limit": "0.00",
        "owner": 3
    },
    "errors": null
}