# ParameterSubscriptionRewardsByPid Get Subscription Data Get Information of balances, tiers, rewards and subscription members for a subscription - Catalog: `Brevo` - Schema: `Program` This is a read-only table function. The Brevo API may not support changing the data or the Invantive UniversalSQL driver for Brevo does not cover it. In the latter case, please use the table NativePlatformScalarRequests to upload data to the Brevo API. ## Parameters of Table Function The following parameters can be used to control the behaviour of the table function `ParameterSubscriptionRewardsByPid`. A value must be provided at all times for required parameters, but optional parameters in general do not need to have a value and the execution will default to a pre-defined behaviour. Values can be specified by position and by name. In both cases, all parameters not specified will be evaluated using their default values. Value specification by position is done by listing all values from the first to the last needed value. For example: a `select * from table(value1, value2, value3)` on a table with four parameters will use the default value for the fourth parameter and the specified values for the first three. Value specification by name is done by listing all values that require a value. For example with `select * from table(name1 => value1, name3 => value3)` on the same table will use the default values for the second and fourth parameters and the specified values for the first and third. | Name | Data Type | Required | Default Value | Documentation | |---|:---:|:---:|:---:|---| | `contactId` | `` | ☐ | | The contact ID to filter by. | | `includeInternal` | `` | ☐ | | Include balances tied to internal definitions. | | `loyaltySubscriptionId` | `` | ☐ | | The loyalty subscription ID to filter by. | | `params` | `` | ☐ | | A list of filter parameters for querying the subscription info. | | `pid` | `` | ☑ | | Loyalty Program ID. A unique identifier for the loyalty program. | ## Columns of Table Function The columns of the table function `ParameterSubscriptionRewardsByPid` are shown below. Each column has an SQL data type. | Name | Data Type | Label | Required | Documentation | |---|:---:|---|:---:|---| | `balance_contactId` | `int64` | | ☐ | Unique identifier of the contact. | | `balance_loyaltyProgramId` | `varchar2` | | ☐ | Unique identifier of the loyalty program. | | `code` | `varchar2` | | ☐ | Reward code assigned to the contact. | | `contactId` | `int64` | | ☐ | Unique identifier of the contact. | | `createdAt` | `varchar2` | Creation Date | ☐ | Timestamp when the reward was created. | | `expirationDate` | `varchar2` | | ☐ | Expiration date of the reward. | | `id` | `varchar2` | ID | ☐ | Unique identifier of the reward. | | `loyaltyProgramId` | `varchar2` | | ☐ | Unique identifier of the loyalty program. | | `loyaltyProgramName` | `varchar2` | | ☐ | Name of the loyalty program. | | `membership_createdAt` | `datetime` | | ☐ | Timestamp when the subscription was created. | | `membership_loyaltySubscriptionId` | `varchar2` | | ☐ | Unique identifier of the loyalty subscription. | | `membership_updatedAt` | `datetime` | | ☐ | Timestamp when the subscription was last updated. | | `meta` | `varchar2` | | ☐ | Additional metadata related to the reward. | | `publicDescription` | `varchar2` | | ☐ | Customer-facing description of the reward, as configured on the reward definition. | | `rewardId` | `varchar2` | | ☐ | Unique identifier of the reward definition. | | `rewardName` | `varchar2` | | ☐ | Customer-facing name of the reward. Falls back to the internal reward name when no public name is set. | | `unit` | `varchar2` | | ☐ | Unit the reward's value is expressed in — one of the currency codes listed below, or PERCENT. Omitted when the reward has no unit (e.g. free-product rewards). | | `updatedAt` | `datetime` | | ☐ | Timestamp when the reward was last updated. | | `validFrom` | `datetime` | | ☐ | Date from which the voucher becomes valid. | | `value` | `double` | Value | ☐ | The value recorded when this reward was attributed to the contact — a snapshot, not necessarily the reward's current configured value. Omitted when not set. |