Stripe Items API

The Items API from Stripe — 4 operation(s) for items.

OpenAPI Specification

stripe-items-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Stripe Accounts Account Items API
  description: This is an object representing a Stripe account. You can retrieve it to see properties on the account like its current requirements or if the account is enabled to make live charges or receive payouts.
  contact:
    email: dev-platform@stripe.com
    name: Stripe Dev Platform Team
    url: https://stripe.com
  termsOfService: https://stripe.com/us/terms/
  version: '2023-10-16'
  x-stripeSpecFilename: spec3
servers:
- url: https://api.stripe.com/
security:
- basicAuth: []
- bearerAuth: []
tags:
- name: Items
paths:
  /v1/checkout/sessions/{session}/line_items:
    get:
      description: <p>When retrieving a Checkout Session, there is an includable <strong>line_items</strong> property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.</p>
      operationId: getCheckoutSessionsSessionLineItems
      parameters:
      - description: A 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.
        in: query
        name: ending_before
        required: false
        schema:
          maxLength: 5000
          type: string
        style: form
      - description: Specifies which fields in the response should be expanded.
        explode: true
        in: query
        name: expand
        required: false
        schema:
          items:
            maxLength: 5000
            type: string
          type: array
        style: deepObject
      - description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
        in: query
        name: limit
        required: false
        schema:
          type: integer
        style: form
      - in: path
        name: session
        required: true
        schema:
          maxLength: 5000
          type: string
        style: simple
      - description: A 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.
        in: query
        name: starting_after
        required: false
        schema:
          maxLength: 5000
          type: string
        style: form
      requestBody:
        content:
          application/x-www-form-urlencoded:
            encoding: {}
            schema:
              additionalProperties: false
              $ref: '#/components/schemas/GetCheckoutSessionsSessionLineItemsRequest'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                description: ''
                x-expandableFields:
                - data
                $ref: '#/components/schemas/PaymentPagesCheckoutSessionListLineItems'
          description: Successful response.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Error response.
      summary: Stripe Get   Checkout Sessions Session Line Items
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      tags:
      - Items
  /v1/Invoice Items:
    get:
      description: <p>Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first.</p>
      operationId: getInvoice Items
      parameters:
      - explode: true
        in: query
        name: created
        required: false
        schema:
          anyOf:
          - properties:
              gt:
                type: integer
              gte:
                type: integer
              lt:
                type: integer
              lte:
                type: integer
            title: range_query_specs
            type: object
          - type: integer
        style: deepObject
      - description: The identifier of the customer whose invoice items to return. If none is provided, all invoice items will be returned.
        in: query
        name: customer
        required: false
        schema:
          maxLength: 5000
          type: string
        style: form
      - description: A 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.
        in: query
        name: ending_before
        required: false
        schema:
          maxLength: 5000
          type: string
        style: form
      - description: Specifies which fields in the response should be expanded.
        explode: true
        in: query
        name: expand
        required: false
        schema:
          items:
            maxLength: 5000
            type: string
          type: array
        style: deepObject
      - description: Only return invoice items belonging to this invoice. If none is provided, all invoice items will be returned. If specifying an invoice, no customer identifier is needed.
        in: query
        name: invoice
        required: false
        schema:
          maxLength: 5000
          type: string
        style: form
      - description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
        in: query
        name: limit
        required: false
        schema:
          type: integer
        style: form
      - description: Set to `true` to only show pending invoice items, which are not yet attached to any invoices. Set to `false` to only show invoice items already attached to invoices. If unspecified, no filter is applied.
        in: query
        name: pending
        required: false
        schema:
          type: boolean
        style: form
      - description: A 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.
        in: query
        name: starting_after
        required: false
        schema:
          maxLength: 5000
          type: string
        style: form
      requestBody:
        content:
          application/x-www-form-urlencoded:
            encoding: {}
            schema:
              additionalProperties: false
              $ref: '#/components/schemas/GetInvoice ItemsRequest'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                description: ''
                x-expandableFields:
                - data
                $ref: '#/components/schemas/InvoicesItemsList'
          description: Successful response.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Error response.
      summary: Stripe Get   Invoice Items
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      tags:
      - Items
    post:
      description: <p>Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified.</p>
      operationId: postInvoice Items
      requestBody:
        content:
          application/x-www-form-urlencoded:
            encoding:
              discounts:
                explode: true
                style: deepObject
              expand:
                explode: true
                style: deepObject
              metadata:
                explode: true
                style: deepObject
              period:
                explode: true
                style: deepObject
              price_data:
                explode: true
                style: deepObject
              tax_code:
                explode: true
                style: deepObject
              tax_rates:
                explode: true
                style: deepObject
            schema:
              additionalProperties: false
              $ref: '#/components/schemas/PostInvoice ItemsRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/invoiceitem'
          description: Successful response.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Error response.
      summary: Stripe Post   Invoice Items
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      tags:
      - Items
  /v1/Invoice Items/{invoiceitem}:
    delete:
      description: <p>Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.</p>
      operationId: deleteInvoice ItemsInvoiceitem
      parameters:
      - in: path
        name: invoiceitem
        required: true
        schema:
          maxLength: 5000
          type: string
        style: simple
      requestBody:
        content:
          application/x-www-form-urlencoded:
            encoding: {}
            schema:
              additionalProperties: false
              $ref: '#/components/schemas/DeleteInvoice ItemsInvoiceitemRequest'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deleted_invoiceitem'
          description: Successful response.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Error response.
      summary: Stripe Delete   Invoice Items
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      tags:
      - Items
    get:
      description: <p>Retrieves the invoice item with the given ID.</p>
      operationId: getInvoice ItemsInvoiceitem
      parameters:
      - description: Specifies which fields in the response should be expanded.
        explode: true
        in: query
        name: expand
        required: false
        schema:
          items:
            maxLength: 5000
            type: string
          type: array
        style: deepObject
      - in: path
        name: invoiceitem
        required: true
        schema:
          maxLength: 5000
          type: string
        style: simple
      requestBody:
        content:
          application/x-www-form-urlencoded:
            encoding: {}
            schema:
              additionalProperties: false
              $ref: '#/components/schemas/GetInvoice ItemsInvoiceitemRequest'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/invoiceitem'
          description: Successful response.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Error response.
      summary: Stripe Get   Invoice Items
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      tags:
      - Items
    post:
      description: <p>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.</p>
      operationId: postInvoice ItemsInvoiceitem
      parameters:
      - in: path
        name: invoiceitem
        required: true
        schema:
          maxLength: 5000
          type: string
        style: simple
      requestBody:
        content:
          application/x-www-form-urlencoded:
            encoding:
              discounts:
                explode: true
                style: deepObject
              expand:
                explode: true
                style: deepObject
              metadata:
                explode: true
                style: deepObject
              period:
                explode: true
                style: deepObject
              price_data:
                explode: true
                style: deepObject
              tax_code:
                explode: true
                style: deepObject
              tax_rates:
                explode: true
                style: deepObject
            schema:
              additionalProperties: false
              $ref: '#/components/schemas/PostInvoice ItemsInvoiceitemRequest'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/invoiceitem'
          description: Successful response.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Error response.
      summary: Stripe Post   Invoice Items
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      tags:
      - Items
  /v1/payment_links/{payment_link}/line_items:
    get:
      description: <p>When retrieving a payment link, there is an includable <strong>line_items</strong> property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.</p>
      operationId: getPaymentLinksPaymentLinkLineItems
      parameters:
      - description: A 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.
        in: query
        name: ending_before
        required: false
        schema:
          maxLength: 5000
          type: string
        style: form
      - description: Specifies which fields in the response should be expanded.
        explode: true
        in: query
        name: expand
        required: false
        schema:
          items:
            maxLength: 5000
            type: string
          type: array
        style: deepObject
      - description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
        in: query
        name: limit
        required: false
        schema:
          type: integer
        style: form
      - in: path
        name: payment_link
        required: true
        schema:
          maxLength: 5000
          type: string
        style: simple
      - description: A 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.
        in: query
        name: starting_after
        required: false
        schema:
          maxLength: 5000
          type: string
        style: form
      requestBody:
        content:
          application/x-www-form-urlencoded:
            encoding: {}
            schema:
              additionalProperties: false
              $ref: '#/components/schemas/GetPaymentLinksPaymentLinkLineItemsRequest'
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                description: ''
                x-expandableFields:
                - data
                $ref: '#/components/schemas/PaymentLinksResourceListLineItems'
          description: Successful response.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Error response.
      summary: Stripe Get   Payment Links Line Items
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      tags:
      - Items
