API Reference

This pages talks about the various accounts used by corporate

Add corporate

This endpoint allows a provider to add a corporate at the provider portal

URL: {{base_url}}/v1/providers/b6c0cc80-c5fd-4430-805c-e3591ec9b3cf/clients
Method: POST

{
    "company_name": "Baradep",
    "tin_number": "782345790",
    "address": "Adenta",
    "admin_first_name": "Akosua",
    "admin_last_name": "Amponsah",
    "admin_phoneno": "+233549802569",
    "admin_email": "[email protected]",
    "authorizedBy": "Paa kwasi  Oppong"
}
{
    "message": "corporate signed up successfully",
    "successful": true,
    "returnedData": {
        "company_name": "Baradep",
        "tin_number": "782345790",
        "address": "Adenta",
        "admin_first_name": "Akosua",
        "admin_last_name": "Amponsah",
        "admin_phoneno": "+233549802569",
        "admin_email": "[email protected]",
        "authorizedBy": "Paa kwasi  Oppong",
        "main_branch_id": 22,
        "provider_client_account": {
            "id": 19,
            "uuid": "f1e1123f-03d4-4dc1-89cd-41f1364a02f8",
            "created_at": "2021-09-20T12:46:29.769728Z",
            "is_deleted": false,
            "modified_at": "2021-09-20T12:46:29.769746Z",
            "companyName": "Baradep",
            "amount": "0.00",
            "creditDurationInDays": null,
            "creditStartDate": "2021-09-20T12:46:29.769644Z",
            "state": "limited-debit-active",
            "authorizedBy": "Paa kwasi  Oppong",
            "maximum_employees_allowed": null,
            "providerId": "b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
            "providerDetails": "b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
            "companyId": 22,
            "company": 22
        }
    }
}

Get all corporate

This endpoint allows a provider to get all corporate clients at the provider portal

URL: {{base_url}}/v1/providers/clients/
Method: GET

{
    "message": "All corporates found",
    "successful": true,
    "returnedData": [
       
        {
            "main_branch_id": 2,
            "uuid": "45aacf6c-6683-459f-bbf1-17c32fbc06af",
            "created_at": "2021-08-31T11:29:54.127130Z",
            "is_deleted": false,
            "modified_at": "2021-08-31T11:29:54.127149Z",
            "company_name": "Azubs",
            "tin_number": 1234532123,
            "address": "Accra",
            "admin_first_name": "Kenpong",
            "admin_last_name": "Asare",
            "admin_email": "[email protected]",
            "admin_phoneno": "+233240345678",
            "state": "verified",
            "authorizedBy": "Paa kwasi  Oppong",
            "user": null
        },
        {
            "main_branch_id": 1,
            "uuid": "fdac8876-8762-4708-b803-dce6b9090d6f",
            "created_at": "2021-08-25T11:17:57.689570Z",
            "is_deleted": false,
            "modified_at": "2021-08-25T11:17:57.689587Z",
            "company_name": "Stanbic bank",
            "tin_number": 9876543,
            "address": "Stanbic Heights, Airport City",
            "admin_first_name": "Joe",
            "admin_last_name": "Asamoah",
            "admin_email": "[email protected]",
            "admin_phoneno": "+233262258796",
            "state": "verified",
            "authorizedBy": "Chris Dare",
            "user": null
        }
    ]
}

Verify corporate client

This endpoint allows a provider to verify a corporate client

URL: {{base_url}}/v1/corporates/onboard/21
Method: PATCH

{
    "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": "verified",
    "authorizedBy": null,
    "user": 104
}
{
    "message": "account updated 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": "verified",
        "authorizedBy": null,
        "user": 104
    }
}

Suspend corporate client

This endpoint allows a provider to suspend a corporate client

URL: {{base_url}}/v1/corporates/onboard/21
Method: PATCH

{
    "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": "suspended",
    "authorizedBy": null,
    "user": 104
}
{
    "message": "account updated 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": "suspended",
        "authorizedBy": null,
        "user": 104
    }
}

Create provider client account

