In this topic:

What are usage lookup tables?

Usage lookup tables are used to simplify usage rule specifications by moving commonly referenced information into a table accessible by the rule. A lookup table consists of lookup entries used for grouping the charge information. Once you have added the desired table entries, activate the table so that it can be used.

Creating lookup tables

To create a new lookup table, use the sample request body and endpoint below:

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

Request

{
  "name": "lookup table #1",
  "description": "sample lookup table for usage rules"
			}

Response

{
  "id": "380",
  "name": "lookup table #1",
  "status": "DRAFT",
  "description": "sample lookup table for usage rules"
}

Activating lookup tables

To use your lookup table, you must activate it:

POST https://example.gotransverse.com/billing/2/usage-lookup-tables/{id}/activate

Note: You can activate a rate table only is it has at least one lookup table entry.

Retrieving available lookup tables

To retrieve the specified lookup table by ID:

GET https://example.gotransverse.com/billing/2/usage-lookup-tables/{id}

To retrieve a list of available lookup tables:

GET https://example.gotransverse.com/billing/2/usage-lookup-tables

Updating lookup tables

To update the usage lookup table, specify new values in the request body as detailed below:

PUT https://example.gotransverse.com/billing/2/usage-lookup-tables/{id}

Request

{   
  "name": "updated lookup table #1"
}

Response

{
  "id": "380",
  "name": "updated lookup table #1",
  "status": "ACTIVE",
  "description": "sample lookup table for usage rules"
}

Suspending lookup tables

To suspend the usage lookup table, use the following endpoint:

POST https://example.gotransverse.com/billing/2/usage-lookup-tables/{id}/suspend

Once you have moved the lookup table to the Suspended status, it won’t be available for use, but you activate it when needed.

Deleting lookup tables

To delete the lookup table that you no longer need, use the following endpoint:

DELETE https://example.gotransverse.com/billing/2/usage-lookup-tables/{id}

Note: Once deleted, you cannot recover this lookup table.

Creating lookup table entries

Lookup table entries are key-value pairs associated with a certain lookup table. Use lookup entries to configure usage rules of the following type: specification=Formula, operator=lookup. Add as many lookup table entries as you need using the following endpoint and sample request body:

POST https://example.gotransverse.com/billing/2/usage-lookup-tables/{id}/entries

Request

{
  "key": "NUMBER02",
  "value": "23",
  "valid_from": "2018-12-14T07:52:54-06:00",
  "valid_to": "2019-12-14T07:52:54-06:00"
}

Response

{
  "id": "21142",
  "key": "NUMBER02",
  "value": "23",
  "valid_from": "2018-12-14T07:52:54-06:00",
  "valid_to": "2019-12-14T07:52:54-06:00"
}

Retrieving lookup table entries

To retrieve the specified lookup entry by ID:

GET https://example.gotransverse.com/billing/2/usage-lookup-tables/{usage_lookup_table_id}/entries/{id}

To retrieve a list of available lookup entries:

GET https://example.gotransverse.com/billing/2/usage-lookup-tables/{usage_lookup_table_id}/entries

Updating lookup table entries

To update a usage lookup entry, specify new values in the request body as detailed below:

PUT https://example.gotransverse.com/billing/2/usage-lookup-tables/{usage_lookup_table_id}/entries/{id}

Request

{
 "value": "32"
}

Response

{
  "id": "21142",
  "key": "NUMBER02",
  "value": "32",
  "valid_from": "2018-12-14T07:52:54-06:00",
  "valid_to": "2019-12-14T07:52:54-06:00"
}

Deleting lookup table entries

To delete the lookup entry that you no longer need:

DELETE https://example.gotransverse.com/billing/2/usage-lookup-tables/{usage_lookup_table_id}/entries/{id}

Note: Once deleted, you cannot recover this lookup table entry.

Top