Converting Metrics to Charges

The Wasabi Account Control API provides for retrieving sub-invoices for the sub-accounts. Sub-invoices are generated at the same time the control account invoice is computed (every 30 days) and accounts for all of the business rules outlined above (minimum object lifetime, minimum object size, minimum storage requirements, etc.). Therefore it is easiest for API developers to simply use this feature when creating chargeable events for the API developer’s customers.

However, if API developers wish to implement their own billing mechanism, the following indicates how to compute costs on a per-account basis:

Active Storage Charges

SUM-OVER-BILLING-PERIOD(
MAX(
  ((PaddedStorageSizeBytes+MetadataStorageSizeBytes)/1024.0/1024.0/1024.0), 1024)
  *
  ({partner-rate-per-TB-per-Month-with-Wasabi}/30/1024)
)

Deleted Storage Charges

SUM-OVER-BILLING-PERIOD(
  (DeletedStorageSizeChage/1024.0/1024.0/1024.0)
  *
  ({partner-rate-per-TB-per-Month-with-Wasabi}/30/1024)
)

Egress Charges

SUM-OVER-BILLING-PERIOD(
	DownloadBytes * {partner-rate-per-GB-egress}
)

The MAX(..., 1024) in the Active Storage Charge is to reflect the minimum required storage business logic (in this case, 1 TB = 1024 GB). A future version of this API will include an additional metric in the Utilization to better reflect the minimum storage requirements.

To reiterate, the algorithms above will not be needed by API developers if they use the existing sub-invoice API endpoints described in the Invoices section. We highly recommend using the existing endpoints so as to not have to duplicate business logic in the API developer client code.