This endpoint allows a provider to create a corporate client account when a corporate is created from the corporate portal.

URL: {{base_url}}/v1/providers/b6c0cc80-c5fd-4430-805c-e3591ec9b3cf/client-accounts
Method: POST

{
    "amount": 0,
    "creditDurationInDays": 45,
    "creditStartDate": "2021-09-13T00:00:00.000Z",
    "companyId": 20,
    "authorizedBy": "Paa kwasi  Oppong",
    "maximum_employees_allowed": "12"
}
{
    "message": "account created successfully",
    "successful": true,
    "returnedData": {
        "id": 20,
        "uuid": "916b9ab7-a958-44b5-bef1-151d0779fa49",
        "created_at": "2021-09-20T13:11:20.760893Z",
        "is_deleted": false,
        "modified_at": "2021-09-20T13:11:20.760907Z",
        "companyName": null,
        "amount": "0.00",
        "creditDurationInDays": 45,
        "creditStartDate": "2021-09-13T00:00:00Z",
        "state": "limited-debit-active",
        "authorizedBy": "Paa kwasi  Oppong",
        "maximum_employees_allowed": 12,
        "providerId": "b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
        "providerDetails": "b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
        "companyId": 20,
        "company": 20
    }
}

Create patient client account

This endpoint allows a provider to create a patient account.

URL: {{base_url}}/v1/providers/b6c0cc80-c5fd-4430-805c-e3591ec9b3cf/patient-accounts
Method: POST

{
   "owner":"5847a6f2-dc50-4935-b796-098aa07fa791"
}
{
    "message":"Account created successfully",
    "success": True,
    "errors":"",  
    "data": {
        "id":"1",
        "uuid":"5847a6f2-dc50-4935-b796-098aa07fa791",
        "status":"CLOSED",
        "account_type":"corporate-client-account",
        "managing_organization":"b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
        "currency":"GHS",
        "service_period_start":"2021-09-17T10:50:26.747617Z",
        "service_period_end":"2021-09-17T10:50:26.747617Z",
        "balance":56.00,
        "limit":70.00,
        "owner":"5847a6f2-dc50-4935-b796-098aa07fa791"
      }
}

Deposit into provider client account

This endpoint allows a provider to deposit money into their provider client account.

URL: {{base_url}}/v1/providers/client-accounts/deposit

value-set for wallet reference types: {{baseURL}}/v1//valueset/user-wallet-reference-type

Method: POST

{
    "amount": 500,
    "accountId": 20,
    "creditDurationInDays": 45,
    "creditStartDate": "2021-09-13T00:00:00.000Z",
    "depositType": "limited-debit-active",
    "companyId": 20,
    "depositedBy": "Paa kwasi  Oppong",
    "maximum_employees_allowed": 12
}
{
    "message": "account deposited successfully ",
    "successful": true,
    "returnedData": {
        "id": 20,
        "uuid": "916b9ab7-a958-44b5-bef1-151d0779fa49",
        "created_at": "2021-09-20T13:11:20.760893Z",
        "is_deleted": false,
        "modified_at": "2021-09-20T13:11:20.760907Z",
        "companyName": null,
        "amount": "500.00",
        "creditDurationInDays": 45,
        "creditStartDate": "2021-09-13T00:00:00Z",
        "state": "limited-debit-active",
        "authorizedBy": "Paa kwasi  Oppong",
        "maximum_employees_allowed": 12,
        "providerId": "b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
        "providerDetails": "b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
        "companyId": 20,
        "company": 20
    }
}

View transactions

This endpoint allows a provider to view transactions of corporate clients.

URL: {{base_url}}/v1/providers/b6c0cc80-c5fd-4430-805c-e3591ec9b3cf/corporates/18/transactions?page=1&page_size=10
Method: GET

