Skip to content

Batch Meter Usage

marketplacemetering_batch_meter_usage R Documentation

The CustomerIdentifier parameter is scheduled for deprecation

Description

The CustomerIdentifier parameter is scheduled for deprecation. Use CustomerAWSAccountID instead.

These parameters are mutually exclusive. You can't specify both CustomerIdentifier and CustomerAWSAccountID in the same request.

To post metering records for customers, SaaS applications call batch_meter_usage, which is used for metering SaaS flexible consumption pricing (FCP). Identical requests are idempotent and can be retried with the same records or a subset of records. Each batch_meter_usage request is for only one product. If you want to meter usage for multiple products, you must make multiple batch_meter_usage calls.

Usage records should be submitted in quick succession following a recorded event. Usage records aren't accepted 6 hours or more after an event.

batch_meter_usage can process up to 25 UsageRecords at a time, and each request must be less than 1 MB in size. Optionally, you can have multiple usage allocations for usage data that's split into buckets according to predefined tags.

batch_meter_usage returns a list of UsageRecordResult objects, which have each UsageRecord. It also returns a list of UnprocessedRecords, which indicate errors on the service side that should be retried.

For Amazon Web Services Regions that support batch_meter_usage, see BatchMeterUsage Region support.

For an example of batch_meter_usage, see BatchMeterUsage code example in the Amazon Web Services Marketplace Seller Guide.

Usage

marketplacemetering_batch_meter_usage(UsageRecords, ProductCode)

Arguments

UsageRecords

[required] The set of UsageRecords to submit. batch_meter_usage accepts up to 25 UsageRecords at a time.

ProductCode

[required] Product code is used to uniquely identify a product in Amazon Web Services Marketplace. The product code should be the same as the one used during the publishing of a new product.

Value

A list with the following syntax:

list(
  Results = list(
    list(
      UsageRecord = list(
        Timestamp = as.POSIXct(
          "2015-01-01"
        ),
        CustomerIdentifier = "string",
        Dimension = "string",
        Quantity = 123,
        UsageAllocations = list(
          list(
            AllocatedUsageQuantity = 123,
            Tags = list(
              list(
                Key = "string",
                Value = "string"
              )
            )
          )
        ),
        CustomerAWSAccountId = "string"
      ),
      MeteringRecordId = "string",
      Status = "Success"|"CustomerNotSubscribed"|"DuplicateRecord"
    )
  ),
  UnprocessedRecords = list(
    list(
      Timestamp = as.POSIXct(
        "2015-01-01"
      ),
      CustomerIdentifier = "string",
      Dimension = "string",
      Quantity = 123,
      UsageAllocations = list(
        list(
          AllocatedUsageQuantity = 123,
          Tags = list(
            list(
              Key = "string",
              Value = "string"
            )
          )
        )
      ),
      CustomerAWSAccountId = "string"
    )
  )
)

Request syntax

svc$batch_meter_usage(
  UsageRecords = list(
    list(
      Timestamp = as.POSIXct(
        "2015-01-01"
      ),
      CustomerIdentifier = "string",
      Dimension = "string",
      Quantity = 123,
      UsageAllocations = list(
        list(
          AllocatedUsageQuantity = 123,
          Tags = list(
            list(
              Key = "string",
              Value = "string"
            )
          )
        )
      ),
      CustomerAWSAccountId = "string"
    )
  ),
  ProductCode = "string"
)