Invoices
get/v1/invoices/{invoice}/lines

Retrieve an invoice's line items

When retrieving an invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.

Path parameters

NameDescription
invoice*

Query parameters

NameDescription
ending_beforeA cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.
expandSpecifies which fields in the response should be expanded.
limitA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterA cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Request body

object (no properties in spec)

Response

FieldTypeDescription
data*array<line_item>

Details about each object.

array item fields
FieldTypeDescription
amount*integer

The amount, in cents (or local equivalent).

currency*string (currency)

Three-letter ISO currency code, in lowercase. Must be a supported currency.

descriptionstring

An arbitrary string attached to the object. Often useful for displaying to users.

discount_amountsarray<discounts_resource_discount_amount>

The amount of discount calculated per discount for this line item.

array item fields
FieldTypeDescription
amount*integer

The amount, in cents (or local equivalent), of the discount.

discount*string | discount | deleted_discount

The discount that was applied to get this discount amount.

discountable*boolean

If true, discounts will apply to this line item. Always false for prorations.

discounts*array<string | discount>

The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount.

id*string

Unique identifier for the object.

invoicestring

The ID of the invoice that contains this line item.

livemode*boolean

If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.

metadata*object

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with type=subscription, metadata reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.

object*string

String representing the object's type. Objects of the same type share the same value.

parentbilling_bill_resource_invoicing_lines_parents_invoice_line_item_parent

The parent that generated this line item.

period*invoice_line_item_period
2 nested fields
FieldTypeDescription
end*integer (unix-time)

The end of the period, which must be greater than or equal to the start. This value is inclusive.

start*integer (unix-time)

The start of the period. This value is inclusive.

pretax_credit_amountsarray<invoices_resource_pretax_credit_amount>

Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item.

array item fields
FieldTypeDescription
amount*integer

The amount, in cents (or local equivalent), of the pretax credit amount.

credit_balance_transactionstring | billing.credit_balance_transaction

The credit balance transaction that was applied to get this pretax credit amount.

discountstring | discount | deleted_discount

The discount that was applied to get this pretax credit amount.

type*string

Type of the pretax credit amount referenced.

pricingbilling_bill_resource_invoicing_pricing_pricing

The pricing information of the line item.

quantityinteger

Quantity of units for the invoice line item in integer format, with any decimal precision truncated. For the line item's full-precision decimal quantity, use quantity_decimal. This field will be deprecated in favor of quantity_decimal in a future version. If the line item is a proration or subscription, the quantity of the subscription that the proration was computed for.

quantity_decimalstring (decimal)

Non-negative decimal with at most 12 decimal places. The quantity of units for the line item.

subscriptionstring | subscription
subtotal*integer

The subtotal of the line item, in cents (or local equivalent), before any discounts or taxes.

taxesarray<billing_bill_resource_invoicing_taxes_tax>

The tax information of the line item.

array item fields
FieldTypeDescription
amount*integer

The amount of the tax, in cents (or local equivalent).

tax_behavior*string

Whether this tax is inclusive or exclusive.

tax_rate_detailsbilling_bill_resource_invoicing_taxes_tax_rate_details

Additional details about the tax rate. Only present when type is tax_rate_details.

taxability_reason*string

The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.

taxable_amountinteger

The amount on which tax is calculated, in cents (or local equivalent).

type*string

The type of tax information.

has_more*boolean

True if this list has another page of items after this one that can be fetched.

object*string

String representing the object's type. Objects of the same type share the same value. Always has the value list.

url*string

The URL where this list can be accessed.