# Download a payment file

Source: https://amanucci.com/nl/docs/developers/api/documents/downloadPaymentFile

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

Download a payment file

The payment file itself: an ISO 20022 `pain.001.001.09` credit-transfer initiation in the Febelfin guideline, `Content-Disposition: attachment; filename="payments-<executeOn>.xml"`, for the bank to sign; the preview's request with its `fingerprint`, refused 409 `preview_stale` where the file now pays otherwise (an amount, an account, a remittance, the debtor or the day), whatever its total. Amanucci sends no money and remembers no file: an invoice reads paid once the bank's statement shows the debit. A POST for its body, a read.

Operation ID: `downloadPaymentFile`

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

### Responses

#### 200 The `pain.001.001.09` file.

```json
{
  "application/xml": {
    "schema": {
      "type": "string"
    }
  }
}
```

#### 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 file moved since its preview (`preview_stale`): preview it again.

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

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