Overview
OpenMeter Usage Syncs enables you to report aggregated usage to external systems
like billing and CRMs to keep your data in sync. Syncs can run every minute
,
hour
, or day
and be filtered by both subject
and usage
.
Configuring Syncs
OpenMeter Cloud has a UI to configure usage syncs.
Create Usage SyncVia API
Setting up a sync via API that reports the daily usage looks as:
Note how we use the optional filter
property here only to report usage greater
than 100
.
Filtering is possible on both subject
and usage
. Available filters are:
$gt
, $gte
, $lt
, $lte
, $eq
, $ne
, $in
and $nin
. You can filter for
specific subjects as
filter: { subject: { $in: ["customer-1", "customer-2"] } }
.
Example Webhook Sync Payload
Usage syncs are delivered as JSON payloads to your
webhook endpoint. We deliver a separate webhook for
each subject. The usage
array contains the aggregated usage for the subject.
If the report defines a group by the usage property, it will contain a separate
entry for each group.
Consuming Webhooks
To consume OpenMeter webhooks, you need to verify the webhook signature and process the payload. Check out the Consuming Webhooks guide for more details.
Debugging Syncs
You can debug syncs in the OpenMeter Cloud UI by checking the sync status and logs. The sync status shows the last run time, the status of the last run, and if any errors occurred.