Provider API (1.0.0)

Download OpenAPI specification:

API for managing providers, including creation, authentication, token management, analytics, orders, and user management

Authentication

Endpoints for authentication and token management

Fetch the authenticated provider's details

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Refresh the provider's API token

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Provider Management

Endpoints for managing providers

Create a new provider

Request Body schema: application/json
required
name
required
string >= 2 characters
state
required
string >= 2 characters
lga
required
string >= 2 characters
address
required
string >= 2 characters
phone_number
required
string >= 2 characters
dial_code
required
string >= 2 characters
staff_first_name
required
string >= 2 characters
staff_last_name
required
string >= 2 characters
staff_phone_number
required
string >= 2 characters
staff_dial_code
required
string >= 2 characters
staff_email
required
string <email>
password
string >= 2 characters
preferred_payment_type
string

Responses

Request samples

Content type
application/json
{
  • "name": "HealthCorp",
  • "state": "California",
  • "lga": "Los Angeles",
  • "address": "123 Health St",
  • "phone_number": "1234567890",
  • "dial_code": "+1",
  • "staff_first_name": "John",
  • "staff_last_name": "Doe",
  • "staff_phone_number": "0987654321",
  • "staff_dial_code": "+1",
  • "staff_email": "[email protected]",
  • "password": "securepassword123",
  • "preferred_payment_type": "credit_card"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Fetch a list of states

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": [
    ]
}

Create a provider using CRM data

Request Body schema: application/json
required
Account_Name
required
string
Shipping_State
required
string
Organisation_LGA
required
string
Shipping_Street
required
string
Phone
required
string

Responses

Request samples

