REST API v1
API reference
Connect Khybersoft with your own tools using our simple REST API.
Authentication
All API requests use an API key sent as a bearer token. Generate keys in Settings → API.
bash
curl https://khybersoft.com/api/v1/invoices \ -H "Authorization: Bearer ks_live_YOUR_KEY"
Endpoints
GET
/api/v1/products
List products
GET
/api/v1/customers
List customers
POST
/api/v1/customers
Create a customer
Invoices
Create and fetch invoices programmatically.
POST /api/v1/invoices
{
"customer_id": 1042,
"items": [
{ "sku": "KS-POS", "qty": 1, "price": 4999 }
],
"send_whatsapp": true
}
Response · 201 Created
{
"id": 2041,
"number": "INV-2041",
"total": 4999,
"status": "paid"
}
Inventory
Check stock levels and receive low-stock webhooks.
GET
/api/v1/stock?branch=main
Current stock by branch
POST
/api/v1/webhooks
Subscribe to low-stock alerts
Errors & rate limits
| Code | Meaning |
|---|---|
| 401 | Missing or invalid API key |
| 403 | Key lacks the required scope |
| 422 | Validation failed — see errors object |
| 429 | Rate limit exceeded (120 req/min) |
Need an API key or a higher limit? Contact us — keys are issued on Business and Enterprise plans.