Class: Recurly::Resources::LineItem

Inherits:
Recurly::Resource show all
Defined in:
lib/recurly/resources/line_item.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

#account ⇒ AccountMini

Returns Account mini details.

Returns:



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

define_attribute :account, :AccountMini

#accounting_code ⇒ String

Returns Internal accounting code to help you reconcile your revenue to the correct ledger. Line items created as part of a subscription invoice will use the plan or add-on's accounting code, otherwise the value will only be present if you define an accounting code when creating the line item.

Returns:

  • (String) —

    Internal accounting code to help you reconcile your revenue to the correct ledger. Line items created as part of a subscription invoice will use the plan or add-on's accounting code, otherwise the value will only be present if you define an accounting code when creating the line item.



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

define_attribute :accounting_code, String

#add_on_code ⇒ String

Returns If the line item is a charge or credit for an add-on, this is its code.

Returns:

  • (String) —

    If the line item is a charge or credit for an add-on, this is its code.



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

define_attribute :add_on_code, String

#add_on_id ⇒ String

Returns If the line item is a charge or credit for an add-on this is its ID.

Returns:

  • (String) —

    If the line item is a charge or credit for an add-on this is its ID.



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

define_attribute :add_on_id, String

#amount ⇒ Float

Returns (quantity * unit_amount) - discount + tax.

Returns:

  • (Float) —

    (quantity * unit_amount) - discount + tax



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

define_attribute :amount, Float

#avalara_service_type ⇒ Integer

Returns Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to the documentation for more available t/s types.

Returns:

  • (Integer) —

    Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to the documentation for more available t/s types.



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

define_attribute :avalara_service_type, Integer

#avalara_transaction_type ⇒ Integer

Returns Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to the documentation for more available t/s types.

Returns:

  • (Integer) —

    Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to the documentation for more available t/s types.



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

define_attribute :avalara_transaction_type, Integer

#bill_for_account_id ⇒ String

Returns The UUID of the account responsible for originating the line item.

Returns:

  • (String) —

    The UUID of the account responsible for originating the line item.



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

define_attribute :bill_for_account_id, String

#created_at ⇒ DateTime

Returns When the line item was created.

Returns:

  • (DateTime) —

    When the line item was created.



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

define_attribute :created_at, DateTime

#credit_applied ⇒ Float

Returns The amount of credit from this line item that was applied to the invoice.

Returns:

  • (Float) —

    The amount of credit from this line item that was applied to the invoice.



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

define_attribute :credit_applied, Float

#credit_reason_code ⇒ String

Returns The reason the credit was given when line item is type=credit.

Returns:

  • (String) —

    The reason the credit was given when line item is type=credit.



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

define_attribute :credit_reason_code, String

#currency ⇒ String

Returns 3-letter ISO 4217 currency code.

Returns:

  • (String) —

    3-letter ISO 4217 currency code.



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

define_attribute :currency, String

#custom_fields ⇒ Array[CustomField]

Returns The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.

Returns:

  • (Array[CustomField]) —

    The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.



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

define_attribute :custom_fields, Array, { :item_type => :CustomField }

#description ⇒ String

Returns Description that appears on the invoice. For subscription related items this will be filled in automatically.

Returns:

  • (String) —

    Description that appears on the invoice. For subscription related items this will be filled in automatically.



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

define_attribute :description, String

#destination_tax_address_source ⇒ String

Returns The source of the address that will be used as the destinaion in determining taxes. Available only when the site is on an Elite plan. A value of "destination" refers to the "Customer tax address". A value of "origin" refers to the "Business entity tax address".

Returns:

  • (String) —

    The source of the address that will be used as the destinaion in determining taxes. Available only when the site is on an Elite plan. A value of "destination" refers to the "Customer tax address". A value of "origin" refers to the "Business entity tax address".



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

define_attribute :destination_tax_address_source, String

#discount ⇒ Float

Returns The sum of all discounts applied to the line item.

Returns:

  • (Float) —

    The sum of all discounts applied to the line item.



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

define_attribute :discount, Float

#discounts ⇒ Array[LineItemDiscount]

Returns The breakdown of discounts applied to the line item by coupon redemption.

