UsageRecords
Creates and retrieves the customer usage and metrics to Stripe for metered billing for subscription prices.
Table Specific Information
Select
The connector 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 connector.
- 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
SELECT ステートメントのWHERE 句では、疑似カラムフィールドを使用して、データソースから返されるタプルを詳細に制御することができます。
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. |