This article presents possible use cases and sample flows that you may encounter when working with external billing events. This can be a helpful jumping off point as you plan your app's implementation.
Important: These examples are only for Partner Billed Apps that process payments outside the Wix Billing system, using their own payment provider. If you use an external pricing page but Wix processes your payments, use the Billing API instead.
Use this flow when you have an app instance ID and can generate an access token for authentication.
To report external billing events using an access token:
If you don't have an access token, call Create Access Token and pass your app instance ID in the request.
Call Report External Billing Event and pass the access token as the Authorization header.
Specify the billing event details in the method parameters:
The response contains the app and instance IDs extracted from the access token. It also echoes any parameters that you passed in the method call:
Use this flow when an access token cannot be generated but you still need to report a billing event. For example, if a Wix user uninstalls your app, you won't be able to generate access tokens for that app instance afterward.
To report external billing events using an API key:
Manage Custom Apps permission.Authorization header. In addition, pass your account ID in the wix-account-ID header. Your account ID will be listed within the
API key manager.