https://api.genuka.com · Auth Authorization: Bearer <token> + X-Company: <companyId> · Getting Started
Endpoints at a glance
Dashboard Analytics
Common query parameters
Most analytics endpoints accept the following date and filter parameters:GET /2023-11/admin/analytics/accounting/stats
Yearly accounting stats comparing current year to previous year: total sales, total expenses, and net profit as daily arrays.
Query parameters
200 OK):
401— Missing or invalid token.403— Authenticated user does not belong to the requested company.
GET /2023-11/admin/analytics/accounting/stats/expenses
Expenses time-series for a period. Supports optional group_by to aggregate by a bill column (e.g. expense_type).
Query parameters
200 OK) — without group_by:
200 OK) — with group_by=expense_type:
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/accounting/stats/revenues
Revenue time-series for a period. Supports group_by to aggregate by an order column (e.g. revenue_type).
Query parameters
200 OK) — without group_by:
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/accounting/stats/revenues/breakdown
Revenue breakdown by adjustment type (e.g. shipping fees, discounts, taxes) for a period.
Query parameters
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/accounting/stats/revenues/settings
Returns the revenue calculation settings (adjustment types and their configuration) for the company.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/avg-bill-amount
Average bill (expense) amount per day for the period, compared to a previous period.
Query parameters — see Common query parameters. Also accepts expenseType (comma-separated expense type handles).
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/avg-order-amount
Average order value per day, compared to the previous period.
Query parameters — see Common query parameters.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/discounts/stats
Discount usage statistics for a period: total discounts used (count), total amount applied, and proportion of discounted sales.
Query parameters — see Common query parameters.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/expenses-by-category
Total expenses grouped by expense category/type for the period.
Query parameters — see Common query parameters (date params only; no revenueType).
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/expenses-by-category-monthly
Expenses by category with a monthly breakdown matrix. Returns categories as rows and months as columns, along with month totals.
Query parameters — see Common query parameters (date params only).
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/orders/stats
Orders report for a period: products sold, total sales, and profit — each with a daily data array and period-over-period percentage change.
Query parameters — see Common query parameters.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/payments/stats
Payments report: inbound payments, outbound payments, and balance — each as daily arrays with period-over-period percentage change.
Query parameters — see Common query parameters (date params only).
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/recurring-customers
Recurring customer rate for a period: customers with exactly 1 order vs. more than 1 order, daily.
Query parameters
200 OK):
401— Unauthenticated.403— Unauthorized.422—end_dateis beforestart_date.
GET /2023-11/admin/analytics/stats
Monthly stats overview: total sales, new orders, and new customers — each with a daily array and period comparison.
Query parameters — see Common query parameters.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/stats/orders/group-by
Total orders revenue grouped by any order column (e.g. state, shop_id, revenue_type).
Query parameters
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/top-customers
Top customers ranked by total spend (default) or order count.
Query parameters
200 OK) — array of CustomerResource:
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/top-products
Top products ranked by quantity sold (default) or total revenue.
Query parameters
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/top-suppliers-expenses
Top suppliers ranked by total expense amount (bills) or bill count.
Query parameters
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/total-bills
Total number of bills (expenses) per day for the period, compared to a previous period.
Query parameters — see Common query parameters. Also accepts expenseType (comma-separated).
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/total-expenses
Total expenses amount per day for the period, compared to a previous period.
Query parameters — see Common query parameters. Also accepts expenseType (comma-separated).
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/total-expenses-by-shop
Total expenses grouped by shop for the period.
Query parameters
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/total-orders
Total order count per day for the period, compared to a previous period.
Query parameters — see Common query parameters.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/total-sales
Total sales revenue per day for the period, compared to a previous period.
Query parameters — see Common query parameters.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/total-sales-by-shop
Total sales revenue grouped by shop for the period.
Query parameters
200 OK):
401— Unauthenticated.403— Unauthorized.
Supplier Analytics
All supplier analytics endpoints share the same date and optionalsupplier_id / limit query parameters.
Common query parameters
GET /2023-11/admin/analytics/suppliers/stats/daily-sales
Daily sales revenue attributed to suppliers for the period.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/suppliers/stats/daily-volume
Daily sales volume (units) attributed to suppliers for the period.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/suppliers/stats/market-share
Market share (by revenue) for each supplier in the period.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/suppliers/stats/profitability-share
Profitability share (by margin) for each supplier in the period.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/suppliers/stats/top-products
Top selling products linked to a supplier for the period.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/suppliers/stats/top-suppliers-by-revenue
Best suppliers ranked by total revenue generated for the period.
200 OK):
401— Unauthenticated.403— Unauthorized.
User (Sales Rep) Analytics
All user analytics endpoints share the same common query parameters as supplier analytics, withuser_id instead of supplier_id.
Common query parameters
GET /2023-11/admin/analytics/users/stats/daily-sales
Daily sales revenue attributed to users (sales reps) for the period.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/users/stats/daily-volume
Daily sales volume (units) attributed to users for the period.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/users/stats/market-share
Market share (by revenue) for each user in the period.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/users/stats/profitability-share
Profitability share by user for the period.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/users/stats/top-products
Top selling products attributed to a user for the period.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/users/stats/top-users-by-revenue
Best users ranked by revenue generated for the period.
200 OK):
401— Unauthenticated.403— Unauthorized.
WhatsApp Analytics
GET /2023-11/admin/analytics/whatsapp/stats
WhatsApp campaign usage: messages sent (with delivery rate), messages read (with read rate), and attributed revenue for the period.
Query parameters — see Common query parameters (date params only).
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/whatsapp/templates-stats
WhatsApp template approval statistics: approved, pending, and rejected templates.
Query parameters — see Common query parameters (date params only).
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/analytics/whatsapp/top-customers
Top customers attributed to WhatsApp campaigns (orders placed within 7 days of receiving a campaign message).
Query parameters
200 OK):
401— Unauthenticated.403— Unauthorized.
Reports
Reports are savedReportRun records containing a structured data payload, optional PDF, and WhatsApp preview text.
POST /2023-11/admin/reports/reports
Generate and save a report for a company. Optionally generates a PDF.
Request body
201 Created):
401— Unauthenticated.403— Authenticated user does not belong to the requested company.404— Company not found.422— Validation error (missing required fields).
GET /2023-11/admin/reports/reports
List saved reports for a company, paginated and optionally filtered.
Query parameters
200 OK) — paginated wrapper:
401— Unauthenticated.403— Unauthorized.422—company_idmissing or invalid.
POST /2023-11/admin/reports/reports/preview
Preview a report without saving it to the database. Returns the full payload.
Request body
200 OK):
401— Unauthenticated.403— Unauthorized.404— Company not found.422— Validation error.
GET /2023-11/admin/reports/reports/{id}
Retrieve a specific saved report by ID.
Path parameters
200 OK):
401— Unauthenticated.403— Unauthorized (report belongs to another company).404— Report not found.
DELETE /2023-11/admin/reports/reports/{id}
Delete a saved report and its associated PDF file.
Path parameters
200 OK):
401— Unauthenticated.403— Unauthorized.404— Report not found.
GET /2023-11/admin/reports/reports/{id}/pdf
Download a report as a PDF file. Generates the PDF on the fly if it does not already exist.
Path parameters
200 OK): Binary PDF stream with Content-Type: application/pdf and Content-Disposition: attachment.
Error responses
400— Report is not yet completed.401— Unauthenticated.403— Unauthorized.404— Report not found.
GET /2023-11/admin/reports/reports/{id}/whatsapp
Get the WhatsApp-formatted text summary of a completed report.
Path parameters
200 OK):
400— Report not completed or payload missing.401— Unauthenticated.403— Unauthorized.404— Report not found.
POST /2023-11/reports/whatsapp/response
Webhook endpoint for handling WhatsApp button replies to report notifications. Called by the WhatsApp webhook forwarder. Sends a detailed report back via WhatsApp when the user responds “yes”.
This endpoint is intended for internal webhook use by the WhatsApp Business API, not for client-side calls.Request body — standard WhatsApp Cloud API webhook payload (button reply). Sent by the WhatsApp Business Platform; no
Authorization or X-Company header required.
200 OK):
200with"status": "ignored"— no messages, wrong message type, or invalid payload format.200with"status": "error"— report or user not found, phone mismatch.500— Internal error.
GET /2023-11/reports/{companyId}/{reportId}/view
View a report as a PDF via a public, tokenized, non-indexable URL. No authentication header required; access is controlled by the token query parameter.
Path parameters
Query parameters
200 OK): Inline PDF stream with Content-Type: application/pdf, X-Robots-Tag: noindex, Cache-Control: no-cache.
Error responses
403— Token missing or invalid.404— Report not found, not completed, or company mismatch.
Monthly Recap
Recaps are auto-generated monthly performance cards identified by ULID or slug. Some fields (revenue, basket) are hidden for non-owners.GET /2023-11/recap/latest
Get the latest recap for a company. The company must be passed via X-Company header or query parameter.
Query parameters
200 OK) — RecapResource:
404— No recap found for the company.422— No company ID provided.
GET /2023-11/recap/{recap}
Get a specific recap by ULID or slug.
Path parameters
200 OK) — RecapResource. Revenue and basket fields (kpis.total_revenue, kpis.average_basket, kpis.trends.revenue, kpis.trends.basket) are 0 when the requester is not the company owner.
404—{ "message": "Recap not found." }
POST /2023-11/recap/{recap}/feedback
Submit feedback (rating + optional text) for a recap.
Path parameters
Request body
200 OK):
404—{ "message": "Recap not found." }422—ratingis missing or invalid.
POST /2023-11/recap/{recap}/track-share
Increment the share count for a recap (call when a user shares the recap link).
Path parameters
Request body — None. This endpoint accepts no body.
200 OK):
404—{ "message": "Recap not found." }
POST /2023-11/recap/{recap}/track-view
Increment the view count for a recap (call on page load).
Path parameters
Request body — None. This endpoint accepts no body.
200 OK):
404—{ "message": "Recap not found." }
Year Wrapped
Annual “Year in Review” metrics for a company. All endpoints accept ayear query parameter and require the X-Company header.
Common query parameters
GET /2023-11/admin/wrapped/annual-revenue
Annual revenue summary with monthly average and best month.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/wrapped/average-basket
Average basket value (order amount) across all non-cancelled orders for the year.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/wrapped/average-customer-basket
Average basket per customer (mean of per-customer average order value) for the year.
200 OK):
401— Unauthenticated.400—companyIdnot provided.
GET /2023-11/admin/wrapped/badges/earned
Earned gamification badges for the company in the given year, including counts by level.
Query parameters — year (see above).
200 OK):
400—companyIdnot provided.401— Unauthenticated.403— Company not eligible for badges.
GET /2023-11/admin/wrapped/badges/evaluate
Evaluate and return all badge statuses for the company in the given year.
Query parameters — year (see above).
200 OK):
400—companyIdnot provided.401— Unauthenticated.403— Company not eligible.
GET /2023-11/admin/wrapped/badges/progress
Badge progress report: which badges were missed and what the next targets are.
Query parameters — year (see above).
200 OK):
400—companyIdnot provided.401— Unauthenticated.
GET /2023-11/admin/wrapped/best-monthly-revenue
The best revenue month in the year.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/wrapped/cash-vs-credit-sales
Breakdown of cash (fully paid) vs credit (unpaid or partially paid) orders for the year.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/wrapped/genuka-management-score
Genuka management score (0–100) computed from invoicing rate, expense tracking, stock management, regularity, and data discipline.
200 OK):
400—companyIdnot provided.401— Unauthenticated.
GET /2023-11/admin/wrapped/inactive-customers
Customers who placed at least one order during the year but have not ordered in the last 90 days.
200 OK):
400—companyIdnot provided.401— Unauthenticated.
GET /2023-11/admin/wrapped/monthly-average-revenue
Average monthly revenue across all months with orders in the year.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/wrapped/monthly-sales-evolution
Month-by-month sales evolution for all 12 months of the year, with the best month identified.
Query parameters — year, locale (e.g. fr, en; default fr).
200 OK):
400—companyIdnot provided.401— Unauthenticated.
GET /2023-11/admin/wrapped/most-productive-day
The single day with the highest revenue in the year.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/wrapped/most-profitable-product
The most profitable product by gross margin (sale price minus cost) for the year.
200 OK) — ProductDetailResource:
400—companyIdnot provided.401— Unauthenticated.404— No matching product found.
GET /2023-11/admin/wrapped/most-sold-products
Products ranked by units sold in the year (only products with more than 2 units sold).
200 OK):
400—companyIdnot provided.401— Unauthenticated.
GET /2023-11/admin/wrapped/never-sold-products
Products that had zero sales during the year.
200 OK) — items are ProductDetailResource:
400—companyIdnot provided.401— Unauthenticated.
GET /2023-11/admin/wrapped/organization-stats
Organization and discipline statistics: invoices issued, non-invoiced sales rate, expenses recorded, estimated profit, and best expense control month.
Query parameters — year, locale (default fr).
200 OK):
400—companyIdnot provided.401— Unauthenticated.
GET /2023-11/admin/wrapped/regular-customers
Customers who placed more than one order during the year, with a count and top 5 list.
200 OK):
401— Unauthenticated.403— Unauthorized.
GET /2023-11/admin/wrapped/top-expenses
Top 3 highest individual expense bills for the year.
200 OK):
400—companyIdnot provided.401— Unauthenticated.
GET /2023-11/admin/wrapped/top-products
Top 5 products ranked by total revenue for the year.
200 OK) — items are ProductDetailResource:
400—companyIdnot provided.401— Unauthenticated.
GET /2023-11/admin/wrapped/total-expenses
Total expenses amount (sum of all bills) for the year.
200 OK):
400—companyIdnot provided.401— Unauthenticated.
Local Test Endpoints
These endpoints are for development/testing purposes only. They should not be called in production. They are implemented as route closures and may perform destructive operations (data cleanup, test broadcasts, etc.).
