Recently, we added a feature to record usage via Kaui. Kaui simply invokes the Record Usage API to record the usages. However, if the subscription is created corresponding to an aviate based usage plan (that has a billing meter), this would not work. For such plans, usages need to be recorded via the Submit Usage Events API.
Changes on the Kaui side:
- Invoke the https://apidocs.killbill.io/aviate-catalog#get-catalog-info to determine if the catalog is XML based or Aviate based
- If the catalog is XML based, keep the same behavior as current - show the current form and invoke the Record Usage API to record the usages on submit
- If the catalog is Aviate based, show a form that allows submitting the following data and invoke the Submit Usage Events API:
- billingMeterCode
- subscriptionId (may not require a separate field)
- trackingId
- timestamp
- value
Some notes:
- All the fields between the Record Usage Form and Submit Usage Events form are the same, except for the unit field, so the Record Usage API requires the
unit field while the Submit Usage Events API requires the billingMeterCode field. So maybe we should show the same form but only change the label of the field to either unit or billingMeterCode depending on the type of the catalog
- Maybe we should show some tooltip or help information, so users are not confused about why they sometimes see the
unit field and why they sometimes see the billingMeterCode field.
Recently, we added a feature to record usage via Kaui. Kaui simply invokes the Record Usage API to record the usages. However, if the subscription is created corresponding to an aviate based usage plan (that has a billing meter), this would not work. For such plans, usages need to be recorded via the Submit Usage Events API.
Changes on the Kaui side:
Some notes:
unitfield while the Submit Usage Events API requires thebillingMeterCodefield. So maybe we should show the same form but only change the label of the field to eitherunitorbillingMeterCodedepending on the type of the catalogunitfield and why they sometimes see thebillingMeterCodefield.