Skip to content
cyrenes

Developers

Build on Cyrenes

Sign in, raise invoices, share pay links and collect by mobile money from your own systems. It's the same /api/v1 that runs the Cyrenes web and mobile apps, over one ledger.

REST · JSON
PascalCase over HTTPS
JWT
15-min access, 6-month refresh
v1
Versioned paths
OpenAPI 3.0
Public spec
1# Exchange a user's credentials for a token pair2curl -X POST https://erp.cyrenes.io/api/v1/auth/login \3  -H "Content-Type: application/json" \4  -d '{"Email": "api@kivuhardware.rw", "Password": "<password>"}'
Response 200 OK
1{2  "Success": true,3  "Data": {4    "Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…",5    "RefreshToken": "Qm9vc3Q1b1c0aEJ0bGRqS2x4…",6    "ExpiresAtUtc": "2026-09-25T08:15:00Z"7  }8}
Real request and response shapes. Full spec: /api/v1/openapi.json

Authentication

Sign in once, stay scoped to one business

Every call carries a short-lived bearer token. The token decides who is calling and which business they're acting for.

JWT bearer tokens

POST /auth/login returns a 15-minute access token and a 6-month refresh token. Send the access token as Authorization: Bearer.

The business comes from the token

Each token carries a TenantId claim, so there is no tenant header to send. Users in several businesses list them with GET /tenants and change with POST /tenants/switch.

PIN sessions for tills

A shared POS terminal unlocks per cashier with POST /pos/unlock, which returns a token scoped to the till.

Token lifecycle
  1. 1
    POST/api/v1/auth/login{ Email, Password }

    Token (15 min) + RefreshToken (6 months)

  2. 2
    GET/api/v1/me

    Authorization: Bearer <Token> on every call

  3. 3
    POST/api/v1/auth/refresh{ Token, RefreshToken }

    A fresh token pair before the old one expires

  4. 4
    GET/api/v1/tenants

    The businesses this user belongs to

  5. 5
    POST/api/v1/tenants/switch{ TenantId }

    A new token pair scoped to that business

  6. 6
    POST/api/v1/auth/logout{ RefreshToken }

    Revoke the refresh token

No API keys yet: integrations sign in as a user

Create a dedicated user for each integration and give it a role group with only the permissions it needs. Its actions show up under its own name, and you can switch it off without touching anyone else.

Conventions

Predictable on every endpoint

One envelope, one casing, one way to page and one way to retry safely. Learn them once and every resource works the same.

GET /api/v1/invoices200 OK
{
  "Success": true,
  "Data": {
    "Items": [
      {
        "Id": 1042,
        "InvoiceNo": "INV-1042",
        "CustomerName": "Kivu Hardware Ltd",
        "DueAmount": 1250000,
        "CurrencyCode": "RWF",
        "StatusDisplay": "Due"
      }
    ],
    "TotalCount": 214,
    "NextCursor": "20"
  }
}
POST /api/v1/invoices400
{
  "Success": false,
  "Error": {
    "Code": "validation_failed",
    "Message": "Customer is required.",
    "Fields": { "CustomerId": "Customer is required." }
  }
}

Success or an error code

Responses are wrapped as { Success, Data } or { Success, Error }, with a machine-readable Code you can branch on.

Error.Code values
validation_failed
One message per offending field, in Error.Fields
bad_request
The request can't be processed as sent
not_found
No such record in this business
in_use
A delete refused because other records still reference it
closed_period
The date falls in a closed accounting period
idempotency_key_required
A money-moving POST was sent without Idempotency-Key
idempotency_key_reused
422: the key was already used with a different body
no_active_tenant
The token isn't scoped to a business

Cursor pagination

Lists return 20 per page with Items, TotalCount and NextCursor. Pass it back as ?cursor=; it is null on the last page.

GET /api/v1/customers?cursor=20&search=kivu

Idempotency-Key

Required on money-moving POSTs: create, finalize, convert, record payment, share, collect, payouts and batch submits. Keys are kept 24 hours per business; only successful responses are replayed, and the same key with a different body returns 422.

Idempotency-Key: 9f1c2b7e-4d3a-4e8b-a6f0-1042a1

Module gating

Routes for a module the business doesn't have return 404. Read EnabledModules from GET /me to know what's on.

