---
title: "Download the original document"
method: GET
path: "/companies/{company}/purchase-scans/{purchase_scan}/source"
tags: ["Purchase Scans"]
---

# Download the original document

`GET /companies/{company}/purchase-scans/{purchase_scan}/source`

## Request

- Base URL: `https://api.factuarea.com/v1`
- URL: `https://api.factuarea.com/v1/companies/{company}/purchase-scans/{purchase_scan}/source`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Download the original file of a purchase scan (PDF or image) as a binary stream with `Content-Disposition: attachment`. Available while the original is retained.

## Path parameters

- `company` string, uuid, required
- `purchase_scan` string, uuid, required

## Headers

- `Factuarea-Version` string, date

## Response `200`

## Other responses

- `400`: `parameter_unknown` with `subcode` `retired_active_profile_header`: the retired `X-Active-Profile` header was sent; the company goes in the path. `parameter_invalid_format` on `Factuarea-Version`: the header is not a `YYYY-MM-DD` date. `unsupported_api_version`: the `Factuarea-Version` date is not a supported version.
- `401`: Missing or invalid API key.
- `403`: The request is not allowed for this API key or its creator. Possible `error.code` values: `insufficient_scope` — the API key lacks the scope this operation requires; `forbidden_action` — the API key has the scope, but the user who created it cannot perform this action for the company; `error.subcode` is `api_key_creator_not_member` (the API key creator no longer belongs to the company), or `purchase_invoices_export_required` (the API key creator lacks the `export` capability for expenses).
- `404`: The requested resource does not exist or belongs to another company. `profile_not_found`: the company in the path does not exist, is not in the API key scope or belongs to the other environment (live or test).
- `429`: Rate limit exceeded. Retry after the duration in `Retry-After`.
- `500`: Unexpected server error.
- `503`: A service this operation depends on is temporarily unavailable. Nothing was changed; retry later (write operations with the same `Idempotency-Key`). Possible `error.code` values: `dependency_unavailable` — a dependency is down; `error.subcode` names it (`file_safety_unavailable` or `scan_storage_unavailable`); `scan_storage_unavailable` — the secure document storage could not be reached.

---

[API](https://skmtc.dev/factuarea/apis/factuarea-public-api.md) · [All operations](https://skmtc.dev/factuarea/apis/factuarea-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/factuarea/apis/factuarea-public-api/revisions/718e77934422?raw)
