CreateBillingMeterEvent
Creates a billing meter event.
Stored Procedure-Specific Information
The EventName, PayloadCustomerMappingValue, and PayloadValueSettingsValue input parameters are required to execute this procedure.
EXEC CreateBillingMeterEvent PayloadValueSettingsValue = '25', PayloadCustomerMappingValue = 'cus_SGxBCKpgR8gIhP', EventName = 'first_meter_event'
The above example creates a meter event without supplying the values for the PayloadCustomerMappingKey and PayloadValueSettingsKey parameters. This automatically creates a meter event with the value of the PayloadCustomerMappingKey parameter being stripe_customer_id and PayloadValueSettingsKey being value.
If a meter was created using custom values of the customer mapping and value settings payload keys, you must supply those values in PayloadCustomerMappingKey and PayloadValueSettingsKey, respectively. The PayloadCustomerMappingKey parameter corresponds to the CustomerMappingEventPayloadKey column and the PayloadValueSettingsKey parameter corresponds to the ValueSettingsEventPayloadKey column of the Meters table in the Stripe schema.
To use custom payload keys, enter:
EXEC CreateBillingMeterEvent EventName = 'first_meter_event', PayloadCustomerMappingKey = 'cust_id', PayloadCustomerMappingValue = 'cus_SGxBCKpgR8gIhP', PayloadValueSettingsKey = 'valhere', PayloadValueSettingsValue = '25'
Input
| Name | Type | Description |
| EventName | String | The name of the meter event. Corresponds with the event_name field on a meter. |
| PayloadCustomerMappingKey | String | Part of the payload of the event. This should contain the value of the field corresponding to a meter's customer_mapping.event_payload_key (default is stripe_customer_id). |
| PayloadCustomerMappingValue | String | Part of the payload of the event. This should contain the value for the customer mapping key. |
| PayloadValueSettingsKey | String | Part of the payload of the event. This should contain the value of the field corresponding to a meter's value_settings.event_payload_key (default is value). |
| PayloadValueSettingsValue | String | Part of the payload of the event. This should contain the value for the value settings key. |
| Identifier | String | A unique identifier for the event. |
| Timestamp | Datetime | The timestamp passed in when creating the event. Measured in seconds since the Unix epoch. |
Result Set Columns
| Name | Type | Description |
| * | String | The fields returned by Stripe. |