# `Stripe.Resources.Billing.CreditGrant`
[🔗](https://github.com/jeffhuen/tiger_stripe/blob/main/lib/stripe/resources/billing/credit_grant.ex#L2)

CreditGrant

A credit grant is an API resource that documents the allocation of some billing credits to a customer.

Related guide: [Billing credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits)

# `amount`

```elixir
@type amount() :: %{
  optional(:monetary) =&gt; amount_monetary() | nil,
  optional(:type) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `monetary` - The monetary amount. Nullable.
* `type` - The type of this amount. We currently only support `monetary` billing credits. Possible values: `monetary`.

# `amount_monetary`

```elixir
@type amount_monetary() :: %{
  optional(:currency) =&gt; String.t() | nil,
  optional(:value) =&gt; integer() | nil,
  optional(String.t()) =&gt; term()
}
```

* `currency` - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Max length: 5000.
* `value` - A positive integer representing the amount.

# `applicability_config`

```elixir
@type applicability_config() :: %{
  optional(:scope) =&gt; applicability_config_scope() | nil,
  optional(String.t()) =&gt; term()
}
```

* `scope`

# `applicability_config_scope`

```elixir
@type applicability_config_scope() :: %{
  optional(:price_type) =&gt; String.t() | nil,
  optional(:prices) =&gt; [applicability_config_scope_prices()] | nil,
  optional(String.t()) =&gt; term()
}
```

* `price_type` - 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](https://docs.stripe.com/api/billing/meter) attached to them. Cannot be used in combination with `prices`. Possible values: `metered`.
* `prices` - The prices that credit grants can apply to. We currently only support `metered` prices. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. Cannot be used in combination with `price_type`.

# `applicability_config_scope_prices`

```elixir
@type applicability_config_scope_prices() :: %{
  optional(:id) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `id` - Unique identifier for the object. Max length: 5000. Nullable.

# `t`

```elixir
@type t() :: %Stripe.Resources.Billing.CreditGrant{
  amount: amount(),
  applicability_config: applicability_config(),
  category: String.t(),
  created: integer(),
  customer: String.t() | Stripe.Resources.Customer.t(),
  customer_account: String.t(),
  effective_at: integer(),
  expires_at: integer(),
  id: String.t(),
  livemode: boolean(),
  metadata: %{required(String.t()) =&gt; String.t()},
  name: String.t(),
  object: String.t(),
  priority: integer() | nil,
  test_clock: String.t() | Stripe.Resources.TestHelpers.TestClock.t(),
  updated: integer(),
  voided_at: integer()
}
```

* `amount` - Expandable.
* `applicability_config` - Expandable.
* `category` - The category of this credit grant. This is for tracking purposes and isn't displayed to the customer. Possible values: `paid`, `promotional`.
* `created` - Time at which the object was created. Measured in seconds since the Unix epoch. Format: Unix timestamp.
* `customer` - ID of the customer receiving the billing credits. Expandable.
* `customer_account` - ID of the account representing the customer receiving the billing credits Max length: 5000. Nullable.
* `effective_at` - The time when the billing credits become effective-when they're eligible for use. Format: Unix timestamp. Nullable.
* `expires_at` - The time when the billing credits expire. If not present, the billing credits don't expire. Format: Unix timestamp. Nullable.
* `id` - Unique identifier for the object. Max length: 5000.
* `livemode` - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
* `metadata` - Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* `name` - A descriptive name shown in dashboard. Max length: 5000. Nullable.
* `object` - String representing the object's type. Objects of the same type share the same value. Possible values: `billing.credit_grant`.
* `priority` - The priority for applying this credit grant. The highest priority is 0 and the lowest is 100. Nullable.
* `test_clock` - ID of the test clock this credit grant belongs to. Nullable. Expandable.
* `updated` - Time at which the object was last updated. Measured in seconds since the Unix epoch. Format: Unix timestamp.
* `voided_at` - The time when this credit grant was voided. If not present, the credit grant hasn't been voided. Format: Unix timestamp. Nullable.

# `expandable_fields`

# `object_name`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