Content type
application/json
{
  • "Account_Name": "string",
  • "Shipping_State": "string",
  • "Organisation_LGA": "string",
  • "Shipping_Street": "string",
  • "Phone": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Fetch a provider

Request Body schema: application/json
required
provider_id
required
string

Responses

Request samples

Content type
application/json
{
  • "provider_id": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Fetch formulary products for a provider

Authorizations:
ApiKeyAuth
query Parameters
search
string

Search string for filtering products

page
integer

Page number for pagination

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Request a new API access key for a provider

path Parameters
providerId
required
string

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Update the preferred payment type for a provider

path Parameters
providerId
required
string
Request Body schema: application/json
required
preferred_payment_type
string

Responses

Request samples

Content type
application/json
{
  • "preferred_payment_type": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Verify and approve provider access

Request Body schema: application/json
required
provider_id
string

Responses

Request samples

Content type
application/json
{
  • "provider_id": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "result": {
    }
}

Set the low wallet balance threshold for a provider

path Parameters
providerId
required
string
Request Body schema: application/json
required
threshold
number

Responses

Request samples

Content type
application/json
{
  • "threshold": 0
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string"
}

Toggle auto-debit functionality for a provider

path Parameters
providerId
required
string
Request Body schema: application/json
required
enable
boolean

Responses

Request samples

Content type
application/json
{
  • "enable": true
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string"
}

Add a virtual account for a provider

path Parameters
providerId
required
string

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Edit provider information

Authorizations:
authMiddle
Request Body schema: application/json
required
phone_number
string >= 2 characters
first_name
string >= 2 characters
last_name
string >= 2 characters
name
string >= 5 characters
address
string >= 6 characters
email
string <email>

Responses

Request samples

Content type
application/json
{
  • "phone_number": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "name": "string",
  • "address": "string",
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "edited_provider": {
    }
}

Analytics

Endpoints for fetching analytics data

Fetch analytics data for a provider

Authorizations:
ApiKeyAuth
query Parameters
timePeriod
required
string
Enum: "week" "month" "quarter"

Time period for analytics (week, month, quarter)

Responses

Response samples

Content type
application/json
{
  • "totalValue": 0,
  • "averageValue": 0,
  • "totalOrders": 0,
  • "percentageIncrease": "string"
}

Fetch analytics data for provider orders

Authorizations:
ApiKeyAuth
query Parameters
startDate
required
string <date-time>

Start date for the analytics period

endDate
required
string <date-time>

End date for the analytics period

providerId
required
string

Provider ID for which analytics are fetched

is_test
boolean

Whether the provider is a test provider

Responses

Response samples

Content type
application/json
{
  • "totalValue": 0,
  • "averageValue": 0,
  • "totalOrders": 0,
  • "percentageIncrease": "string"
}

Fetch statistics for provider orders

Authorizations:
ApiKeyAuth
query Parameters
start
string <date-time>

Start date for filtering orders

end
string <date-time>

End date for filtering orders

query
string

Search query for filtering orders

page
integer

Page number for pagination

Responses

Response samples

Content type
application/json
{
  • "totalOrders": 0,
  • "totalOrderValue": 0,
  • "totalCancelled": 0,
  • "totalCompleted": 0,
  • "totalPending": 0,
  • "averageOrderValue": 0
}

Customer Management

Endpoints for managing customers

Fetch customers for a provider

Authorizations:
None
query Parameters
start
string

Start date for filtering

end
string

End date for filtering

query
string

Search query

page
integer
Default: 1

Page number

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": [
    ]
}

Edit a customer in the provider's organization

Authorizations:
ApiKeyAuth
path Parameters
unique_customer_id
required
string

Unique ID of the customer to edit

Request Body schema: application/json
required
dial_code
string >= 2 characters
phone_number
string >= 2 characters
first_name
string >= 2 characters
last_name
string >= 2 characters
address
string >= 2 characters
sex
string >= 2 characters

Responses

Request samples

Content type
application/json
{
  • "dial_code": "string",
  • "phone_number": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "address": "string",
  • "sex": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Create a new customer/patient for a provider

Authorizations:
authMiddle
Request Body schema: application/json
required
first_name
required
string >= 2 characters
last_name
required
string >= 2 characters
dial_code
required
string >= 2 characters
phone_number
required
string >= 2 characters
email
required
string <email>
address
string
date_of_birth
string
status
string
Enum: "active" "inactive" "pending"
avatar_url
string
avatar_mime_type
string

Responses

Request samples

Content type
application/json
{
  • "first_name": "string",
  • "last_name": "string",
  • "dial_code": "string",
  • "phone_number": "string",
  • "email": "[email protected]",
  • "address": "string",
  • "date_of_birth": "string",
  • "status": "active",
  • "avatar_url": "string",
  • "avatar_mime_type": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

View details of a specific customer/patient

Authorizations:
authMiddle
path Parameters
customer_id
required
string

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "customer": {
    }
}

Get all customers/patients for a provider

Authorizations:
authMiddle
query Parameters
page
integer
Default: 1
limit
integer
Default: 10

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Plan Management

Endpoints for managing customer plans

Fetch plans for a provider

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": [
    ]
}

Add a customer to a plan

Authorizations:
ApiKeyAuth
path Parameters
unique_customer_id
required
string

Unique ID of the customer

Request Body schema: application/json
required
name
required
string >= 2 characters
schedule
required
string
Enum: "day" "year" "week" "month" "quarter"
plan_id
required
string non-empty
type
required
string
Enum: "one_off" "recurring"
state_code
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "schedule": "day",
  • "plan_id": "string",
  • "type": "one_off",
  • "state_code": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Order Management

Endpoints for managing customer orders

Create a formulary order for a customer

Authorizations:
ApiKeyAuth
path Parameters
unique_customer_id
required
string

Unique ID of the customer

Request Body schema: application/json
required
state_code
required
string
address
required
string
prescription
string
prescription_mime_type
string
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "state_code": "string",
  • "address": "string",
  • "prescription": "string",
  • "prescription_mime_type": "string",
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Create an order for a customer's plan

Authorizations:
ApiKeyAuth
path Parameters
unique_customer_id
required
string

Unique ID of the customer

unique_plan_id
required
string

Unique ID of the plan

Request Body schema: application/json
required
state_code
required
string
address
required
string

Responses

Request samples

