# Create Income Invoice — Quipu

> Creates a new income invoice. See the docs.

- Key: `quipu-create-income-invoice`
- Type: Action (Write)
- Version: 0.0.2
- App: Quipu (`quipu`) — https://pipedream.com/apps/quipu.md
- This page (HTML): https://pipedream.com/apps/quipu/actions/create-income-invoice
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/quipu/actions/create-income-invoice/create-income-invoice.mjs

## Description

Creates a new income invoice. [See the docs](http://quipuapp.github.io/api-v1-docs/#creating-an-invoice).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `client` | `string` | Yes | Select a client. Options are loaded from the connected account. |
| `number` | `string` | Yes | The invoice number. |
| `issued` | `string` | Yes | The issue date of the invoice, ISO 8601 format. Example: 2019-07-26. |
| `dueDate` | `string` | Yes | The due date of the invoice, ISO 8601 format. Example: 2019-07-26. |
| `items` | `string` | No | An array of objects as the following example: [{"type": "book_entry_items", "attributes": {"concept": "Screws", "unitary_amount": "0.50", "quantity":30, "vat_percent":21, "retention_percent":0}}, {"type": "book_entry_items", "attributes": {"concept": "Nuts", "unitary_amount": "0.35", "quantity":30, "vat_percent":21, "retention_percent":0}}] see docs here. |
| `accountingCategory` | `string` | No | Select an accounting category. Options are loaded from the connected account. |
| `paidAt` | `string` | No | Date of payment, ISO 8601 format. Example: 2019-07-26. |
| `paymentMethod` | `string` | No | The method of payment. |
| `tags` | `string[]` | No | Add tags to the invoice. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "quipu",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "quipu-create-income-invoice",
  arguments: {
    client: "Client",
    number: "Number",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "quipu-create-income-invoice",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    quipu: { authProvisionId: "apn_xxxxxxx" },
    client: "Client",
    number: "Number",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "quipu-create-income-invoice",
    "configured_props": {
      "quipu": { "authProvisionId": "apn_xxxxxxx" },
      "client": "Client",
      "number": "Number"
    }
  }'
```

---

- App: https://pipedream.com/apps/quipu.md · All apps: https://pipedream.com/apps
