(More info about usage in guide attached)
Below is a basic example of creating usage in Younium. Usage in Younium needs to be keyed on one of the following levels, from least to most specific:
- Order / Subscription
The example below uses the account as key, which will make the usage eligible for invoicing on any order/subscription, product and charge for the Account. This scenario could be enough if the accounts only have one active order at a time. If the case is that accounts have multiple orders active simultaneously, usage must be keyed on at least the order level. In this scenario, the custom field externalAccountId is used as key field for account lookup.
The unit is the second part of linking a usage item to a charge. The unit must match the unit on the charge for the usage to be linked during invoicing. In the example below, the field unit is used as key.
description: 'Usage description',
source: 'Source where the usage was produced',
A usage item can only be updated if it has not yet been processed. A usage item becomes processed as soon it is linked to an invoice in Younium.
The below example uses the id of a usage item as key, and update the quantity to 20.
Usage items can only be deleted in Younium as long as they have not yet been processed.
The example below uses the id field of a usage item as key for delete.