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

#created_atDateTime

Returns When the line item was created.

Returns:

  • (DateTime)

    When the line item was created.



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

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.



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

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



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

define_attribute :credit_reason_code, String

#currencyString

Returns 3-letter ISO 4217 currency code.

Returns:

  • (String)

    3-letter ISO 4217 currency code.



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

define_attribute :currency, String

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



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

define_attribute :description, String

#discountFloat

Returns The discount applied to the line item.

Returns:

  • (Float)

    The discount applied to the line item.



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

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.



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

define_attribute :end_date, DateTime

#external_skuString

Returns Optional Stock Keeping Unit assigned to an item. Available when the Credit Invoices and Subscription Billing Terms features are enabled.

Returns:

  • (String)

    Optional Stock Keeping Unit assigned to an item. Available when the Credit Invoices and Subscription Billing Terms features are enabled.



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

define_attribute :external_sku, String

#idString

Returns Line item ID.

Returns:

  • (String)

    Line item ID



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

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.



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

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.



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

define_attribute :invoice_number, String

#item_codeString

Returns Unique code to identify an item. Available when the Credit Invoices and Subscription Billing Terms features are enabled.

Returns:

  • (String)

    Unique code to identify an item. Available when the Credit Invoices and Subscription Billing Terms features are enabled.



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

define_attribute :item_code, String

#item_idString

Returns System-generated unique identifier for an item. Available when the Credit Invoices and Subscription Billing Terms features are enabled.

Returns:

  • (String)

    System-generated unique identifier for an item. Available when the Credit Invoices and Subscription Billing Terms features are enabled.



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

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.



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

define_attribute :legacy_category, String

#objectString

Returns Object type.

Returns:

  • (String)

    Object type



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

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.



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

define_attribute :origin, 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.



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

define_attribute :original_line_item_invoice_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.



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

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.



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

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.



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

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



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

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.



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

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.



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

define_attribute :quantity, Integer

#refundBoolean

Returns Refund?.

Returns:

  • (Boolean)

    Refund?



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

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



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

define_attribute :refunded_quantity, Integer

#revenue_schedule_typeString

Returns Revenue schedule type.

Returns:

  • (String)

    Revenue schedule type



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

define_attribute :revenue_schedule_type, String

#shipping_addressShippingAddress

Returns:



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

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.



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

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.



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

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.



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

define_attribute :subscription_id, String

#subtotalFloat

Returns `quantity * unit_amount`.

Returns:

  • (Float)

    `quantity * unit_amount`



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

define_attribute :subtotal, Float

#taxFloat

Returns The tax amount for the line item.

Returns:

  • (Float)

    The tax amount for the line item.



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

define_attribute :tax, Float

#tax_codeString

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

Returns:

  • (String)

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



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

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.



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

define_attribute :tax_exempt, :Boolean

#tax_infoTaxInfo

Returns Tax info.

Returns:



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

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.



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

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.



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

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.



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

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.



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

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.



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

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.



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

define_attribute :uuid, String