Update an invoice item
POST / v1 / invoiceitems /:id
Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it’s attached to is closed.
Parameters
- amount integer The integer amount in the smallest currency unit of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer’s account, pass a negative amount.
- description string An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
- metadata map 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata. - period object The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have Stripe Revenue Recognition enabled, the period will be used to recognize and defer revenue. See the Revenue Recognition documentation for details.
- pricing object The pricing information for the invoice item.
More parameters
- discountable boolean
- discounts array of objects
- invoicing _ rules string Preview feature
- price _ data object
- quantity integer Deprecated
- quantity _ decimal string
- tax _ behavior enum Recommended if calculating taxes
- tax _ code string Recommended if calculating taxes
- tax _ rates array of strings
- unit _ amount _ decimal string
Returns
The updated invoice item object is returned upon success. Otherwise, this call raises an error.
Response
{ "id": "ii_1MtGUtLkdIwHu7ixBYwjAM00", "object": "invoiceitem", "amount": 1099, "currency": "usd", "customer": "cus_NeZei8imSbMVvi", "date": 1680640231, "description": "T-shirt", "discountable": true, "discounts": [], "invoice": null, "livemode": false, "metadata": { "order_id": "6735" }, "parent": null, "period": { "end": 1680640231, "start": 1680640231 }, "pricing": { "price_details": { "price": "price_1MtGUsLkdIwHu7ix1be5Ljaj", "product": "prod_NeZe7xbBdJT8EN" }, "type": "price_details", "unit_amount_decimal": "1099" }, "proration": false, "quantity": 1, "quantity_decimal": "1", "tax_rates": [], "test_clock": null}
Retrieve an invoice item
GET / v1 / invoiceitems /:id
Retrieves the invoice item with the given ID.
Parameters
No parameters.
Returns
Returns an invoice item if a valid invoice item ID was provided. Raises an error otherwise.
Response
{ "id": "ii_1MtGUtLkdIwHu7ixBYwjAM00", "object": "invoiceitem", "amount": 1099, "currency": "usd", "customer": "cus_NeZei8imSbMVvi", "date": 1680640231, "description": "T-shirt", "discountable": true, "discounts": [], "invoice": null, "livemode": false, "metadata": {}, "parent": null, "period": { "end": 1680640231, "start": 1680640231 }, "pricing": { "price_details": { "price": "price_1MtGUsLkdIwHu7ix1be5Ljaj", "product": "prod_NeZe7xbBdJT8EN" }, "type": "price_details", "unit_amount_decimal": "1099" }, "proration": false, "quantity": 1, "quantity_decimal": "1", "tax_rates": [], "test_clock": null}
List all invoice items
GET / v1 / invoiceitems
Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first.
Parameters
- customer string The identifier of the customer whose invoice items to return. If none is provided, returns all invoice items.
- customer _ account string The identifier of the account representing the customer whose invoice items to return. If none is provided, returns all invoice items.
More parameters
- created object
- ending _ before string
- invoice string
- limit integer
- pending boolean
- starting _ after string
Returns
A dictionary with a data property that contains an array of up to limit invoice items, starting after invoice item starting_after. Each entry in the array is a separate invoice item object. If no more invoice items are available, the resulting array will be empty.
Response
{ "object": "list", "url": "/v1/invoiceitems", "has_more": false, "data": [ { "id": "ii_1MtGUtLkdIwHu7ixBYwjAM00", "object": "invoiceitem", "amount": 1099, "currency": "usd", "customer": "cus_NeZei8imSbMVvi", "date": 1680640231, "description": "T-shirt", "discountable": true, "discounts": [], "invoice": null, "livemode": false, "metadata": {}, "parent": null, "period": { "end": 1680640231, "start": 1680640231 }, "pricing": { "price_details": { "price": "price_1MtGUsLkdIwHu7ix1be5Ljaj", "product": "prod_NeZe7xbBdJT8EN" }, "type": "price_details", "unit_amount_decimal": "1099" }, "proration": false, "quantity": 1, "quantity_decimal": "1", "tax_rates": [], "test_clock": null } ]}
