Core ConceptsAPI Reference Overview
Core Concepts

API Reference

Comprehensive reference for Louis Lukkanit classes, methods, and configurations, including code snippets for developers.

curl -X GET https://api.example.com/v1/cms/pages \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"
{
  "data": [
    {
      "id": "page-123",
      "title": "Home Page",
      "slug": "home",
      "content": "Welcome content"
    }
  ],
  "meta": {
    "total": 50,
    "per_page": 25
  }
}
curl -X POST https://api.example.com/v1/pos/sales \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "items": [{"product_id": "prod-1", "quantity": 2}],
    "customer_email": "customer@example.com"
  }'
{
  "error": "Unauthorized",
  "message": "Invalid token"
}

Overview

Access the Louis Lukkanit API at https://api.example.com/v1 to manage CMS content, POS transactions, and business systems. Authenticate requests using Bearer tokens. All endpoints return JSON responses.

Review your {API_KEY} from the dashboard at https://dashboard.example.com before integrating.

Authentication

Secure all requests with a Bearer token in the Authorization header.

// Example: Fetch token first
const token = 'your-token-here';
fetch('https://api.example.com/v1/auth/login', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ email: 'user@example.com', password: 'pass' })
});

CMS Endpoints

Retrieve and manage CMS pages.

List Pages

dataarray
Required

Array of page objects.

metaobject

Pagination metadata.

query
limitinteger

Pages per response, default 25, max 100.

POS Endpoints

Create a new point-of-sale transaction.

Prepare Payload

Include items and customer data.

Send POST Request

Use the endpoint below.

Laravel Package Integration

Integrate Louis Lukkanit packages into your Laravel application.

// config/louis-lukkanit.php
return [
    'api_key' => env('LOUIS_API_KEY'),
    'base_url' => 'https://api.example.com/v1',
];

Configuration Options

KeyTypeDefaultDescription
api_keystringnullYour {API_KEY}
base_urlstring/v1API base endpoint
timeoutinteger30Request timeout in seconds

Publish config with php artisan vendor:publish --tag=louis-config.

Error Handling

Common errors include 401 Unauthorized and 429 Rate Limited.

try {
    $response = CmsManager::pages()->get();
} catch (Exception $e) {
    if ($e->getCode() === 401) {
        // Refresh token
    }
}
Was this page helpful?
Built with Documentation.AI

Last updated today