Metering for usage - AWS Marketplace

Metering for usage

For software as a service (SaaS) subscriptions, you meter for all usage, and then customers are billed by AWS based on the metering records that you provide. For SaaS contracts, you only meter for usage beyond a customer’s contract entitlements. When your application meters usage for a customer, your application is providing AWS with a quantity of usage accrued. Your application meters for the pricing dimensions that you defined when you created your product, such as gigabytes transferred or hosts scanned in a given hour. For example, if you charge based on the amount of data sent into your application, you can measure the amount of data and send a corresponding metering record once an hour. AWS calculates a customer’s bill using the metering data along with the prices that you provided when you created your product.


Optionally, you can split the usage across properties that you track. These properties are exposed to the buyer as tags. These tags allow the buyer to view their costs split into usage by the tag values. For example, if you charge by the user, and users have a "Department" property, you could create a usage allocations with tags that have a key of "Department", and one allocation per value. This does not change the price, dimensions, or the total usage that you report, but allows your customer to view their costs by categories appropriate to your product.

We recommend that you send a metering record every hour to give customers as much granular visibility into their usage and costs as possible. If you aggregate usage in time periods greater than an hour (for example, one day), continue sending metering records every hour and record a quantity of 0 if there is no usage to report for that hour. Report usage to AWS on an hourly basis for all of your customers, in batches of up to 25 at a time.

AWS can only bill customers for usage of your product upon receiving metering records from you. You're responsible for ensuring that your product’s metering records are successfully transmitted and received. You can use AWS CloudTrail to verify the record or records that you send are accurate. You can also use the information to perform audits over time. For more information, see Logging AWS Marketplace API calls with AWS CloudTrail.

Configure your product to meter usage

You use the BatchMeterUsage operation in the AWS Marketplace Metering Service to deliver metering records to AWS. Keep the following in mind:

  • We require sellers to use batching by using the BatchMeterUsage operation.

  • We deduplicate metering requests on the hour.

    • Requests are deduplicated per product/customer/hour/dimension.

    • You can always retry any request, but if you meter for a different quantity, the original quantity is billed.

    • If you send multiple requests for the same customer/dimension/hour, the records are not aggregated.

  • Your metering records contain a timestamp that can't be later than 1 hour in the past.

  • BatchMeterUsage payloads must not exceed 1MB. Choose the number of usage records to send in a BatchMeterUsage request so that you don't exceed the size of the payload.

  • The AWS Marketplace Metering Service is available in 14 AWS Regions. By default, the US East (N. Virginia) Region is enabled for SaaS metering products when you request your product. If you intend to use other Regions, contact the AWS Marketplace Seller Operations team. For more information, see BatchMeterUsage.

For code examples, see Code examples.

Example: Host scanning

Your product analyzes computing hardware for known security vulnerabilities. Customers manually initiate or schedule these scans of their Amazon Elastic Compute Cloud (Amazon EC2) instances. As your product performs these scans, it tallies the number of unique hosts scanned every hour. In this example, your product uses the Hosts category. You can declare multiple dimensions for the types of hosts scanned. For example, you can charge different prices for small, medium, and large hosts.

Example: Log analysis

Your SaaS product digests logs that are generated by customer products, reporting trends, and anomalies. As customers upload logs to your product, you measure the quantity of data received in megabytes, gigabytes, or terabytes. On the tenth minute of every hour, a cron job reads this usage for each customer for the previous hour. The job builds a batch report and uses the BatchMeterUsage operation to send it to AWS. In this example, your product uses the Data category. Your product can also meter for the amount of log data stored for any given hour. In this case, your product can meter along two dimensions: data received in the hour and total data stored in the hour. You can continue to meter for data stored until the customer deletes this data or it expires.