Class: Recurly::Resources::Usage
- Inherits:
- 
      Recurly::Resource
      
        - Object
- Recurly::Resource
- Recurly::Resources::Usage
 
- Defined in:
- lib/recurly/resources/usage.rb
Instance Attribute Summary collapse
- 
  
    
      #amount  ⇒ Float 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    The amount of usage. 
- 
  
    
      #billed_at  ⇒ DateTime 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    When the usage record was billed on an invoice. 
- 
  
    
      #created_at  ⇒ DateTime 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    When the usage record was created in Recurly. 
- #id ⇒ String
- 
  
    
      #measured_unit_id  ⇒ String 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    The ID of the measured unit associated with the add-on the usage record is for. 
- 
  
    
      #merchant_tag  ⇒ 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. 
- 
  
    
      #object  ⇒ String 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Object type. 
- 
  
    
      #percentage_tiers  ⇒ Array[SubscriptionAddOnPercentageTier] 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    The percentage tiers of the subscription based on the usage_timestamp. 
- 
  
    
      #recording_timestamp  ⇒ DateTime 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    When the usage was recorded in your system. 
- 
  
    
      #tier_type  ⇒ String 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    The pricing model for the add-on. 
- 
  
    
      #tiers  ⇒ Array[SubscriptionAddOnTier] 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    The tiers and prices of the subscription based on the usage_timestamp. 
- 
  
    
      #unit_amount  ⇒ Float 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Unit price. 
- 
  
    
      #unit_amount_decimal  ⇒ String 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Unit price that can optionally support a sub-cent value. 
- 
  
    
      #updated_at  ⇒ DateTime 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    When the usage record was billed on an invoice. 
- 
  
    
      #usage_percentage  ⇒ Float 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    The percentage taken of the monetary amount of usage tracked. 
- 
  
    
      #usage_timestamp  ⇒ DateTime 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    When the usage actually happened. 
- 
  
    
      #usage_type  ⇒ String 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Type of usage, returns usage type if `add_on_type` is `usage`. 
Attributes inherited from Recurly::Resource
Method Summary
Methods inherited from Recurly::Resource
#==, #get_response, #inspect, #requires_client?, #to_json, #to_s
Methods included from Schema::SchemaFactory
Methods included from Schema::ResourceCaster
Methods included from Schema::SchemaValidator
#get_did_you_mean, #validate!, #validate_attribute!
Instance Attribute Details
#amount ⇒ Float
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”).
| 11 | # File 'lib/recurly/resources/usage.rb', line 11 define_attribute :amount, Float | 
#billed_at ⇒ DateTime
Returns When the usage record was billed on an invoice.
| 15 | # File 'lib/recurly/resources/usage.rb', line 15 define_attribute :billed_at, DateTime | 
#created_at ⇒ DateTime
Returns When the usage record was created in Recurly.
| 19 | # File 'lib/recurly/resources/usage.rb', line 19 define_attribute :created_at, DateTime | 
#id ⇒ String
| 23 | # File 'lib/recurly/resources/usage.rb', line 23 define_attribute :id, String | 
#measured_unit_id ⇒ String
Returns 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_tag ⇒ String
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.
| 31 | # File 'lib/recurly/resources/usage.rb', line 31 define_attribute :merchant_tag, String | 
#object ⇒ String
Returns Object type.
| 35 | # File 'lib/recurly/resources/usage.rb', line 35 define_attribute :object, String | 
#percentage_tiers ⇒ Array[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.
| 39 | # File 'lib/recurly/resources/usage.rb', line 39 define_attribute :percentage_tiers, Array, { :item_type => :SubscriptionAddOnPercentageTier } | 
#recording_timestamp ⇒ DateTime
Returns When the usage was recorded in your system.
| 43 | # File 'lib/recurly/resources/usage.rb', line 43 define_attribute :recording_timestamp, DateTime | 
#tier_type ⇒ String
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.
| 47 | # File 'lib/recurly/resources/usage.rb', line 47 define_attribute :tier_type, String | 
#tiers ⇒ Array[SubscriptionAddOnTier]
Returns 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_amount ⇒ Float
Returns Unit price.
| 55 | # File 'lib/recurly/resources/usage.rb', line 55 define_attribute :unit_amount, Float | 
#unit_amount_decimal ⇒ String
Returns 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_at ⇒ DateTime
Returns When the usage record was billed on an invoice.
| 63 | # File 'lib/recurly/resources/usage.rb', line 63 define_attribute :updated_at, DateTime | 
#usage_percentage ⇒ Float
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.
| 67 | # File 'lib/recurly/resources/usage.rb', line 67 define_attribute :usage_percentage, Float | 
#usage_timestamp ⇒ DateTime
Returns 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_type ⇒ String
Returns 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 |