π§βπ» Create User Endpoint
The Create User API allows a cashier or manager to create a new player account under their shop. It validates all input fields, ensures username uniqueness, and automatically configures the player with inherited shop settings (limits, currency, menu, etc.).
βΉοΈ Description
- Creates a new account under the current cashier or manager.
- Automatically applies the shopβs configuration (currency, limits, menu, etc.).
Endpoint
POST https://proapi.gapi.lol/api/cashier/create
Authentication
This endpoint requires authentication using a valid Bearer token in the request header:
Authorization: Bearer <your_token>
Accept: application/json
Request Body
Send the following fields as JSON in the body of the request:
{
"name": "Player One",
"username": "player001",
"password": "123456"
}
nameβ required, string, maximum 100 characters.usernameβ required, unique, alphanumeric (AβZ, 0β9, underscore, dash, or dot only).
Regex:/^[A-Za-z0-9_.-]+$/passwordβ required, minimum 6 characters.
Successful Response
Returns a confirmation and details of the newly created player:
{
"success": true,
"message": "User created successfully",
"data": {
"id": 3211,
"email": "player001",
"role": "user"
}
}
Example Request (cURL)
curl -X POST "https://proapi.gapi.lol/api/cashier/create" \
-H "Authorization: Bearer <your_token>" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Player One",
"username": "player001",
"password": "123456"
}'
Error Responses
401 Unauthorized β Wrong username or password:
{
"success": false,
"message": "Please login via API token"
}
403 Forbidden β Account suspended or disabled:
{
"success": false,
"message": "Account suspended"
}
429 Too Many Requests β Rate limit exceeded:
{
"success": false,
"message": "Too many attempts. Try again later."
}
500 Internal Server Error β Server-side issue:
{
"success": false,
"message": "Unexpected server error"
}