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.
-
#destination_tax_address_source ⇒ String
The source of the address that will be used as the destinaion in determining taxes.
-
#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.
-
#liability_gl_account_code ⇒ String
Unique code to identify the ledger account.
-
#object ⇒ String
Object type.
-
#origin ⇒ String
A credit created from an original charge will have the value of the charge's origin.
-
#origin_tax_address_source ⇒ String
The source of the address that will be used as the origin in determining taxes.
-
#original_line_item_invoice_id ⇒ String
The invoice where the credit originated.
-
#performance_obligation_id ⇒ String
The ID of a performance obligation.
-
#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_gl_account_code ⇒ String
Unique code to identify the ledger account.
-
#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
Optional field used by Avalara, Vertex, and Recurly's In-the-Box tax solution to determine taxation rules.
-
#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
Only for merchants using Recurly's In-The-Box taxes.
-
#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 |
#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”.
67 |
# File 'lib/recurly/resources/line_item.rb', line 67 define_attribute :destination_tax_address_source, String |
#discount ⇒ Float
Returns The discount applied to the line item.
71 |
# File 'lib/recurly/resources/line_item.rb', line 71 define_attribute :discount, Float |
#end_date ⇒ DateTime
Returns If this date is provided, it indicates the end of a time range.
75 |
# File 'lib/recurly/resources/line_item.rb', line 75 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.
79 |
# File 'lib/recurly/resources/line_item.rb', line 79 define_attribute :external_sku, String |
#id ⇒ String
Returns Line item ID.
83 |
# File 'lib/recurly/resources/line_item.rb', line 83 define_attribute :id, String |
#invoice_id ⇒ String
Returns Once the line item has been invoiced this will be the invoice's ID.
87 |
# File 'lib/recurly/resources/line_item.rb', line 87 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.
91 |
# File 'lib/recurly/resources/line_item.rb', line 91 define_attribute :invoice_number, String |
#item_code ⇒ String
Returns Unique code to identify an item. Available when the Credit Invoices feature is enabled.
95 |
# File 'lib/recurly/resources/line_item.rb', line 95 define_attribute :item_code, String |
#item_id ⇒ String
Returns System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled.
99 |
# File 'lib/recurly/resources/line_item.rb', line 99 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.
103 |
# File 'lib/recurly/resources/line_item.rb', line 103 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: `-_.,:`.
107 |
# File 'lib/recurly/resources/line_item.rb', line 107 define_attribute :liability_gl_account_code, String |
#object ⇒ String
Returns Object type.
111 |
# File 'lib/recurly/resources/line_item.rb', line 111 define_attribute :object, String |
#origin ⇒ String
Returns A credit created from an original charge will have the value of the charge's origin.
115 |
# File 'lib/recurly/resources/line_item.rb', line 115 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”.
119 |
# File 'lib/recurly/resources/line_item.rb', line 119 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.
123 |
# File 'lib/recurly/resources/line_item.rb', line 123 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.
127 |
# File 'lib/recurly/resources/line_item.rb', line 127 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.
131 |
# File 'lib/recurly/resources/line_item.rb', line 131 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.
135 |
# File 'lib/recurly/resources/line_item.rb', line 135 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.
139 |
# File 'lib/recurly/resources/line_item.rb', line 139 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`.
143 |
# File 'lib/recurly/resources/line_item.rb', line 143 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.
147 |
# File 'lib/recurly/resources/line_item.rb', line 147 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.
151 |
# File 'lib/recurly/resources/line_item.rb', line 151 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.
155 |
# File 'lib/recurly/resources/line_item.rb', line 155 define_attribute :quantity_decimal, String |
#refund ⇒ Boolean
Returns Refund?.
159 |
# File 'lib/recurly/resources/line_item.rb', line 159 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).
163 |
# File 'lib/recurly/resources/line_item.rb', line 163 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.
167 |
# File 'lib/recurly/resources/line_item.rb', line 167 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: `-_.,:`.
171 |
# File 'lib/recurly/resources/line_item.rb', line 171 define_attribute :revenue_gl_account_code, String |
#revenue_schedule_type ⇒ String
Returns Revenue schedule type.
175 |
# File 'lib/recurly/resources/line_item.rb', line 175 define_attribute :revenue_schedule_type, String |
#shipping_address ⇒ ShippingAddress
179 |
# File 'lib/recurly/resources/line_item.rb', line 179 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.
183 |
# File 'lib/recurly/resources/line_item.rb', line 183 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.
187 |
# File 'lib/recurly/resources/line_item.rb', line 187 define_attribute :state, String |
#subscription_id ⇒ String
Returns If the line item is a charge or credit for a subscription, this is its ID.
191 |
# File 'lib/recurly/resources/line_item.rb', line 191 define_attribute :subscription_id, String |
#subtotal ⇒ Float
Returns `quantity * unit_amount`.
195 |
# File 'lib/recurly/resources/line_item.rb', line 195 define_attribute :subtotal, Float |
#tax ⇒ Float
Returns The tax amount for the line item.
199 |
# File 'lib/recurly/resources/line_item.rb', line 199 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.
203 |
# File 'lib/recurly/resources/line_item.rb', line 203 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.
207 |
# File 'lib/recurly/resources/line_item.rb', line 207 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.
211 |
# File 'lib/recurly/resources/line_item.rb', line 211 define_attribute :tax_inclusive, :Boolean |
#tax_info ⇒ TaxInfo
Returns Only for merchants using Recurly's In-The-Box taxes.
215 |
# File 'lib/recurly/resources/line_item.rb', line 215 define_attribute :tax_info, :TaxInfo |
#taxable ⇒ Boolean
Returns `true` if the line item is taxable, `false` if it is not.
219 |
# File 'lib/recurly/resources/line_item.rb', line 219 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.
223 |
# File 'lib/recurly/resources/line_item.rb', line 223 define_attribute :type, String |
#unit_amount ⇒ Float
Returns Positive amount for a charge, negative amount for a credit.
227 |
# File 'lib/recurly/resources/line_item.rb', line 227 define_attribute :unit_amount, Float |
#unit_amount_decimal ⇒ String
Returns Positive amount for a charge, negative amount for a credit.
231 |
# File 'lib/recurly/resources/line_item.rb', line 231 define_attribute :unit_amount_decimal, String |
#updated_at ⇒ DateTime
Returns When the line item was last changed.
235 |
# File 'lib/recurly/resources/line_item.rb', line 235 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.
239 |
# File 'lib/recurly/resources/line_item.rb', line 239 define_attribute :uuid, String |