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

CreditBalanceTransaction

A credit balance transaction is a resource representing a transaction (either a credit or a debit) against an existing credit grant.

# `credit`

```elixir
@type credit() :: %{
  optional(:amount) =&gt; credit_amount() | nil,
  optional(:credits_application_invoice_voided) =&gt;
    credit_credits_application_invoice_voided() | nil,
  optional(:type) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `amount`
* `credits_application_invoice_voided` - Details of the invoice to which the reinstated credits were originally applied. Only present if `type` is `credits_application_invoice_voided`. Nullable.
* `type` - The type of credit transaction. Possible values: `credits_application_invoice_voided`, `credits_granted`.

# `credit_amount`

```elixir
@type credit_amount() :: %{
  optional(:monetary) =&gt; credit_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`.

# `credit_amount_monetary`

```elixir
@type credit_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.

# `credit_credits_application_invoice_voided`

```elixir
@type credit_credits_application_invoice_voided() :: %{
  optional(:invoice) =&gt; String.t() | Stripe.Resources.Invoice.t() | nil,
  optional(:invoice_line_item) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `invoice` - The invoice to which the reinstated billing credits were originally applied.
* `invoice_line_item` - The invoice line item to which the reinstated billing credits were originally applied. Max length: 5000.

# `debit`

```elixir
@type debit() :: %{
  optional(:amount) =&gt; debit_amount() | nil,
  optional(:credits_applied) =&gt; debit_credits_applied() | nil,
  optional(:type) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `amount`
* `credits_applied` - Details of how the billing credits were applied to an invoice. Only present if `type` is `credits_applied`. Nullable.
* `type` - The type of debit transaction. Possible values: `credits_applied`, `credits_expired`, `credits_voided`.

# `debit_amount`

```elixir
@type debit_amount() :: %{
  optional(:monetary) =&gt; debit_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`.

# `debit_amount_monetary`

```elixir
@type debit_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.

# `debit_credits_applied`

```elixir
@type debit_credits_applied() :: %{
  optional(:invoice) =&gt; String.t() | Stripe.Resources.Invoice.t() | nil,
  optional(:invoice_line_item) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `invoice` - The invoice to which the billing credits were applied.
* `invoice_line_item` - The invoice line item to which the billing credits were applied. Max length: 5000.

# `t`

```elixir
@type t() :: %Stripe.Resources.Billing.CreditBalanceTransaction{
  created: integer(),
  credit: credit(),
  credit_grant: String.t() | Stripe.Resources.Billing.CreditGrant.t(),
  debit: debit(),
  effective_at: integer(),
  id: String.t(),
  livemode: boolean(),
  object: String.t(),
  test_clock: String.t() | Stripe.Resources.TestHelpers.TestClock.t(),
  type: String.t()
}
```

* `created` - Time at which the object was created. Measured in seconds since the Unix epoch. Format: Unix timestamp.
* `credit` - Credit details for this credit balance transaction. Only present if type is `credit`. Nullable. Expandable.
* `credit_grant` - The credit grant associated with this credit balance transaction. Expandable.
* `debit` - Debit details for this credit balance transaction. Only present if type is `debit`. Nullable. Expandable.
* `effective_at` - The effective time of this credit balance transaction. Format: Unix timestamp.
* `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.
* `object` - String representing the object's type. Objects of the same type share the same value. Possible values: `billing.credit_balance_transaction`.
* `test_clock` - ID of the test clock this credit balance transaction belongs to. Nullable. Expandable.
* `type` - The type of credit balance transaction (credit or debit). Possible values: `credit`, `debit`. Nullable.

# `expandable_fields`

# `object_name`

---

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