Developers

Ruva's API connects your own systems to your business.Coming soon

Paying customers, with a Ruva subscription, make keys in the back office's Developer page and build against their own business: orders, products, stock and reports, with signed webhooks when something happens. There is no free sandbox.

The till and the back office use the same documented REST API: JWT bearer auth, idempotency where it matters, and a real-time event stream, with an explorer you sign in to as your own business.

Authentication

Ruva uses JWT bearer tokens. Log in once for an access/refresh pair, then send the access token on every request. Business endpoints are namespaced under /api/v1.

POST /api/v1/auth/login
curl -s -X POST https://www.ruvapos.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
        "email": "you@yourbusiness.co.za",
        "password": "your-password"
      }'
Response
{
  "accessToken": "eyJhbGciOi...",
  "refreshToken": "8f3c2e1a-...",
  "expiresInSeconds": 3600,
  "user": {
    "id": "...",
    "email": "you@yourbusiness.co.za",
    "role": "MANAGER",
    "locale": "en-ZA"
  }
}

Then authorise subsequent calls with Authorization: Bearer <accessToken>, and refresh when it expires. The token carries your business and your role, so every call is scoped to your own business.

Sign-in takes an email and a password. If your email belongs to more than one business, the answer asks you to name which, and every query is scoped to that business.

Public, unauthenticated routes

A small number of routes sit outside /api/v1 because they're deliberately public:

MethodRouteWhat it is
GET/health, /readyLiveness and readiness
GET/docs, /docs/openapi.yamlThe reference and the spec
GET/receipts/{number}Digital receipts, signed-link access only

