Getting Started

Welcome to KPEI API documentation. Follow these steps to get started:

1. Create an Account

Sign up for a KPEI API account to get your API keys and access to our services.

2. Get Your API Keys

Once registered, you'll receive:

  • API Key: Your unique identifier
  • Secret Key: For authentication
  • Environment: Sandbox or Production

3. Make Your First API Call

Use the following sample code to make your first API call:

curl -X POST https://kpei-stg.api.bawana.com/v1/payment/initiate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "amount": 1000,
    "currency": "USD",
    "description": "Test payment"
  }'

Authentication

KPEI API uses OAuth 2.0 Bearer tokens for authentication. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

For security, all API requests must be made over HTTPS.

Payment API

Initiate Payment

Endpoint: POST /v1/payment/initiate

Request Parameters

Parameter Type Required Description
amount decimal Yes Payment amount
currency string Yes 3-letter currency code
description string Yes Payment description

Response Example

{
  "status": "success",
  "data": {
    "transaction_id": "txn_123456789",
    "payment_url": "https://pay.kpei-stg.api.bawana.com/txn_123456789",
    "expires_at": "2023-12-31T23:59:59Z"
  }
}

Data Exchange API

Send Data

Endpoint: POST /v1/data/send

This endpoint allows you to send data to be synchronized with other systems.

Request Parameters

Parameter Type Required Description
data_type string Yes Type of data being sent
payload object Yes Data payload
webhook_url string No URL for webhook notifications

Identity Verification API

Verify Identity

Endpoint: POST /v1/identity/verify

Verify user identity using various methods including document verification and biometric authentication.

Request Parameters

Parameter Type Required Description
verification_type string Yes Type of verification (document, biometric)
user_data object Yes User information for verification

Error Codes

Code Message Description
200 Success Request completed successfully
400 Bad Request Invalid request parameters
401 Unauthorized Invalid or missing API key
403 Forbidden Access denied
404 Not Found Resource not found
500 Internal Server Error Server error occurred