Each of the subscription plans offers some number of operations for free (per operation type) and everything that’s above this plan should be charged.

For charging operational fees we’re using the product manager, which offers endpoints for checking each operation’s fee and committing such transactions.

So it’s not the product manager's responsibility to charge these operations, it is here just to keep evidence of usage for the subscription plan of each user and provide you the information, on how much upcoming operations should be charged and it’s the responsibility of other services to create transactions for it and when successfully executed committing them again to product manager.

Supported operations

Product manager currently supports the following operation types:

  • TRANSFER

  • TOP_UP

  • ATM_WITHDRAWAL

  • CASH_IN

  • REMITTANCE_SERVICE

If your operation is missing, let squad Accounts and Subscriptions know.

Usual use case

Transaction processor manager would like to create a transaction for the user of the TRANSFER type.

It needs to find out if such a transaction should be charged as an operation that’s above the user’s subscription plan or if the plan covers it. In case it should be charged this needs to be confirmed with the user before such charging is applied.

Note: Some operation types might not require notifying users (such as ATM-WITHDRAWALS), in such case you might skip querying product manager

So first step is to check current usage with query endpoint. After that, if the response says the operation will be charged you can display this information to the user and get his consent for charging it. The response contains the precise amount that will be charged use it for confirmation.

If the user has approved charging or consent is not required for the operation type, the operation should be committed to the product manager by calling the commit endpoint. Here the response again contains the amount that should be covered.

If this consent was required and its amount is different from what user was presented after query operation (this might happen for example when multiple operations are being performed simultaneously), the commit should be reverted immediately by calling the revert endpoint and new consent needs to be obtained.

If the operation is for free (it is covered by the subscription plan) or the response from commit contains what has been confirmed with user, the operation can be performed (here create a transaction of TRANSFER type) and a transaction for charging user this operational fee can be created.