---
title: "Archive sale"
method: PUT
path: "/api/files/sales/{saleGuid}/archive"
tags: ["Sales"]
---

# Archive sale

`PUT /api/files/sales/{saleGuid}/archive`

## Request

- Base URL: `https://api.skyslope.com`
- URL: `https://api.skyslope.com/api/files/sales/{saleGuid}/archive`
- Auth: OpenID Connect (`https://example.com/.well-known/openid-configuration`)

Archives a Closed sale whose accomplishment is Completed by setting its status to Archived (61). The optional notes (up to 2000 characters, no < or >) become the text of the file's ARCHIVE log entry. Returns 403 if the caller's role lacks the ArchiveFiles permission (by default only Broker, Auditor and Non-Approving Auditor have it), and 422 if the sale is not Closed and Completed, including when it is already Archived, or if the body is present but is not a single JSON object whose notes is a string.

### Validation & Requirements
#### Required Parameters
- `saleGuid` (path, string, format=guid)

#### Required JSON Body Fields
- None

#### Validations
- Invalid GUID values in `*Guid`/`*Guids` fields return `422 Unprocessable Entity`.
- Invalid date values in `*date*` fields return `422 Unprocessable Entity`.
- Missing required request body returns `422 Unprocessable Entity` with `Missing request body.`.
- Additional business-rule validation may return `422` with details in the `errors` array.

#### Integration Requirement
- Retrieve the corresponding `...Form` endpoint immediately before write operations to get current dynamic required fields and allowed values.

## Path parameters

- `saleGuid` string, guid, required

## Request body

- ArchiveSaleForm
  - `notes` string, nullable

## Response `200`

- LinkedResponseOfArchiveSaleResponse
  - `value` ArchiveSaleResponse
  - `warnings` string[], nullable
  - `links` Link[], nullable
    - `href` string, nullable
    - `rel` string, nullable
    - `method` string, nullable

## Other responses

- `403`
- `404`
- `422`

## Changes

- **2026-11-18** `eace73e24154`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/skyslope/apis/skyslope-api/changes/api/files/sales/:saleGuid/archive/put.md)

---

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