{
    "meta": {
        "current": "1",
        "page_size_query": "10",
        "next": null,
        "previous": null,
        "page_size": 1,
        "total": 1
    },
    "results": [
        {
            "companyDetails": {
                "companyName": "Yoda Ltd",
                "location": "adenta"
            },
            "providerDetails": {
                "name": "Nyaho Medical",
                "contact_no": "+233-(0)30-708-6490"
            },
            "patientDetails": null,
            "transactionData": {
                "id": 41,
                "uuid": "5847a6f2-dc50-4935-b796-098aa07fa791",
                "created_at": "2021-09-17T10:50:26.747599Z",
                "is_deleted": false,
                "modified_at": "2021-09-17T10:50:26.747617Z",
                "transaction_type": "deposit",
                "amount": "1000.00",
                "providerId": "b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
                "companyId": 18,
                "patient": null,
                "billId": null
            }
        }
    ]
}

Creating client account(new)

This endpoint allows a provider to create a client account for corporates created directly from the corporate portal.

URL: {{base_url}}/v1/providers/b6c0cc80-c5fd-4430-805c-e3591ec9b3cf/client-accounts

Method: POST

{
   "owner":"5847a6f2-dc50-4935-b796-098aa07fa791"
}
{
    "message":"Account created successfully",
    "success": True,
    "errors":"",  
    "data": {
        "id":"1",
        "uuid":"5847a6f2-dc50-4935-b796-098aa07fa791",
        "status":"CLOSED",
        "account_type":"corporate-client-account",
        "managing_organization":"b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
        "currency":"GHS",
        "service_period_start":"2021-09-17T10:50:26.747617Z",
        "service_period_end":"2021-09-17T10:50:26.747617Z",
        "balance":56.00,
        "limit":70.00,
        "owner":"5847a6f2-dc50-4935-b796-098aa07fa791"
      }
}

Get client account by company(new)

This endpoint allows a provider to get client accounts by company/owner or managing organisation.

URL: {{base_url}}/v1/providers/b6c0cc80-c5fd-4430-805c-e3591ec9b3cf/client-accounts

Method: GET

Filter fields:

  1. status
  2. managing_organization
  3. owner
  4. currency
  5. account_type
{
    "message":"Account retrieved successfully",
    "success": True,
    "errors":"",  
    "data": [{
        "id":"1",
        "uuid":"5847a6f2-dc50-4935-b796-098aa07fa791",
        "status":"CLOSED",
        "account_type":"corporate-client-account",
        "managing_organization":"b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
        "currency":"GHS",
        "service_period_start":"2021-09-17T10:50:26.747617Z",
        "service_period_end":"2021-09-17T10:50:26.747617Z",
        "balance":56.00,
        "limit":70.00,
        "owner":"fd695ebb-5432-4e0d-9d59-5ac095638c0a"
        
        
      }]
}

Verify company(new)

This endpoint allows a provider to verify a corporate's client account

URL: {{base_url}}/v1/providers/{{provider_id}}/client-accounts/{{client_id}}/actions

Method: POST

{
	"action":"VERIFY"
}
{
    "message":"Company verified successfully",
    "success": True,
    "errors":"",  
    "data": {
        "id":"1",
        "uuid":"5847a6f2-dc50-4935-b796-098aa07fa791",
        "status":"ACTIVE",
        "account_type":"corporate-client-account",
        "managing_organization":"b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
        "currency":"GHS",
        "service_period_start":"2021-09-17T10:50:26.747617Z",
        "service_period_end":"2021-09-17T10:50:26.747617Z",
        "balance":56.00,
        "limit":70.00,
        "owner":"5847a6f2-dc50-4935-b796-098aa07fa791"
      }
}

Suspend company(new)

This endpoint allows a provider to suspend a corporate's client account

URL: {{base_url}}/v1/providers/{{provider_id}}/client-accounts/{{client_id}}/actions

Method: POST

{
	"action":"SUSPEND"
}
{
    "message":"Company suspended successfully",
    "success": True,
    "errors":"",
    "data": {
        "id":"1",
        "uuid":"5847a6f2-dc50-4935-b796-098aa07fa791",
        "status":"SUSPENDED",
        "account_type":"corporate-client-account",
        "managing_organization":"b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
        "currency":"GHS",
        "service_period_start":"2021-09-17T10:50:26.747617Z",
        "service_period_end":"2021-09-17T10:50:26.747617Z",
        "balance":56.00,
        "limit":70.00,
        "owner":"5847a6f2-dc50-4935-b796-098aa07fa791"
      }
}

