Skip to content

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 ​

MethodEndpointDescription
POST/business/customer/createCreate a new customer
GET/business/customer/listGet list of customers
GET/business/customer/details/:idGet customer details
PATCH/business/customer/update/:idUpdate 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 ​

bash
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 ​

json
{
  "success": true,
  "message": "Customer created successfully",
  "data": {
    "_id": "507f1f77bcf86cd799439011",
    "name": "John Doe",
    "email": "[email protected]",
    "phone": "+254712345678"
  }
}

Customer Types ​

TypeDescription
individualPersonal customer
businessBusiness/corporate customer

Use Cases ​

E-commerce Customer Sync ​

Sync customers from your e-commerce platform:

javascript
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:

javascript
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 ​

MethodEndpointDescription
POST/business/lead/createCreate a new lead
GET/business/lead/listGet 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 ​

MethodEndpointDescription
POST/business/contact/createCreate a new contact
GET/business/contact/listList all contacts
GET/business/contact/details/:idGet contact details

Quotes ​

The Quotes API gives you read access to sales proposals created for customers.

Available Endpoints ​

MethodEndpointDescription
GET/business/quote/listList all quotes
GET/business/quote/details/:idGet 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 ​

MethodEndpointDescription
GET/business/contract/listList all contracts
GET/business/contract/details/:idGet contract details

Bookings ​

The Bookings API gives you read access to scheduled sessions and meeting records.

Available Endpoints ​

MethodEndpointDescription
GET/business/booking/listList all bookings
GET/business/booking/details/:idGet 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 ​

MethodEndpointDescription
GET/business/appointment/listList all appointment types
GET/business/appointment/details/:idGet 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

Cashfin Business API Documentation