External Billing Events API: Sample Use Cases and Flows

This article shares some possible sample flows you may encounter when working with external billing events. This can be a helpful jumping off point as you plan your app's implementation.

Report an external billing event using an access token

  1. If you don't have an access token, call Create Access Token and pass it your app instance ID.

  2. Pass the access token as the authorization header to Report External Billing Event.

  3. Send the billing event details in the method parameters:

    Copy
  4. 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:

    Copy

Report an external billing event using an API key

Whether or not you have the app instance ID, you might find yourself in a scenario where you can't generate an access token. This can happen, for example, if a user has already uninstalled your app.

In this case, you can use an API key to report billing events for your app.

  1. Create a new API key in the API key manager of the Wix account that owns your app. This key must have the account-level Manage Custom Apps permission.
  2. Pass the API key as the authorization header when you call Report External Billing Event. In addition, pass your account ID under the header wix-account-id.
  3. Pass your app ID and the billing event details in the method parameters.
Did this help?