GET /api/v1/me → { "EnabledModules": [ … ] }

Versioning & uploads

The version is in the path, /api/v1. JSON is PascalCase both ways. Uploads are multipart; request bodies are capped at 25 MB (receipt attachments at 20 MB).

POST /api/v1/expenses/{id}/attachment

Reference

Resources your business runs on

A curated map of the API. Paths are relative to https://erp.cyrenes.io/api/v1; the OpenAPI spec has every route, parameter and schema.

openapi.json

Invoices, quotes & drafts

One resource, three categories: Invoice, Draft and Quote.

  • GET
    /invoices

    List with cursor, search, customer, status, date and category filters

  • POST
    /invoices

    Create an invoice, draft or quoteIdempotency-Key

  • GET
    /invoices/{id}

    Header, lines and balances

  • POST
    /invoices/{id}/finalize

    Finalize a draftIdempotency-Key

  • GET
    /invoices/{id}/convert-preview

    Preview a quote or draft conversion

  • POST
    /invoices/{id}/convert

    Convert a quote or draft into an invoiceIdempotency-Key

  • POST
    /invoices/{id}/payments

    Record a payment against the invoiceIdempotency-Key

  • GET
    /invoices/{id}/pdf

    Download the branded PDF

  • POST
    /invoices/{id}/cancel

    Cancel the document

Pay links & collections

Mobile money through MTN MoMo and Airtel Money.

  • GET
    /invoices/{id}/pay-link

    Public page where the customer pays by MoMo or card

  • POST
    /invoices/{id}/share

    Email the invoice PDF with its pay linkIdempotency-Key

  • POST
    /invoices/{id}/collect

    USSD push to the customer's phoneIdempotency-Key

  • GET
    /payments/{gatewayTxId}/status

    Pending, Processing, Successful, Failed or Expired

  • GET
    /payees/lookup

    Verify the name registered to a phone number

  • POST
    /payouts

    Pay out to mobile money from the walletIdempotency-Key

Customers, suppliers & items

  • GET
    /customers

    List and search customers

  • POST
    /customers

    Create a customer

  • PUT
    /customers/{id}

    Update a customer

  • GET
    /suppliers

    List and search suppliers

  • GET
    /items

    List products and services

  • POST
    /items

    Create an item

Purchases

Same shape as invoices, for the buying side.

  • GET
    /purchases

    List purchases

  • POST
    /purchases

    Create a purchaseIdempotency-Key

  • POST
    /purchases/{id}/finalize

    Finalize a draft purchaseIdempotency-Key

  • POST
    /purchases/{id}/payments

    Record a supplier paymentIdempotency-Key

  • POST
    /purchases/{id}/pay/wallet

    Pay the supplier by mobile moneyIdempotency-Key

Expenses

  • GET
    /expenses

    List expenses

  • POST
    /expenses

    Record an expense (optional Idempotency-Key and CapturedDate for offline capture)

  • POST
    /expenses/{id}/attachment

    Attach the receipt photo or scan

  • POST
    /expenses/{id}/pay/wallet

    Pay the expense by mobile moneyIdempotency-Key

  • GET
    /expense-types

    Expense categories

Approvals

  • GET
    /workflow/approvals

    What is waiting for your sign-off

  • GET
    /workflow/approvals/{id}

    One request and its levels

  • POST
    /workflow/approvals/{id}/approve

    Approve with an optional comment

  • POST
    /workflow/approvals/{id}/reject

    Reject with a comment

  • GET
    /workflow/definitions

    Approval levels per document type

Bulk payments

  • POST
    /bulk-payments/collections

    Start a collection batch

  • POST
    /bulk-payments/collections/{id}/lines

    Add invoices to the batch

  • POST
    /bulk-payments/collections/{id}/submit

    Submit for approval and sendingIdempotency-Key

  • POST
    /bulk-payments/payouts/{id}/lines/purchases

    Add supplier bills to a payout batch

  • POST
    /bulk-payments/payouts/lines/{lineId}/verify

    Verify the payee name on a line

  • POST
    /bulk-payments/payouts/{id}/submit

    Submit the payout batchIdempotency-Key

  • GET
    /bulk-payments/dashboard/{id}

    Per-line status for a batch

  • GET
    /bulk-payments/templates

    Scheduled and recurring templates