Content type
application/json
{
  • "state_code": "string",
  • "address": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Fetch orders for a customer's plan

Authorizations:
ApiKeyAuth
path Parameters
unique_customer_id
required
string

Unique ID of the customer

unique_plan_id
required
string

Unique ID of the plan

query Parameters
start
string <date-time>

Start date for filtering orders

end
string <date-time>

End date for filtering orders

query
string

Search query for filtering orders

page
integer

Page number for pagination

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": [
    ]
}

Update the status of a customer's order

Authorizations:
ApiKeyAuth
path Parameters
unique_customer_id
required
string

Unique ID of the customer

unique_plan_id
required
string

Unique ID of the plan

unique_order_id
required
string

Unique ID of the order

Request Body schema: application/json
required
status
required
string
Value: "SUCCESS"

Responses

Request samples

Content type
application/json
{
  • "status": "SUCCESS"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Fetch all orders for a provider

Authorizations:
None
query Parameters
status
string
page
integer
Default: 1
limit
integer
Default: 10

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": [
    ],
  • "pagination": {
    }
}

Create a new order for a provider

Authorizations:
None
Request Body schema: application/json
required
delivery_fee
required
number
required
Array of objects
patient
required
string
user_first_name
string
user_last_name
string
user_email
string <email>
user_phone_number
string
delivery_type
string
additional_notes
string

Responses

Request samples

Content type
application/json
{
  • "delivery_fee": 0,
  • "items": [
    ],
  • "patient": "string",
  • "user_first_name": "string",
  • "user_last_name": "string",
  • "user_email": "[email protected]",
  • "user_phone_number": "string",
  • "delivery_type": "string",
  • "additional_notes": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "order": {
    }
}

Wallet Management

Endpoints for managing Provider wallet

Fetch the wallet balance of a provider

path Parameters
providerId
required
string

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Add funds to the provider's wallet

path Parameters
providerId
required
string
Request Body schema: application/json
required
amount
required
number
source
required
string
description
string

Responses

Request samples

Content type
application/json
{
  • "amount": 0,
  • "source": "string",
  • "description": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Deduct funds from the provider's wallet

path Parameters
providerId
required
string
Request Body schema: application/json
required
amount
required
number
source
required
string
description
string

Responses

Request samples

Content type
application/json
{
  • "amount": 0,
  • "source": "string",
  • "description": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Transaction Management

Endpoints for managing Provider transactions

Process a bank transfer

Request Body schema: application/json
required
userId
required
string
userType
required
string
Enum: "BRANCH" "PROVIDER"
name
required
string
accountNumber
required
string
bankCode
required
string
amount
required
number
reason
required
string

Responses

Request samples

Content type
application/json
{
  • "userId": "string",
  • "userType": "BRANCH",
  • "name": "string",
  • "accountNumber": "string",
  • "bankCode": "string",
  • "amount": 0,
  • "reason": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": {
    }
}

Fetch the transaction history of a provider

path Parameters
providerId
required
string

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "data": [
    ]
}

User Management

Endpoints for managing provider users

Add a user to a provider

Authorizations:
ApiKeyAuth
Request Body schema: application/json
required
first_name
required
string >= 2 characters
last_name
required
string >= 2 characters
dial_code
required
string >= 2 characters
phone_number
required
string >= 2 characters
email
required
string <email>
role
required
string >= 2 characters
password
string >= 2 characters
is_admin
required
boolean

Responses

Request samples

Content type
application/json
{
  • "first_name": "string",
  • "last_name": "string",
  • "dial_code": "string",
  • "phone_number": "string",
  • "email": "[email protected]",
  • "role": "string",
  • "password": "string",
  • "is_admin": true
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "email": "string",
  • "phone_number": "string",
  • "dial_code": "string",
  • "role": "string",
  • "is_admin": true,
  • "is_active": true
}

Fetch user profiles

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": [
    ]
}

Add a customer to a provider

Authorizations:
None
Request Body schema: application/json
required
dial_code
required
string >= 2 characters
phone_number
required
string >= 2 characters
first_name
required
string >= 2 characters
last_name
required
string >= 2 characters
address
required
string >= 2 characters
sex
required
string >= 2 characters

Responses

Request samples

Content type
application/json
{
  • "dial_code": "string",
  • "phone_number": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "address": "string",
  • "sex": "string"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}