Documentation

Introduction

Welcome to Katlai CRM / ERP documentation. This document guides users on how to setup and use this software.

API Reference: Device Usage

Endpoint: katlai.aizent.com/device/switch

Description: This endpoint is used to handle device check-in and check-out events.

Parameters:

  • serial (string): The unique serial number of the device (e.g., dev-0001).
  • status (string): The status of the device, which can be one of the following:
    • checkin
    • checkout
    • timein
    • timeout
  • scent (string): Scent or element (e.g., Wood).
  • start_time (time): Schedule Start Time (e.g., 08:00:00).
  • end_time (time): Schedule End Time (e.g., 09:00:00).

These parameters should exist in the database: 1) serial, 2) scent, 3) schedules

Example Request:

GET katlai.aizent.com/device/switch?serial=dev-0001&status=checkin&scent=wood&start_time=08:00:00&end_time=12:00:00

Example Response:

{ "message": "Device check-in successful", "serial": "dev-0001", "status": "checkin", "timestamp": "2024-11-01T08:00:00Z" }

API Reference: Customer

Endpoint: https://katlai.aizent.com/api/customers

Description: This endpoint is used to create or update customer information in the system.

Request Method: POST

Request Body Parameters:

  • name (string, optional): The full name of the customer.
  • email (string, required): The email address of the customer. Must be a valid email format.
  • phone (string, optional): The customer's phone number.
  • gender (char, optional): The gender of the customer. Valid values: m (male), f (female).
  • age (integer, optional): The age of the customer.
  • birthdate (string, optional): The birthdate of the customer in YYYY-MM-DD format.
  • preferences (JSON, optional): A JSON object containing the customer's preferences.

Example Request:

POST https://katlai.aizent.com/api/customers
Content-Type: application/json

{
    "name": "John Doe",
    "email": "johndoe@example.com",
    "phone": "1234567890",
    "gender": "m",
    "age": 30,
    "birthdate": "1994-05-15",
    "preferences": {
        "language": "en",
        "newsletter": true
    }
}
        

Success Response:

Status Code: 200 OK

{
    "message": "Customer setup successful",
    "customer_id": 12345,
    "data": {
        "name": "John Doe",
        "email": "johndoe@example.com",
        "phone": "1234567890",
        "gender": "m",
        "age": 30,
        "birthdate": "1994-05-15",
        "preferences": {
            "language": "en",
            "newsletter": true
        }
    }
}
        

Validation Failure Response:

Status Code: 422 Unprocessable Entity

{
    "error": "Validation failed",
    "details": {
        "email": [
            "The email field is required."
        ]
    }
}
        

POC Instruction

Tell your chatbot partner to simulate the control of a sample device with serial number = HKAP0100000001 of type aromapodpro. The workflow steps we believe is as follows:

  1. Customer scans qr code
  2. The chatbot session starts
  3. Ask one simple multiple choice question: Which scent to use? Choices: a) fire, b) wood, c) water, d) air When the customer answers b or wood, and after the session ends, then the device database will call our api automatically >
    our erp api endpoint - https://katlai.aizent.com/device/switch?serial=HKAP0100000001&submit=&status=checkin&scent=wood

Let us know once this is accomplished so we can check our ERP database if data has been received. Thank you.

Technical Overview

  1. Installation of app, security, database on cloud servers like AWS.
  2. Setup admin users and assign roles.
  3. Configure IoT database IP.
  4. Input types - 1) Automated via webhook, 2) Manual input
  5. Setup and Test webhook communication from 1) device to 2) device database to our 3) ERP CRM database

Operations Guide

  1. Create "Corporation".
  2. Create "Client" (belongs to Corporation) - set corporation, client_type (hotel, spa for now), timezone, charge rate (daily or hourly)
  3. Create users and assign roles.
  4. Create "Device Types" - ie. app2x (code), Aroma Pod Pro 4 capsules (name)
  5. Create "Room" (belongs to Client).
  6. Create "Devices" - set device_type, serial.
  7. Do "Device Setups" - 1) physical installation, 2) app - select device serial and assign to the room it was installed.
  8. Filter "Reports" by client, period - Device Usage, Payments, Billables
  9. After physical installation of the device and "Device Setup", the device should communicate with its device database and in make a request to our CRM database passing device serial and status.

FAQ

Device Usage Instance
Only the latest or last created device usage instance will be subject to checkout and timein and out.

Tips and Notes

Observe Data Integrity and Privacy

Contact the System Administrator for System Errors

Practice Effective Data Entry and Management

Document System Changes

Use Workflow Automation Carefully

Use Reliable Internet Connections