AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

BatchMeterUsage is called from a SaaS application listed on AWS Marketplace to post metering records for a set of customers.

For identical requests, the API is idempotent; requests can be retried with the same records or a subset of the input records.

Every request to BatchMeterUsage is for one product. If you need to meter usage for multiple products, you must make multiple calls to BatchMeterUsage.

Usage records are expected to be submitted as quickly as possible after the event that is being recorded, and are not accepted more than 6 hours after the event.

BatchMeterUsage can process up to 25 UsageRecords at a time.

A UsageRecord can optionally include multiple usage allocations, to provide customers with usage data split into buckets by tags that you define (or allow the customer to define).

BatchMeterUsage returns a list of UsageRecordResult objects, showing the result for each UsageRecord, as well as a list of UnprocessedRecords, indicating errors in the service side that you should retry.

BatchMeterUsage requests must be less than 1MB in size.

For an example of using BatchMeterUsage, see BatchMeterUsage code example in the AWS Marketplace Seller Guide.

Note:

This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginBatchMeterUsage and EndBatchMeterUsage.

Namespace: Amazon.AWSMarketplaceMetering
Assembly: AWSSDK.AWSMarketplaceMetering.dll
Version: 3.x.y.z

Syntax

C#
public virtual Task<BatchMeterUsageResponse> BatchMeterUsageAsync(
         BatchMeterUsageRequest request,
         CancellationToken cancellationToken
)

Parameters

request
Type: Amazon.AWSMarketplaceMetering.Model.BatchMeterUsageRequest

Container for the necessary parameters to execute the BatchMeterUsage service method.

cancellationToken
Type: System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value


The response from the BatchMeterUsage service method, as returned by AWSMarketplaceMetering.

Exceptions

ExceptionCondition
DisabledApiException The API is disabled in the Region.
InternalServiceErrorException An internal error has occurred. Retry your request. If the problem persists, post a message with details on the AWS forums.
InvalidCustomerIdentifierException You have metered usage for a CustomerIdentifier that does not exist.
InvalidProductCodeException The product code passed does not match the product code used for publishing the product.
InvalidTagException The tag is invalid, or the number of tags is greater than 5.
InvalidUsageAllocationsException The usage allocation objects are invalid, or the number of allocations is greater than 500 for a single usage record.
InvalidUsageDimensionException The usage dimension does not match one of the UsageDimensions associated with products.
ThrottlingException The calls to the API are throttled.
TimestampOutOfBoundsException The timestamp value passed in the UsageRecord is out of allowed range. For BatchMeterUsage, if any of the records are outside of the allowed range, the entire batch is not processed. You must remove invalid records and try again.

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5

See Also