API Reference

Hajatek API

Build powerful integrations with Hajatek. Manage your store, products, orders, and customers programmatically.

Getting Started

Base URL

https://api.hajatek.com/v1

Authentication

Use your API key from the dashboard. Send it as a Bearer token in the Authorization header.

Authorization: Bearer YOUR_API_KEY

Rate Limiting

Request limits depend on your plan:

Starter
100 requests/min
Pro
500 requests/min
Business
Unlimited

Response Format

All responses return JSON with Content-Type: application/json header.

Core Endpoints

GET/stores/{store_id}
Get store information
GET/products
List products
Query Params: page, limit, category, search
POST/products
Create a new product
PUT/products/{id}
Update a product
DELETE/products/{id}
Delete a product
GET/orders
List orders
Query Params: status, page, limit
GET/orders/{id}
Get order details
PUT/orders/{id}/status
Update order status
GET/customers
List customers
GET/analytics/summary
Get store analytics

Webhooks

Receive real-time notifications when events occur in your store. Register a URL in your dashboard to receive automatic POST requests.

Available Events

order.createdWhen a new order is created
order.updatedWhen an order is updated
payment.completedWhen a payment is completed
product.createdWhen a new product is created
inventory.lowWhen inventory is running low

Webhook Payload Example

{
  "id": "evt_1234567890",
  "type": "order.created",
  "created_at": "2026-03-15T12:00:00Z",
  "data": {
    "order_id": "ord_abc123",
    "store_id": "str_xyz789",
    "total": 299.99,
    "currency": "SAR",
    "status": "pending",
    "items": [
      {
        "product_id": "prod_001",
        "name": "Premium Widget",
        "quantity": 2,
        "price": 149.99
      }
    ]
  }
}

Signature Verification

Every webhook request includes an X-Hajatek-Signature header containing an HMAC-SHA256 signature. Verify the signature using your webhook secret key to ensure the request is authentic.

X-Hajatek-Signature: sha256=a1b2c3d4e5f6...

Code Examples

cURL
curl -X GET "https://api.hajatek.com/v1/products?page=1&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
JavaScript / Node.js
const response = await fetch(
  "https://api.hajatek.com/v1/products?page=1&limit=10",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
    },
  }
);

const data = await response.json();
console.log(data.products);
Python
import requests

response = requests.get(
    "https://api.hajatek.com/v1/products",
    params={"page": 1, "limit": 10},
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
)

data = response.json()
print(data["products"])

AI Agent Integration

Connect your store to AI agents like Claude and ChatGPT via the MCP protocol.

Explore MCP Documentation
المطورين | Hajatek