components:
  schemas:
    deleted_invoiceitem:
      description: ''
      properties:
        deleted:
          description: Always true for a deleted object
          enum:
          - true
          type: boolean
        id:
          description: Unique identifier for the object.
          maxLength: 5000
          type: string
        object:
          description: String representing the object's type. Objects of the same type share the same value.
          enum:
          - invoiceitem
          type: string
      required:
      - deleted
      - id
      - object
      title: DeletedInvoiceItem
      type: object
      x-expandableFields: []
      x-resourceId: deleted_invoiceitem
    GetPaymentLinksPaymentLinkLineItemsRequest:
      type: object
      properties: {}
    error:
      description: An error response from the Stripe API
      properties:
        error:
          $ref: '#/components/schemas/api_errors'
      required:
      - error
      type: object
    invoice:
      description: 'Invoices are statements of amounts owed by a customer, and are either

        generated one-off, or generated periodically from a subscription.


        They contain [invoice items](https://stripe.com/docs/api#Invoice Items), and proration adjustments

        that may be caused by subscription upgrades/downgrades (if necessary).


        If your invoice is configured to be billed through automatic charges,

        Stripe automatically finalizes your invoice and attempts payment. Note

        that finalizing the invoice,

        [when automatic](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection), does

        not happen immediately as the invoice is created. Stripe waits

        until one hour after the last webhook was successfully sent (or the last

        webhook timed out after failing). If you (and the platforms you may have

        connected to) have no webhooks configured, Stripe waits one hour after

        creation to finalize the invoice.


        If your invoice is configured to be billed by sending an email, then based on your

        [email settings](https://dashboard.stripe.com/account/billing/automatic),

        Stripe will email the invoice to your customer and await payment. These

        emails can contain a link to a hosted page to pay the invoice.


        Stripe applies any customer credit on the account before determining the

        amount due for the invoice (i.e., the amount that will be actually

        charged). If the amount due for the invoice is less than Stripe''s [minimum allowed charge

        per currency](/docs/currencies#minimum-and-maximum-charge-amounts), the

        invoice is automatically marked paid, and we add the amount due to the

        customer''s credit balance which is applied to the next invoice.


        More details on the customer''s credit balance are

        [here](https://stripe.com/docs/billing/customer/balance).


        Related guide: [Send invoices to customers](https://stripe.com/docs/billing/invoices/sending)'
      properties:
        account_country:
          description: The country of the business associated with this invoice, most often the business creating the invoice.
          maxLength: 5000
          nullable: true
          type: string
        account_name:
          description: The public name of the business associated with this invoice, most often the business creating the invoice.
          maxLength: 5000
          nullable: true
          type: string
        account_tax_ids:
          description: The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
          items:
            anyOf:
            - maxLength: 5000
              type: string
            - $ref: '#/components/schemas/tax_id'
            - $ref: '#/components/schemas/deleted_tax_id'
            x-expansionResources:
              oneOf:
              - $ref: '#/components/schemas/tax_id'
              - $ref: '#/components/schemas/deleted_tax_id'
          nullable: true
          type: array
        amount_due:
          description: Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`.
          type: integer
        amount_paid:
          description: The amount, in cents (or local equivalent), that was paid.
          type: integer
        amount_remaining:
          description: The difference between amount_due and amount_paid, in cents (or local equivalent).
          type: integer
        amount_shipping:
          description: This is the sum of all the shipping amounts.
          type: integer
        application:
          anyOf:
          - maxLength: 5000
            type: string
          - $ref: '#/components/schemas/application'
          - $ref: '#/components/schemas/deleted_application'
          description: ID of the Connect Application that created the invoice.
          nullable: true
          x-expansionResources:
            oneOf:
            - $ref: '#/components/schemas/application'
            - $ref: '#/components/schemas/deleted_application'
        application_fee_amount:
          description: The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.
          nullable: true
          type: integer
        attempt_count:
          description: Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule.
          type: integer
        attempted:
          description: Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users.
          type: boolean
        auto_advance:
          description: Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
          type: boolean
        automatic_tax:
          $ref: '#/components/schemas/automatic_tax'
        billing_reason:
          description: 'Indicates the reason why the invoice was created.


            * `manual`: Unrelated to a subscription, for example, created via the invoice editor.

            * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds.

            * `subscription_create`: A new subscription was created.

            * `subscription_cycle`: A subscription advanced into a new period.

            * `subscription_threshold`: A subscription reached a billing threshold.

            * `subscription_update`: A subscription was updated.

            * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint.'
          enum:
          - automatic_pending_invoice_item_invoice
          - manual
          - quote_accept
          - subscription
          - subscription_create
          - subscription_cycle
          - subscription_threshold
          - subscription_update
          - upcoming
          nullable: true
          type: string
        charge:
          anyOf:
          - maxLength: 5000
            type: string
          - $ref: '#/components/schemas/charge'
          description: ID of the latest charge generated for this invoice, if any.
          nullable: true
          x-expansionResources:
            oneOf:
            - $ref: '#/components/schemas/charge'
        collection_method:
          description: Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.
          enum:
          - charge_automatically
          - send_invoice
          type: string
        created:
          description: Time at which the object was created. Measured in seconds since the Unix epoch.
          format: unix-time
          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).
          type: string
        custom_fields:
          description: Custom fields displayed on the invoice.
          items:
            $ref: '#/components/schemas/invoice_setting_custom_field'
          nullable: true
          type: array
        customer:
          anyOf:
          - maxLength: 5000
            type: string
          - $ref: '#/components/schemas/customer'
          - $ref: '#/components/schemas/deleted_customer'
          description: The ID of the customer who will be billed.
          nullable: true
          x-expansionResources:
            oneOf:
            - $ref: '#/components/schemas/customer'
            - $ref: '#/components/schemas/deleted_customer'
        customer_address:
          anyOf:
          - $ref: '#/components/schemas/address'
          description: The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated.
          nullable: true
        customer_email:
          description: The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated.
          maxLength: 5000
          nullable: true
          type: string
        customer_name:
          description: The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated.
          maxLength: 5000
          nullable: true
          type: string
        customer_phone:
          description: The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated.
          maxLength: 5000
          nullable: true
          type: string
        customer_shipping:
          anyOf:
          - $ref: '#/components/schemas/shipping'
          description: The customer's shipping information. Until the invoice is finalized, this field will equal `customer.shipping`. Once the invoice is finalized, this field will no longer be updated.
          nullable: true
        customer_tax_exempt:
          description: The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated.
          enum:
          - exempt
          - none
          - reverse
          nullable: true
          type: string
        customer_tax_ids:
          description: The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated.
          items:
            $ref: '#/components/schemas/invoices_resource_invoice_tax_id'
          nullable: true
          type: array
        default_payment_method:
          anyOf:
          - maxLength: 5000
            type: string
          - $ref: '#/components/schemas/payment_method'
          description: ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
          nullable: true
          x-expansionResources:
            oneOf:
            - $ref: '#/components/schemas/payment_method'
        default_source:
          anyOf:
          - maxLength: 5000
            type: string
          - $ref: '#/components/schemas/bank_account'
          - $ref: '#/components/schemas/card'
          - $ref: '#/components/schemas/source'
          description: ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
          nullable: true
          x-expansionResources:
            oneOf:
            - $ref: '#/components/schemas/bank_account'
            - $ref: '#/components/schemas/card'
            - $ref: '#/components/schemas/source'
          x-stripeBypassValidation: true
        default_tax_rates:
          description: The tax rates applied to this invoice, if any.
          items:
            $ref: '#/components/schemas/tax_rate'
          type: array
        description:
          description: An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
          maxLength: 5000
          nullable: true
          type: string
        discount:
          anyOf:
          - $ref: '#/components/schemas/discount'
          description: Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts.
          nullable: true
        discounts:
          description: The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
          items:
            anyOf:
            - maxLength: 5000
              type: string
            - $ref: '#/components/schemas/discount'
            - $ref: '#/components/schemas/deleted_discount'
            x-expansionResources:
              oneOf:
              - $ref: '#/components/schemas/discount'
              - $ref: '#/components/schemas/deleted_discount'
          nullable: true
          type: array
        due_date:
          description: The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`.
          format: unix-time
          nullable: true
          type: integer
        effective_at:
          description: The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
          format: unix-time
          nullable: true
          type: integer
        ending_balance:
          description: Ending cust

# --- truncated at 32 KB (73 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/stripe/refs/heads/main/openapi/stripe-items-api-openapi.yml