Monetization catalogue API reference
The read-only addresses your website or app reads active plans, their prices and your features from, with sign-in, paging, search and the fields each one returns.
- Applies to
- Monetization 3.0 and later
- Who can do this
- Developer
On this page
Overview
Monetization serves its catalogue, your active plans and features, so a website or app can show a pricing page. It's read only: nothing here starts a subscription or changes a plan.
There are two copies of the same addresses, which differ only in how the caller signs in:
| Surface | Base path | Sign-in |
|---|---|---|
| Web | /api/ | In Core 12.7 and 12.8 none works. A signed-in Laramin session and a token from POST /api/ both get 401. |
| Mobile | /api/ | The token your mobile app gets when its user signs in, or a personal API token. |
Use the mobile addresses. Any signed-in user can call them. No Monetization permission is needed, and the answers are the same whichever business the caller works in. An anonymous visitor gets 401.
A personal API token from Account menu › API Tokens works on the mobile addresses. Send it as Authorization: Bearer <token>. The web addresses refuse it with 401, like every other caller. See Create and manage personal API tokens and Authenticate API requests.
- Verbs: every address is
GET. - Responses use Laramin's standard envelope:
{ success, message, data, meta }. Errors carry{ success: false, message, … }. - Paging: lists take
?page=and?per_page=.per_pageis at least 1 and at most 100. - Empty is not an error: a catalogue with nothing active answers
200with an empty list. - Names are
snake_case. Dates are ISO 8601.
Plans
GET plans
Every plan whose Status is Active, ordered by Order and then slug. 20 per page by default.
The list includes Enterprise plans and plans whose Visible to is Internal. Use is_enterprise and visibility to decide what your pricing page shows.
| Field | What it is |
|---|---|
id, slug | The plan's id and its permanent slug. Use the slug to refer to a plan. |
name, description, specifications | Text in the caller's language when a translation exists. |
status | Always active here. |
sort_order | Order on the plan form. |
visibility | The stored code, such as fvby_public or fvby_internal, or null. |
is_featured, is_enterprise, is_default, is_ | The plan's Featured, Enterprise, Default and Taxable switches. |
region_id, region_key | The plan's region, or null. region_key is the country and state, such as IN:Karnataka, or IN:__ALL__ for a whole country. |
image | A full address for the plan's Image, or null. |
pricings | The plan's active prices. See below. |
created_at, updated_at | When the plan was created and last changed. |
Each entry in pricings:
| Field | What it is |
|---|---|
currency_code | Such as INR. |
interval, interval_count | day, week, month, quarter or year, and how many of them. month with 3 means every three months. |
price_minor, price | The price in the currency's smallest unit (an integer), and the same price as a decimal string. Use price_minor for sums. Not every currency has two decimals: JPY has none and OMR has three. |
setup_fee_minor | The Setup fee, in the smallest unit. |
trial_period | Trial days, or null. |
A plan's entitlements (which features it includes and their values) aren't part of this response.
Features
| Method | Path | Returns |
|---|---|---|
| GET | /api//api/ | Every active feature, ordered by slug. 15 per page by default. |
| GET | /api//api/ | Active features whose slug or Internal title contains the keyword. 10 per page by default. Without keyword, 422 with A keyword is required. |
| GET | /api//api/ | One active feature. Without slug, 422 with A slug is required. An unknown or inactive slug answers 404 with No feature is published under that slug. |
Each feature:
| Field | What it is |
|---|---|
id, slug | The feature's id and its permanent slug. |
title | The Internal title, for your team. |
label | The Customer label: what to show on a pricing card. Can be null. |
description | The feature's description. |
status | Always active here. |
unit_type | The stored code of the kind of value, such as futs_number or futs_boolean. |
unit | What the number counts, such as GB, or null. |
visibility, flag | Stored codes, such as fvby_public and fflg_beta, or null. |
default_value | Default value, or null. |
is_usage_metric | true when the feature is Metered. |
scope | Always monetization.root for features created on screen. |
created_at, updated_at | When the feature was created and last changed. |
The stored codes start with futs_, fvby_ and fflg_ on purpose. Compare them as they are, and don't strip the prefix.
Example
Couldn't copy. Select the code and press Ctrl+C (⌘+C on a Mac).
GET /api/v1/mobile/module/monetization/plans?per_page=10
Accept: application/json
Authorization: Bearer <token>Replace the highlighted values with your own.
Couldn't copy. Select the code and press Ctrl+C (⌘+C on a Mac).
{
"success": true,
"message": "Success",
"data": [
{
"id": 4,
"name": "Growth",
"slug": "growth",
"status": "active",
"is_enterprise": false,
"region_key": "IN:__ALL__",
"pricings": [
{ "currency_code": "INR", "interval": "month", "interval_count": 1,
"price_minor": 149900, "price": "1499.00", "setup_fee_minor": 0, "trial_period": 14 }
]
}
]
}Fields are shortened in this example.
Thanks. That helps us decide what to write next.
Thanks for telling us what was missing.
You already answered for this article today. Thanks.
We got a lot of answers from your network just now. Try again in a few minutes.
We couldn't send that. Check your connection and try again.
Links in this article
Printed from help.bsscn.com. The online article may have changed since.