Complete API documentation for payment processing
The Payment Gateway API allows you to create, verify, and manage payment transactions securely. All requests must be authenticated using your API key and originate from your registered domain.
https://edupay.edumindly.com/api
All API requests require authentication using your API key. The API key must be included in the request headers.
X-Payment-Api-Key: your_api_key_here Content-Type: application/json
The API is rate limited to ensure fair usage and system stability.
Creates a new payment instance and returns an invoice ID and payment URL.
{
"full_name": "John Doe",
"email": "[email protected]",
"phone": "+1234567890",
"amount": 100.50,
"redirect_url": "https://yourdomain.com/success",
"return_type": "GET",
"metadata": {
"order_id": "ORDER_123",
"product": "Premium Subscription"
}
}
| Field | Type | Required | Description |
|---|---|---|---|
| full_name | string | Yes | Customer's full name |
| string | No | Customer's email address | |
| phone | string | Yes | Customer's phone number |
| amount | number | Yes | Payment amount |
| redirect_url | string | No | URL to redirect after payment |
| return_type | string | No | HTTP method for redirect (GET|POST) |
| metadata | object | No | Additional data to store with payment |
{
"invoice_id": "INV_20241201_123456",
"payment_url": "https://yourdomain.com/payment/PAY_20241201_123456"
}
Retrieves the current status and details of a payment using the invoice ID.
{
"invoice_id": "INV_20241201_123456"
}
| Field | Type | Required | Description |
|---|---|---|---|
| invoice_id | string | Yes | The invoice ID returned from payment creation |
{
"status": true,
"message": "payment retrieved successfully",
"data": {
"id": 1,
"invoice_id": "INV_20241201_123456",
"payment_id": "PAY_20241201_123456",
"full_name": "John Doe",
"email": "[email protected]",
"phone": "+1234567890",
"amount": 100.50,
"status": "created",
"redirect_url": "https://yourdomain.com/success",
"return_type": "GET",
"metadata": {
"order_id": "ORDER_123",
"product": "Premium Subscription"
},
"created_at": "2024-12-01T10:30:00Z",
"updated_at": "2024-12-01T10:30:00Z"
}
}
Updates the status of an existing payment. Only specific status transitions are allowed.
{
"invoice_id": "INV_20241201_123456",
"status": "completed"
}
| Field | Type | Required | Description |
|---|---|---|---|
| invoice_id | string | Yes | The invoice ID to update |
| status | string | Yes | New status (completed|failed|cancelled) |
{
"status": true,
"message": "payment status updated successfully"
}
{
"status": false,
"message": "invoice not found on this brand"
}
The API uses conventional HTTP response codes to indicate the success or failure of an API request.
| Code | Description | Common Causes |
|---|---|---|
| 200 | OK | Request successful |
| 400 | Bad Request | Invalid request data or missing required fields |
| 401 | Unauthorized | Missing/invalid API key, inactive brand, or domain mismatch |
| 404 | Not Found | Invoice not found or doesn't belong to your brand |
| 422 | Unprocessable Entity | Validation errors in request data |
| 429 | Too Many Requests | Rate limit exceeded (100 requests/minute) |
| 500 | Internal Server Error | Server error - contact support if persistent |
{
"message": "Api key is required",
"errors": {
"field_name": ["Validation error message"]
}
}