Skip to content

Customer Management

Manage customers and their plans with these live provider API operations.

GET /customers

Fetch customers for a provider.

Inputs

LocationFieldTypeRequired
querystartstringNo
queryendstringNo
queryquerystringNo
querypageintegerNo

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:

FieldType
idstring
first_namestring
last_namestring
phone_numberstring
dial_codestring
addressstring
sexstring
created_atstring

POST /customers

Create a new customer/patient for a provider.

Inputs

LocationFieldTypeRequired
bodydial_codestringYes
bodyphone_numberstringYes
bodyfirst_namestringYes
bodylast_namestringYes
bodyaddressstringYes
bodyaddress_linestringYes
bodyemailstringYes
bodysexstringNo
bodystatusstringYes

Example

POST https://dispensaryapi.famasi.africa/api/v1/providers/customers

Returns 200 with these fields in data:

FieldType
idstring
first_namestring
last_namestring
phone_numberstring
dial_codestring
addressstring
sexstring
created_atstring

PUT /customers/{unique_customer_id}

Edit a customer in the provider’s organization.

Inputs

LocationFieldTypeRequired
pathunique_customer_idstringYes
bodydial_codestringNo
bodyphone_numberstringNo
bodyfirst_namestringNo
bodylast_namestringNo
bodyaddressstringNo
bodysexstringNo

Example

PUT https://dispensaryapi.famasi.africa/api/v1/providers/customers/{unique_customer_id}?unique_customer_id={value}

Returns 200 with these fields in data:

FieldTypeDescription
idstringUnique identifier for the customer
first_namestringFirst name of the customer
last_namestringLast name of the customer
emailstringEmail of the customer
phone_numberstringPhone number of the customer
dial_codestringDial code of the customer
rolestringRole of the customer (e.g., PATIENT, PROVIDER)
is_verifiedbooleanIndicates if the customer’s account is verified
is_activebooleanIndicates if the customer’s account is active
addressstringAddress of the customer
coordinateslist of numberGeographical coordinates of the customer’s location
date_of_birthstringDate of birth of the customer
avatarstringURL of the customer’s avatar image
avatar_mime_typestringMIME type of the avatar file
wallet_balancenumberCurrent balance in the customer’s wallet
virtual_account_numberstringVirtual account number for the customer
virtual_bank_namestringName of the virtual bank associated with the customer
paystack_customer_codestringPaystack customer code for payment integration
external_idstringExternal ID for third-party integrations
statusstringStatus of the customer (e.g., active, inactive)
sexstringGender of the customer
provider_idstringID of the provider associated with the customer
branch_idstringID of the branch associated with the customer
purchasesintegerTotal number of purchases made by the customer
created_atstringTimestamp when the customer was created
updated_atstringTimestamp 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

LocationFieldTypeRequired
pathcustomer_idstringYes

Example

GET https://dispensaryapi.famasi.africa/api/v1/providers/view-customer/{customer_id}?customer_id={value}

Returns 200 with these fields:

FieldType
customerobject

Errors: 404 customer not found, 500 internal server error.

POST /customers/{unique_customer_id}/plans

Add a customer to a plan.

Inputs

LocationFieldTypeRequired
pathunique_customer_idstringYes
bodynamestringYes
bodyschedulestringYes
bodyplan_idstringYes
bodytypestringYes
bodystate_codestringYes

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:

FieldTypeDescription
idstringUnique identifier for the plan
namestringName of the plan
created_atstringTimestamp when the plan was created
updated_atstringTimestamp when the plan was last updated
start_datestringStart date of the plan
next_datestringNext scheduled date for the plan
amountnumberTotal amount of the plan
discountnumberDiscount applied to the plan
schedulestringFrequency of the plan (e.g., day, week, month)
metaobjectAdditional metadata about the plan
userobjectUser-related information for the plan
main_plan_idstringID of the main plan this plan is associated with
is_activebooleanIndicates if the plan is active
typestringType of the plan (e.g., one-off, recurring)
patient_idstringID of the patient associated with the plan
provider_idstringID of the provider associated with the plan
debitsintegerNumber of debits made for the plan
expected_debitsintegerExpected number of debits for the plan
quantityintegerQuantity of items in the plan
stateobjectState information related to the plan
itemslist of objectList of items in the plan
auto_debitbooleanIndicates if auto-debit is enabled for the plan
recipientstringRecipient of the plan (default: self)
customer_idstringID of the customer associated with the plan
user_first_namestringFirst name of the user associated with the plan
user_last_namestringLast name of the user associated with the plan
user_emailstringEmail of the user associated with the plan
user_phone_numberstringPhone number of the user associated with the plan
user_dial_codestringDial code of the user associated with the plan
user_addressstringAddress of the user associated with the plan
user_coordinateslist of numberGeographical coordinates of the user’s location
caregiver_first_namestringFirst name of the caregiver (if applicable)
caregiver_last_namestringLast name of the caregiver (if applicable)
caregiver_emailstringEmail of the caregiver (if applicable)
caregiver_phone_numberstringPhone number of the caregiver (if applicable)
caregiver_dial_codestringDial 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:

FieldType
idstring
namestring
descriptionstring
currencystring
starting_pricenumber
publishedboolean
created_timestring

Authentication

Send a provider API key as x-api-key. Provider API keys →