Customer Data
Customer Data Functions
Overview
A great deal of the NCC data for billing engine usage is configured separately for each ACS customer (service provider). The NCC Charging API offers several accessor functions for retrieving this data within your scripts.
All customer-level data is cached (among all calls) for 300 seconds within the Lua runtime.
ACS Customer IDs
In order to use these functions, you will need to know the ACS customer ID you wish to query. This can be retrieved with the NCC API, either in the platform data (for all customers) or by accessing ACS engine fields (for the active subscriber’s customer).
Periodic Charges
- ccs.customer.periodic_charges
 - ccs.customer.get_periodic_charge_by_name
 - ccs.customer.get_periodic_charge_by_id
 - ccs.customer.periodic_charge_id_for_name
 - ccs.customer.periodic_charge_name_for_id
 - ccs.customer.periodic_charge.can_apply_charge
 - ccs.customer.periodic_charge.can_prorate
 - ccs.customer.periodic_charge.supports_reference
 
Balance Types
- ccs.customer.balance_types
 - ccs.customer.get_balance_type_by_name
 - ccs.customer.get_balance_type_by_id
 - ccs.customer.balance_type_id_for_name
 - ccs.customer.balance_type_name_for_id
 - ccs.customer.balance_type_is_periodic_charge
 
Balance Units
- ccs.customer.balance_units
 - ccs.customer.get_balance_unit_by_name
 - ccs.customer.get_balance_unit_by_id
 - ccs.customer.balance_unit_id_for_name
 - ccs.customer.balance_unit_name_for_id
 
Wallet Types
- ccs.customer.wallet_types
 - ccs.customer.get_wallet_type_by_name
 - ccs.customer.get_wallet_type_by_id
 - ccs.customer.wallet_type_id_for_name
 - ccs.customer.wallet_type_name_for_id
 
Product Types
- ccs.customer.product_types
 - ccs.customer.get_product_type_by_name
 - ccs.customer.get_product_type_by_id
 - ccs.customer.product_type_id_for_name
 - ccs.customer.product_type_name_for_id
 
Voucher Types
- ccs.customer.voucher_types
 - ccs.customer.voucher_type_balances
 - ccs.customer.get_voucher_type_by_name
 - ccs.customer.get_voucher_type_by_id
 - ccs.customer.get_voucher_type_balances
 
