getInvoiceitemsInvoiceitem
Retrieve an invoice item
Details
- Method:
GET - Path:
/v1/invoiceitems/{invoiceitem} - Operation ID:
GetInvoiceitemsInvoiceitem
Parameters
{
"expand": {
"description": "Specifies which fields in the response should be expanded.",
"required": false,
"location": "query",
"type": "array"
},
"invoiceitem": {
"description": "",
"required": true,
"location": "path",
"type": "string"
}
}Response Schema
{
"description": "Invoice Items represent the component lines of an [invoice](https://docs.stripe.com/api/invoices). When you create an invoice item with an `invoice` field, it is attached to the specified invoice and included as [an invoice line item](https://docs.stripe.com/api/invoices/line_item) within [invoice.lines](https://docs.stripe.com/api/invoices/object#invoice_object-lines).\n\nInvoice Items can be created before you are ready to actually send the invoice. This can be particularly useful when combined\nwith a [subscription](https://docs.stripe.com/api/subscriptions). Sometimes you want to add a charge or credit to a customer, but actually charge\nor credit the customer's card only at the end of a regular billing cycle. This is useful for combining several charges\n(to minimize per-transaction fees), or for having Stripe tabulate your usage-based billing totals.\n\nRelated guides: [Integrate with the Invoicing API](https://docs.stripe.com/invoicing/integration), [Subscription Invoices](https://docs.stripe.com/billing/invoices/subscription#adding-upcoming-invoice-items).",
"properties": {
"amount": {
"description": "Amount (in the `currency` specified) of the invoice item. This should always be equal to `unit_amount * quantity`.",
"type": "integer"
},
"currency": {
"description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).",
"format": "currency",
"type": "string"
},
"customer": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/customer"
},
{
"$ref": "#/components/schemas/deleted_customer"
}
],
"description": "The ID of the customer to bill for this invoice item.",
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/customer"
},
{
"$ref": "#/components/schemas/deleted_customer"
}
]
}
},
"customer_account": {
"description": "The ID of the account to bill for this invoice item.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"date": {
"description": "Time at which the object was created. Measured in seconds since the Unix epoch.",
"format": "unix-time",
"type": "integer"
},
"description": {
"description": "An arbitrary string attached to the object. Often useful for displaying to users.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"discountable": {
"description": "If true, discounts will apply to this invoice item. Always false for prorations.",
"type": "boolean"
},
"discounts": {
"description": "The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.",
"items": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/discount"
}
],
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/discount"
}
]
}
},
"nullable": true,
"type": "array"
},
"id": {
"description": "Unique identifier for the object.",
"maxLength": 5000,
"type": "string"
},
"invoice": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/invoice"
}
],
"description": "The ID of the invoice this invoice item belongs to.",
"nullable": true,
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/invoice"
}
]
}
},
"livemode": {
"description": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.",
"type": "boolean"
},
"metadata": {
"additionalProperties": {
"maxLength": 500,
"type": "string"
},
"description": "Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.",
"nullable": true,
"type": "object"
},
"net_amount": {
"description": "The amount after discounts, but before credits and taxes. This field is `null` for `discountable=true` items.",
"type": "integer"
},
"object": {
"description": "String representing the object's type. Objects of the same type share the same value.",
"enum": [
"invoiceitem"
],
"type": "string"
},
"parent": {
"anyOf": [
{
"$ref": "#/components/schemas/billing_bill_resource_invoice_item_parents_invoice_item_parent"
}
],
"description": "The parent that generated this invoice item.",
"nullable": true
},
"period": {
"description": "",
"properties": {
"end": {
"description": "The end of the period, which must be greater than or equal to the start. This value is inclusive.",
"format": "unix-time",
"type": "integer"
},
"start": {
"description": "The start of the period. This value is inclusive.",
"format": "unix-time",
"type": "integer"
}
},
"required": [
"end",
"start"
],
"title": "InvoiceLineItemPeriod",
"type": "object",
"x-expandableFields": []
},
"pricing": {
"anyOf": [
{
"$ref": "#/components/schemas/billing_bill_resource_invoicing_pricing_pricing"
}
],
"description": "The pricing information of the invoice item.",
"nullable": true
},
"proration": {
"description": "Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.",
"type": "boolean"
},
"proration_details": {
"description": "",
"properties": {
"discount_amounts": {
"description": "Discount amounts applied when the proration was created.",
"items": {
"description": "",
"properties": {
"amount": {
"description": "The amount, in cents (or local equivalent), of the discount.",
"type": "integer"
},
"discount": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/discount"
},
{
"$ref": "#/components/schemas/deleted_discount"
}
],
"description": "The discount that was applied to get this discount amount.",
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/discount"
},
{
"$ref": "#/components/schemas/deleted_discount"
}
]
}
}
},
"required": [
"amount",
"discount"
],
"title": "DiscountsResourceDiscountAmount",
"type": "object",
"x-expandableFields": [
"discount"
]
},
"type": "array"
}
},
"required": [
"discount_amounts"
],
"title": "ProrationDetails",
"type": "object",
"x-expandableFields": [
"discount_amounts"
]
},
"quantity": {
"description": "Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for.",
"type": "integer"
},
"tax_rates": {
"description": "The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item.",
"items": {
"description": "Tax rates can be applied to [invoices](/invoicing/taxes/tax-rates), [subscriptions](/billing/taxes/tax-rates) and [Checkout Sessions](/payments/checkout/use-manual-tax-rates) to collect tax.\n\nRelated guide: [Tax rates](/billing/taxes/tax-rates)",
"properties": {
"active": {
"description": "Defaults to `true`. When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set.",
"type": "boolean"
},
"country": {
"description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"created": {
"description": "Time at which the object was created. Measured in seconds since the Unix epoch.",
"format": "unix-time",
"type": "integer"
},
"description": {
"description": "An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"display_name": {
"description": "The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.",
"maxLength": 5000,
"type": "string"
},
"effective_percentage": {
"description": "Actual/effective tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true,\nthis percentage reflects the rate actually used to calculate tax based on the product's taxability\nand whether the user is registered to collect taxes in the corresponding jurisdiction.",
"nullable": true,
"type": "number"
},
"flat_amount": {
"anyOf": [
{
"$ref": "#/components/schemas/tax_rate_flat_amount"
}
],
"description": "The amount of the tax rate when the `rate_type` is `flat_amount`. Tax rates with `rate_type` `percentage` can vary based on the transaction, resulting in this field being `null`. This field exposes the amount and currency of the flat tax rate.",
"nullable": true
},
"id": {
"description": "Unique identifier for the object.",
"maxLength": 5000,
"type": "string"
},
"inclusive": {
"description": "This specifies if the tax rate is inclusive or exclusive.",
"type": "boolean"
},
"jurisdiction": {
"description": "The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customerβs invoice.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"jurisdiction_level": {
"description": "The level of the jurisdiction that imposes this tax rate. Will be `null` for manually defined tax rates.",
"enum": [
"city",
"country",
"county",
"district",
"multiple",
"state"
],
"nullable": true,
"type": "string"
},
"livemode": {
"description": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.",
"type": "boolean"
},
"metadata": {
"additionalProperties": {
"maxLength": 500,
"type": "string"
},
"description": "Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.",
"nullable": true,
"type": "object"
},
"object": {
"description": "String representing the object's type. Objects of the same type share the same value.",
"enum": [
"tax_rate"
],
"type": "string"
},
"percentage": {
"description": "Tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions.",
"type": "number"
},
"rate_type": {
"description": "Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. This field is only present for TaxRates created by Stripe Tax.",
"enum": [
"flat_amount",
"percentage"
],
"nullable": true,
"type": "string"
},
"state": {
"description": "[ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, \"NY\" for New York, United States.",
"maxLength": 5000,
"nullable": true,
"type": "string"
},
"tax_type": {
"description": "The high-level tax type, such as `vat` or `sales_tax`.",
"enum": [
"amusement_tax",
"communications_tax",
"gst",
"hst",
"igst",
"jct",
"lease_tax",
"pst",
"qst",
"retail_delivery_fee",
"rst",
"sales_tax",
"service_tax",
"vat"
],
"nullable": true,
"type": "string",
"x-stripeBypassValidation": true
}
},
"required": [
"active",
"created",
"display_name",
"id",
"inclusive",
"livemode",
"object",
"percentage"
],
"title": "TaxRate",
"type": "object",
"x-expandableFields": [
"flat_amount"
],
"x-resourceId": "tax_rate"
},
"nullable": true,
"type": "array"
},
"test_clock": {
"anyOf": [
{
"maxLength": 5000,
"type": "string"
},
{
"$ref": "#/components/schemas/test_helpers.test_clock"
}
],
"description": "ID of the test clock this invoice item belongs to.",
"nullable": true,
"x-expansionResources": {
"oneOf": [
{
"$ref": "#/components/schemas/test_helpers.test_clock"
}
]
}
}
},
"required": [
"amount",
"currency",
"customer",
"date",
"discountable",
"id",
"livemode",
"object",
"period",
"proration",
"quantity"
],
"title": "InvoiceItem",
"type": "object",
"x-expandableFields": [
"customer",
"discounts",
"invoice",
"parent",
"period",
"pricing",
"proration_details",
"tax_rates",
"test_clock"
],
"x-resourceId": "invoiceitem"
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('stripe')
# Call this tool
result = await agent.call_tool('getInvoiceitemsInvoiceitem', {
# Add required parameters here
})