CaliPay Docs

Development Guide

Complete technical documentation for developers working with CaliPay platform - API references, integration guides, and best practices.

Quick Reference

API Reference

REST API endpoints

Authentication

JWT & API keys

SDKs & Libraries

Client libraries

Webhooks

Event notifications

API Documentation

REST API Overview
Core

CaliPay provides a comprehensive REST API for managing associations, members, invoices, and payments.

Base URL

https://api.calipay.in/v1

Authentication

  • JWT Bearer tokens for user sessions
  • API keys for server-to-server communication
  • OAuth 2.0 for third-party integrations
  • Rate limiting: 1000 requests/hour

Response Format

  • JSON format for all responses
  • Consistent error handling
  • Pagination for list endpoints
  • HTTP status codes

Core API Endpoints

Association Management

GET /associationsList all associations
POST /associationsCreate new association
GET /associations/{id}Get association details
PATCH /associations/{id}Update association

Member Management

GET /membersList association members
POST /membersAdd new member
GET /members/{id}Get member details
PATCH /members/{id}Update member information

Invoice & Payment APIs

GET /invoicesList invoices
POST /invoicesCreate invoice
POST /paymentsProcess payment
GET /payments/{id}Get payment status

Authentication & Security

JWT Authentication
Required

CaliPay uses JWT tokens for authentication. Obtain tokens through the login endpoint and include them in API requests.

# Login to get JWT token

curl -X POST https://api.calipay.in/v1/auth/login \

-H "Content-Type: application/json" \

-d '{"phone": "+919876543210", "otp": "123456"}'

# Use token in subsequent requests

curl -X GET https://api.calipay.in/v1/associations \

-H "Authorization: Bearer YOUR_JWT_TOKEN"

Security Best Practices

  • Store tokens securely (never in localStorage for sensitive apps)
  • Implement token refresh logic for long-running applications
  • Use HTTPS for all API communications
  • Validate and sanitize all input parameters
  • Implement proper error handling without exposing sensitive data

API Keys & Rate Limiting

API Key Usage

  • Server-to-server communications
  • Webhook signature verification
  • Administrative operations
  • Bulk data operations

Rate Limits

  • 1000 requests per hour per API key
  • 100 requests per minute per IP
  • 429 status code when limit exceeded
  • Rate limit headers in responses

Integration Guides

Payment Gateway Integration
Razorpay

CaliPay integrates with Razorpay for payment processing. Follow these steps for custom payment implementations.

Payment Flow

  1. Create payment intent via CaliPay API
  2. Initialize Razorpay checkout with returned payment ID
  3. Handle payment success/failure callbacks
  4. Verify payment signature for security
  5. Update payment status via webhook or polling

# Create payment intent

curl -X POST https://api.calipay.in/v1/payments/intent \

-H "Authorization: Bearer JWT_TOKEN" \

-H "Content-Type: application/json" \

-d '{"invoice_id": "inv_123", "amount": 5000}'

Webhook Integration

Set up webhooks to receive real-time notifications about payment status, member updates, and other important events.

Supported Events

  • payment.completed
  • payment.failed
  • invoice.created
  • member.registered
  • member.updated

Webhook Security

  • HMAC signature verification
  • Timestamp validation
  • Idempotency handling
  • Retry mechanism

Development Environment

Local Development Setup

Prerequisites

  • Node.js 18+ and npm/yarn
  • Git for version control
  • Docker (optional, for local database)
  • VS Code or preferred IDE
  • Postman or similar API testing tool

# Clone the repository

git clone https://github.com/calipay/calipay-platform.git

cd calipay-platform

# Install dependencies

npm install

# Set up environment variables

cp .env.example .env.local

# Start development server

npm run dev

Database Schema & Migrations

CaliPay uses PostgreSQL with Prisma ORM for database operations. Follow migration best practices for schema changes.

Core Tables

  • associations: RWA/community information
  • users: Member and admin user accounts
  • properties: Property hierarchy and details
  • invoices: Billing and invoice records
  • payments: Payment transactions and status
  • notifications: System and user notifications

Testing & Deployment

Testing Strategy

  • Unit Tests: Jest for component and utility testing
  • Integration Tests: API endpoint testing with Supertest
  • E2E Tests: Playwright for user journey testing
  • Load Testing: Artillery for performance testing
  • Security Testing: OWASP ZAP for vulnerability scanning

Deployment Pipeline

  • CI/CD: GitHub Actions for automated deployment
  • Environments: Development, Staging, Production
  • Infrastructure: Docker containers on AWS/GCP
  • Monitoring: DataDog/New Relic for observability
  • Rollback: Blue-green deployment strategy

SDKs & Client Libraries

Official SDKs

JavaScript/TypeScript

npm install @calipay/sdk

Python

pip install calipay-python

PHP

composer require calipay/php-sdk

SDK Features:

  • Automatic authentication handling and token refresh
  • Type-safe API methods with full TypeScript support
  • Built-in error handling and retry mechanisms
  • Webhook signature verification utilities
  • Comprehensive documentation and examples

Developer Support

API Reference

Complete API documentation with examples and response schemas.

View API Docs →

GitHub Repository

Access source code, report issues, and contribute to the project.

View on GitHub →

Developer Community

Join our Discord community for developer support and discussions.

Join Discord →