CRM API Overview
The CRM API allows you to manage customer relationships programmatically.
Build lasting customer relationships with comprehensive profile management. The CRM module integrates seamlessly with orders, invoices, and subscriptions to provide a complete view of each customer's journey with your business.
What You Can Build
- Customer Portals: Create and manage customer accounts
- Marketing Platforms: Segment customers for targeted campaigns
- Support Systems: Access customer history for better support
- Analytics Dashboards: Track customer lifetime value and engagement
Customers
The Customers API allows you to create and manage customer records.
Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /business/customer/create | Create a new customer |
GET | /business/customer/list | Get list of customers |
GET | /business/customer/details/:id | Get customer details |
PATCH | /business/customer/update/:id | Update a customer |
Customer Data
Customers in Cashfin can include:
- Contact information (name, email, phone)
- Address details
- Payment methods
- Associated orders and transactions
Quick Example
Create a Customer
curl -X POST "https://api.cashfin.africa/business/customer/create" \
-H "Authorization: cs_your_client_secret" \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "[email protected]",
"phone": "+254712345678",
"country": "Kenya",
"currency": "KES"
}'Response
{
"success": true,
"message": "Customer created successfully",
"data": {
"_id": "507f1f77bcf86cd799439011",
"name": "John Doe",
"email": "[email protected]",
"phone": "+254712345678"
}
}Customer Types
| Type | Description |
|---|---|
individual | Personal customer |
business | Business/corporate customer |
Use Cases
E-commerce Customer Sync
Sync customers from your e-commerce platform:
async function syncCustomer(externalCustomer) {
const response = await fetch(
"https://api.cashfin.africa/business/customer/create",
{
method: "POST",
headers: {
Authorization: API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: externalCustomer.fullName,
email: externalCustomer.email,
phone: externalCustomer.phone,
country: externalCustomer.country,
currency: "KES",
type: externalCustomer.isCompany ? "business" : "individual",
}),
}
);
return response.json();
}Customer-First Order Creation
Create customer before order:
async function createOrderWithCustomer(orderData, customerData) {
// 1. Create or find customer
const customerResponse = await fetch(
"https://api.cashfin.africa/business/customer/create",
{
method: "POST",
headers: {
Authorization: API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify(customerData),
}
);
const { data: customer } = await customerResponse.json();
// 2. Create order with customer ID
const orderResponse = await fetch(
"https://api.cashfin.africa/business/order/checkout",
{
method: "POST",
headers: {
Authorization: API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
...orderData,
customeremail: customer.email,
}),
}
);
return orderResponse.json();
}Leads
The Leads API allows you to capture and manage prospective customers before they convert.
Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /business/lead/create | Create a new lead |
GET | /business/lead/list | Get list of leads |
Lead Data
Leads in Cashfin can include:
- Contact and company information
- Lead source and status tracking
- Budget and request details
- Pipeline stage management
Contacts
The Contacts API lets you create and manage a general-purpose business contact directory — team members, clients, or anyone you interact with.
Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /business/contact/create | Create a new contact |
GET | /business/contact/list | List all contacts |
GET | /business/contact/details/:id | Get contact details |
Quotes
The Quotes API gives you read access to sales proposals created for customers.
Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /business/quote/list | List all quotes |
GET | /business/quote/details/:id | Get quote details |
Contracts
The Contracts API gives you read access to contract records — agreements with customers including start/end dates, value, and status.
Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /business/contract/list | List all contracts |
GET | /business/contract/details/:id | Get contract details |
Bookings
The Bookings API gives you read access to scheduled sessions and meeting records.
Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /business/booking/list | List all bookings |
GET | /business/booking/details/:id | Get booking details |
Appointments
The Appointments API gives you read access to appointment type definitions — bookable service types with availability schedules and booking statistics.
Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /business/appointment/list | List all appointment types |
GET | /business/appointment/details/:id | Get appointment type details |
Next Steps
- Customers - Full customer management API reference
- Contacts - General-purpose contact directory
- Leads - Full lead management API reference
- Quotes - Read quote and proposal data
- Contracts - Read contract records
- Bookings - Read booking and scheduling records
- Appointments - Read appointment type definitions