CreditGrants
Create, update, delete, and query the Accounts you manage in Stripe.
Table Specific Information
Select
The driver uses the Stripe API to filter the results by the following columns and operators:
- Id supports the following operator: =.
- CustomerId supports the following operator: =.
The rest of the filter is executed client-side within the driver.
You can select from the CreditGrants table with the following queries:
SELECT * FROM CreditGrants; SELECT * FROM CreditGrants WHERE Id = 'credgr_test_61St1pbUaoMcUECiL41ATXQzBWNrlDAO'; SELECT * FROM CreditGrants WHERE CustomerId = 'cus_RADJuiVg2CKwok';
Insert
To create a new credit grants, AmountMonetaryCurrency, AmountMonetaryValue, AmountType, Category, CustomerId, and ApplicabilityConfigScopePriceType are required:
INSERT INTO CreditGrants(AmountMonetaryCurrency, AmountMonetaryValue, AmountType, Category, CustomerId, ApplicabilityConfigScopePriceType) values('usd', 65000, 'monetary', 'paid', 'cus_RADJuiVg2CKwok', 'metered' )
Update
Only ExpiresAt and MetadataAggregate fields can be modified. To modify a credit grants, specify the credit grant Id:
UPDATE CreditGrants SET ExpiresAt='2025-08-11 05:30:00', MetadataAggregate='{\"coupon\": \"dasvfsghasdfas\",\"promotion_code\": \"L9l9iBvo\"}' where Id='credgr_test_61St1fLV58W5r9v9G41ATXQzBWNrlRLE'
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | String | True |
Unique identifier for the object. | |
| Object | String | True |
String representing the object’s type. Objects of the same type share the same value. | |
| AmountMonetaryCurrency | String | False |
Three-letter ISO currency code, in lowercase. Must be a supported currency. | |
| AmountMonetaryValue | Integer | False |
A positive integer representing the amount. | |
| AmountType | String | False |
The type of this amount. We currently only support monetary billing credits. The allowed values are monetary. | |
| ApplicabilityConfigScopePriceType | String | False |
The price type that credit grants can apply to. We currently only support the metered price type. This refers to prices that have a Billing Meter attached to them. Cannot be used in combination with prices. The allowed values are metered. | |
| ApplicabilityConfigScopePricesId | String | False |
The prices that credit grants can apply to. We currently only support metered prices. This refers to prices that have a Billing Meter attached to them. Cannot be used in combination with price_type. | |
| Category | String | False |
The category of this credit grant. This is for tracking purposes and isn’t displayed to the customer. The allowed values are paid, promotional. | |
| Created | Datetime | True |
Time at which the object was created. Measured in seconds since the Unix epoch. | |
| CustomerId | String | False |
ID of the customer receiving the billing credits. | |
| EffectiveAt | Datetime | False |
The time when the billing credits become effective-when they’re eligible for use. | |
| ExpiresAt | Datetime | False |
The time when the billing credits expire. If not present, the billing credits don’t expire. | |
| Livemode | Boolean | True |
Has the value true if the object exists in live mode or the value false if the object exists in test mode. | |
| MetadataAggregate | String | False |
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. | |
| Name | String | False |
A descriptive name shown in dashboard. | |
| TestClockId | String | True |
ID of the test clock this credit grant belongs to. | |
| UpdatedAt | String | True |
Time at which the object was last updated. Measured in seconds since the Unix epoch. | |
| VoidedAt | String | True |
The time when this credit grant was voided. If not present, the credit grant hasn’t been voided. | |
| Priority | Integer | False |
The priority for applying this credit grant. The highest priority is 0 and the lowest is 100. |