Introduction
Togai
Togai is an API-first metering and pricing solution service which helps any business to configure, manage and iterate pricing for their customers. Togai supports configuring multiple pricing options like usage-based pricing, subscription pricing, hybrid pricing models and within that, Togai supports multiple pricing strategies like tiered pricing, volume pricing, package-based pricing, minimum commitments. Along with all these features, functionalities like credits, invoice management can be handled end-to-end with Togai. Overall Togai provides an easy way (no-code/low code) way to configure and manage the revenue operations for a business.
Also Togai has rich integrations support with other applications (like popular payment gateways, CRMs, accounting softwares etc). So the existing business processes can be easily improved with Togai.
Postman flows
Postman flows on the other hand is a visual programming tool which helps to easily connect, configure and orchestrate APIs using an easily configurable low code editor.
Objective
This post is about using Togai APIs and Postman flows to showcase on how easily businesses can configure and manage their revenue operations. For the sake of this post, we are going to configure postman flow to handle the basic metering & pricing requirements for a sample business.
- When the customer is onboarded, create a customer and associate a price plan to the customer in Togai.
- When a customer uses the service, ingest the customer's usages data using Togai APIs.
- See the revenue generated from a customer and revenue trends using Togai APIs and Postman's charts widgets
Setup
We are going to take a use case of a ride hailing business where the company hails different vehicle types and they have a fixed pre-paid which will be charged immediately and a post-paid overage plan which will be changed to the customer at the end of subscription’s billing period.
Before we start configuring or executing any postman flows, first step is to setup Togai so that the customer onboarding and revenue management can be done easily. Follow the below steps in-order to setup Togai.
Step-1: sign-up/sign-in using your business email with https://app.togai.com portal.
Step-2: Once after logged in Togai account, set the base currency through which your business is going to look into the revenue analytics. This can be done in Togai’s admin center page - https://app.togai.com/admin-center/currencies
Step-3: Configure the event schemas. This represents the structure through which your application will be sending usage data to Togai. Togai expects you to configure the attributes (numerical values of your customer’s usage) and optionally dimensions (labels/tags which gives more information about the usage) as part of the event schema.

Step-4: Create usage meters for the event schemas configured in Togai. Usage meters are basically the metrics which can be configured to measure and also to generate revenue against. Its one of the powerful features of Togai where any filtering and mathematical transformations can be applied for the events.

Step-5: Create a price plan in app.togai.com using the usage meters configured above. For the sake of this example, there is a fixed pre-paid plan of 100$ which covers 20 mile bike rides and 100 mile car rides and post that every mile travelled through car will be charged 1.5$ and every bike ride mile will be charged with 1$.
Configure the postman flow to automate your pricing
Now since the setup is completed in Togai, its time to configure the postman flow to automate your pricing.
Step-6: Get the api secret/bearer token of your Togai account from Togai’s admin center page - https://app.togai.com/admin-center/api-tokens
Step-7: Fork the postman collection (https://www.postman.com/togai-postman-flows-integration/workspace/public-workspace/collection/19015878-79ca67e9-c9fd-4ca5-9319-406eeb7af4af?action=share&creator=19015878) to your workspace. This has the list of APIs and configurations specific to the automation requirements discussed in this post. If you are looking to get the list of all APIs available in Togai, either you can visit Togai docs page (docs.togai.com) or the full API collection from Togai’s public workspace.
Step-8: Fork the postman flow (https://www.postman.com/togai-postman-flows-integration/workspace/public-workspace/flow/6475caf0b6b0b4003230aef6) which has the configurations to automate the usecases discussed earlier.
Step-9: This flow expects the {{bearerToken}} created as part of Step-6 from Togai. So create an environment and set the variable “bearerToken” and paste the api secret value.
Time to run the postman flow
Finally we arrived at a stage where we will be seeing the output for the effort we have put in to configure the steps. The forked postman flow has 3 sub-flows which performs 1) customer creation & default price plan association 2) ingest events 3) customer revenue report generation. We will be triggering each flow one by one now.
Customer onboarding flow
To trigger the customer onboarding flow, start the forked out postman flow with “create.customer” payload.
Sample request payload to trigger customer onboarding sub-flow
{
"action":"create.customer",
"payload": {
"name":"James Bond",
"email":"james@m16.co.uk",
"address": "London, United Kingdom",
"id": "007"
}
}
Event ingestion flow
To ingest usage events, start the forked out postman flow with “ingest.event” payload. You can ingest the raw events generated by your application to Togai directly using this flow.
Sample request payload to trigger event ingestion sub-flow
{
"action":"ingest.event",
"payload": {
"schemaName":"Rides",
"timestamp":"2023-05-30T06:37:27.000Z",
"accountId": "007",
"distanceTravelled":"400",
"timeTaken": "300",
"vehicleType": "car",
"city": "London"
}
}
Revenue report generation flow
To trigger revenue report generation flow, start the forked out postman flow with “get.report” payload
Sample request payload to trigger event ingestion sub-flow
{
"action":"get.report",
"payload": {
"startTime":"2023-04-30T06:37:27.000Z",
"endTime":"2023-06-30T06:37:27.000Z",
"accountId": "007"
}
}
Summary
In conclusion, Togai APIs and Postman flows form a powerful combination which can help any business to easily automate their pricing and revenue operations. The post shows the glimpse of the power and like the flows configured in this post, businesses can configure any pricing related flow customisations using Togai APIs and deploy them with Postman. Without much of engineering effort, this combination helps businesses to get their operations up and running easily.

