API Reference
The Selva API provides a comprehensive set of endpoints for payment processing, account management, and webhook subscriptions.
Authentication is managed through the SELVA dashboard. For authenticated endpoints, include the bearer token issued for your environment in the Authorization header.
Interactive API Documentation
Explore all available endpoints, try requests, and view responses using our interactive API documentation powered by Scalar.
Open the interactive API Reference: /api-reference
The API reference is automatically generated from our OpenAPI specification and provides an interactive interface to explore all endpoints, view request/response schemas, and test API calls directly from your browser.
Endpoint Categories
Accounts
GET /api/accounts- List all accountsPOST /api/accounts- Create a new accountGET /api/accounts/{id}- Get account detailsGET /api/accounts/{id}/balance- Get account balance
Payments
POST /api/payments- Create a paymentPOST /api/payments/validate- Validate payment detailsGET /api/payments/history- Get payment historyGET /api/payments/{id}- Get payment by IDGET /api/payments/service-status- Check payment rail availability
Verification
GET /api/phone/information/{phone}- Get phone number informationGET /api/iban/information/{iban}- Get IBAN information
Webhooks
GET /api/webhooks/subscriptions- List webhook subscriptionsPOST /api/webhooks/subscriptions- Create webhook subscriptionGET /api/webhooks/subscriptions/{id}- Get webhook subscriptionDELETE /api/webhooks/subscriptions/{id}- Delete webhook subscriptionPOST /api/webhooks/subscriptions/{id}/suspend- Suspend webhook deliveryPOST /api/webhooks/subscriptions/{id}/resume- Resume webhook delivery
Request Format
All API requests use:
- Content-Type:
application/jsonfor POST requests - Authorization:
Bearer {access_token}header for authenticated requests - Idempotency: Include
X-Idempotency-Keyheader forPOST /api/payments
Response Format
All API responses use JSON format and include standard HTTP status codes:
200 OK- Request successful201 Created- Resource created successfully204 No Content- Request successful, no content to return400 Bad Request- Invalid request parameters401 Unauthorized- Invalid or missing authentication403 Forbidden- Insufficient permissions404 Not Found- Resource not found500 Internal Server Error- Server error503 Service Unavailable- Service temporarily unavailable
Rate Limits
API rate limits are applied per client and endpoint. Rate limit information is included in response headers:
X-RateLimit-Limit- Maximum number of requests allowedX-RateLimit-Remaining- Number of requests remainingX-RateLimit-Reset- Time when the rate limit resets
Pagination
List endpoints support pagination using page and per_page parameters:
GET /api/payments/history?page=1&per_page=20
Response includes pagination metadata:
{
"success": true,
"message": "Payment history retrieved successfully",
"data": []
}
Filtering and Sorting
Many list endpoints support filtering and sorting. See individual endpoint documentation for available options.
Error Handling
All errors follow a consistent format:
{
"success": false,
"message": "Human-readable error message",
"data": null,
"errors": {}
}
See the Error Handling guide for detailed error examples and handling strategies.
OpenAPI Specification
Download the complete OpenAPI 3.1 specification:
You can use this specification to:
- Generate client SDKs
- Import into API testing tools (Postman, Insomnia)
- Generate documentation
- Validate requests and responses
SDKs and Code Examples
While the API can be called directly, you may find these helpful:
- Postman Collection: Import for testing
- Code Examples: See Common Workflows for integration patterns
Support
For questions about specific endpoints:
- Check the interactive API documentation above
- Review Common Workflows for usage examples
- Contact support at support@selva.fi.cr