# Preview a document's send

Source: https://amanucci.com/fr/docs/developers/api/documents/previewDocument

## GET /v1/entities/{entityId}/documents/{documentId}/preview

Preview a document's send

What a send would do, before it is done, and what a finalized document's sends carried: the document's email, naming no address; the plan as ordered steps, the Peppol step carrying the e-invoice it would send and whether Peppol is live; on a finalized document what its email and Peppol attempts carried, the e-invoice read from its stored UBL; the warnings a send by those steps would carry; and its number, on a draft the one it will take, said to be predicted. Writes nothing. The PDF is `pdfPath`'s (`previewDocumentPdf`). A document in another entity, or none, is 404.

Operation ID: `previewDocument`

### Parameters

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

### Responses

#### 200 The email, the steps, what was sent, the warnings and the number.

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

#### 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"
    }
  }
}
```

#### 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"
    }
  }
}
```
