Get Business Colors
Returns a key-value map of colour tokens configured for a specific location. The portal uses these values to apply the operator’s brand palette at runtime, overriding the default theme. Colours are stored as CSS-compatible hex or RGB strings.
Authentication
Requires a valid customer bearer token.
Path Parameters
The numeric identifier of the location whose colour palette you want to retrieve.
Response
Returns a flat Record<string, string> object where each key is a colour token name and each value is a CSS colour string.
{
"primaryColor": "#ff5100",
"secondaryColor": "#001279",
"backgroundColor": "#F9FAFB",
"textColor": "#111827"
}
TypeScript Integration
import endpoints from '@/api/endpoints'
import { useTypedData } from '@/api/fetchData'
const endpoint = endpoints.system.colors(businessId)
// endpoint.type is Record<string, string>
const { resource: colors } = useTypedData(httpClient, endpoint)
Usage in Portal
| Context | Source file |
|---|
| Location branding / theme injection | src/states/useLocationByRouteContext.tsx |
Error Responses
The bearer token is missing, expired, or invalid.
No location with the given businessId was found.
| Method | Endpoint | Description |
|---|
GET | /api/public/businesses/current | Get the current location details |
GET | /api/public/configuration | Get portal configuration for a space |