API Overview
Base URL
KingsPay provides two API environments for merchants:
| Environment | Base URL |
|---|---|
| Production | https://merchant-api.kingspay.id |
| Sandbox | https://sandbox-merchant-api.kingspay.id/ |
All API endpoints follow the format: {baseUrl}/api/v1/{resource}/{action}
Authentication
API authentication details will be provided by KingsPay to registered merchants. Typically, requests require headers such as Authorization (Bearer token or API Key) and Content-Type: application/json.
Request & Response Format
- Content-Type:
application/json - Response: All responses return JSON with the structure:
status(boolean): Request success statusmessage(string): Descriptive messagelogId(string): Unique ID for tracking/debuggingdata(object, optional): Response data (only on success)
HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Request processed successfully |
| 400 | Bad Request — Validation failed or invalid parameters |
| 401 | Unauthorized — Authentication failed |
| 404 | Not Found — Resource not found |
| 500 | Internal Server Error — Server error |