Returns:

  • (Array[LineItemDiscount]) —

    The breakdown of discounts applied to the line item by coupon redemption.



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

define_attribute :discounts, Array, { :item_type => :LineItemDiscount }

#end_date ⇒ DateTime

Returns If this date is provided, it indicates the end of a time range.

Returns:

  • (DateTime) —

    If this date is provided, it indicates the end of a time range.



79
# File 'lib/recurly/resources/line_item.rb', line 79

define_attribute :end_date, DateTime

#external_sku ⇒ String

Returns Optional Stock Keeping Unit assigned to an item. Available when the Credit Invoices feature is enabled.

Returns:

  • (String) —

    Optional Stock Keeping Unit assigned to an item. Available when the Credit Invoices feature is enabled.



83
# File 'lib/recurly/resources/line_item.rb', line 83

define_attribute :external_sku, String

#harmonized_system_code ⇒ String

Returns The Harmonized System (HS) code is an internationally standardized system of names and numbers to classify traded products. The HS code, sometimes called Commodity Code, is used by customs authorities around the world to identify products when assessing duties and taxes. The HS code may also be referred to as the tariff code or customs code. Values should contain only digits and decimals.

Returns:

  • (String) —

    The Harmonized System (HS) code is an internationally standardized system of names and numbers to classify traded products. The HS code, sometimes called Commodity Code, is used by customs authorities around the world to identify products when assessing duties and taxes. The HS code may also be referred to as the tariff code or customs code. Values should contain only digits and decimals.



87
# File 'lib/recurly/resources/line_item.rb', line 87

define_attribute :harmonized_system_code, String

#id ⇒ String

Returns Line item ID.

Returns:

  • (String) —

    Line item ID



91
# File 'lib/recurly/resources/line_item.rb', line 91

define_attribute :id, String

#invoice_id ⇒ String

Returns Once the line item has been invoiced this will be the invoice's ID.

Returns:

  • (String) —

    Once the line item has been invoiced this will be the invoice's ID.



95
# File 'lib/recurly/resources/line_item.rb', line 95

define_attribute :invoice_id, String

#invoice_number ⇒ String

Returns Once the line item has been invoiced this will be the invoice's number. If VAT taxation and the Country Invoice Sequencing feature are enabled, invoices will have country-specific invoice numbers for invoices billed to EU countries (ex: FR1001). Non-EU invoices will continue to use the site-level invoice number sequence.

Returns:

  • (String) —

    Once the line item has been invoiced this will be the invoice's number. If VAT taxation and the Country Invoice Sequencing feature are enabled, invoices will have country-specific invoice numbers for invoices billed to EU countries (ex: FR1001). Non-EU invoices will continue to use the site-level invoice number sequence.



99
# File 'lib/recurly/resources/line_item.rb', line 99

define_attribute :invoice_number, String

#item_code ⇒ String

Returns Unique code to identify an item. Available when the Credit Invoices feature is enabled.

Returns:

  • (String) —

    Unique code to identify an item. Available when the Credit Invoices feature is enabled.



103
# File 'lib/recurly/resources/line_item.rb', line 103

define_attribute :item_code, String

#item_id ⇒ String

Returns System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled.

Returns:

  • (String) —

    System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled.



107
# File 'lib/recurly/resources/line_item.rb', line 107

define_attribute :item_id, String

#legacy_category ⇒ String

Returns Category to describe the role of a line item on a legacy invoice: - "charges" refers to charges being billed for on this invoice. - "credits" refers to refund or proration credits. This portion of the invoice can be considered a credit memo. - "applied_credits" refers to previous credits applied to this invoice. See their original_line_item_id to determine where the credit first originated. - "carryforwards" can be ignored. They exist to consume any remaining credit balance. A new credit with the same amount will be created and placed back on the account.

Returns:

  • (String) —

    Category to describe the role of a line item on a legacy invoice: - "charges" refers to charges being billed for on this invoice. - "credits" refers to refund or proration credits. This portion of the invoice can be considered a credit memo. - "applied_credits" refers to previous credits applied to this invoice. See their original_line_item_id to determine where the credit first originated. - "carryforwards" can be ignored. They exist to consume any remaining credit balance. A new credit with the same amount will be created and placed back on the account.



111
# File 'lib/recurly/resources/line_item.rb', line 111

