Stripe.Resources.Billing.CreditGrant (tiger_stripe v0.3.0)

Copy Markdown View Source

CreditGrant

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

Related guide: Billing credits

Summary

Types

amount()

@type amount() :: %{
  optional(:monetary) => amount_monetary() | nil,
  optional(:type) => String.t() | nil,
  optional(String.t()) => term()
}
  • monetary - The monetary amount. Nullable.
  • type - The type of this amount. We currently only support monetary billing credits. Possible values: monetary.

amount_monetary()

@type amount_monetary() :: %{
  optional(:currency) => String.t() | nil,
  optional(:value) => integer() | nil,
  optional(String.t()) => term()
}

applicability_config()

@type applicability_config() :: %{
  optional(:scope) => applicability_config_scope() | nil,
  optional(String.t()) => term()
}
  • scope

applicability_config_scope()

@type applicability_config_scope() :: %{
  optional(:price_type) => String.t() | nil,
  optional(:prices) => [applicability_config_scope_prices()] | nil,
  optional(String.t()) => 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 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 attached to them. Cannot be used in combination with price_type.

applicability_config_scope_prices()

@type applicability_config_scope_prices() :: %{
  optional(:id) => String.t() | nil,
  optional(String.t()) => term()
}
  • id - Unique identifier for the object. Max length: 5000. Nullable.

t()

@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()) => 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 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.

Functions

expandable_fields()

object_name()