---
title: "POST /companies/{companySlug}/purchases/{purchaseId}/attachments"
method: POST
path: "/companies/{companySlug}/purchases/{purchaseId}/attachments"
tags: ["purchases"]
---

# POST /companies/{companySlug}/purchases/{purchaseId}/attachments

`POST /companies/{companySlug}/purchases/{purchaseId}/attachments`

## Request

- Base URL: `https://api.fiken.no/api/v2`
- URL: `https://api.fiken.no/api/v2/companies/{companySlug}/purchases/{purchaseId}/attachments`
- Auth: OAuth 2
  - Authorization code: `https://fiken.no/oauth/authorize`
  - Token URL: `https://fiken.no/oauth/token`

Creates and adds a new attachment to a Purchase

## Query parameters

- `attachToPayment` boolean
- `attachToSale` boolean
- `ehfDocumentId` integer
- `inboxDocumentId` integer

## Request body `multipart/form-data`

- object
  - `filename` string: The filename. Must end with either .png, .jpeg, .jpg, .gif or .pdf
  - `file` string, binary

## Response `201`

Created

## Changes

- **2026-09-03** `2473dacdb89c`: 2 info
  - added the new optional `query` request parameter `ehfDocumentId`
  - added the new optional `query` request parameter `inboxDocumentId`
- **2026-03-28** `dff97b55851e`: 2 warning, 2 info
  - removed the request property `attachToPayment`
  - removed the request property `attachToSale`
  - added the new optional `query` request parameter `attachToPayment`
  - added the new optional `query` request parameter `attachToSale`
- **2021-12-08** `4813e5666340`: 1 info
  - the endpoint scheme security `fiken_api_oauth` was removed from the API

[Operation history](https://skmtc.dev/fiken/apis/fiken-api/changes/companies/:companySlug/purchases/:purchaseId/attachments/post.md)

---

[API](https://skmtc.dev/fiken/apis/fiken-api.md) - [All operations](https://skmtc.dev/fiken/apis/fiken-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fiken/apis/fiken-api/revisions/29111da67f94?raw)
