This documentation explains how to integrate with the Go4Bill API. All requests and responses are in JSON format.
https://apitest.go4billapp.com/public/api
Endpoint
/register
Creates a new user account and sends an email verification code (OTP).
| Field | Type | Required | Description |
|---|---|---|---|
| first_name | String | Yes | User's first name. |
| last_name | String | Yes | User's last name. |
| phone | String | Yes | Unique phone number. |
| country | String | Yes | User's country. |
| Yes | Unique email address. | ||
| password | String | Yes | Minimum of 8 characters. |
| password_confirmation | String | Yes | Must match password. |
{
"first_name":"latifat",
"last_name":"mella",
"phone":"07064365473",
"country":"Nigeria",
"email":"oyegbemiledamola@gmail.com",
"password":"password123",
"password_confirmation":"password123"
}
{
"status": true,
"message":"Registration successful. Please check your email for the verification code."
}
Endpoint
/admin/login
Authenticates an administrator and returns an access token upon successful login. The returned token should be included in the Authorization header when accessing protected admin endpoints.
| Field | Type | Required | Description |
|---|---|---|---|
| Yes | Administrator email address. | ||
| password | String | Yes | Administrator password. |
{
"email":"marketadmin@go4bill.com",
"password":"password123"
}
{
"status": true,
"message": "Login successful.",
"token": "1|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"user": {
"id": 1,
"first_name": "Market",
"last_name": "Admin",
"email": "marketadmin@go4bill.com",
"role": "admin"
}
}
Endpoint
/login
Authenticates a registered user and returns an access token that can be used to access protected user endpoints.
| Field | Type | Required | Description |
|---|---|---|---|
| Yes | Registered email address. | ||
| password | String | Yes | User password. |
{
"email":"user@example.com",
"password":"password123"
}
{
"status": true,
"message": "Login successful.",
"token": "2|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"user": {
"id": 3,
"first_name": "Latifat",
"last_name": "Mella",
"email": "user@example.com"
}
}
Endpoint
/admin/users?search=yas
Searches users by name, email or phone number.
| Name | Description |
|---|---|
| search | Keyword to search. |
GET /admin/users?search=yas
Endpoint
/update-card-unique-code
Links an RFID/NFC card to an existing user account. Each card can only belong to one user.
| Field | Type | Required | Description |
|---|---|---|---|
| user_id | Integer | Yes | User ID. |
| card_unique_code | String | Yes | Unique RFID/NFC Card Number. |
{
"user_id":3,
"card_unique_code":"12345675441234567890"
}
{
"status": true,
"message":"Card unique code updated successfully.",
"data":{
"user_id":3,
"card_unique_code":"12345675441234567890"
}
}
Endpoint
/scanner/access
This endpoint scans a user's RFID/NFC card before allowing entry into the market. The system automatically determines whether the user is:
{
"card_unique_code":"12345675441234567890"
}
{
"status":true,
"message":"OPEN",
"data":{
"user_id":3,
"name":"Latifat Mella",
"role":"visitor",
"amount_deducted":50,
"balance":950
}
}
Endpoint
/gate/exit
This endpoint records the user's exit from the market. The system updates the user's last active gate entry and records the exit time.
{
"card_unique_code":"12345675441234567890"
}
{
"status":true,
"message":"Exit recorded successfully."
}