Products · Developer guides
Developer Guides
How a USSD flow runs, what a page can read, and where to find the flow format, expressions, templates and the Exchange API.
These guides cover the flow JSON in detail. If you haven't built a flow yet, start with Getting Started.
How a Flow Runs
When a subscriber dials your code, Monime shows the first page of your flow. Each time the subscriber answers, Monime checks the answer, saves it, runs the page's on_done, and shows the next page.
Pages run in the order you list them. A page can change that order:
on_done.next_pagejumps to another page.- An
exchangeaction or adynamicpage asks your server which page comes next. options.skippasses over a page.
The flow ends when:
- a
displaypage is shown - a page with
options.terminalfinishes - your server's exchange response stops the flow
- the subscriber answers no to a yes or no prompt that has an
exit_message - the subscriber hangs up, or the session times out
Payments are built in. A collect_payment page charges the subscriber's mobile money in the session, with no payment integration of your own.
What a Page Can Read
| Write | To read |
|---|---|
$(page.ID.value) | An earlier answer |
$(session.KEY) | The subscriber's number and network |
$(data.KEY) | Data your server sent for this page |
$(sc.KEY) | A value saved earlier in this session |
$(rc.KEY) | A value saved for this subscriber on an earlier visit |
See Variables for the details, and Expressions for comparisons and functions.
Next Steps
Flow Definition
The flow JSON: pages, component types, limits, options and on_done.
Authoring Conventions
Naming, flow shapes, labels, menus and a checklist before publishing.
Page Types
Display, prompt, menu, dynamic, template and side effect pages.
Variables
Read answers, session details, server data and saved values.
Context Stores
Save values for the session (sc) or for the next visit (rc).
Expressions
Comparisons, choices and built-in functions inside $(...).
Templates
Built-in operations such as taking a payment or looking up a KYC name.
Exchange API
Let your server choose pages and send data into the flow.
Example Flows
Complete flows to copy: school fees, weekly giving, meter top-up.
Error Handling
What goes wrong, and how to design for it.