A few routes inside /api/v1 are public too, because the caller is a guest with no account — the guest self-order surface (/api/v1/qr/*), online booking and public click-and-collect. They resolve the venue from a location id printed on the table code and are rate-limited. The QR routes additionally answer 403 qr_not_licensed unless the venue holds the QR Ordering product and its licence is current or within its grace period, so build that branch in before you ship.

Conventions

  • Money is integer cents. No floats anywhere near a total — a POS that rounds in binary floating point eventually loses a cent.
  • Menu prices are VAT-inclusive, matching how the till works. VAT is exact: 15/115 of each sale's total after discounts, rounded once to the nearest cent, and shared across its lines.
  • Manager-gated endpoints mirror the in-app permission model: the token's role is checked server-side regardless of what the client showed.
  • Errors use one shape with a documented code catalogue, so a client can branch on the code rather than parse prose.
  • Pagination is consistent across the list endpoints, with shared query parameters.
  • Entitlement is part of the contract. An account holds one or more of three products (Restaurant, Shop and QR Ordering), and the set rides in the access token as a claim, so a client can read it without a round trip. GET /api/v1/licence/entitlements returns the same thing for a UI that has just changed it. Endpoints that belong to a product a caller doesn't hold refuse with a specific code rather than pretending: guest ordering answers qr_not_licensed, and adding a guest order to a table's tab answers tab_not_available unless the venue offers a tab.

Request and response schemas, the error-code catalogue and the endpoint index live in the API reference at /docs. This page is the orientation, not the reference. The reference renders the OpenAPI spec, which currently describes the integration surface rather than the whole server — the back-office administration routes the console uses are largely absent from it. If an endpoint is missing from /docs, it may still exist.

Idempotency

Payments and sale commits accept an idempotency key. This matters more than usual here because a terminal that loses its connection mid-request retries, and a retried payment must not charge twice. Send the same key and you get the same result rather than a second capture.

Design assumption worth knowing. Receipt numbers are sequential per device per day, so two tills ringing simultaneously — and a till that rang offline all afternoon — can't collide when everything syncs.

Webhooks

Payment providers (Yoco and PayFast) confirm asynchronously. Ruva verifies the provider's signature before trusting a delivery, and capture is idempotent, so a provider retry can't double-capture a bill.

ProviderBehaviour
YocoSignature-verified. Yoco retries a failed delivery for roughly 28 hours before deactivating the subscription, so transient downtime is recoverable without manual replay.
PayFastEach notification is checked four ways before anything is captured: its signature, the address it came from, its amount against the order, and PayFast's own confirmation of it.

Pay-by-link depends on this path end to end: the POS creates the checkout, shows a waiting screen, and the bill closes itself when the webhook confirms.

Webhooks to your own systems

The other direction: Ruva tells your systems when something happens — sale.completed, sale.refunded, product.created, product.updated, stock.adjusted, order.created, order.updated, customer.created, customer.updated, kitchen.ticket_ready and kitchen.ticket_bumped. A sale is announced however it was taken, including on a till that was offline and synced later. Add an endpoint on the back office's Developer page, choose its events, and keep the signing secret it shows you once; the page's test button sends a signed ping.

Every delivery is a signed JSON POST in the Standard Webhooks scheme, under Ruva-Webhook-* headers: pass those to a Standard Webhooks library to verify it. Answer 2xx within 10 seconds; anything else is retried with backoff, eight attempts in all, and any delivery can be replayed from the Developer page. The header id is the same on every retry of one delivery; the body's id is the same on a replay, so you can tell a fact you have already applied. Customer events carry the customer's id and never their name or contact details.

Verifying one by hand, in Node:

JavaScript
import crypto from "node:crypto";

// secret: the endpoint's whsec_… value; rawBody: the request body exactly as received.
export function verifyRuva(secret, headers, rawBody, nowSeconds = Date.now() / 1000) {
  const id = headers["ruva-webhook-id"], ts = Number(headers["ruva-webhook-timestamp"]);
  if (!id || !Number.isFinite(ts) || Math.abs(nowSeconds - ts) > 300) return false;
  const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
  const expected = crypto.createHmac("sha256", key).update(`${id}.${ts}.${rawBody}`).digest();
  return (headers["ruva-webhook-signature"] || "").split(" ").some((entry) => {
    if (!entry.startsWith("v1,")) return false;
    const given = Buffer.from(entry.slice(3), "base64");
    return given.length === expected.length && crypto.timingSafeEqual(given, expected);
  });
}

To pull instead, an API app with webhooks:read lists the same events:

shell
TOKEN=$(curl -s -u "$CLIENT_ID:$CLIENT_SECRET" -d grant_type=client_credentials \
  "$RUVA/api/v1/platform/oauth/token" | jq -r .access_token)
curl -s -H "Authorization: Bearer $TOKEN" "$RUVA/api/v1/platform/app/events?type=sale.completed"

Refuse a timestamp more than 5 minutes from your clock. Every event, header and field is in the reference's x-webhooks section, generated from the code that sends them: /docs/openapi.yaml.

Real-time events

Terminals subscribe to a WebSocket stream so a change on one till appears on the others in a second or two, with a background poll as the safety net.

WS /api/v1/sync/ws
kitchen  fired · bumped · ready · rush · recalled
table    seated · cleared
payment  captured

The green "ready to run" banner every terminal pops when the kitchen plates a ticket is this stream, in the browser too.

The sync protocol

Terminals hold a local database and reconcile with the server rather than depending on it:

  • Push — queued changes go up every 30 seconds while online, and immediately on reconnect.
  • Retry — per item, backing off from 1 minute to 1 hour, so a flaky link doesn't hammer the server or drain a tablet.
  • Dead-letter — anything the server refuses, or anything that has failed 10 times, is parked for review, rather than blocking everything behind it.
  • Pull — the device also pulls menu, prices, staff, customers, tables and reservations, so every terminal converges.

Sales rung offline generate their double-entry journals when they sync, so the ledger ends up identical either way. The protocol is documented in full in the API reference.

The morning jobs

These two jobs run by themselves each morning, once a day for each location; a manager can also call their endpoints, signed in as themselves. A call after the morning's run is done answers "already done today" and does nothing more:

MethodRouteWhat it does
POST/api/v1/loyalty/birthday-vouchersIssues today's 20% birthday vouchers, valid 30 days
POST/api/v1/checklists/summary/sendEmails the day's checklist digest

Rate limits

Built in, and every allowance is somebody's own: a client's, by the address its request reached our network from (a forwarded address it typed itself changes nothing), or an API app's, by its token, whichever address it calls from. Past one, the answer is 429 with Retry-After:

WhatAllowance
Sign-in10 a minute per client
Token refresh30 a minute per client
Screen pairing10 a minute per client
Password reset10 a minute per client
Stop link in a message10 a minute per client
Stop link in a message, pressed10 a minute per stop link
Screen pairing: starting20 a minute per client
Screen pairing: waiting240 a minute per client
Screen pairing: adding30 a minute per client
One pairing90 a minute per pairing token
Screen pairing: one business20 a minute per business
Sign-up5 a minute per client
Sign-up: what it offers60 a minute per client
Integration sign-in20 a minute per client
The API600 a minute per API app
Guest ordering600 a minute per client
Guest ratings30 a minute per client
Guest email codes30 a minute per client
Receipts by email10 an hour per client
A takeaway guest's "I'm here"6 a minute per order
A guest calling a waiter or asking for the bill60 an hour per client
Calls from one order10 an hour per order
Counted menu scans5 an hour per client
WhatsApp orders from one guest10 an hour per guest number
WhatsApp orders at one location120 an hour per location
The public sample café20 a minute per sample café visitor
Wrong table codes5 a minute per address and venue
Wrong table codes at one table10 a minute per table
Guest booking60 a minute per client
Large-party booking enquiries5 an hour per client
Till sync600 a minute per client
Readiness and status300 a minute per client
Payment webhooks1000 a minute per client
WhatsApp webhook6000 a minute per client
Support mail webhook600 a minute per client
Kitchen reprints60 a minute per signed-in device
Kiosk counts6 a minute per signed-in device
Kiosk orders60 a minute per signed-in device
Kiosk loyalty sign-ins10 a minute per signed-in device
Kiosk loyalty sign-ins: one business30 a minute per business
Live-update sockets (browser)30 a minute per signed-in device
Counted-stock reads (a till)30 a minute per signed-in device
Billing changes10 a minute per business
Billing change links10 a minute per client
Checklist digest sends5 an hour per business
Asking the agent you forgot to name5 an hour per business
WhatsApp codes confirming a new business's mobile number5 an hour per business
Ledgr key checks10 an hour per client
Second-factor code attempts10 a minute per signed-in device
Changing your own password5 an hour per person
Changing your own name20 an hour per person
Sign-ins at a till's PIN pad20 a minute per signed-in device
PINs set for someone else30 an hour per person

Configuration

Ruva runs the server, so there is nothing to configure on it. Your own systems need only your business's API apps and webhook endpoints, made on the back office's Developer page.

Building something against Ruva?

Tell us what you're integrating and we'll point you at the right endpoints — or tell you straight if the API doesn't cover it yet.

See what's already built in