Class: Recurly::Resources::Usage

Inherits:
Recurly::Resource show all
Defined in:
lib/recurly/resources/usage.rb

Instance Attribute Summary collapse

Attributes inherited from Recurly::Resource

#attributes

Method Summary

Methods inherited from Recurly::Resource

#==, #get_response, #inspect, #requires_client?, #to_json, #to_s

Methods included from Schema::SchemaFactory

#schema

Methods included from Schema::ResourceCaster

#cast

Methods included from Schema::SchemaValidator

#get_did_you_mean, #validate!, #validate_attribute!

Instance Attribute Details

#amountFloat

Returns The amount of usage. Can be positive, negative, or 0. If the Decimal Quantity feature is enabled, this value will be rounded to nine decimal places. Otherwise, all digits after the decimal will be stripped. If the usage-based add-on is billed with a percentage, your usage should be a monetary amount formatted in cents (e.g., $5.00 is “500”).

Returns:

  • (Float)

    The amount of usage. Can be positive, negative, or 0. If the Decimal Quantity feature is enabled, this value will be rounded to nine decimal places. Otherwise, all digits after the decimal will be stripped. If the usage-based add-on is billed with a percentage, your usage should be a monetary amount formatted in cents (e.g., $5.00 is “500”).



11
# File 'lib/recurly/resources/usage.rb', line 11

define_attribute :amount, Float

#billed_atDateTime

Returns When the usage record was billed on an invoice.

Returns:

  • (DateTime)

    When the usage record was billed on an invoice.



15
# File 'lib/recurly/resources/usage.rb', line 15

define_attribute :billed_at, DateTime

#created_atDateTime

Returns When the usage record was created in Recurly.

Returns:

  • (DateTime)

    When the usage record was created in Recurly.



19
# File 'lib/recurly/resources/usage.rb', line 19

define_attribute :created_at, DateTime

#idString

Returns:

  • (String)


23
# File 'lib/recurly/resources/usage.rb', line 23

define_attribute :id, String

#measured_unit_idString

Returns The ID of the measured unit associated with the add-on the usage record is for.

Returns:

  • (String)

    The ID of the measured unit associated with the add-on the usage record is for.



27
# File 'lib/recurly/resources/usage.rb', line 27

define_attribute :measured_unit_id, String

#merchant_tagString

Returns Custom field for recording the id in your own system associated with the usage, so you can provide auditable usage displays to your customers using a GET on this endpoint.

Returns:

  • (String)

    Custom field for recording the id in your own system associated with the usage, so you can provide auditable usage displays to your customers using a GET on this endpoint.



31
# File 'lib/recurly/resources/usage.rb', line 31

define_attribute :merchant_tag, String

#objectString

Returns Object type.

Returns:

  • (String)

    Object type



35
# File 'lib/recurly/resources/usage.rb', line 35

define_attribute :object, String

#percentage_tiersArray[SubscriptionAddOnPercentageTier]

Returns The percentage tiers of the subscription based on the usage_timestamp. If tier_type = flat, percentage_tiers = []. This feature is currently in development and requires approval and enablement, please contact support.

Returns:

  • (Array[SubscriptionAddOnPercentageTier])

    The percentage tiers of the subscription based on the usage_timestamp. If tier_type = flat, percentage_tiers = []. This feature is currently in development and requires approval and enablement, please contact support.



39
# File 'lib/recurly/resources/usage.rb', line 39

define_attribute :percentage_tiers, Array, { :item_type => :SubscriptionAddOnPercentageTier }

#recording_timestampDateTime

Returns When the usage was recorded in your system.

Returns:

  • (DateTime)

    When the usage was recorded in your system.



43
# File 'lib/recurly/resources/usage.rb', line 43

define_attribute :recording_timestamp, DateTime

#tier_typeString

Returns The pricing model for the add-on. For more information, [click here](docs.recurly.com/docs/billing-models#section-quantity-based). See our [Guide](recurly.com/developers/guides/item-addon-guide.html) for an overview of how to configure quantity-based pricing models.

Returns:



47
# File 'lib/recurly/resources/usage.rb', line 47

define_attribute :tier_type, String

#tiersArray[SubscriptionAddOnTier]

Returns The tiers and prices of the subscription based on the usage_timestamp. If tier_type = flat, tiers = [].

Returns:

  • (Array[SubscriptionAddOnTier])

    The tiers and prices of the subscription based on the usage_timestamp. If tier_type = flat, tiers = []



51
# File 'lib/recurly/resources/usage.rb', line 51

define_attribute :tiers, Array, { :item_type => :SubscriptionAddOnTier }

#unit_amountFloat

Returns Unit price.

Returns:

  • (Float)

    Unit price



55
# File 'lib/recurly/resources/usage.rb', line 55

define_attribute :unit_amount, Float

#unit_amount_decimalString

Returns Unit price that can optionally support a sub-cent value.

Returns:

  • (String)

    Unit price that can optionally support a sub-cent value.



59
# File 'lib/recurly/resources/usage.rb', line 59

define_attribute :unit_amount_decimal, String

#updated_atDateTime

Returns When the usage record was billed on an invoice.

Returns:

  • (DateTime)

    When the usage record was billed on an invoice.



63
# File 'lib/recurly/resources/usage.rb', line 63

define_attribute :updated_at, DateTime

#usage_percentageFloat

Returns The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0.

Returns:

  • (Float)

    The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0.



67
# File 'lib/recurly/resources/usage.rb', line 67

define_attribute :usage_percentage, Float

#usage_timestampDateTime

Returns When the usage actually happened. This will define the line item dates this usage is billed under and is important for revenue recognition.

Returns:

  • (DateTime)

    When the usage actually happened. This will define the line item dates this usage is billed under and is important for revenue recognition.



71
# File 'lib/recurly/resources/usage.rb', line 71

define_attribute :usage_timestamp, DateTime

#usage_typeString

Returns Type of usage, returns usage type if `add_on_type` is `usage`.

Returns:

  • (String)

    Type of usage, returns usage type if `add_on_type` is `usage`.



75
# File 'lib/recurly/resources/usage.rb', line 75

define_attribute :usage_type, String