Categories under 50k revenue this week
curl -X POST https://oc-acme.ap-south-1.originchain.ai/v1/sql \
-H "Authorization: Bearer $OC_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sql":"SELECT category, SUM(qty * unit_price) AS revenue FROM orders o JOIN catalog_skus s ON o.sku_id = s.sku_id WHERE o.ts > now() - interval ''7 days'' GROUP BY category HAVING SUM(qty * unit_price) < 50000"}' {
"rows": [
{ "category": "Stationery", "revenue": 41020 },
{ "category": "Garden Tools", "revenue": 28415 }
],
"meta": { "latency_ms": 62 }
}