Once a Billing Meter is created, it is important to test it to make sure that the integration is working correctly and that other configuration details are set up as needed in Moesif and the Billing Provider.
Accessing the meter tests
If you created a new billing meter, once you click the Create button, you will be prompted to test the meter.
We generally do not suggest dismissing or skipping the tests since it can help to troubleshoot connectivity issues more easily. You can also run the tests later as well.
If you have an existing meter, you can test it at any time by clicking the Test Meter button after going into the Billing Meter.
There are 4 parts in a Meter Test. Each of them play a critical role in ensuring that the meter is active, subscriptions are created, API calls are being added to metered usage, and that usage is syncing to the billing provider.
Part 0 - Prerequisites
The first step in the test is to ensure that the billing provider integration is enabled on Moesif and that the billing meter is active. Both of these should be enabled.
If both of the billing provider integration and billing meter are enabled, this step may be skipped by default and start the test on Part 1.
Part 1 - Create Subscription
This step requires that you create one or more subscriptions for a customer which uses the product/price/add-on that is used on the billing meter. You will need to go into the Billing Provider and create the subscription. This will then be synced over to Moesif and the test will show as passed/completed. The subscriptions that are synced will also display in the table at the bottom of the test screen.
Part 2 - Send API Calls
Once the subscription is created, you’ll then want to send API calls through for that subscription. The API calls that come into Moesif should be for the user that you created the subscription for in the billing provider. Once the API call comes into Moesif, you should see the test pass and the table at the bottom of the test populate.
Part 3 - Verify Results
Lastly, the test will verify that the API call usage is synced to the billing provider. This may take a little bit of time, up to 30 minutes before this part of the test passes.
Before usage is synced to billing provider and Moesif, the screen will be in a pending state look like this.
Once the usage is synced to the billing provider, the test will then show as passed. At this point, the billing meter is correctly set up and ready to use.