API Reference
Complete REST API documentation for CasPay
Base URL
https://caspay.link/api/v1
Authentication
All API requests require authentication using your API key in the Authorization header:
Authorization: Bearer your_api_key
Endpoints
Payments
POST
/payments
Create a new payment request
{ "productId": "prod_123", "amount": 100, "currency": "CSPR", "customerEmail": "customer@example.com" }
GET
/payments/:id
Retrieve payment details by ID
GET
/payments
List all payments with pagination
Subscriptions
POST
/subscriptions
Create a new subscription
{ "planId": "plan_123", "customerWallet": "0x...", "startDate": "2024-01-01" }
DELETE
/subscriptions/:id
Cancel an active subscription
Webhooks
POST
/webhooks
Register a webhook endpoint
{ "url": "https://yourdomain.com/webhook", "events": ["payment.completed", "subscription.created"] }
Response Codes
| Code | Description |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request |
401 | Unauthorized |
404 | Not Found |
500 | Internal Server Error |