CreditGrants
Represents billing credit grants applied to customers, including credit amount, category, applicability scope, and effective and expiration details.
Table-Specific Information
SELECT
The provider uses the Stripe API to filter the results by the following columns and operators:
| Column | Supported Operators |
| Id | = |
| CustomerId | = |
The rest of the filter is executed client-side within the provider.
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 grant, 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 the ExpiresAt and MetadataAggregate fields can be modified. To modify a credit grant, 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 |
The unique identifier for the credit grant object. | |
| Object | String | True |
The 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. Stripe currently only supports monetary billing credits. The allowed values are monetary. | |
| ApplicabilityConfigScopePriceType | String | False |
The price type that credit grants can apply to. Stripe currently only supports the metered price type, which 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. Stripe currently only supports metered prices, which 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 is not displayed to the customer. The allowed values are paid, promotional. | |
| Created | Datetime | True |
The time at which the object was created. Measured in seconds since the Unix epoch. | |
| CustomerId | String | False |
Customers.Id |
The Id of the customer receiving the billing credits. |
| EffectiveAt | Datetime | False |
The time when the billing credits become effective, when they are eligible for use. | |
| ExpiresAt | Datetime | False |
The time when the billing credits expire. If not present, the billing credits do not expire. | |
| Livemode | Boolean | True |
Indicates whether the object exists in live mode. Returns true if the object exists in live mode and false if the object exists in test mode. | |
| MetadataAggregate | String | False |
The set of key-value pairs that you can attach to the credit grant object. This can be useful for storing additional information about the object in a structured format. | |
| Name | String | False |
A descriptive name shown in the dashboard. | |
| TestClockId | String | True |
TestClocks.Id |
The Id of the test clock this credit grant belongs to. |
| UpdatedAt | Datetime | True |
The time at which the object was last updated. Measured in seconds since the Unix epoch. | |
| VoidedAt | Datetime | True |
The time when this credit grant was voided. If not present, the credit grant has not been voided. | |
| Priority | Integer | False |
The priority for applying this credit grant. The highest priority is 0 and the lowest is 100. | |
| CustomerAccount | String | False |
The Id of the account representing the customer receiving the billing credits. | |
| ApplicabilityConfigScopeProducts | String | True |
DEPRECATED. The products that credit grants can apply to. |