Getting Started
There are several aspects to billing for hub apps, although not all of them will apply to some types of app: charges made by the hub to be paid by the app developer, charges made by the hub paid by the app end user, and charges made by the app developer to be paid by the app user.
If an app seeks authorization from the end user to access the end user's own hub account then it may run workflows, store data and perform other operations that will result in charges. The hub will bill the end user directly for these just as if the end user had performed them directly. The app and app developer will not be able to access data about these charges or add any mark-up.
An app developer who wishes to use pre-created workflows as part of the app's computation and wants that computation to be billed directly to the user must make the workflow public. This means that any user can run it even without using the app or being known to the app developer. If this is not acceptable then consider creating a user service.
An app developer is only charged for an end user's use of an app when either
App developers cannot prevent charges being incurred for user service invocations or egress charges for end users who bypass the app and access them directly. An app developer can, however, design the app to fetch a time-limited token from their own server, relying on the single-origin policy or on a login cookie to identify legitimate app users, and then validate that token inside the user service. Alternatively the user service could validate that the calling workspace is a legitimate app user. This can be found in the `calling_workspace` input.
The Hub does not currently facilitate charging an app's end user for their use of an app, even where the end user is also a hub user. App developers must record access and bill their users directly.
If your app is a server-side app then it can record accesses directly. Developers of client-side apps that depend on calling hub user services must rely on the user service workflow itself. These should be written to validate that the calling workspace is a legitimate user of the app who can be charged before returning any results. If necessary, they should also record any access data required for billing into files in the developer's workspace stores or call APIs on the developer's own servers.