UsageRecords
Creates and retrieves the customer usage and metrics to Stripe for metered billing for subscription prices.
Table Specific Information
Select
The driver uses the Stripe API to filter the results by the following columns and operators while the rest of the filter is executed client-side within the driver.
- Id supports the following operator: =.
- SubscriptionItem supports the following operator: =.
- AccountId supports the following operator: =.
To retrieve UsageRecords, a SubscriptionItem is required:
SELECT * FROM UsageRecords WHERE SubscriptionItem='si_NBswnjzMefKen7'
Insert
To create a usage record for a subscription item, you must specify at least a SubscriptionItem value:
INSERT INTO UsageRecords (SubscriptionItem, Timestamp, Quantity) values ('si_NBswnjzMefKen7', '2023-07-14T05:36:46.000-04:00', 100)
Columns
Name | Type | ReadOnly | References | Description |
Id [KEY] | String | True |
The Id of the usage record. | |
Invoice | String | True |
The Id of the invoice. | |
Livemode | Boolean | True |
true if the object is in live mode andfalse if in test mode. | |
PeriodEnd | Datetime | True |
The time of the period end. | |
PeriodStart | Datetime | True |
The time of the period start. | |
SubscriptionItem | String | False |
The Id of the subscription item. | |
Timestamp | Datetime | False |
The timestamp for the usage event. | |
TotalUsage | Integer | True |
The total usage. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
AccountId | String |
The Id of the connected account to get value list for. |
Quantity | Integer |
The usage quantity for the specified date. |