> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.stripe.core.CreateInvoiceItem

- Component: `appmixer.stripe.core.CreateInvoiceItem`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.stripe 3.1.0](https://connectors.appmixer.com/connector/appmixer.stripe/3.1.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.stripe/3.1.0/component/appmixer.stripe.core.CreateInvoiceItem>

Adds a line item to a customer's draft invoice, or to the customer's pending items that the next invoice picks up. Use either a price (with a quantity) or an amount and currency.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Customer ID (`customer`) | text | The ID of the customer to bill, e.g. cus_NeZei8imSbMVvi. |
| Price ID (`price`) | text | The ID of a Stripe Price, e.g. price_1MtGUsLkdIwHu7ix1be5Ljaj. Use either a price or an amount. |
| Quantity (`quantity`) | number | The quantity of the price. Used with Price ID only; defaults to 1. |
| Amount (`amount`) | number | The amount in the smallest currency unit, e.g. 1099 for $10.99. A negative amount reduces the amount due. Use either an amount or a price. |
| Currency (`currency`) | text | Three-letter ISO currency code, e.g. usd. Required with Amount. |
| Description (`description`) | text | Text shown on the invoice for this item. |
| Invoice ID (`invoice`) | text | The ID of a draft invoice to add the item to, e.g. in_1MtHbELkdIwHu7ixl4OzzPMv. If empty, the item is added to the customer's next invoice. |
| Metadata (`metadata`) | key-value | Optional key-value pairs to store on the object, e.g. an order ID from your system. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Invoice Item ID (`id`) | string | - |
| Object (`object`) | string | - |
| Amount (`amount`) | integer | - |
| Currency (`currency`) | string | - |
| Customer ID (`customer`) | string | - |
| Description (`description`) | string,null | - |
| Invoice ID (`invoice`) | string,null | - |
| Quantity (`quantity`) | integer | - |
| Date (Unix Timestamp) (`date`) | integer | - |
| Pricing (`pricing`) | object,null | - |
| Live Mode (`livemode`) | boolean | - |
| Metadata (`metadata`) | object | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.stripe.core.CreateInvoiceItem",
  "description": "Adds a line item to a customer's draft invoice, or to the customer's pending items that the next invoice picks up. Use either a price (with a quantity) or an amount and currency.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:stripe"
  },
  "quota": {
    "manager": "appmixer:stripe",
    "resources": "requests"
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "customer": {
            "type": "string"
          },
          "price": {
            "type": "string"
          },
          "quantity": {
            "type": "integer",
            "minimum": 0
          },
          "amount": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "invoice": {
            "type": "string"
          },
          "metadata": {
            "type": "string"
          }
        },
        "required": [
          "customer"
        ]
      },
      "inspector": {
        "inputs": {
          "customer": {
            "type": "text",
            "label": "Customer ID",
            "index": 1,
            "tooltip": "The ID of the customer to bill, e.g. cus_NeZei8imSbMVvi."
          },
          "price": {
            "type": "text",
            "label": "Price ID",
            "index": 2,
            "tooltip": "The ID of a Stripe Price, e.g. price_1MtGUsLkdIwHu7ix1be5Ljaj. Use either a price or an amount."
          },
          "quantity": {
            "type": "number",
            "label": "Quantity",
            "index": 3,
            "tooltip": "The quantity of the price. Used with Price ID only; defaults to 1."
          },
          "amount": {
            "type": "number",
            "label": "Amount",
            "index": 4,
            "tooltip": "The amount in the smallest currency unit, e.g. 1099 for $10.99. A negative amount reduces the amount due. Use either an amount or a price."
          },
          "currency": {
            "type": "text",
            "label": "Currency",
            "index": 5,
            "tooltip": "Three-letter ISO currency code, e.g. usd. Required with Amount."
          },
          "description": {
            "type": "text",
            "label": "Description",
            "index": 6,
            "tooltip": "Text shown on the invoice for this item."
          },
          "invoice": {
            "type": "text",
            "label": "Invoice ID",
            "index": 7,
            "tooltip": "The ID of a draft invoice to add the item to, e.g. in_1MtHbELkdIwHu7ixl4OzzPMv. If empty, the item is added to the customer's next invoice."
          },
          "metadata": {
            "type": "key-value",
            "label": "Metadata",
            "index": 8,
            "tooltip": "Optional key-value pairs to store on the object, e.g. an order ID from your system."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "title": "Invoice Item ID",
            "example": "ii_1MtGUtLkdIwHu7ixBYwjAM00"
          },
          "object": {
            "type": "string",
            "title": "Object",
            "example": "invoiceitem"
          },
          "amount": {
            "type": "integer",
            "title": "Amount",
            "example": 1099
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "example": "usd"
          },
          "customer": {
            "type": "string",
            "title": "Customer ID",
            "example": "cus_NeZei8imSbMVvi"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "title": "Description",
            "example": "T-shirt"
          },
          "invoice": {
            "type": [
              "string",
              "null"
            ],
            "title": "Invoice ID",
            "example": "in_1MtHbELkdIwHu7ixl4OzzPMv"
          },
          "quantity": {
            "type": "integer",
            "title": "Quantity",
            "example": 1
          },
          "date": {
            "type": "integer",
            "title": "Date (Unix Timestamp)",
            "example": 1680640231
          },
          "pricing": {
            "type": [
              "object",
              "null"
            ],
            "title": "Pricing",
            "properties": {
              "type": {
                "type": "string",
                "title": "Pricing.Type",
                "example": "price_details"
              },
              "unit_amount_decimal": {
                "type": [
                  "string",
                  "null"
                ],
                "title": "Pricing.Unit Amount Decimal",
                "example": "1099"
              },
              "price_details": {
                "type": [
                  "object",
                  "null"
                ],
                "title": "Pricing.Price Details",
                "properties": {
                  "price": {
                    "type": "string",
                    "title": "Pricing.Price Details.Price ID",
                    "example": "price_1MtGUsLkdIwHu7ix1be5Ljaj"
                  },
                  "product": {
                    "type": "string",
                    "title": "Pricing.Price Details.Product ID",
                    "example": "prod_NeZe7xbBdJT8EN"
                  }
                },
                "example": {
                  "price": "price_1MtGUsLkdIwHu7ix1be5Ljaj",
                  "product": "prod_NeZe7xbBdJT8EN"
                }
              }
            },
            "example": {
              "type": "price_details",
              "price_details": {
                "price": "price_1MtGUsLkdIwHu7ix1be5Ljaj",
                "product": "prod_NeZe7xbBdJT8EN"
              },
              "unit_amount_decimal": "1099"
            }
          },
          "livemode": {
            "type": "boolean",
            "title": "Live Mode",
            "example": false
          },
          "metadata": {
            "type": "object",
            "title": "Metadata",
            "example": {
              "orderId": "1001"
            }
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
