Chirak Developer & AI Documentation
Securely connect your Chirak store's inventory, sales, and customer database to AI assistants (Claude Desktop, Cursor, custom agents) and automation tools (Zapier, Make).
1. Generating Your API Key (Mobile-First)
You do not need a desktop computer to create integration keys. Generate personal access tokens directly inside the iOS app:
- Open the Chirak app on your iPhone or iPad.
- Navigate to the More tab and tap Integrations & AI.
- Tap the + (Add) button in the top right corner.
- Provide a friendly label (e.g. Claude MacBook, Zapier Store), pick the scope (Full Access or Read-Only), and select an expiration period.
- Copy the generated token (
chk_live_...). For maximum security, the raw secret is only displayed once.
2. Model Context Protocol (MCP) Server
With the official chirak-mcp package, leading AI models can query your current stock, parse wholesale invoice images to register products, and complete sales.
Automatic Installation (Smithery CLI)
Install and configure Chirak for Claude Desktop automatically with a single command:
npx -y smithery mcp add ufhouck/chirak
Claude Desktop Setup (Manual)
Or add the following block manually to your claude_desktop_config.json configuration file:
{
"mcpServers": {
"chirak": {
"command": "npx",
"args": ["-y", "chirak-mcp"],
"env": {
"CHIRAK_API_KEY": "chk_live_YOUR_API_KEY_HERE"
}
}
}
}
Cursor & Windsurf Setup
Under Cursor Settings > Features > MCP, click Add New MCP Server:
Name: chirak
Type: command
Command: npx -y chirak-mcp
Environment Variables: CHIRAK_API_KEY=chk_live_YOUR_API_KEY_HERE
Available MCP AI Tools
| Tool Name | Description & AI Capability |
|---|---|
get_chirak_help |
Returns complete store operational guide, active business context (today's revenue/orders), and recommended prompt patterns. |
get_inventory |
Lists active inventory products with stock levels, retail pricing, cost, and categories. |
search_product |
Instantly searches products by name, SKU code, or barcode. |
add_product |
Creates a new product with stock, pricing, and category. Ideal for parsing supplier invoices. |
update_product |
Updates product details: selling/cost price, name, stock count, SKU, barcode, category, or units. |
adjust_stock |
Adjusts physical inventory (+/-) with an audit reason (purchase, damage, return, adjustment). |
delete_product |
Permanently removes a product from your Chirak catalog and syncs deletion across devices. |
record_sale |
Records a customer sale and atomically decrements product inventory in real time. |
cancel_sale |
Cancels a sale order and automatically restocks all sold items back into inventory. |
get_daily_summary |
Fetches revenue metrics, order totals, and critical low-stock alerts for today or this week. |
list_customers |
Searches customer directory with contact information, order history, and lifetime spending. |
add_customer |
Creates a new customer profile with phone, email, address, channel, and VIP notes. |
update_customer |
Updates customer details, delivery address, phone number, social handles, or preferences. |
delete_customer |
Deletes a customer profile from the store directory. |
3. REST API Reference
Base URL: https://chirak.app/api/v1
All protected endpoints require your secret token in the standard HTTP header (X-API-Key or Authorization: ApiKey):
X-API-Key: chk_live_YOUR_API_KEY_HERE
GET /v1/products
Lists active inventory products, retail prices, and available stock quantities.
curl -X GET "https://chirak.app/api/v1/products?limit=20" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE"
GET /v1/products/:id
Retrieves a single product by UUID or barcode with complete price and stock attributes.
curl -X GET "https://chirak.app/api/v1/products/PRODUCT_UUID_OR_BARCODE" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE"
POST /v1/products
Adds a new product to your inventory catalog.
curl -X POST "https://chirak.app/api/v1/products" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"name": "Classic Linen Shirt",
"sellingPrice": 850,
"costPrice": 420,
"stockQuantity": 25,
"sku": "CLS-01",
"category": "Clothing",
"currency": "TRY"
}'
PATCH /v1/products/:id
Updates specific fields of a product (price, cost, stock, name, SKU, barcode, unit).
curl -X PATCH "https://chirak.app/api/v1/products/PRODUCT_UUID" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"sellingPrice": 890,
"stockQuantity": 30
}'
PATCH /v1/products/:id/stock
Atomically adjusts stock (+/-) with an audit reason and generates a stock movement entry.
curl -X PATCH "https://chirak.app/api/v1/products/PRODUCT_UUID/stock" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"quantityChange": 10,
"reason": "purchase",
"note": "Wholesale delivery invoice #8412"
}'
DELETE /v1/products/:id
Permanently deletes a product from the inventory catalog.
curl -X DELETE "https://chirak.app/api/v1/products/PRODUCT_UUID" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE"
POST /v1/sales
Creates a sale record and atomically decrements product inventory in the database.
curl -X POST "https://chirak.app/api/v1/sales" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"customerName": "Jane Doe",
"channel": "WhatsApp",
"paymentStatus": "Paid",
"items": [
{
"sku": "CLS-01",
"quantity": 2,
"unitPrice": 850
}
]
}'
POST /v1/sales/:id/cancel
Cancels an order, marks status as cancelled, and automatically restocks all item quantities.
curl -X POST "https://chirak.app/api/v1/sales/SALE_ORDER_UUID/cancel" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE"
GET /v1/reports/summary
Returns daily or weekly revenue metrics, total orders, and critical low-stock alerts.
curl -X GET "https://chirak.app/api/v1/reports/summary?period=today" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE"
GET /v1/customers
Retrieves your customer contacts directory and lifetime purchase amounts.
curl -X GET "https://chirak.app/api/v1/customers?limit=25" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE"
POST /v1/customers
Creates a new customer card with contact details, address, and channel.
curl -X POST "https://chirak.app/api/v1/customers" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Doe",
"phone": "+905551234567",
"channel": "WhatsApp",
"address": "Nişantaşı, İstanbul",
"notes": "Prefers evening deliveries"
}'
PATCH /v1/customers/:id
Updates customer address, phone number, email, channel, or notes.
curl -X PATCH "https://chirak.app/api/v1/customers/CUSTOMER_UUID" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"phone": "+905559876543",
"notes": "VIP Gold customer"
}'
DELETE /v1/customers/:id
Deletes a customer profile from your directory.
curl -X DELETE "https://chirak.app/api/v1/customers/CUSTOMER_UUID" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE"
4. Zapier & Make.com Automations
Connect Chirak to thousands of apps (Shopify, WooCommerce, Google Sheets, WhatsApp, Slack, Telegram) via no-code platforms using our high-speed Cloud REST API.
Connecting via Zapier (Webhooks by Zapier)
In your Zapier workflow, add an action using 'Webhooks by Zapier' → 'Custom Request'. Set the method to POST or PATCH, target endpoint, and supply your API key in the headers:
{
"method": "POST",
"url": "https://chirak.app/api/v1/sales",
"headers": {
"X-API-Key": "chk_live_YOUR_API_KEY_HERE",
"Content-Type": "application/json"
},
"data": {
"channel": "shopify",
"paymentMethod": "card",
"customerName": "Jane Doe",
"items": [
{
"productId": "PRODUCT_UUID",
"quantity": 1,
"unitPrice": 850
}
]
}
}
Connecting via Make.com (HTTP Module)
In Make.com (Integromat), add the 'HTTP - Make a request' module. Set the URL to any Chirak endpoint, choose your method, add Header 'X-API-Key' with your key, and send JSON payload.
curl -X POST "https://chirak.app/api/v1/sales" \
-H "X-API-Key: chk_live_YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"channel": "make_webhook",
"paymentMethod": "online",
"items": [
{
"productId": "PRODUCT_UUID",
"quantity": 2,
"unitPrice": 450
}
]
}'