Usage-based contracts

An overview of the typical use case handling in regards to usage data records (UDRs).

Depending on the nature of your product, service or licence, the regular invoice to be created may vary as the underlying billing model depends on the consumption/usage within the related period of time. For this type of products, you will have to work with the usage data records (UDR). UDR represent the customer's usage data in the context of the subscription module. In case of usage-based products, they play an important part of your billing data. The subscriptions module provides a variety of mechanisms to deal with the processing of the provided usage data.

How it works

When providing usage data records, the following process steps will take place:

  • (Prerequisite) Merchant stores relevant data on their end while customer is consuming a usage-based product within a billing period.
  • Customer sends UDR at any time.
  • Merchant sends usage data to Accounting as a Service.
  • Accounting as a Service stores the received usage data as UDR.
  • Based on regularly scheduled jobs (e.g. once per month) and asynchronously to the reception, Accounting as a Service processes the data.

When processing customer usage data, the following types of asynchronous process tasks exist:

  • Guiding: Handles the assignment of usage data to customer contracts.
  • Rating: Pricing of the usage data based on the data stored in the product and tariff information.

The processing tasks are covered asynchronously by regularly executed jobs. This type of usage data processing is common in industries where invoicing is not time-critical or only occurs once a month.

High-level process description
A process overview using BPMN
Checkout the BPMN illustration to get an overview of the process, including the various activities and participating main actors.

How to implement

Provide customer usage data

To provide customer usage data, make a POST /subscriptions/{version}/usage request.

Sample request
POST /subscriptions/v1/usage HTTP/1.1
Host: api-uat.accounting.riverty.io
X-Subscription-Key: YOUR_API_SUBSCRIPTION_TOKEN
Content-Type: application/json

{
  "transactionID": "TR13134131223",
  "usageStart": "2018-12-01T00:00:00.0000000",
  "usageEnd": "2018-12-31T00:00:00.0000000"
  "usageType": "CarRentUsage",
  "VIN": "SGZCZ43D13S812715",
  "contractId": "CON123",
  "distance": 112
}
Sample response
HTTP/1.1 200 OK

See also