Close company(new)

This endpoint allows a provider to close a corporate's client account

URL: {{base_url}}/v1/providers/{{provider_id}}/client-accounts/{{client_id}}/actions

Method: POST

{
	"action":"CLOSE"
}
{
    "message":"Company closed successfully",
    "success": True,
    "errors":"",  
    "data": {
        "id":"1",
        "uuid":"5847a6f2-dc50-4935-b796-098aa07fa791",
        "status":"CLOSED",
        "account_type":"corporate-client-account",
        "managing_organization":"b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
        "currency":"GHS",
        "service_period_start":"2021-09-17T10:50:26.747617Z",
        "service_period_end":"2021-09-17T10:50:26.747617Z",
        "balance":56.00,
        "limit":70.00,
        "owner":"5847a6f2-dc50-4935-b796-098aa07fa791"
      }
}

Deposit into account

This endpoint allows a provider to record a deposit into a client account.

URL: {{base_url}}/v1/providers/{{provider_id}}/client-accounts/{{client_id}}/actions

Method: POST

{
    "action":"DEPOSIT",
    "amount":450,
    "currency":"GHS",
    "reference":"Akos",
    "reference_type":"BANK_TRANSFER",
    "comment":"" 
}
{
    "message":"Deposit successful",
    "success": True,
    "errors":"",
    "data": {
        "id":"1",
        "uuid":"5847a6f2-dc50-4935-b796-098aa07fa791",
        "status":"ACTIVE",
        "account_type":"corporate-client-account",
        "managing_organization":"b6c0cc80-c5fd-4430-805c-e3591ec9b3cf",
        "currency":"GHS",
        "service_period_start":"2021-09-17T10:50:26.747617Z",
        "service_period_end":"2021-09-17T10:50:26.747617Z",
        "balance":56.00,
        "limit":70.00,
        "owner":"5847a6f2-dc50-4935-b796-098aa07fa791"
      }
}

View clients at provider

Allows providers to view corporates.

URL: {{baseURL}}/v1/providers/59c9e42c-b561-419f-b042-88f3ea861b43/clients

Method: GET

{
    "message": "corporate retrieved successfully",
    "successful": true,
    "returnedData": [
        {
            "main_branch_id": "abe50894-b288-4554-8ed4-dd1b2e38b9f1",
            "uuid": "aad9c9b3-8c9f-4ba7-9058-01ee632932d5",
            "created_at": "2021-09-23T10:04:54.453593Z",
            "is_deleted": false,
            "modified_at": "2021-09-23T10:04:54.453609Z",
            "company_name": "Chris ventures Ltd",
            "tin_number": null,
            "address": "adenta",
            "admin_first_name": "Chris",
            "admin_last_name": "Dare",
            "admin_email": "[email protected]",
            "admin_phoneno": "233545465909",
            "authorizedBy": null,
            "user": 28
        },]

Get Corporate info

All a corporate to get their info(company profile)

URL: v1/providers/59c9e42c-b561-419f-b042-88f3ea861b43/clients/<client_id>

Method: GET

{
    "success": true,
    "message": "Successfully retrieved manageable organization",
    "data": {
        "main_branch_id": "8a4a929e-981c-424a-98e9-042702b9ab48",
        "uuid": "b6dd667d-b84a-47b0-b662-b66af5b4963a",
        "created_at": "2021-09-28T14:26:32.126607Z",
        "is_deleted": false,
        "modified_at": "2021-09-28T14:26:32.126636Z",
        "company_name": "Sheldon ltd",
        "tin_number": null,
        "address": "adenta",
        "admin_first_name": "Akosua",
        "admin_last_name": "Jackson",
        "admin_email": "[email protected]",
        "admin_phoneno": "2335495065299",
        "authorizedBy": "[email protected]",
        "user": 39
    },
    "errors": null
}