Skip to content

Contracts API ​

Retrieve contract records for your business.

Contracts track agreements with customers, including start and end dates, value, and status. The Contracts API gives you read access to all contracts — useful for syncing contract data to external legal or CRM systems.

Read-Only

The Contracts API is read-only. Contracts are created and managed from the Cashfin dashboard.

Use Cases

  • Legal System Sync: Pull contract data into your document management system
  • Revenue Tracking: Monitor contracted revenue and renewal dates
  • CRM Integration: Correlate contracts with customer records in external systems

Endpoints ​

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

List Contracts ​

Retrieve a paginated list of contracts.

http
GET /business/contract/list

Query Parameters ​

ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger10Results per page (max: 100)
searchstring-Search by title, contract number, or description
statusstring-Filter by status: draft, sent, signed, active, expired, terminated
typestring-Filter by contract type

Example Request ​

bash
curl -X GET "https://api.cashfin.africa/business/contract/list?page=1&limit=10&status=active" \
  -H "Authorization: cs_your_client_secret"
javascript
const response = await fetch(
  "https://api.cashfin.africa/business/contract/list?page=1&limit=10&status=active",
  {
    headers: { Authorization: "cs_your_client_secret" },
  }
);
const data = await response.json();
python
import requests

response = requests.get(
    'https://api.cashfin.africa/business/contract/list',
    headers={'Authorization': 'cs_your_client_secret'},
    params={'page': 1, 'limit': 10, 'status': 'active'}
)

Success Response ​

json
{
  "success": true,
  "data": [
    {
      "_id": "507f1f77bcf86cd799439090",
      "contractno": "CON-2024-001",
      "title": "Annual Maintenance Agreement",
      "type": "maintenance",
      "status": "active",
      "amount": 120000.0,
      "starttime": "2024-01-01T00:00:00.000Z",
      "endtime": "2024-12-31T00:00:00.000Z",
      "createdat": "2024-01-01T08:00:00.000Z"
    }
  ],
  "pagination": {
    "total": 14,
    "page": 1,
    "limit": 10,
    "pages": 2
  }
}

Get Contract Details ​

Retrieve full details of a specific contract.

http
GET /business/contract/details/:id

Path Parameters ​

ParameterTypeRequiredDescription
idstringYesContract ID (MongoDB ObjectID)

Example Request ​

bash
curl -X GET "https://api.cashfin.africa/business/contract/details/507f1f77bcf86cd799439090" \
  -H "Authorization: cs_your_client_secret"
javascript
const contractId = "507f1f77bcf86cd799439090";

const response = await fetch(
  `https://api.cashfin.africa/business/contract/details/${contractId}`,
  {
    headers: { Authorization: "cs_your_client_secret" },
  }
);
const data = await response.json();
python
import requests

contract_id = '507f1f77bcf86cd799439090'

response = requests.get(
    f'https://api.cashfin.africa/business/contract/details/{contract_id}',
    headers={'Authorization': 'cs_your_client_secret'}
)

Success Response ​

json
{
  "success": true,
  "data": {
    "_id": "507f1f77bcf86cd799439090",
    "contractno": "CON-2024-001",
    "title": "Annual Maintenance Agreement",
    "description": "Monthly software maintenance and support services",
    "type": "maintenance",
    "status": "active",
    "amount": 120000.0,
    "starttime": "2024-01-01T00:00:00.000Z",
    "endtime": "2024-12-31T00:00:00.000Z",
    "billed": false,
    "items": [
      {
        "name": "Monthly Maintenance",
        "quantity": 12,
        "rate": 10000.0
      }
    ],
    "createdat": "2024-01-01T08:00:00.000Z",
    "updatedat": "2024-01-01T08:00:00.000Z"
  }
}

Contract Statuses ​

StatusDescription
draftContract created but not yet sent
sentSent to customer for review
signedContract signed by both parties
activeContract is currently active
expiredContract end date has passed
terminatedContract terminated early

Error Responses ​

Contract Not Found ​

json
{
  "success": false,
  "error": "Contract not found"
}

Cashfin Business API Documentation