> 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.xero.accounting.AddAttachmentToInvoice

- Component: `appmixer.xero.accounting.AddAttachmentToInvoice`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.xero 2.3.0](https://connectors.appmixer.com/connector/appmixer.xero/2.3.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.xero/2.3.0/component/appmixer.xero.accounting.AddAttachmentToInvoice>

Attach files to a sales invoice or purchase bill.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Tenant ID (`tenantId`) | text | - |
| Invoice ID (`invoiceId`) | text | - |
| File name (`filename`) | text | - |
| Attachment (`attachment`) | filepicker | The file to be attached. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| `AttachmentID` | - | - |
| `FileName` | - | - |
| `Url` | - | - |
| `MimeType` | - | - |
| `ContentLength` | - | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.xero.accounting.AddAttachmentToInvoice",
  "author": "Jiří Hofman <jirka@client.io>",
  "description": "Attach files to a sales invoice or purchase bill.",
  "private": false,
  "auth": {
    "service": "appmixer:xero",
    "scope": [
      "accounting.attachments"
    ]
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string",
            "format": "uuid"
          },
          "filename": {
            "type": "string"
          },
          "attachment": {
            "type": "string"
          }
        },
        "required": [
          "tenantId",
          "invoiceId",
          "filename",
          "attachment"
        ]
      },
      "inspector": {
        "inputs": {
          "tenantId": {
            "type": "text",
            "label": "Tenant ID",
            "index": 1,
            "source": {
              "url": "/component/appmixer/xero/accounting/ListTenants?outPort=tenants",
              "data": {
                "transform": "./transformers#tenantsToSelectArray"
              }
            }
          },
          "invoiceId": {
            "type": "text",
            "label": "Invoice ID",
            "index": 2
          },
          "filename": {
            "type": "text",
            "label": "File name",
            "index": 3
          },
          "attachment": {
            "type": "filepicker",
            "label": "Attachment",
            "tooltip": "The file to be attached.",
            "index": 4
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "options": [
        {
          "label": "AttachmentID",
          "value": "AttachmentID",
          "schema": {
            "example": "e59a2c7f-1306-4078-a0f5-3c62f9d4c25e"
          }
        },
        {
          "label": "FileName",
          "value": "FileName",
          "schema": {
            "example": "signed-quote.pdf"
          }
        },
        {
          "label": "Url",
          "value": "Url",
          "schema": {
            "example": "https://api.xero.com/api.xro/2.0/Invoices/d4e5f6a7-b8c9-0123-defa-345678901234/Attachments/signed-quote.pdf"
          }
        },
        {
          "label": "MimeType",
          "value": "MimeType",
          "schema": {
            "example": "application/pdf"
          }
        },
        {
          "label": "ContentLength",
          "value": "ContentLength",
          "schema": {
            "example": "48213"
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
