API
Integrations
API
This documentation covers the RESTful API endpoints for managing customers in the system. All endpoints are protected by ApiClientMiddleware and require proper authentication.
Create a secret key
To get started, create a secret key to authenticate your API requests.
Use https://api.truebeep.com/v1 as the base URL for all TrueBeep API requests.
Create Customer
Creates a new customer record.
{
"success": true,
"data": {
"id": "e8c43l37t1zayx8t66t5xbg9",
"firstName": "John",
"lastName": "Doe",
"phone": "+177566302",
"points": 15
}
}
| Field | Type | Description |
|---|---|---|
firstName(Required) | string | This field is required |
lastName(Required) | string | This field is required |
phone(Conditional) | string | Min 10 digits |
email(Conditional) | string | Valid email |
username(Optional) | string | Optional |
Conditional fields indicate that at least one of the marked fields is required. For this endpoint, you must provide either phone or email (or both) along with the required fields.
Bulk Create Customers
Create multiple customer records in a single request.
[
{
"id": "uuid",
"firstName": "John",
"lastName": "Doe",
"phone": "1234567890",
"email": "john.doe@example.com"
},
{
"id": "uuid2",
"firstName": "Sam",
"lastName": "Smith",
"phone": "9876543210",
"email": "sam.smith@example.com"
}
]
| Field | Type | Description |
|---|---|---|
firstName(Required) | string | This field is required |
lastName(Required) | string | This field is required |
phone(Conditional) | string | Min 10 digits |
email(Conditional) | string | Valid email |
username(Optional) | string | Optional |
Conditional fields indicate that at least one of the marked fields is required. For this endpoint, you must provide either phone or email (or both) along with the required fields.
Update Customer
Update customer information.
{
"id": "uuid",
"firstName": "Walter",
"lastName": "White",
"phone": "+1234567890"
}
Get Customer
Retrieve customer information by ID.
{
"id": "uuid",
"firstName": "John",
"lastName": "Doe",
"phone": "1234567890",
"email": "john.doe@example.com",
"points": "100"
}
Update Customer QR Points
Update customer points using a QR code scan.
{
"success": true,
"data": {
"id": "jv3cstlguhr2e91oihi0bfsx",
"firstName": "John",
"lastName": "Doe",
"points": 2
}
}
| Field | Type | Description |
|---|---|---|
code(Required) | string | This field is required |
couponId(Required) | string | This field is required |
Update Customer Loyalty Points
Update a customer's loyalty points.
{
"id": "l7817f8lbdqn18pok75x2mnm",
"firstName": "John",
"lastName": "Doe",
"email": "john@gmail.com",
"points": 10
}
| Field | Type | Description |
|---|---|---|
points(Required) | number | This field is required |
type(Required) | increment or decrement | This field is required |