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

#accountAccountMini

Returns Account mini details.

Returns:



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

define_attribute :account, :AccountMini

#accounting_codeString

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_codeString

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_idString

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

#amountFloat

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_typeInteger

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.

Returns:



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

define_attribute :avalara_service_type, Integer

#avalara_transaction_typeInteger

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.

Returns:



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

define_attribute :avalara_transaction_type, Integer

#bill_for_account_idString

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_atDateTime

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_appliedFloat

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_codeString

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

#currencyString

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_fieldsArray[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 }

#descriptionString

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_sourceString

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

#discountFloat

Returns The discount applied to the line item.

Returns:

  • (Float)

    The discount applied to the line item.



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

define_attribute :discount, Float

#end_dateDateTime

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.



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

define_attribute :end_date, DateTime

#external_skuString

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.



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

define_attribute :external_sku, String

#idString

Returns Line item ID.

Returns:

  • (String)

    Line item ID



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

define_attribute :id, String

#invoice_idString

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.



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

define_attribute :invoice_id, String

#invoice_numberString

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.



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

define_attribute :invoice_number, String

#item_codeString

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.



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

define_attribute :item_code, String

#item_idString

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.



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

define_attribute :item_id, String

#legacy_categoryString

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.



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

define_attribute :legacy_category, String

#liability_gl_account_codeString

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: `-_.,:`



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

define_attribute :liability_gl_account_code, String

#objectString

Returns Object type.

Returns:

  • (String)

    Object type



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

define_attribute :object, String

#originString

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.



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

define_attribute :origin, String

#origin_tax_address_sourceString

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”.



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

define_attribute :origin_tax_address_source, String

#original_line_item_invoice_idString

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.



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

define_attribute :original_line_item_invoice_id, String

#performance_obligation_idString

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.



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

define_attribute :performance_obligation_id, String

#plan_codeString

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.



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

define_attribute :plan_code, String

#plan_idString

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.



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

define_attribute :plan_id, String

#previous_line_item_idString

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.



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

define_attribute :previous_line_item_id, String

#product_codeString

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`.



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

define_attribute :product_code, String

#proration_rateFloat

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.



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

define_attribute :proration_rate, Float

#quantityInteger

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.



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

define_attribute :quantity, Integer

#quantity_decimalString

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.



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

define_attribute :quantity_decimal, String

#refundBoolean

Returns Refund?.

Returns:

  • (Boolean)

    Refund?



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

define_attribute :refund, :Boolean

#refunded_quantityInteger

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).



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

define_attribute :refunded_quantity, Integer

#refunded_quantity_decimalString

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.



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

define_attribute :refunded_quantity_decimal, String

#revenue_gl_account_codeString

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: `-_.,:`



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

define_attribute :revenue_gl_account_code, String

#revenue_schedule_typeString

Returns Revenue schedule type.

Returns:

  • (String)

    Revenue schedule type



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

define_attribute :revenue_schedule_type, String

#shipping_addressShippingAddress

Returns:



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

define_attribute :shipping_address, :ShippingAddress

#start_dateDateTime

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.



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

define_attribute :start_date, DateTime

#stateString

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.



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

define_attribute :state, String

#subscription_idString

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.



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

define_attribute :subscription_id, String

#subtotalFloat

Returns `quantity * unit_amount`.

Returns:

  • (Float)

    `quantity * unit_amount`



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

define_attribute :subtotal, Float

#taxFloat

Returns The tax amount for the line item.

Returns:

  • (Float)

    The tax amount for the line item.



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

define_attribute :tax, Float

#tax_codeString

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.



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

define_attribute :tax_code, String

#tax_exemptBoolean

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.



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

define_attribute :tax_exempt, :Boolean

#tax_inclusiveBoolean

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.



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

define_attribute :tax_inclusive, :Boolean

#tax_infoTaxInfo

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

Returns:

  • (TaxInfo)

    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

#taxableBoolean

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.



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

define_attribute :taxable, :Boolean

#typeString

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.



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

define_attribute :type, String

#unit_amountFloat

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

Returns:

  • (Float)

    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_decimalString

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

Returns:

  • (String)

    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_atDateTime

Returns When the line item was last changed.

Returns:

  • (DateTime)

    When the line item was last changed.



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

define_attribute :updated_at, DateTime

#uuidString

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.



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

define_attribute :uuid, String