define_attribute :legacy_category, String

#liability_gl_account_code ⇒ String

Returns Unique code to identify the ledger account. Each code must start with a letter or number. The following special characters are allowed: -_.,:.

Returns:

  • (String) —

    Unique code to identify the ledger account. Each code must start with a letter or number. The following special characters are allowed: -_.,:



115
# File 'lib/recurly/resources/line_item.rb', line 115

define_attribute :liability_gl_account_code, String

#object ⇒ String

Returns Object type.

Returns:

  • (String) —

    Object type



119
# File 'lib/recurly/resources/line_item.rb', line 119

define_attribute :object, String

#origin ⇒ String

Returns A credit created from an original charge will have the value of the charge's origin.

Returns:

  • (String) —

    A credit created from an original charge will have the value of the charge's origin.



123
# File 'lib/recurly/resources/line_item.rb', line 123

define_attribute :origin, String

#origin_tax_address_source ⇒ String

Returns The source of the address that will be used as the origin in determining taxes. Available only when the site is on an Elite plan. A value of "origin" refers to the "Business entity tax address". A value of "destination" refers to the "Customer tax address".

Returns:

  • (String) —

    The source of the address that will be used as the origin in determining taxes. Available only when the site is on an Elite plan. A value of "origin" refers to the "Business entity tax address". A value of "destination" refers to the "Customer tax address".



127
# File 'lib/recurly/resources/line_item.rb', line 127

define_attribute :origin_tax_address_source, String

#original_line_item_invoice_id ⇒ String

Returns The invoice where the credit originated. Will only have a value if the line item is a credit created from a previous credit, or if the credit was created from a charge refund.

Returns:

  • (String) —

    The invoice where the credit originated. Will only have a value if the line item is a credit created from a previous credit, or if the credit was created from a charge refund.



131
# File 'lib/recurly/resources/line_item.rb', line 131

define_attribute :original_line_item_invoice_id, String

#performance_obligation_id ⇒ String

Returns The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.

Returns:

  • (String) —

    The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.



135
# File 'lib/recurly/resources/line_item.rb', line 135

define_attribute :performance_obligation_id, String

#plan_code ⇒ String

Returns If the line item is a charge or credit for a plan or add-on, this is the plan's code.

Returns:

  • (String) —

    If the line item is a charge or credit for a plan or add-on, this is the plan's code.



139
# File 'lib/recurly/resources/line_item.rb', line 139

define_attribute :plan_code, String

#plan_id ⇒ String

Returns If the line item is a charge or credit for a plan or add-on, this is the plan's ID.

Returns:

  • (String) —

    If the line item is a charge or credit for a plan or add-on, this is the plan's ID.



143
# File 'lib/recurly/resources/line_item.rb', line 143

define_attribute :plan_id, String

#previous_line_item_id ⇒ String

Returns Will only have a value if the line item is a credit created from a previous credit, or if the credit was created from a charge refund.

Returns:

  • (String) —

    Will only have a value if the line item is a credit created from a previous credit, or if the credit was created from a charge refund.



147
# File 'lib/recurly/resources/line_item.rb', line 147

define_attribute :previous_line_item_id, String

#product_code ⇒ String

Returns For plan-related line items this will be the plan's code, for add-on related line items it will be the add-on's code. For item-related line items it will be the item's external_sku.

Returns:

  • (String) —

    For plan-related line items this will be the plan's code, for add-on related line items it will be the add-on's code. For item-related line items it will be the item's external_sku.



151
# File 'lib/recurly/resources/line_item.rb', line 151

define_attribute :product_code, String

#proration_rate ⇒ Float

Returns When a line item has been prorated, this is the rate of the proration. Proration rates were made available for line items created after March 30, 2017. For line items created prior to that date, the proration rate will be null, even if the line item was prorated.

Returns:

  • (Float) —

    When a line item has been prorated, this is the rate of the proration. Proration rates were made available for line items created after March 30, 2017. For line items created prior to that date, the proration rate will be null, even if the line item was prorated.



155
# File 'lib/recurly/resources/line_item.rb', line 155

define_attribute :proration_rate, Float

#quantity ⇒ Integer

