How does billing work?

Summary
Everything a developer will need to know about the payment process.

Overview

AHI offers Pay Before plans - where payment is lodged before scans are allowed to be requested, in the form of scan credit, similar to paying a subscription or buying a ticket to a concert.

This is ideal for subscription or user based pricing solutions. For example, a user pays a monthly subscription which entitles them to 100 BodyScans and four FaceScans in a month, for a set fee. The mechanism AHI has developed to help manage this solution is a per-user "scan credit" system, dubbed "ScanControl".

ScanControl

ScanControl is the mechanism AHI have developed to help manage the Pay Before plan. It works as a scan credit system, where scan credit is banked into a virtual wallet for each user, allowing the user to utilize a set number of scans per period. ScanControl is highly configurable depending on the agreement made between client and AHI.

ScanControl: Add Credit

Adding scan credit for the user is done as either scan purchase or subscription payment (different billing identifiers to signal each type). The client app or server calls the AHI payment API, which complies with RevenueCat Webhook specification, to deposit scan credit into the user's scan credit wallet:

ScanControl: Request Scan (Sentinel)

When a user requests to do a scan, the AHI SDK will check if the user is in credit to do that scan or not, using the ScanControl Sentinel mechanism. ScanControl Sentinel simply checks the user's wallet to see if they are in credit before allowing the scan to proceed. There is a GET API the client app or server can call to first check what scan credit the user has before attempting to do a scan for convenience.

ScanControl: Scan Completed (Redeem)

Once a user successfully completes a scan and retrieves a scan result, the scan credit will be redeemed from the user's wallet.

See Using ScanControl Billing System to learn how the service is implemented.