Authentication

API Key authentication for Kasi Collections API

Authentication

All endpoints require API Key authentication using the X-API-Key header.

API Key Header

Include your API key in every request:

X-API-Key: <your-api-key>

Example Request

curl -X POST https://api.kasipayments.co.za/v1/policies \
  -H "X-API-Key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "policy_number": "POL001",
    "customer_id": "CUST001",
    "external_customer_ref": "EXT123",
    "product_code": "FUNERAL_01",
    "collection_amount": 150.00
  }'

Getting Your API Key

To obtain your API credentials:

  1. Contact integrations@kasi.money
  2. Provide your organization details
  3. Receive your API key and base URL

Security Best Practices

  • Never commit API keys to version control
  • Use environment variables to store your API key
  • Rotate keys regularly for enhanced security
  • Keep keys confidential - treat them like passwords

Error Responses

If authentication fails, you'll receive a 401 Unauthorized response:

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key",
    "request_id": "req_abc123"
  }
}

Next Steps