# Submit a switched-in client's documents

Source: https://amanucci.com/nl/docs/developers/api/migrations/submitMigrationDocuments

## POST /v1/firms/{firmId}/migrations/{migrationId}/documents

Submit a switched-in client's documents

Submit a signed migration's staged documents: each file is checked against its staged bytes and kept when it opens as an archive, a PDF or a UBL; the rest are answered `unreadable` and stored nowhere. In the background, an archive is expanded under its caps, each PDF and UBL kept as the client's evidence, read without being booked (a PDF with no UBL beside it by the model, priced like an upload) and joined to the replayed entry of the same supplier, number and amount; a document nothing claims stays unclaimed. A staged or abandoned migration refuses (409 `migration_unsigned`).

Operation ID: `submitMigrationDocuments`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "firmId",
    "in": "path"
  },
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "migrationId",
    "in": "path"
  }
]
```

### Request body

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/MigrationDrop"
      }
    }
  }
}
```

### Responses

#### 201 The files kept for the worker, and the ones no reader opens.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/SubmittedMigrationDocuments"
    }
  }
}
```

#### 401 Dead or absent credential (`unauthenticated`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 403 Authenticated, present, and refused: a missing grant, a missing seat, or a missing step-up.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 404 Absent, or hidden from this asker — the two are indistinguishable (`not-found`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 409 The world is not in the state the request assumed: a stale `expectedSeq`, or a transition already made.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 422 The request did not satisfy the schema (`invalid-input`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 429 Too many requests on this door's bucket (`rate-limited`); refused before any handler ran, `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 503 Temporarily unavailable; `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```
