. . .

Billing

If ApiOmat is installed as a whitelabel solution, it is possible to configure plans for apps and connect standalone and/or existing billing and order processes.

Plans

Each application in ApiOmat has exactly one plan, defining which limits apply for this app. Limits are:

  • max number of users

  • max number of space in MB

  • max number of modules allowed to add

  • allowed systems (LIVE, STAGING, TEST)

For whitelabel installations, a Basic plan is automatically created with the following settings:

  • max number of users: 1500

  • max number of space in MB: 300

  • max number of modules allowed to add: 3

  • allowed systems: LIVE

The Basic plan settings can be modified, but the Basic plan itself cannot be deleted and is the default plan for new apps.

To create a new plan, use the following REST call:

curl -X POST https://<YOURHOST>/yambas/rest/plans -d planName="Medium" -d price=49 -d maxUsers=5000 -d maxModules=5 -d maxSize=1000 -d systems="LIVE,TEST" -u <SUPERADMIN-EMAIL>

To update an existing plan, use the following REST call:

curl -X PUT https://<YOURHOST>/yambas/rest/plans/Medium -d "{\"price\":51}" -u <SUPERADMIN-EMAIL>

To retrieve all plans, use the following REST call:

curl https://<YOURHOST>/yambas/rest/plans -u <SUPERADMIN-EMAIL>

Order Process

When a customer clicks on an order button in dashboard, YAMBAS is queried for a redirect URL to an external order process. By default, the ApiOmat payment is used, but you can configure a URL where the customer will be redirected to. The request sequence is described in the following picture:

images/download/attachments/27725020/orderGraph.png

Flow

First thing to do is to define a service URL which is used by YAMBAS to start the order. The URL is defined in apiomat.yaml using the key orderCallbackURL:


yambas:
orderCallbackURL: https://yourdomain.com/callbackURL

The service will recieve a POST request with the following request parameters:

  • appName = Application ID to update

  • appDisplayName = Full application name

  • appPlanName = current application plan

  • customerName = customer name owning the application

  • transactionId = generated ID which can be used to identify the order during the whole process; it is recommended to attach this ID to every request, especially the redirect URLs.

  • secret = secret generated by YAMBAS which is only shared with the external order service; is used to validate the order finalization and prevent customers to update their app plans for themselves. Must not be shown to the customer or any other client!

The request must return the redirect URL in the response and a response code of 200 or 201 in case of success. Otherwise, the return code is returned to dashboard.

Dashboard redirects to the order service, then where the customer can usually select a plan for their app and a payment method. After successful payment, the service finishes the order by sending a POST request to YAMBAS:

curl -X POST https://<YOURHOST>/yambas/rest/order/<APPNAME> -d planName=<SELECTED_PLAN_NAME> -d transactionId=<TRANSACTION_ID> -d secret=<SECRET>

A response of 200 is returned in case of successful order and the app has the new plan set.