Everything you need to integrate with the OneSolu platform. RESTful APIs, webhooks, and analytics endpoints.
All API requests require authentication via a Bearer token. Include your API key in the Authorization header of every request.
Authorization: Bearer YOUR_API_KEY
Important: Keep your API keys secure. Do not expose them in client-side code or public repositories. Use environment variables to store keys securely.
https://api.onesolu.dev/v1
/api/ordersCreate a new order. Provide the items and customer ID in the request body.
curl -X POST https://api.onesolu.dev/v1/api/orders \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "menu_id": "menu_001", "quantity": 2 },
{ "menu_id": "menu_002", "quantity": 1 }
],
"customer_id": "cust_abc123"
}'{
"data": {
"id": "order_xyz789",
"customer_id": "cust_abc123",
"items": [
{ "menu_id": "menu_001", "quantity": 2, "subtotal": 70000 },
{ "menu_id": "menu_002", "quantity": 1, "subtotal": 42000 }
],
"total": 112000,
"currency": "IDR",
"status": "pending",
"created_at": "2025-02-18T10:30:00Z"
}
}/api/orders/:idGet the current status and details of an order by its ID.
curl -X GET https://api.onesolu.dev/v1/api/orders/order_xyz789 \ -H "Authorization: Bearer YOUR_API_KEY"
{
"data": {
"id": "order_xyz789",
"customer_id": "cust_abc123",
"status": "preparing",
"estimated_ready": "2025-02-18T10:45:00Z",
"total": 112000,
"currency": "IDR",
"created_at": "2025-02-18T10:30:00Z"
}
}/api/orders/:id/statusUpdate the status of an existing order. Valid statuses: pending, preparing, ready, completed, cancelled.
curl -X PUT https://api.onesolu.dev/v1/api/orders/order_xyz789/status \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "status": "ready" }'{
"data": {
"id": "order_xyz789",
"status": "ready",
"updated_at": "2025-02-18T10:42:00Z"
},
"message": "Order status updated successfully"
}/api/webhooksRegister a webhook to receive real-time notifications for events like order updates, parking sessions, and analytics triggers.
curl -X POST https://api.onesolu.dev/v1/api/webhooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.com/webhooks/onesolu",
"events": ["order.created", "order.updated", "park.session.ended"],
"secret": "whsec_your_signing_secret"
}'{
"data": {
"id": "wh_abc123",
"url": "https://yourapp.com/webhooks/onesolu",
"events": ["order.created", "order.updated", "park.session.ended"],
"active": true,
"created_at": "2025-02-18T10:00:00Z"
}
}{
"id": "evt_xyz789",
"type": "order.updated",
"data": {
"order_id": "order_xyz789",
"status": "ready",
"updated_at": "2025-02-18T10:42:00Z"
},
"created_at": "2025-02-18T10:42:01Z"
}/api/analytics/dailyGet daily analytics data including API call counts, response times, error rates, and top endpoints. Defaults to the last 7 days.
curl -X GET "https://api.onesolu.dev/v1/api/analytics/daily?days=7" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"data": {
"period": "7d",
"total_requests": 4180,
"avg_response_time_ms": 85,
"error_rate": 0.023,
"daily": [
{ "date": "2025-02-12", "requests": 580, "errors": 12 },
{ "date": "2025-02-13", "requests": 720, "errors": 8 },
{ "date": "2025-02-14", "requests": 650, "errors": 15 },
{ "date": "2025-02-15", "requests": 890, "errors": 20 },
{ "date": "2025-02-16", "requests": 1100, "errors": 25 },
{ "date": "2025-02-17", "requests": 430, "errors": 5 },
{ "date": "2025-02-18", "requests": 310, "errors": 3 }
],
"top_endpoints": [
{ "endpoint": "/api/menu", "count": 1540 },
{ "endpoint": "/api/orders", "count": 1280 },
{ "endpoint": "/api/analytics/daily", "count": 860 }
]
}
}| Plan | Requests/min | Requests/day |
|---|---|---|
| Free | 60 | 1,000 |
| Pro | 300 | 50,000 |
| Enterprise | Unlimited | Unlimited |
X-RateLimit-Limit: 300 X-RateLimit-Remaining: 298 X-RateLimit-Reset: 1708257600
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request body or parameters |
| 401 | Unauthorized | Missing or invalid API key |
| 404 | Not Found | Resource not found |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Server Error | Internal server error |
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or expired API key",
"status": 401
}
}