# Preview a payment file

Source: https://amanucci.com/docs/developers/api/documents/previewPaymentFile

## POST /v1/entities/{entityId}/payment-file/preview

Preview a payment file

What a payment file would hold: each transfer, its amount (what is owed, net of the supplier's credit notes, unless lowered), the account the invoice printed, its remittance and its warnings, the count and the total; or the first refusal. A POST for its body, a read: nothing is written.

Operation ID: `previewPaymentFile`

### Parameters

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

### Request body

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

### Responses

#### 200 The file, without its XML.

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

#### 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 Pay refused the request (`PayProblem`), or the schema did (`invalid-input`).

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

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