# Create Article — Fortnox

> Creates a new article in the Fortnox API. See the documentation.

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

## Description

Creates a new article in the Fortnox API. [See the documentation](https://api.fortnox.se/apidocs#tag/fortnox_Articles/operation/1_create_3).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `description` | `string` | Yes | The description of the article |
| `ean` | `string` | No | The EAN of the article |
| `directCost` | `string` | No | The direct cost of the article |
| `freightCost` | `string` | No | The freight cost of the article |
| `purchasePrice` | `string` | No | The purchase price of the article |
| `salesPrice` | `string` | No | The sales price of the article |
| `manufacturer` | `string` | No | The manufacturer of the article |
| `quantityInStock` | `string` | No | The quantity in stock of the article |
| `supplierNumber` | `string` | No | The number of the supplier Options are loaded from the connected account. |
| `type` | `string` | No | The type of the article |
| `vat` | `string` | No | The VAT of the article |
| `weight` | `string` | No | The weight of the article |
| `width` | `string` | No | The width of the article |
| `height` | `string` | No | The height of the article |

## 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": "fortnox",
      },
    },
  },
)

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: "fortnox-create-article",
  arguments: {
    description: "Description",
    ean: "EAN",
  },
})
```

**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: "fortnox-create-article",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    fortnox: { authProvisionId: "apn_xxxxxxx" },
    description: "Description",
    ean: "EAN",
  },
})

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": "fortnox-create-article",
    "configured_props": {
      "fortnox": { "authProvisionId": "apn_xxxxxxx" },
      "description": "Description",
      "ean": "EAN"
    }
  }'
```

---

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