Skip to main content

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.

POST/customer

Create Customer

Creates a new customer record.

Example Responses:
{
"success": true,
"data": {
"id": "e8c43l37t1zayx8t66t5xbg9",
"firstName": "John",
"lastName": "Doe",
"phone": "+177566302",
"points": 15
}
}
Parameters:
FieldTypeDescription
firstName(Required)
stringThis field is required
lastName(Required)
stringThis field is required
phone(Conditional)
stringMin 10 digits
email(Conditional)
stringValid email
username(Optional)
stringOptional
info

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.

POST/customers

Bulk Create Customers

Create multiple customer records in a single request.

Example Responses:
[
{
"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"
}
]
Parameters:
FieldTypeDescription
firstName(Required)
stringThis field is required
lastName(Required)
stringThis field is required
phone(Conditional)
stringMin 10 digits
email(Conditional)
stringValid email
username(Optional)
stringOptional
info

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.

PUT/customer/:customerId

Update Customer

Update customer information.

Example Responses:
{
"id": "uuid",
"firstName": "Walter",
"lastName": "White",
"phone": "+1234567890"
}
GET/customer/:customerId

Get Customer

Retrieve customer information by ID.

Example Responses:
{
"id": "uuid",
"firstName": "John",
"lastName": "Doe",
"phone": "1234567890",
"email": "john.doe@example.com",
"points": "100"
}
POST/customer/:customerId/qr

Update Customer QR Points

Update customer points using a QR code scan.

Example Responses:
{
"success": true,
"data": {
"id": "jv3cstlguhr2e91oihi0bfsx",
"firstName": "John",
"lastName": "Doe",
"points": 2
}
}
Parameters:
FieldTypeDescription
code(Required)
stringThis field is required
couponId(Required)
stringThis field is required
POST/customer/:customerId/loyalty

Update Customer Loyalty Points

Update a customer's loyalty points.

Example Responses:
{
"id": "l7817f8lbdqn18pok75x2mnm",
"firstName": "John",
"lastName": "Doe",
"email": "john@gmail.com",
"points": 10
}
Parameters:
FieldTypeDescription
points(Required)
numberThis field is required
type(Required)
increment or decrementThis field is required