Create a Metering Record

Before you get started

You'll need to make sure you have the correct listing type and usage-based SKUs configured, along with your Access Token

Send a Usage Record

AWS (Legacy) - Deprecated

This endpoint is deprecated and will be removed on June 1st, 2023. Please contact your Tackle Representative to assist you with migrating your AWS products to the new API. If your AWS products have already been migrated, please proceed to the AWS & Red Hat section.

To send usage records to AWS, send a POST request to https://api.tackle.io/v1/metering/meter with the right authorization header and a body similar to the following example:

{
  "cloud": "aws",
  "customerid": "ij3sXMkN3or",
  "productid": "1test1a2b3c4d5e6f7g8h9ijk",
  "records": [
    {
      "CustomerIdentifier": "ij3sXMkN3or",
      "ProductIdentifier": "1test1a2b3c4d5e6f7g8h9ijk",
      "Dimension": "example_dimension_name",
      "Timestamp": "2019-07-15T15:00:00.000000+00:00",
      "Quantity": 1
    }
  ]
}

Ready to see the code in action? Check out our Create a metering record (AWS) recipe!

Azure & GCP

To send usage records to Azure or GCP, send a POST request to https://api.tackle.io/v2/metering/meter with the right authorization header and a body similar to the following example:

{
  "cloud": "azure",
  "customerid": "1b3gs3f4-2794-abcd-3fa3-063ga0s3t3re",
  "productid": "tackle-azure-platform",
  "records": [
    {
      "customerid": "1b3gs3f4-2794-abcd-3fa3-063ga0s3t3re",
      "productid": "tackle-azure-platform",
      "dimension": "usage-per-unit",
      "quantity": 2
    }
  ]
}
{
  "cloud": "gcp",
  "customerid": "E-ABC2-D330-E2FG-H2Q2",
  "productid": "tackle-for-gcp",
  "records": [
    {
      "customerid": "E-ABC2-D330-E2FG-H2Q2",
      "productid": "tackle-for-gcp",
      "dimension": "usage-per-unit",
      "quantity": 2
    }
  ]
}

Ready to see the code in action? Check out our Create a metering record (GCP) recipe!

AWS & Red Hat

The endpoint for submitting AWS and Red Hat usage records is https://api.tackle.io/v1/metering/usage-records. We recommend you use the PUT method, but we do support both PUT and POST.

PUT

Using the PUT method will create or update an existing usage record (if it hasn't already been sent to the marketplace).

If a usage record already exists in Tackle's system for the submitted product, dimension, customer and hour (from start_time), we will update the quantity on the existing record. If the record has already been submitted to the marketplace, the API will respond with a 409 - Conflict response.

POST

Using the POST method will create a new usage record.

Caution: If you submit duplicate usage records for the same product, dimension, customer and hour (from start_time), only one of the submitted records will be sent to the marketplace: we do not aggregate submitted records.

Send the request with the right authorization header and body similar to the following example:

[
  {
    "cloud": "redhat",
    "product_id": "e2fc31adc8dc32e281e3a6c27d003d7c",
    "customer_id": "6182cde02709282f5baf7329",
    "start_time": "2021-12-09 18:31:12.789942",
    "end_time": "2021-12-09 18:35:12.789942",
    "scheduled_at": "2021-12-09 18:55:00.789942",
    "dimension": {
      "name": "Metering-Test-Charge-1-Users",
      "quantity": 42
    }
  }
]
[
  {
    "cloud": "aws",
    "product_id": "e2fc31adc8dc32e281e3a6c27d003d7c",
    "customer_id": "6182cde02709282f5baf7329",
    "start_time": "2021-12-09 18:31:12.789942",
    "scheduled_at": "2021-12-09 18:55:00.789942",
    "dimension": {
      "name": "Metering-Test-Charge-1-Users",
      "quantity": 42
    }
  }
]

Ready to see the code in action? Check out our Create a usage record (Redhat) recipe!

How to confirm usage records have been sent?

AWS (Legacy), Azure, GCP

You can use the Downstream Metering UI to confirm usage records were sent. Submitted items will have a green checkmark next to the submitted usage.

AWS and Red Hat

To see what metering records are present, see List Usage Records.

To see a specific usage record, see Get a Usage Record.

You can also use the Downstream Metering UI, looking for a green checkmark next to the submitted usage.

What's next?