Endpoints

Reports

Export collection results for reconciliation

Reports Resource

Export collection results in CSV or JSON format for reconciliation and reporting.

Endpoints

  • GET /reports/collections - Export collection results

Export Collection Results

Export collection results for a specific period.

Endpoint: GET /reports/collections

Query Parameters:

  • period_month (required) - Format: YYYY-MM
  • format (optional) - Values: csv, json (default: csv)

Request:

GET /reports/collections?period_month=2025-11&format=csv

CSV Response (13 required fields):

period_month,customer_id,external_customer_ref,policy_number,product_code,collection_amount_due,collection_amount_collected,shortfall,collection_status,first_attempt_date,last_attempt_date,number_of_attempts,last_failure_reason
2025-11,CUST001,EXT123,POL001,FUNERAL_01,150.00,150.00,0.00,PAID_FULL,2025-11-05,2025-11-05,1,
2025-11,CUST002,EXT124,POL002,FUNERAL_01,200.00,150.00,50.00,PAID_PARTIAL,2025-11-05,2025-11-28,3,INSUFFICIENT_FUNDS

JSON Response:

{
  "period_month": "2025-11",
  "results": [
    {
      "period_month": "2025-11",
      "customer_id": "CUST001",
      "external_customer_ref": "EXT123",
      "policy_number": "POL001",
      "product_code": "FUNERAL_01",
      "collection_amount_due": 150.00,
      "collection_amount_collected": 150.00,
      "shortfall": 0.00,
      "collection_status": "PAID_FULL",
      "first_attempt_date": "2025-11-05",
      "last_attempt_date": "2025-11-05",
      "number_of_attempts": 1,
      "last_failure_reason": null
    }
  ]
}

Use Case: End-of-month reconciliation and reporting
Agreement Reference: Section 5.2a

CSV Fields

All 13 required fields are included in the CSV export:

#FieldDescription
1period_monthCollection period (YYYY-MM)
2customer_idInternal customer identifier
3external_customer_refYour customer reference
4policy_numberPolicy identifier
5product_codeProduct identifier
6collection_amount_duePremium amount due
7collection_amount_collectedAmount successfully collected
8shortfallUncollected amount
9collection_statusPAID_FULL / PAID_PARTIAL / UNPAID / CANCELLED
10first_attempt_dateDate of first collection attempt
11last_attempt_dateDate of most recent attempt
12number_of_attemptsTotal attempts made
13last_failure_reasonReason for last failure (if any)

Example Usage

# Export CSV for November 2025
curl "https://api.kasipayments.co.za/v1/reports/collections?period_month=2025-11&format=csv" \
  -H "X-API-Key: your-key" \
  -o november-collections.csv

# Export JSON for November 2025
curl "https://api.kasipayments.co.za/v1/reports/collections?period_month=2025-11&format=json" \
  -H "X-API-Key: your-key" \
  -o november-collections.json