Named Events
| ▲ ccs.customer.periodic_charges (acs_cust_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve periodic charge information for. | |
| Returns | 
A (possibly empty) table of periodic charge definitions for the supplied ACS customer, formatted as:
 | 
    ||
| Errors | 
If the ACS customer ID provided cannot be converted into a number, the following error will be raised:
 
 If the retrieved periodic charges are not able to be turned into a table, the following error will be raised: 
  | 
    ||
| Usage | 
This function queries the Lua runtime and extracts all periodic charge details for the provided ACS customer, returning it in a table of values.
This data may come from the Lua runtime cache if it is available and fresh. Otherwise, it is retrieved from the local SLC database.  | 
    ||
| ▲ ccs.get_periodic_charge_by_name (acs_cust_id, periodic_charge_name) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve periodic charge information for. | |
| periodic_charge_name | The name of the periodic charge to retrieve. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS periodic charge, formatted as:
 | 
    ||
| Errors | None. | ||
| Usage | 
This function offers a helper lookup on the periodic charge data on the NCC system. It calls the ccs.customer.periodic_charges function with the supplied ACS customer ID and then searches for the periodic charge name provided, returning the periodic charge details if found. If the periodic charge is not found, nil is returned.
 | 
    ||
| ▲ ccs.get_periodic_charge_by_id (acs_cust_id, periodic_charge_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve periodic charge information for. | |
| periodic_charge_id | The ID of the periodic charge to retrieve. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS periodic charge, formatted as:
 | 
    ||
| Errors | None. | ||
| Usage | 
This function offers a helper lookup on the periodic charge data on the NCC system. It calls the ccs.customer.periodic_charges function with the supplied ACS customer ID and then searches for the periodic charge ID provided, returning the periodic charge details if found. If the periodic charge is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.periodic_charge_id_for_name (acs_cust_id, periodic_charge_name) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve periodic charge information for. | |
| periodic_charge_name | The name of the periodic charge to retrieve the ID for. | ||
| Returns | 
The ID of the periodic charge that has the name provided, or nil if no match was found.
 | 
    ||
| Errors | None. | ||
| Usage | 
This is a specialised shortcut version of ccs.customer.get_periodic_charge_by_name that returns only the ID of the periodic charge name provided. If the periodic charge is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.periodic_charge_name_for_id (acs_cust_id, periodic_charge_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve periodic charge information for. | |
| periodic_charge_id | The ID of the periodic charge to retrieve the name for. | ||
| Returns | 
The name of the periodic charge that has the ID provided, or nil if no match was found.
 | 
    ||
| Errors | None. | ||
| Usage | 
This is a specialised shortcut version of ccs.customer.get_periodic_charge_by_id that returns only the name of the periodic charge ID provided. If the periodic charge is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.periodic_charge.can_apply_charge (acs_cust_id, periodic_charge_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to check periodic charge information for. | |
| periodic_charge_id | The ID of the periodic charge to check. | ||
| Returns | 
If the periodic charge supports a charge being applied during subscription management, returns true. Otherwise, returns false.			
 | 
    ||
| Errors | None. | ||
| Usage | 
This function checks the specified periodic charge and returns true if the periodic charge has an operation name, recharge amount, or voucher type specified, i.e. is a credit or debit charge.
 | 
    ||
| ▲ ccs.customer.periodic_charge.can_prorate (acs_cust_id, periodic_charge_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to check periodic charge information for. | |
| periodic_charge_id | The ID of the periodic charge to check. | ||
| Returns | 
If the periodic charge supports pro-rating being applied during subscription management, returns true. Otherwise, returns false.			
 | 
    ||
| Errors | None. | ||
| Usage | 
This function checks the specified periodic charge and returns true if the periodic charge has any pro-rating configuration.
 | 
    ||
| ▲ ccs.customer.periodic_charge.supports_reference (acs_cust_id, periodic_charge_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to check periodic charge information for. | |
| periodic_charge_id | The ID of the periodic charge to check. | ||
| Returns | 
If the periodic charge supports a reference date being specified during subscription management, returns true. Otherwise, returns false.			
 | 
    ||
| Errors | None. | ||
| Usage | 
This function checks the specified periodic charge and returns true if the periodic charge is based on a reference date, rather than fixed configuration.
 | 
    ||
| ▲ ccs.customer.balance_types (acs_cust_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve balance type information for. | |
| Returns | 
A (possibly empty) table of balance type definitions for the supplied ACS customer, formatted as:
 | 
    ||
| Errors | 
If the ACS customer ID provided cannot be converted into a number, the following error will be raised:
 
 If the retrieved balance types are not able to be turned into a table, the following error will be raised: 
  | 
    ||
| Usage | 
This function queries the Lua runtime and extracts all balance type details for the provided ACS customer, returning it in a table of values.
This data may come from the Lua runtime cache if it is available and fresh. Otherwise, it is retrieved from the local SLC database.  | 
    ||
| ▲ ccs.get_balance_type_by_name (acs_cust_id, balance_type_name) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve balance type information for. | |
| balance_type_name | The name of the balance type to retrieve. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS balance type, formatted as:
 | 
    ||
| Errors | None. | ||
| Usage | 
This function offers a helper lookup on the balance type data on the NCC system. It calls the ccs.customer.balance_types function with the supplied ACS customer ID and then searches for the balance type name provided, returning the balance type details if found. If the balance type is not found, nil is returned.
 | 
    ||
| ▲ ccs.get_balance_type_by_id (acs_cust_id, balance_type_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve balance type information for. | |
| balance_type_id | The ID of the balance type to retrieve. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS balance type, formatted as:
 | 
    ||
| Errors | None. | ||
| Usage | 
This function offers a helper lookup on the balance type data on the NCC system. It calls the ccs.customer.balance_types function with the supplied ACS customer ID and then searches for the balance type ID provided, returning the balance type details if found. If the balance type is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.balance_type_id_for_name (acs_cust_id, balance_type_name) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve balance type information for. | |
| balance_type_name | The name of the balance type to retrieve the ID for. | ||
| Returns | 
The ID of the balance type that has the name provided, or nil if no match was found.
 | 
    ||
| Errors | None. | ||
| Usage | 
This is a specialised shortcut version of ccs.customer.get_balance_type_by_name that returns only the ID of the balance type name provided. If the balance type is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.balance_type_name_for_id (acs_cust_id, balance_type_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve balance type information for. | |
| balance_type_id | The ID of the balance type to retrieve the name for. | ||
| Returns | 
The name of the balance type that has the ID provided, or nil if no match was found.
 | 
    ||
| Errors | None. | ||
| Usage | 
This is a specialised shortcut version of ccs.customer.get_balance_type_by_id that returns only the name of the balance type ID provided. If the balance type is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.balance_type_is_periodic_charge (acs_cust_id, balance_type_id, lookup_info) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve balance type information for. | |
| balance_type_id | The ID of the balance type to check. | ||
| lookup_info | A table of subscriber lookup information. Optional; will be automatically retrieved if not provided. | ||
| Returns | 
If the balance type is a periodic charge, true. Otherwise false.
 | 
    ||
| Errors | 
If the ACS customer ID provided does not have any periodic charges:
 
  | 
    ||
| Usage | 
This function examines the periodic charges for the ACS customer ID provided, retrieving them from the runtime if not provided in the lookup_info table. If the balance type ID is found in the periodic charge balance types, true is returned. In all other cases, false is returned.
 | 
    ||
| ▲ ccs.customer.balance_units (acs_cust_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve balance unit information for. | |
| Returns | 
A (possibly empty) table of balance unit definitions for the supplied ACS customer, formatted as:
 | 
    ||
| Errors | 
If the ACS customer ID provided cannot be converted into a number, the following error will be raised:
 
 If the retrieved balance units are not able to be turned into a table, the following error will be raised: 
  | 
    ||
| Usage | 
This function queries the Lua runtime and extracts all balance unit details for the provided ACS customer, returning it in a table of values.
This data may come from the Lua runtime cache if it is available and fresh. Otherwise, it is retrieved from the local SLC database.  | 
    ||
| ▲ ccs.get_balance_unit_by_name (acs_cust_id, balance_unit_name) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve balance unit information for. | |
| balance_unit_name | The name of the balance unit to retrieve. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS balance unit, formatted as:
 | 
    ||
| Errors | None. | ||
| Usage | 
This function offers a helper lookup on the balance unit data on the NCC system. It calls the ccs.customer.balance_units function with the supplied ACS customer ID and then searches for the balance unit name provided, returning the balance unit details if found. If the balance unit is not found, nil is returned.
 | 
    ||
| ▲ ccs.get_balance_unit_by_id (acs_cust_id, balance_unit_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve balance unit information for. | |
| balance_unit_id | The ID of the balance unit to retrieve. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS balance unit, formatted as:
 | 
    ||
| Errors | None. | ||
| Usage | 
This function offers a helper lookup on the balance unit data on the NCC system. It calls the ccs.customer.balance_units function with the supplied ACS customer ID and then searches for the balance unit ID provided, returning the balance unit details if found. If the balance unit is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.balance_unit_id_for_name (acs_cust_id, balance_unit_name) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve balance unit information for. | |
| balance_unit_name | The name of the balance unit to retrieve the ID for. | ||
| Returns | 
The ID of the balance unit that has the name provided, or nil if no match was found.
 | 
    ||
| Errors | None. | ||
| Usage | 
This is a specialised shortcut version of ccs.customer.get_balance_unit_by_name that returns only the ID of the balance unit name provided. If the balance unit is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.balance_unit_name_for_id (acs_cust_id, balance_unit_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve balance unit information for. | |
| balance_unit_id | The ID of the balance unit to retrieve the name for. | ||
| Returns | 
The name of the balance unit that has the ID provided, or nil if no match was found.
 | 
    ||
| Errors | None. | ||
| Usage | 
This is a specialised shortcut version of ccs.customer.get_balance_unit_by_id that returns only the name of the balance unit ID provided. If the balance unit is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.wallet_types (acs_cust_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve wallet type information for. | |
| Returns | 
A (possibly empty) table of wallet type definitions for the supplied ACS customer, formatted as:
 | 
    ||
| Errors | 
If the ACS customer ID provided cannot be converted into a number, the following error will be raised:
 
 If the retrieved wallet types are not able to be turned into a table, the following error will be raised: 
  | 
    ||
| Usage | 
This function queries the Lua runtime and extracts all wallet type details for the provided ACS customer, returning it in a table of values.
This data may come from the Lua runtime cache if it is available and fresh. Otherwise, it is retrieved from the local SLC database.  | 
    ||
| ▲ ccs.get_wallet_type_by_name (acs_cust_id, wallet_type_name) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve wallet type information for. | |
| wallet_type_name | The name of the wallet type to retrieve. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS wallet type, formatted as:
 | 
    ||
| Errors | None. | ||
| Usage | 
This function offers a helper lookup on the wallet type data on the NCC system. It calls the ccs.customer.wallet_types function with the supplied ACS customer ID and then searches for the wallet type name provided, returning the wallet type details if found. If the wallet type is not found, nil is returned.
 | 
    ||
| ▲ ccs.get_wallet_type_by_id (acs_cust_id, wallet_type_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve wallet type information for. | |
| wallet_type_id | The ID of the wallet type to retrieve. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS wallet type, formatted as:
 | 
    ||
| Errors | None. | ||
| Usage | 
This function offers a helper lookup on the wallet type data on the NCC system. It calls the ccs.customer.wallet_types function with the supplied ACS customer ID and then searches for the wallet type ID provided, returning the wallet type details if found. If the wallet type is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.wallet_type_id_for_name (acs_cust_id, wallet_type_name) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve wallet type information for. | |
| wallet_type_name | The name of the wallet type to retrieve the ID for. | ||
| Returns | 
The ID of the wallet type that has the name provided, or nil if no match was found.
 | 
    ||
| Errors | None. | ||
| Usage | 
This is a specialised shortcut version of ccs.customer.get_wallet_type_by_name that returns only the ID of the wallet type name provided. If the wallet type is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.wallet_type_name_for_id (acs_cust_id, wallet_type_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve wallet type information for. | |
| wallet_type_id | The ID of the wallet type to retrieve the name for. | ||
| Returns | 
The name of the wallet type that has the ID provided, or nil if no match was found.
 | 
    ||
| Errors | None. | ||
| Usage | 
This is a specialised shortcut version of ccs.customer.get_wallet_type_by_id that returns only the name of the wallet type ID provided. If the wallet type is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.product_types (acs_cust_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve product type information for. | |
| Returns | 
A (possibly empty) table of product type definitions for the supplied ACS customer, formatted as:
 | 
    ||
| Errors | 
If the ACS customer ID provided cannot be converted into a number, the following error will be raised:
 
 If the retrieved product types are not able to be turned into a table, the following error will be raised: 
  | 
    ||
| Usage | 
This function queries the Lua runtime and extracts all product type details for the provided ACS customer, returning it in a table of values.
This data may come from the Lua runtime cache if it is available and fresh. Otherwise, it is retrieved from the local SLC database.  | 
    ||
| ▲ ccs.get_product_type_by_name (acs_cust_id, product_type_name) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve product type information for. | |
| product_type_name | The name of the product type to retrieve. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS product type, formatted as:
 | 
    ||
| Errors | None. | ||
| Usage | 
This function offers a helper lookup on the product type data on the NCC system. It calls the ccs.customer.product_types function with the supplied ACS customer ID and then searches for the product type name provided, returning the product type details if found. If the product type is not found, nil is returned.
 | 
    ||
| ▲ ccs.get_product_type_by_id (acs_cust_id, product_type_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve product type information for. | |
| product_type_id | The ID of the product type to retrieve. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS product type, formatted as:
 | 
    ||
| Errors | None. | ||
| Usage | 
This function offers a helper lookup on the product type data on the NCC system. It calls the ccs.customer.product_types function with the supplied ACS customer ID and then searches for the product type ID provided, returning the product type details if found. If the product type is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.product_type_id_for_name (acs_cust_id, product_type_name) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve product type information for. | |
| product_type_name | The name of the product type to retrieve the ID for. | ||
| Returns | 
The ID of the product type that has the name provided, or nil if no match was found.
 | 
    ||
| Errors | None. | ||
| Usage | 
This is a specialised shortcut version of ccs.customer.get_product_type_by_name that returns only the ID of the product type name provided. If the product type is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.product_type_name_for_id (acs_cust_id, product_type_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve product type information for. | |
| product_type_id | The ID of the product type to retrieve the name for. | ||
| Returns | 
The name of the product type that has the ID provided, or nil if no match was found.
 | 
    ||
| Errors | None. | ||
| Usage | 
This is a specialised shortcut version of ccs.customer.get_product_type_by_id that returns only the name of the product type ID provided. If the product type is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.voucher_types (acs_cust_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve voucher type information for. | |
| Returns | 
A (possibly empty) table of voucher type definitions for the supplied ACS customer, formatted as:
 | 
    ||
| Errors | 
If the ACS customer ID provided cannot be converted into a number, the following error will be raised:
 
 If the retrieved voucher types are not able to be turned into a table, the following error will be raised: 
  | 
    ||
| Usage | 
This function queries the Lua runtime and extracts all voucher type details for the provided ACS customer, returning it in a table of values.
This data may come from the Lua runtime cache if it is available and fresh. Otherwise, it is retrieved from the local SLC database.  | 
    ||
| ▲ ccs.customer.voucher_type_balances (acs_cust_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve voucher type balance information for. | |
| Returns | 
A (possibly empty) table of voucher type balance definitions for the supplied ACS customer, formatted as:
 | 
    ||
| Errors | 
If the ACS customer ID provided cannot be converted into a number, the following error will be raised:
 
 If the retrieved voucher type balances are not able to be turned into a table, the following error will be raised: 
  | 
    ||
| Usage | 
This function queries the Lua runtime and extracts all voucher type balances for the provided ACS customer, returning it in a table of values.
This data may come from the Lua runtime cache if it is available and fresh. Otherwise, it is retrieved from the local SLC database.  | 
    ||
| Usage Notes | Note that in order for this function to be available, the NCC SLC must have the CCS_MB_RECHARGE table manually created and replicated on the SLC - by default it is only created and available on VWS nodes. | ||
| ▲ ccs.customer.get_voucher_type_by_name (acs_cust_id, voucher_type_name) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve voucher type information for. | |
| voucher_type_name | The name of the voucher type to retrieve. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS voucher type, formatted as:
 | 
    ||
| Errors | 
If the ACS customer ID provided cannot be converted into a number, the following error will be raised:
 
 If the voucher type name is not provided, the following error will be raised: 
  | 
    ||
| Usage | 
This function offers a helper lookup on the voucher type data on the NCC system. It calls the ccs.customer.voucher_types function with the supplied ACS customer ID and then searches for the voucher type name provided, returning the voucher type details if found. If the voucher type is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.get_voucher_type_by_id (acs_cust_id, voucher_type_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve voucher type information for. | |
| voucher_type_id | The ID of the voucher type to retrieve. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS voucher type, formatted as:
 | 
    ||
| Errors | 
If the ACS customer ID provided cannot be converted into a number, the following error will be raised:
 
 If the voucher type ID is not provided, the following error will be raised: 
  | 
    ||
| Usage | 
This function offers a helper lookup on the voucher type data on the NCC system. It calls the ccs.customer.voucher_types function with the supplied ACS customer ID and then searches for the voucher type ID provided, returning the voucher type details if found. If the voucher type is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.get_voucher_type_balances (acs_cust_id, voucher_type) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve voucher type information for. | |
| voucher_type | The table entry (ccs.customer.voucher_types) of the voucher type to retrieve balance information for. | ||
| Returns | 
If no match is found, an unchanged table is returned. If a match is found, the provided table has the balances added, formatted as:
 | 
    ||
| Errors | 
If the ACS customer ID provided cannot be converted into a number, the following error will be raised:
 
 If the voucher provided is not provided or is not a table, the following error will be raised: 
  | 
    ||
| Usage | 
This function takes the provided voucher type, and offers a helper lookup on the voucher type balances data on the NCC system, which is added to the voucher type as a sub-table. It calls the ccs.customer.voucher_type_balances function with the supplied ACS customer ID and then compares the related voucher type ID (RECHARGE_TYPE_ID) provided, and adds any matches as a sub-table. The provided voucher_type table is unchanged if there are no matches.
 | 
    ||
| ▲ ccs.customer.named_events (acs_cust_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve named event information for. | |
| Returns | 
A (possibly empty) table of voucher type definitions for the supplied ACS customer, formatted as:
 | 
    ||
| Errors | 
If the ACS customer ID provided cannot be converted into a number, the following error will be raised:
 
 If the retrieved named events are not able to be turned into a table, the following error will be raised: 
  | 
    ||
| Usage | 
This function queries the Lua runtime and extracts all named event details for the provided ACS customer, returning it in a table of values.
This data may come from the Lua runtime cache if it is available and fresh. Otherwise, it is retrieved from the local SLC database.  | 
    ||
| ▲ ccs.customer.get_named_event_by_name (acs_cust_id, named_event_name, named_event_class) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve named event information for. | |
| named_event_name | The name of the named event to retrieve. | ||
| named_event_class | The class of the named event to retrieve. Optional; the first named event that matches provided named_event_name will be returned. Note that the name of a named event is only unique by class. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS named event, formatted as:
 | 
    ||
| Errors | 
If the ACS customer ID provided cannot be converted into a number, the following error will be raised:
 
 If the named event name is not provided, the following error will be raised: 
  | 
    ||
| Usage | 
This function offers a helper lookup on the named event data on the NCC system. It calls the ccs.customer.named_events function with the supplied ACS customer ID and then searches for the named event name provided (and optionally, the named event class), returning the named event details if found. If the named event is not found, nil is returned.
 | 
    ||
| ▲ ccs.customer.get_named_event_by_id (acs_cust_id, named_event_id) | |||
|---|---|---|---|
| Parameters | acs_cust_id | The ACS customer ID to retrieve named event information for. | |
| named_event_id | The ID of the named event to retrieve. | ||
| Returns | 
Either nil if no match is found, or a table for a single CCS named event, formatted as:
 | 
    ||
| Errors | 
If the ACS customer ID provided cannot be converted into a number, the following error will be raised:
 
 If the named event ID is not provided, the following error will be raised: 
  | 
    ||
| Usage | 
This function offers a helper lookup on the named event data on the NCC system. It calls the ccs.customer.named_events function with the supplied ACS customer ID and then searches for the named event name provided, returning the named event details if found. If the named event is not found, nil is returned.
 | 
    ||