> 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.CreateInvoice

- Component: `appmixer.stripe.core.CreateInvoice`
- 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.CreateInvoice>

Creates a new invoice for a customer, which can later be finalized and paid.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Customer Id (`customer`) | text | The identifier of the customer to invoice. |
| Collection Method (`collectionMethod`) | select | Select how to collect payment. |
| Description (`description`) | text | An optional description for the invoice. |
| Auto Advance (`autoAdvance`) | toggle | If true, the invoice will be automatically finalized and sent to the customer. |
| Due Date (`dueDate`) | date-time | The date on which payment for this invoice is due. Required if collection method is 'Send Invoice'. |
| Days Until Due (`daysUntilDue`) | number | Number of days from when the invoice is sent until it is due. Required if collection method is 'Send Invoice' and Due Date is not provided. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Id (`id`) | string | - |
| Object (`object`) | string | - |
| Customer (`customer`) | string | - |
| Status (`status`) | string | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.stripe.core.CreateInvoice",
  "author": "Appmixer <info@appmixer.com>",
  "description": "Creates a new invoice for a customer, which can later be finalized and paid.",
  "version": "1.0.0",
  "private": false,
  "auth": {
    "service": "appmixer:stripe"
  },
  "quota": {
    "manager": "appmixer:stripe",
    "resources": "requests"
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "customer": {
            "type": "string"
          },
          "collectionMethod": {
            "type": "string",
            "enum": [
              "charge_automatically",
              "send_invoice"
            ]
          },
          "description": {
            "type": "string"
          },
          "autoAdvance": {
            "type": "boolean"
          },
          "dueDate": {
            "type": "string",
            "format": "date-time"
          },
          "daysUntilDue": {
            "type": "number"
          }
        },
        "required": [
          "customer"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "collectionMethod": {
                  "const": "send_invoice"
                }
              }
            },
            "then": {
              "anyOf": [
                {
                  "required": [
                    "dueDate"
                  ]
                },
                {
                  "required": [
                    "daysUntilDue"
                  ]
                }
              ]
            }
          }
        ]
      },
      "inspector": {
        "inputs": {
          "customer": {
            "type": "text",
            "tooltip": "The identifier of the customer to invoice.",
            "label": "Customer Id",
            "index": 0
          },
          "collectionMethod": {
            "type": "select",
            "tooltip": "Select how to collect payment.",
            "label": "Collection Method",
            "index": 1,
            "options": [
              {
                "label": "Charge Automatically",
                "value": "charge_automatically"
              },
              {
                "label": "Send Invoice",
                "value": "send_invoice"
              }
            ]
          },
          "description": {
            "type": "text",
            "tooltip": "An optional description for the invoice.",
            "label": "Description",
            "index": 2
          },
          "autoAdvance": {
            "type": "toggle",
            "label": "Auto Advance",
            "index": 3,
            "defaultValue": false,
            "tooltip": "If true, the invoice will be automatically finalized and sent to the customer."
          },
          "dueDate": {
            "type": "date-time",
            "label": "Due Date",
            "tooltip": "The date on which payment for this invoice is due. Required if collection method is 'Send Invoice'.",
            "index": 4
          },
          "daysUntilDue": {
            "type": "number",
            "label": "Days Until Due",
            "tooltip": "Number of days from when the invoice is sent until it is due. Required if collection method is 'Send Invoice' and Due Date is not provided.",
            "index": 5
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "options": [
        {
          "label": "Id",
          "value": "id",
          "schema": {
            "type": "string",
            "example": "in_1ABC123DEF456"
          }
        },
        {
          "label": "Object",
          "value": "object",
          "schema": {
            "type": "string",
            "example": "invoice"
          }
        },
        {
          "label": "Customer",
          "value": "customer",
          "schema": {
            "type": "string",
            "example": "cus_ABC123DEF456"
          }
        },
        {
          "label": "Status",
          "value": "status",
          "schema": {
            "type": "string",
            "example": "draft"
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