Accounting & reports

  • GET
    /accounting/reports/profit-and-loss

    Profit and loss for a period

  • GET
    /accounting/reports/balance-sheet

    Balance sheet as at a date

  • GET
    /accounting/reports/trial-balance

    Trial balance

  • GET
    /accounting/reports/cash-flow

    Cash flow statement

  • GET
    /accounting/reports/general-ledger

    General ledger by account

  • GET
    /accounting/chart-of-accounts

    The business's chart of accounts

  • POST
    /accounting/journal-entries

    Post a manual journal entry

POS

  • POST
    /pos/unlock

    Cashier PIN unlock for a till session

  • POST
    /pos/session

    Open a sale

  • GET
    /pos/items/by-code/{code}

    Look up an item by barcode or code

  • POST
    /pos/session/{id}/lines

    Add a line to the sale

  • POST
    /pos/session/{id}/checkout

    Take payment and close the sale

  • GET
    /pos/sales/today

    Today's sales at the till

Sites & attendance

  • GET
    /sites

    Project sites

  • GET
    /sites/{id}

    One site and its details

  • GET
    /daily-attendance

    A day's attendance sheet

  • PUT
    /daily-attendance

    Save the attendance sheetIdempotency-Key

  • GET
    /labour-runs/preview

    Preview wages for a period

  • POST
    /labour-runs/{id}/disburse

    Pay the labour run

Notifications & push

  • GET
    /notifications

    The signed-in user's inbox

  • GET
    /notifications/unread-count

    Unread badge count

  • POST
    /notifications/read-all

    Mark everything read

  • POST
    /push/register

    Register a device for push notifications

Realtime & payment status

Know when a payment lands

Mobile money settles asynchronously. Poll the payment for its status, and listen on the SignalR hub for changes across the business while you're connected.

GET/api/v1/payments/{gatewayTxId}/status
  • PendingCreated and queued for the provider
  • ProcessingWith the provider, awaiting the customer
  • SuccessfulPaid; the invoice and ledger update on settlement
  • FailedDeclined or errored; read FailureReason
  • ExpiredNot approved in time

No outbound webhooks today

Cyrenes doesn't call your servers. Poll a payment's status, listen on the hub while your app is connected, or both. There is no payment-status hub event, so watch for invoice · updated or poll.

/hubs/notifications · SignalRWeb socket
// @microsoft/signalr — the token goes in the query string
const hub = new HubConnectionBuilder()
  .withUrl("https://erp.cyrenes.io/hubs/notifications", {
    accessTokenFactory: () => token,
  })
  .build();

hub.on("activity", (e) => {
  // { entity: "invoice", action: "updated", id: 1042, … }
  if (e.entity === "invoice") refreshInvoice(e.id);
});
hub.on("notify", (e) => showBadge(e.unreadCount));
await hub.start();

activity

Per business. Entity, Action, Id, OccurredAtUtc.

expenseinvoicepurchaseapproval
createdupdatedcancelledraiseddecided

notify

Per user. The new Notification plus the user's UnreadCount, the same inbox as GET /notifications.

OpenAPI

Generate a client from the spec

The full OpenAPI 3.0 document is public at /api/v1/openapi.json. Import it into Postman or Insomnia, or generate a typed client with the tooling you already use.

GET /api/v1/openapi.jsonOpenAPI 3.0
{
  "openapi": "3.0.1",
  "info": { "title": "…", "version": "v1" },
  "paths": {
    "/api/v1/auth/login": { "post": { … } },
    "/api/v1/invoices": { "get": { … }, "post": { … } },
    "/api/v1/invoices/{id}/pay-link": { "get": { … } },
    "/api/v1/invoices/{id}/collect": { "post": { … } },
    "/api/v1/payments/{gatewayTxId}/status": { "get": { … } }
  }
}

Get API access

Tell us what you're building. We'll help you set up an integration user with the right role group and test your flow against your own business before you go live.

Ship your integration with a team behind it

Start free, then talk to us about API access for your business.

Start in minutes

Open an account, add your business and send your first pay link the same day.

One ledger

Every payment, invoice, purchase and expense posts to the books automatically.

Talk to a person

Our team in Kigali helps you set up rails, approvals and your chart of accounts.