REST API
በCelerp በይነገጽ ውስጥ ያለ እያንዳንዱ ተግባር የREST API መዳረሻ ነው - UI በውስጡ የሚጠቀመው ያው API ነው። የሥራ ሂደቶችን በራስ-ሰር ያስኪዱ፣ ሌሎች ሥርዓቶችን ያገናኙ ወይም የራስዎን መሣሪያዎች ይገንቡ። API ከውሂብዎ ጋር በራስዎ ኮምፒውተር ላይ ይሠራል፤ ወደ ክላውድ ምንም አይላክም።
🔗 መነሻ URL
http://localhost:8000 በpip ሲጫን። የዴስክቶፕ መተግበሪያው የራሱን ፖርት ይመርጣል፤ celerp-data/api-port ን ይመልከቱ።
🔑 ማረጋገጫ
የBearer JWT ቶከን ከ/auth/login
📦 ቅርጸት
JSON ግቤት፣ JSON ውጤት
📖 ዝርዝር መግለጫ
GET /openapi.json (OpenAPI 3.1)
የትኛው ፖርት? በpip install celerp ሲጫን የAPI አገልጋዩ በlocalhost:8000 ላይ ይሰራል (በ--api-port ይቀይሩት)፤ ፖርት 8080 ደግሞ ለሰዎች የሚሆን የድር በይነገጽ ነው እንጂ API አይደለም። የዴስክቶፕ መተግበሪያው በተከፈተ ቁጥር ያልተያዙ ፖርቶችን ይመርጣል፤ የAPI ፖርቱንም በcelerp-data አቃፊው ውስጥ ባለው api-port ፋይል ላይ ይጽፋል። ፖርቱን ቋሚ ለማድረግ ከማስጀመርዎ በፊት CELERP_API_PORT ያዘጋጁ።
ማንነት ማረጋገጫ
Celerp ለአጭር ጊዜ የሚያገለግሉ የJSON ዌብ ቶከኖችን ይጠቀማል። የመዳረሻ ቶከን ለማግኘት በCelerp ኢሜይልዎ እና የይለፍ ቃልዎ ይግቡ፤ ከዚያም በእያንዳንዱ ጥያቄ ላይ እንደ Bearer ራስጌ ይላኩት።
1. ይግቡ
curl -X POST http://localhost:8000/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "your-password"}'
ምላሹ ሁለት ቶከኖችን ይይዛል፦
{
"access_token": "eyJhbGciOiJI...",
"refresh_token": "eyJhbGciOiJI..."
}
2. በቶከኑ API ይጥሩ
curl http://localhost:8000/items \
-H "Authorization: Bearer eyJhbGciOiJI..."
- ቶከኑ ተጠቃሚዎን፣ ሚናዎን እና ኩባንያዎን ይለያል፤ ስለዚህ ጥያቄዎች በራስ-ሰር በዚያ ኩባንያ ብቻ ይወሰናሉ - ተጨማሪ ራስጌ አያስፈልግም።
- የመዳረሻ ቶከኖች እስከ 24 ሰዓት ያገለግላሉ። አንዱ ጊዜው ሲያልፍ
refresh_tokenበPOST ወደ/auth/token/refreshበመላክ አዲስ ጥንድ ቶከን ያግኙ። - ከአንድ በላይ ኩባንያ አባል ነዎት? በ
GET /auth/my-companiesይዘርዝሯቸው፤ ከዚያም ለሌላው ኩባንያ የሚያገለግል ቶከን በPOST /auth/switch-company/{company_id}ያግኙ።
ቶከኖች ፈቃዶችዎን ይይዛሉ። የviewer ቶከን ማንበብ ይችላል እንጂ መጻፍ አይችልም፤ የወጪ አሃዞችን ለማየት manager ወይም ከዚያ በላይ ሚና ያስፈልጋል። ቶከኖችን እንደ የይለፍ ቃል ይጠብቁ - ቶከኑን የያዘ ማንኛውም ሰው እርስዎን ሆኖ መሥራት ይችላል።
ጥያቄዎችን መላክ
ሁሉም የAPI መዳረሻዎች በAPI ሰርቨርዎ አድራሻ ሥር ይገኛሉ (በpip ሲጫን http://localhost:8000፣ ከታች ባሉት ምሳሌዎች እንዳለው) እና JSON ይመልሳሉ። የዝርዝር መዳረሻዎች የitems ድርድር እና የtotal ብዛት ይመልሳሉ፦
curl "http://localhost:8000/items?limit=20&offset=0" \
-H "Authorization: Bearer $TOKEN"
{
"items": [
{ "id": "item:...", "sku": "WIDGET-001", "name": "Widget", "quantity": 42 }
],
"total": 142
}
ገጽ በገጽ ማሳየት፦ ?limit= (ነባሪው 50) እና ?offset= ይላኩ። አብዛኞቹ የዝርዝር መዳረሻዎች የq= የፍለጋ ቃል እና የአምድ ማጣሪያዎችንም ይቀበላሉ (ለምሳሌ ?status=available)።
ውሂብ መፍጠር
መዝገቦችን ለመፍጠር JSON በPOST ይላኩ። የመጻፍ ጥያቄዎች የአዲሱን መዝገብ id ይመልሳሉ (ከጀርባው ያለውንም event_id - በCelerp ውስጥ እያንዳንዱ ለውጥ እንደ ክስተት ይመዘገባል)።
curl -X POST http://localhost:8000/crm/contacts \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corp",
"email": "[email protected]",
"contact_type": "customer",
"idempotency_key": "acme-2026-06-21"
}'
ድግግሞሽን መከላከል፦ በማንኛውም የመጻፍ ጥያቄ ላይ idempotency_key ያካትቱ። በተመሳሳይ ቁልፍ እንደገና የተላከ ጥያቄ ተደጋጋሚ መዝገብ አይፈጥርም - ለሚቆራረጥ ኔትወርክ እና ለባች ሥራዎች አስተማማኝ ነው።
የአጠቃቀም ደንቦች
- ስህተቶች ከ2xx ውጭ የሆኑ ምላሾች
{"detail": "..."}ከመደበኛ የHTTP ሁኔታ ኮድ ጋር ይመልሳሉ። - የጥያቄ ገደቦች በነባሪ ለእያንዳንዱ IP በደቂቃ 60 ጥያቄዎች፤ መግቢያ በደቂቃ 10 ብቻ ነው። ገደቡን ማለፍ
429ይመልሳል። - ፈቃዶች የAPI መዳረሻዎች በሚናዎ ይወሰናሉ፦
viewer → operator → manager → admin → owner። - የኩባንያ ወሰን እያንዳንዱ ጥያቄ በቶከንዎ ውስጥ ባለው ኩባንያ ላይ ይሠራል፤ በሌላ ኩባንያ ላይ ለመሥራት ኩባንያ ይቀይሩ።
በብዛት የሚጠቀሙባቸው የAPI መዳረሻዎች
ለመጀመር የሚያግዙ ጥቂቶቹ ብቻ። እያንዳንዱ ሞጁል የራሱን መዳረሻዎች ይጨምራል - ሙሉው ዝርዝር ከታች ባለው የOpenAPI ስኪማ ውስጥ ይገኛል።
| ዘዴ | ዱካ | መግለጫ |
|---|---|---|
POST | /auth/login | የመዳረሻ ቶከን ያግኙ (ማረጋገጫ አያስፈልግም) |
GET | /health | የአገልግሎቱ ሁኔታ (ማረጋገጫ አያስፈልግም) |
GET | /items | የክምችት ዕቃዎችን ይዘርዝሩ |
POST | /items | ዕቃ ይፍጠሩ |
GET | /docs | ሰነዶችን ይዘርዝሩ (ደረሰኞች፣ የግዢ ትዕዛዞች፣ የአቅራቢ ሂሳቦች፣ …) |
POST | /docs | ሰነድ ይፍጠሩ |
GET | /crm/contacts | ደንበኞችን & አቅራቢዎችን ይዘርዝሩ |
POST | /crm/contacts | ዕውቂያ ይፍጠሩ |
GET | /dashboard/kpis | ቁልፍ የንግድ አፈጻጸም አመልካቾች (KPI) |
በየክፍሉ ሙሉ ማጣቀሻ
በሚሠራው API የሚቀርብ እያንዳንዱ የAPI መዳረሻ፣ በየክፍሉ ተደራጅቶ። እያንዳንዱ ገጽ የHTTP ዘዴውን፣ አድራሻውን፣ መለኪያዎቹን፣ የጥያቄ እና የምላሽ ቅርጸቶችን እና የምሳሌ ጥሪ ይዘረዝራል።
Auth
Authentication API for Celerp users, login, logout, password recovery, company switching, and API access. (12 endpoints)
Companies
Company settings and administration API for users, roles, locations, taxes, payment terms, price lists, modules, and company preferences. (68 endpoints)
Items
Inventory API for products and stock items, quantities, pricing, locations, barcodes, valuation, imports, reservations, transfers, transformations, and stock status. (35 endpoints)
Docs
Business document API for invoices, bills, purchase orders, quotations, credit notes, shipping documents, payments, fulfillment, PDF output, and document lifecycle operations. (49 endpoints)
Lists
Inventory list API for stock audits, transfers, write-offs, manifests, scans, reservations, notes, exports, and list lifecycle operations. (37 endpoints)
Accounting
Celerp accounting REST API for the chart of accounts, journal entries, general ledger, bank reconciliation, financial statements, transfers, and fiscal period controls. (47 endpoints)
Ledger
Event ledger API for reading Celerp business events and rebuilding derived application data. (3 endpoints)
Reports
ERP reporting API for accounts receivable and payable aging, sales, purchases, and expiring inventory. (5 endpoints)
Manufacturing
Manufacturing API for production orders, recipes, work centers, workflows, material requirements, costing, scheduling, component issue, and finished-goods receipt. (26 endpoints)
Labels
Inventory label and barcode API for label templates, single-item labels, bulk label sheets, and printable PDFs. (7 endpoints)
Crm
CRM REST API for customers, suppliers, contacts, addresses, people, notes, tags, files, imports, exports, and contact management. (25 endpoints)
Subscriptions
Recurring document and subscription API for invoice and purchase-order templates, scheduling, activation, pausing, resuming, cancellation, and on-demand generation. (6 endpoints)
Connectors
Integration API for connecting Celerp ERP to external commerce and business platforms, managing connector credentials, and running data synchronization. (9 endpoints)
Payments
Payment integration API for connecting payment processing, checking payment availability, and reading connection status. (4 endpoints)
Backup
Backup and restore API for exporting, importing, listing, creating, and restoring Celerp ERP backups. (7 endpoints)
Notifications
User notification API for listing notifications and marking individual or all notifications as read. (3 endpoints)
Events
Real-time server-sent events API for Celerp notifications and live application events. (1 endpoint)
System
System health, readiness, restart, and factory reset endpoints for a Celerp ERP installation. (9 endpoints)
Admin
Administrative diagnostics and system status endpoints for maintaining a Celerp ERP installation. (2 endpoints)
Ai
Celerp AI API for ERP assistant conversations, document extraction, batch jobs, memory, usage, and user-confirmed business actions. (22 endpoints)
Attachments
Inventory attachment API for uploading, downloading, tagging, previewing, and deleting item files and product images. (12 endpoints)
Dashboard
Dashboard API for ERP KPIs, recent business activity, and searchable activity history. (3 endpoints)
Payments Public
Public payment endpoints for customer payment links and payment-provider return handling. (2 endpoints)
Received
Received documents API for documents other Celerp users shared with you: list and review them, book one as your own draft, and bring a booked draft up to date with the sender's latest revision. (5 endpoints)
Search
Global Celerp ERP search API for finding permitted records across modules from a single query. (1 endpoint)
Settings
System settings and Celerp Connect API for account setup, cloud connection state, billing, backups, connectors, and partner configuration. (16 endpoints)
Share
Document sharing API for creating, inspecting, updating, and revoking public share links for Celerp documents and lists. (4 endpoints)
Share Public
Public document sharing and import endpoints for viewing shared Celerp documents and downloading or importing portable document bundles. (4 endpoints)
Stars
Supporter badge and Celerp community recognition API for badge verification, display, opt-out, and prompts. (6 endpoints)
Verticals
Industry preset and category schema API for configuring Celerp ERP fields and defaults by business vertical. (5 endpoints)
ሙሉውን API ይመልከቱ
ሙሉ እና ሁልጊዜ የተዘመነው ማጣቀሻ የራስዎ Celerp የሚያመነጨው የOpenAPI 3.1 ስኪማ ነው፦
GET http://localhost:8000/openapi.json
ወደ ማንኛውም የOpenAPI መሣሪያ - Postman፣ Insomnia፣ Swagger UI ወይም የኮድ ማመንጫ - ያስገቡት፤ እያንዳንዱን የAPI መዳረሻ እና የውሂብ ሞዴል ይመልከቱ፣ ጥያቄዎችን ይሞክሩ፣ በሚጠቀሙበት የፕሮግራም ቋንቋ ዝግጁ የAPI ደንበኛ ኮድ ያመንጩ። Celerp በኢንተርኔት የሚስተናገድ የሰነድ ገጽ ሳይሆን ስኪማውን ራሱን ያቀርባል፤ ስለዚህ የAPIዎ ዝርዝር በራስዎ Celerp ውስጥ ብቻ በግል ይቆያል።
በቀላል ቋንቋ መጠየቅ ይመርጣሉ? የAI ረዳቱ (Connect) ይህንኑ API ለእርስዎ ይጠቀማል - ሪፖርት እንዲያወጣ ወይም ሰነድ እንዲፈጥር በተለመደው ቋንቋ ይጠይቁት። ያስታውሱ፦ API ማድረግ የሚችለውን ሁሉ ያለ ምንም ልዩ ፈቃድ ነው የሚያደርገው - በትክክል የገባ ተጠቃሚ ማድረግ የሚችለውን ብቻ።