Class: Recurly::Resources::LineItem
- Inherits:
-
Recurly::Resource
- Object
- Recurly::Resource
- Recurly::Resources::LineItem
- Defined in:
- lib/recurly/resources/line_item.rb
Instance Attribute Summary collapse
-
#account ⇒ AccountMini
Account mini details.
-
#accounting_code ⇒ String
Internal accounting code to help you reconcile your revenue to the correct ledger.
-
#add_on_code ⇒ String
If the line item is a charge or credit for an add-on, this is its code.
-
#add_on_id ⇒ String
If the line item is a charge or credit for an add-on this is its ID.
-
#amount ⇒ Float
‘(quantity * unit_amount) - (discount + tax)`.
-
#avalara_service_type ⇒ Integer
Used by Avalara for Communications taxes.
-
#avalara_transaction_type ⇒ Integer
Used by Avalara for Communications taxes.
-
#bill_for_account_id ⇒ String
The UUID of the account responsible for originating the line item.
-
#created_at ⇒ DateTime
When the line item was created.
-
#credit_applied ⇒ Float
The amount of credit from this line item that was applied to the invoice.
-
#credit_reason_code ⇒ String
The reason the credit was given when line item is ‘type=credit`.
-
#currency ⇒ String
3-letter ISO 4217 currency code.
-
#custom_fields ⇒ Array[CustomField]
The custom fields will only be altered when they are included in a request.
-
#description ⇒ String
Description that appears on the invoice.
-
#discount ⇒ Float
The discount applied to the line item.
-
#end_date ⇒ DateTime
If this date is provided, it indicates the end of a time range.
-
#external_sku ⇒ String
Optional Stock Keeping Unit assigned to an item.
-
#id ⇒ String
Line item ID.
-
#invoice_id ⇒ String
Once the line item has been invoiced this will be the invoice’s ID.
-
#invoice_number ⇒ String
Once the line item has been invoiced this will be the invoice’s number.
-
#item_code ⇒ String
Unique code to identify an item.
-
#item_id ⇒ String
System-generated unique identifier for an item.
-
#legacy_category ⇒ String
Category to describe the role of a line item on a legacy invoice: - “charges” refers to charges being billed for on this invoice.
-
#object ⇒ String
Object type.
-
#origin ⇒ String
A credit created from an original charge will have the value of the charge’s origin.
-
#original_line_item_invoice_id ⇒ String
The invoice where the credit originated.
-
#plan_code ⇒ String
If the line item is a charge or credit for a plan or add-on, this is the plan’s code.
-
#plan_id ⇒ String
If the line item is a charge or credit for a plan or add-on, this is the plan’s ID.
-
#previous_line_item_id ⇒ 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.
-
#product_code ⇒ 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.
-
#proration_rate ⇒ Float
When a line item has been prorated, this is the rate of the proration.
-
#quantity ⇒ Integer
This number will be multiplied by the unit amount to compute the subtotal before any discounts or taxes.
-
#quantity_decimal ⇒ String
A floating-point alternative to Quantity.
-
#refund ⇒ Boolean
Refund?.
-
#refunded_quantity ⇒ Integer
For refund charges, the quantity being refunded.
-
#refunded_quantity_decimal ⇒ String
A floating-point alternative to Refunded Quantity.
-
#revenue_schedule_type ⇒ String
Revenue schedule type.
- #shipping_address ⇒ ShippingAddress
-
#start_date ⇒ DateTime
If an end date is present, this is value indicates the beginning of a billing time range.
-
#state ⇒ String
Pending line items are charges or credits on an account that have not been applied to an invoice yet.
-
#subscription_id ⇒ String
If the line item is a charge or credit for a subscription, this is its ID.
-
#subtotal ⇒ Float
‘quantity * unit_amount`.
-
#tax ⇒ Float
The tax amount for the line item.
-
#tax_code ⇒ String
Used by Avalara, Vertex, and Recurly’s EU VAT tax feature.
-
#tax_exempt ⇒ Boolean
‘true` exempts tax on charges, `false` applies tax on charges.
-
#tax_inclusive ⇒ Boolean
Determines whether or not tax is included in the unit amount.
-
#tax_info ⇒ TaxInfo
Tax info.
-
#taxable ⇒ Boolean
‘true` if the line item is taxable, `false` if it is not.
-
#type ⇒ String
Charges are positive line items that debit the account.
-
#unit_amount ⇒ Float
Positive amount for a charge, negative amount for a credit.
-
#unit_amount_decimal ⇒ String
Positive amount for a charge, negative amount for a credit.
-
#updated_at ⇒ DateTime
When the line item was last changed.
-
#uuid ⇒ String
The UUID is useful for matching data with the CSV exports and building URLs into Recurly’s UI.
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
#account ⇒ AccountMini
Returns Account mini details.
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.
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.
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.
23 |
# File 'lib/recurly/resources/line_item.rb', line 23 define_attribute :add_on_id, String |
#amount ⇒ Float
Returns ‘(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](help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) 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](help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) 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.
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.
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.
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`.
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.
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.
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.
63 |
# File 'lib/recurly/resources/line_item.rb', line 63 define_attribute :description, String |
#discount ⇒ Float
Returns The discount applied to the line item.
67 |
# File 'lib/recurly/resources/line_item.rb', line 67 define_attribute :discount, Float |
#end_date ⇒ DateTime
Returns If this date is provided, it indicates the end of a time range.
71 |
# File 'lib/recurly/resources/line_item.rb', line 71 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.
75 |
# File 'lib/recurly/resources/line_item.rb', line 75 define_attribute :external_sku, String |
#id ⇒ String
Returns Line item ID.
79 |
# File 'lib/recurly/resources/line_item.rb', line 79 define_attribute :id, String |
#invoice_id ⇒ String
Returns Once the line item has been invoiced this will be the invoice’s ID.
83 |
# File 'lib/recurly/resources/line_item.rb', line 83 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.
87 |
# File 'lib/recurly/resources/line_item.rb', line 87 define_attribute :invoice_number, String |
#item_code ⇒ String
Returns Unique code to identify an item. Available when the Credit Invoices feature is enabled.
91 |
# File 'lib/recurly/resources/line_item.rb', line 91 define_attribute :item_code, String |
#item_id ⇒ String
Returns System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled.
95 |
# File 'lib/recurly/resources/line_item.rb', line 95 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.
99 |
# File 'lib/recurly/resources/line_item.rb', line 99 define_attribute :legacy_category, String |
#object ⇒ String
Returns Object type.
103 |
# File 'lib/recurly/resources/line_item.rb', line 103 define_attribute :object, String |
#origin ⇒ String
Returns A credit created from an original charge will have the value of the charge’s origin.
107 |
# File 'lib/recurly/resources/line_item.rb', line 107 define_attribute :origin, 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.
111 |
# File 'lib/recurly/resources/line_item.rb', line 111 define_attribute :original_line_item_invoice_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.
115 |
# File 'lib/recurly/resources/line_item.rb', line 115 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.
119 |
# File 'lib/recurly/resources/line_item.rb', line 119 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.
123 |
# File 'lib/recurly/resources/line_item.rb', line 123 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`.
127 |
# File 'lib/recurly/resources/line_item.rb', line 127 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.
131 |
# File 'lib/recurly/resources/line_item.rb', line 131 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.
135 |
# File 'lib/recurly/resources/line_item.rb', line 135 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.
139 |
# File 'lib/recurly/resources/line_item.rb', line 139 define_attribute :quantity_decimal, String |
#refund ⇒ Boolean
Returns Refund?.
143 |
# File 'lib/recurly/resources/line_item.rb', line 143 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).
147 |
# File 'lib/recurly/resources/line_item.rb', line 147 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.
151 |
# File 'lib/recurly/resources/line_item.rb', line 151 define_attribute :refunded_quantity_decimal, String |
#revenue_schedule_type ⇒ String
Returns Revenue schedule type.
155 |
# File 'lib/recurly/resources/line_item.rb', line 155 define_attribute :revenue_schedule_type, String |
#shipping_address ⇒ ShippingAddress
159 |
# File 'lib/recurly/resources/line_item.rb', line 159 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.
163 |
# File 'lib/recurly/resources/line_item.rb', line 163 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.
167 |
# File 'lib/recurly/resources/line_item.rb', line 167 define_attribute :state, String |
#subscription_id ⇒ String
Returns If the line item is a charge or credit for a subscription, this is its ID.
171 |
# File 'lib/recurly/resources/line_item.rb', line 171 define_attribute :subscription_id, String |
#subtotal ⇒ Float
Returns ‘quantity * unit_amount`.
175 |
# File 'lib/recurly/resources/line_item.rb', line 175 define_attribute :subtotal, Float |
#tax ⇒ Float
Returns The tax amount for the line item.
179 |
# File 'lib/recurly/resources/line_item.rb', line 179 define_attribute :tax, Float |
#tax_code ⇒ String
Returns Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use ‘unknown`, `physical`, or `digital`.
183 |
# File 'lib/recurly/resources/line_item.rb', line 183 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.
187 |
# File 'lib/recurly/resources/line_item.rb', line 187 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.
191 |
# File 'lib/recurly/resources/line_item.rb', line 191 define_attribute :tax_inclusive, :Boolean |
#tax_info ⇒ TaxInfo
Returns Tax info.
195 |
# File 'lib/recurly/resources/line_item.rb', line 195 define_attribute :tax_info, :TaxInfo |
#taxable ⇒ Boolean
Returns ‘true` if the line item is taxable, `false` if it is not.
199 |
# File 'lib/recurly/resources/line_item.rb', line 199 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.
203 |
# File 'lib/recurly/resources/line_item.rb', line 203 define_attribute :type, String |
#unit_amount ⇒ Float
Returns Positive amount for a charge, negative amount for a credit.
207 |
# File 'lib/recurly/resources/line_item.rb', line 207 define_attribute :unit_amount, Float |
#unit_amount_decimal ⇒ String
Returns Positive amount for a charge, negative amount for a credit.
211 |
# File 'lib/recurly/resources/line_item.rb', line 211 define_attribute :unit_amount_decimal, String |
#updated_at ⇒ DateTime
Returns When the line item was last changed.
215 |
# File 'lib/recurly/resources/line_item.rb', line 215 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.
219 |
# File 'lib/recurly/resources/line_item.rb', line 219 define_attribute :uuid, String |