This document provides an overview of the APIs available in the api.php file. These APIs allow interaction with the system for account management, payouts, transactions, promo codes, and reporting.
Fetches the balance of the current user's account.
Example Response:
{
"user": 100.50
}
Returns the ledger for a specific account.
Submits a payout request for the current user.
Request Body:
{
"account_type": "user",
"amount": 50.00
}
Example Response:
{
"status": "pending",
"message": "Payout request submitted."
}
Fetches the payout history for the current user.
Submits a refund request for a specific ticket.
Request Body:
{
"ticket_id": "12345",
"reason": "Event canceled"
}
Example Response:
{
"status": "requested",
"message": "Refund submitted."
}
Lists all promo codes created by the current user.
Fetches usage records for a specific promo code.
Query Parameter:
?code=CODE123
Fetches all transactions for the current user.
Creates a new transaction for a ticket sale.
Request Body:
{
"ticket_id": "12345",
"event_id": "67890",
"amount": 100.00,
"promo_code": "PROMO123",
"ref_1_id": 1,
"ref_1_desc": "Reference 1 Description",
"ref_2_id": 2,
"ref_2_desc": "Reference 2 Description"
}
Example Response:
{
"transaction_id": "98765",
"message": "Transaction created successfully."
}
Approves a payout request.
Request Body:
{
"external_reference": "BANK123"
}
Rejects a payout request with a reason.
Request Body:
{
"reason": "Insufficient funds"
}
Marks a payout request as paid.
Request Body:
{
"payment_reference": "PAY123"
}
The API uses RESTful principles. Each endpoint corresponds to a specific functionality, and the HTTP method determines the action:
All requests require authentication via a token. Ensure the token is included in the request headers.
If an error occurs, the API returns a JSON response with an error message and a corresponding HTTP status code.
Example Error Response:
{
"error": "Unauthorized"
}