In this topic:

What are rate tables?

Rate tables contain a list of usage-based charges that can be applied to a usage event. Each rate table is made up of rate table entries which define the rate for consumed usage, effective dates, and the lookup value. Rate table entries are valid during the specified time periods which cannot overlap.

You can associate a usage rule with a desired rate table by specifying the rate_table rate type of the usage rule. Now, the usage will be evaluated per conditions from the indicated rate table entry.

Creating a Rate Table

POST https://example.gotransverse.com/billing/2/rate-tables

Request

{
  "uom": "DAY",
  "name": " rate table for usage rules #1",
  "status": "DRAFT",
  "description": "additional information"
}

Response

{
  "id": "728",
  "uom": "DAY",
  "name": "rate table for usage rules #1",
  "status": "DRAFT",
  "description": "additional information"
}

Adding Rate Table Entries

Rate table entries indicate the rate for usage evaluating and effective dates when it is valid. Let’s create two rate table entries:

Rate table entry #1

POST https://example.gotransverse.com/billing/2/rate-tables/{rate_table_id}/entries

Request

{
  "rate": 20,
  "lookup": "entry #1",
  "valid_from": "2018-12-14T00:00:00-06:00",
  "valid_to": "2019-12-13T00:00:00-06:00"
}

Response

{
  "id": "287188",
  "rate": 20,
  "lookup": "entry #1",
  "valid_from": "2018-12-14T00:00:00-06:00",
  "rate_table": {
      "id": "728",
      "name": "rate table for usage rules #1"
  },
  "valid_to": "2019-12-13T00:00:00-06:00"
			}

Rate table entry #2

POST https://example.gotransverse.com/billing/2/rate-tables/{rate_table_id}/entries

Request

{
  "rate": 25,
  "lookup": "entry #2",
  "valid_from": "2018-12-14T00:00:00-06:00",
  "valid_to": "2019-12-13T00:00:00-06:00"
}

Response

{
  "id": "287190",
  "rate": 25,
  "lookup": "entry #2",
  "valid_from": "2018-12-14T00:00:00-06:00",
  "rate_table": {
      "id": "728",
      "name": "rate table for usage rules #1"
  },
  "valid_to": "2019-12-13T00:00:00-06:00"
}
Top