Customer Management
Manage customers and their plans with these live provider API operations.
GET /customers
Fetch customers for a provider.
Inputs
| Location | Field | Type | Required |
|---|---|---|---|
| query | start | string | No |
| query | end | string | No |
| query | query | string | No |
| query | page | integer | No |
Example
GET https://dispensaryapi.famasi.africa/api/v1/providers/customers?start={value}&end={value}&query={value}&page={value}Returns 200 with these fields in data:
| Field | Type |
|---|---|
id | string |
first_name | string |
last_name | string |
phone_number | string |
dial_code | string |
address | string |
sex | string |
created_at | string |
POST /customers
Create a new customer/patient for a provider.
Inputs
| Location | Field | Type | Required |
|---|---|---|---|
| body | dial_code | string | Yes |
| body | phone_number | string | Yes |
| body | first_name | string | Yes |
| body | last_name | string | Yes |
| body | address | string | Yes |
| body | address_line | string | Yes |
| body | email | string | Yes |
| body | sex | string | No |
| body | status | string | Yes |
Example
POST https://dispensaryapi.famasi.africa/api/v1/providers/customersReturns 200 with these fields in data:
| Field | Type |
|---|---|
id | string |
first_name | string |
last_name | string |
phone_number | string |
dial_code | string |
address | string |
sex | string |
created_at | string |
PUT /customers/{unique_customer_id}
Edit a customer in the provider’s organization.
Inputs
| Location | Field | Type | Required |
|---|---|---|---|
| path | unique_customer_id | string | Yes |
| body | dial_code | string | No |
| body | phone_number | string | No |
| body | first_name | string | No |
| body | last_name | string | No |
| body | address | string | No |
| body | sex | string | No |
Example
PUT https://dispensaryapi.famasi.africa/api/v1/providers/customers/{unique_customer_id}?unique_customer_id={value}Returns 200 with these fields in data:
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the customer |
first_name | string | First name of the customer |
last_name | string | Last name of the customer |
email | string | Email of the customer |
phone_number | string | Phone number of the customer |
dial_code | string | Dial code of the customer |
role | string | Role of the customer (e.g., PATIENT, PROVIDER) |
is_verified | boolean | Indicates if the customer’s account is verified |
is_active | boolean | Indicates if the customer’s account is active |
address | string | Address of the customer |
coordinates | list of number | Geographical coordinates of the customer’s location |
date_of_birth | string | Date of birth of the customer |
avatar | string | URL of the customer’s avatar image |
avatar_mime_type | string | MIME type of the avatar file |
wallet_balance | number | Current balance in the customer’s wallet |
virtual_account_number | string | Virtual account number for the customer |
virtual_bank_name | string | Name of the virtual bank associated with the customer |
paystack_customer_code | string | Paystack customer code for payment integration |
external_id | string | External ID for third-party integrations |
status | string | Status of the customer (e.g., active, inactive) |
sex | string | Gender of the customer |
provider_id | string | ID of the provider associated with the customer |
branch_id | string | ID of the branch associated with the customer |
purchases | integer | Total number of purchases made by the customer |
created_at | string | Timestamp when the customer was created |
updated_at | string | Timestamp when the customer was last updated |
Errors: 400 invalid request data, 500 server error.
GET /view-customer/{customer_id}
View details of a specific customer/patient.
Inputs
| Location | Field | Type | Required |
|---|---|---|---|
| path | customer_id | string | Yes |
Example
GET https://dispensaryapi.famasi.africa/api/v1/providers/view-customer/{customer_id}?customer_id={value}Returns 200 with these fields:
| Field | Type |
|---|---|
customer | object |
Errors: 404 customer not found, 500 internal server error.
POST /customers/{unique_customer_id}/plans
Add a customer to a plan.
Inputs
| Location | Field | Type | Required |
|---|---|---|---|
| path | unique_customer_id | string | Yes |
| body | name | string | Yes |
| body | schedule | string | Yes |
| body | plan_id | string | Yes |
| body | type | string | Yes |
| body | state_code | string | Yes |
Example
POST https://dispensaryapi.famasi.africa/api/v1/providers/customers/{unique_customer_id}/plans?unique_customer_id={value}Returns 201 with these fields in data:
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the plan |
name | string | Name of the plan |
created_at | string | Timestamp when the plan was created |
updated_at | string | Timestamp when the plan was last updated |
start_date | string | Start date of the plan |
next_date | string | Next scheduled date for the plan |
amount | number | Total amount of the plan |
discount | number | Discount applied to the plan |
schedule | string | Frequency of the plan (e.g., day, week, month) |
meta | object | Additional metadata about the plan |
user | object | User-related information for the plan |
main_plan_id | string | ID of the main plan this plan is associated with |
is_active | boolean | Indicates if the plan is active |
type | string | Type of the plan (e.g., one-off, recurring) |
patient_id | string | ID of the patient associated with the plan |
provider_id | string | ID of the provider associated with the plan |
debits | integer | Number of debits made for the plan |
expected_debits | integer | Expected number of debits for the plan |
quantity | integer | Quantity of items in the plan |
state | object | State information related to the plan |
items | list of object | List of items in the plan |
auto_debit | boolean | Indicates if auto-debit is enabled for the plan |
recipient | string | Recipient of the plan (default: self) |
customer_id | string | ID of the customer associated with the plan |
user_first_name | string | First name of the user associated with the plan |
user_last_name | string | Last name of the user associated with the plan |
user_email | string | Email of the user associated with the plan |
user_phone_number | string | Phone number of the user associated with the plan |
user_dial_code | string | Dial code of the user associated with the plan |
user_address | string | Address of the user associated with the plan |
user_coordinates | list of number | Geographical coordinates of the user’s location |
caregiver_first_name | string | First name of the caregiver (if applicable) |
caregiver_last_name | string | Last name of the caregiver (if applicable) |
caregiver_email | string | Email of the caregiver (if applicable) |
caregiver_phone_number | string | Phone number of the caregiver (if applicable) |
caregiver_dial_code | string | Dial code of the caregiver (if applicable) |
Errors: 400 invalid request data, 500 server error.
GET /plans
Fetch plans for a provider.
Returns 200 with these fields in data:
| Field | Type |
|---|---|
id | string |
name | string |
description | string |
currency | string |
starting_price | number |
published | boolean |
created_time | string |
Authentication
Send a provider API key as x-api-key. Provider API keys →