Returns This number will be multiplied by the unit amount to compute the subtotal before any discounts or taxes.

Returns:

  • (Integer) —

    This number will be multiplied by the unit amount to compute the subtotal before any discounts or taxes.



159
# File 'lib/recurly/resources/line_item.rb', line 159

define_attribute :quantity, Integer

#quantity_decimal ⇒ String

Returns A floating-point alternative to Quantity. If this value is present, it will be used in place of Quantity for calculations, and Quantity will be the rounded integer value of this number. This field supports up to 9 decimal places. The Decimal Quantity feature must be enabled to utilize this field.

Returns:

  • (String) —

    A floating-point alternative to Quantity. If this value is present, it will be used in place of Quantity for calculations, and Quantity will be the rounded integer value of this number. This field supports up to 9 decimal places. The Decimal Quantity feature must be enabled to utilize this field.



163
# File 'lib/recurly/resources/line_item.rb', line 163

define_attribute :quantity_decimal, String

#refund ⇒ Boolean

Returns Refund?.

Returns:

  • (Boolean) —

    Refund?



167
# File 'lib/recurly/resources/line_item.rb', line 167

define_attribute :refund, :Boolean

#refunded_quantity ⇒ Integer

Returns For refund charges, the quantity being refunded. For non-refund charges, the total quantity refunded (possibly over multiple refunds).

Returns:

  • (Integer) —

    For refund charges, the quantity being refunded. For non-refund charges, the total quantity refunded (possibly over multiple refunds).



171
# File 'lib/recurly/resources/line_item.rb', line 171

define_attribute :refunded_quantity, Integer

#refunded_quantity_decimal ⇒ String

Returns A floating-point alternative to Refunded Quantity. For refund charges, the quantity being refunded. For non-refund charges, the total quantity refunded (possibly over multiple refunds). The Decimal Quantity feature must be enabled to utilize this field.

Returns:

  • (String) —

    A floating-point alternative to Refunded Quantity. For refund charges, the quantity being refunded. For non-refund charges, the total quantity refunded (possibly over multiple refunds). The Decimal Quantity feature must be enabled to utilize this field.



175
# File 'lib/recurly/resources/line_item.rb', line 175

define_attribute :refunded_quantity_decimal, String

#revenue_gl_account_code ⇒ String

Returns Unique code to identify the ledger account. Each code must start with a letter or number. The following special characters are allowed: -_.,:.

Returns:

  • (String) —

    Unique code to identify the ledger account. Each code must start with a letter or number. The following special characters are allowed: -_.,:



179
# File 'lib/recurly/resources/line_item.rb', line 179

define_attribute :revenue_gl_account_code, String

#revenue_schedule_type ⇒ String

Returns Revenue schedule type.

Returns:

  • (String) —

    Revenue schedule type



183
# File 'lib/recurly/resources/line_item.rb', line 183

define_attribute :revenue_schedule_type, String

#shipping_address ⇒ ShippingAddress

Returns:



187
# File 'lib/recurly/resources/line_item.rb', line 187

define_attribute :shipping_address, :ShippingAddress

#start_date ⇒ DateTime

Returns If an end date is present, this is value indicates the beginning of a billing time range. If no end date is present it indicates billing for a specific date.

Returns:

  • (DateTime) —

    If an end date is present, this is value indicates the beginning of a billing time range. If no end date is present it indicates billing for a specific date.



191
# File 'lib/recurly/resources/line_item.rb', line 191

define_attribute :start_date, DateTime

#state ⇒ String

Returns Pending line items are charges or credits on an account that have not been applied to an invoice yet. Invoiced line items will always have an invoice_id value.

Returns:

  • (String) —

    Pending line items are charges or credits on an account that have not been applied to an invoice yet. Invoiced line items will always have an invoice_id value.



195
# File 'lib/recurly/resources/line_item.rb', line 195

define_attribute :state, String

#subscription_id ⇒ String

Returns If the line item is a charge or credit for a subscription, this is its ID.

Returns:

  • (String) —

    If the line item is a charge or credit for a subscription, this is its ID.



199
# File 'lib/recurly/resources/line_item.rb', line 199

define_attribute :subscription_id, String

#subtotal ⇒ Float

Returns quantity * unit_amount.

