SmartBook API
REST API for integrating with SmartBook's booking platform.
Base URL: https://smartbook.now/api/v1
Alle forespørsler og svar bruker application/json med mindre annet er spesifisert.
Booking
Endepunkter for tjenester, tilgjengelighet og bestillinger.
GET
/api/v1/services?slug={businessSlug}Hent alle tjenester for en bedrift.
Respons
{
"data": [
{
"id": "uuid",
"name": "Herreklipp",
"duration_minutes": 30,
"price": 499,
"currency": "NOK"
}
]
}GET
/api/v1/availability?serviceId={id}&date={YYYY-MM-DD}Hent tilgjengelige tidspunkter for en tjeneste på en gitt dato.
Respons
{
"data": {
"date": "2026-03-26",
"slots": [
"09:00",
"09:30",
"10:00",
"10:30",
"11:00"
]
}
}POST
/api/v1/bookingsOpprett en ny bestilling.
Request body
{
"service_id": "uuid",
"date": "2026-03-26",
"time": "10:00",
"customer_name": "Ola Nordmann",
"customer_email": "ola@example.com",
"customer_phone": "+4791234567"
}Respons
{
"data": {
"id": "uuid",
"status": "confirmed",
"service_id": "uuid",
"date": "2026-03-26",
"time": "10:00"
}
}POST
/api/v1/bookings/cancelKanseller en eksisterende bestilling.
Request body
{
"booking_id": "uuid"
}Respons
{
"data": {
"id": "uuid",
"status": "cancelled"
}
}Betaling
Stripe-betalingsintegrasjon.
POST
/api/v1/payments/create-intentOpprett en Stripe-betalingsintensjon for en bestilling.
Request body
{
"booking_id": "uuid",
"amount": 499,
"currency": "nok"
}Respons
{
"data": {
"client_secret": "pi_xxx_secret_xxx",
"payment_intent_id": "pi_xxx"
}
}AI
AI-chatbot for kundekommunikasjon.
POST
/api/v1/ai/chatAI-chatbot med strømming. Returnerer en strøm av tekstfragmenter (Server-Sent Events).
Request body
{
"messages": [
{
"role": "user",
"content": "Hvilke tjenester tilbyr dere?"
}
],
"business_slug": "min-bedrift"
}Respons
data: {"content": "Vi tilbyr følgende tjenester..."}
data: {"content": " Herreklipp, dameklipp..."}
data: [DONE]