Returns:

  • (Float) —

    quantity * unit_amount



203
# File 'lib/recurly/resources/line_item.rb', line 203

define_attribute :subtotal, Float

#tax ⇒ Float

Returns The tax amount for the line item.

Returns:

  • (Float) —

    The tax amount for the line item.



207
# File 'lib/recurly/resources/line_item.rb', line 207

define_attribute :tax, Float

#tax_code ⇒ String

Returns Optional field used by Avalara, Vertex, and Recurly's In-the-Box tax solution to determine taxation rules. You can pass in specific tax codes using any of these tax integrations. For Recurly's In-the-Box tax offering you can also choose to instead use simple values of unknown, physical, or digital tax codes.

Returns:

  • (String) —

    Optional field used by Avalara, Vertex, and Recurly's In-the-Box tax solution to determine taxation rules. You can pass in specific tax codes using any of these tax integrations. For Recurly's In-the-Box tax offering you can also choose to instead use simple values of unknown, physical, or digital tax codes.



211
# File 'lib/recurly/resources/line_item.rb', line 211

define_attribute :tax_code, String

#tax_exempt ⇒ Boolean

Returns true exempts tax on charges, false applies tax on charges. If not defined, then defaults to the Plan and Site settings. This attribute does not work for credits (negative line items). Credits are always applied post-tax. Pre-tax discounts should use the Coupons feature.

Returns:

  • (Boolean) —

    true exempts tax on charges, false applies tax on charges. If not defined, then defaults to the Plan and Site settings. This attribute does not work for credits (negative line items). Credits are always applied post-tax. Pre-tax discounts should use the Coupons feature.



215
# File 'lib/recurly/resources/line_item.rb', line 215

define_attribute :tax_exempt, :Boolean

#tax_inclusive ⇒ Boolean

Returns Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.

Returns:

  • (Boolean) —

    Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.



219
# File 'lib/recurly/resources/line_item.rb', line 219

define_attribute :tax_inclusive, :Boolean

#tax_info ⇒ TaxInfo

Returns Only for merchants using Recurly's In-The-Box taxes.

Returns:

  • (TaxInfo) —

    Only for merchants using Recurly's In-The-Box taxes.



223
# File 'lib/recurly/resources/line_item.rb', line 223

define_attribute :tax_info, :TaxInfo

#taxable ⇒ Boolean

Returns true if the line item is taxable, false if it is not.

Returns:

  • (Boolean) —

    true if the line item is taxable, false if it is not.



227
# File 'lib/recurly/resources/line_item.rb', line 227

define_attribute :taxable, :Boolean

#type ⇒ String

Returns Charges are positive line items that debit the account. Credits are negative line items that credit the account.

Returns:

  • (String) —

    Charges are positive line items that debit the account. Credits are negative line items that credit the account.



231
# File 'lib/recurly/resources/line_item.rb', line 231

define_attribute :type, String

#unit_amount ⇒ Float

Returns Positive amount for a charge, negative amount for a credit.

Returns:

  • (Float) —

    Positive amount for a charge, negative amount for a credit.



235
# File 'lib/recurly/resources/line_item.rb', line 235

define_attribute :unit_amount, Float

#unit_amount_decimal ⇒ String

Returns Positive amount for a charge, negative amount for a credit.

Returns:

  • (String) —

    Positive amount for a charge, negative amount for a credit.



239
# File 'lib/recurly/resources/line_item.rb', line 239

define_attribute :unit_amount_decimal, String

#updated_at ⇒ DateTime

Returns When the line item was last changed.

Returns:

  • (DateTime) —

    When the line item was last changed.



243
# File 'lib/recurly/resources/line_item.rb', line 243

define_attribute :updated_at, DateTime

#uuid ⇒ String

Returns The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.

Returns:

  • (String) —

    The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.



247
# File 'lib/recurly/resources/line_item.rb', line 247

define_attribute :uuid, String

#vertex_transaction_type ⇒ String

Returns Used by Vertex for tax calculations. Possible values are sale, rental, lease.

Returns:

  • (String) —

    Used by Vertex for tax calculations. Possible values are sale, rental, lease.



251
# File 'lib/recurly/resources/line_item.rb', line 251

define_attribute :vertex_transaction_type, String