> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clinkbill.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SFTP Configuration

> Download daily settlement files over SFTP

## Overview

Clink delivers a daily settlement file to a secure SFTP directory. You can
connect an SFTP client (or your own automated job) to pull these files for
bookkeeping and internal reconciliation.

<Note>
  Files are read-only. The SFTP account is provisioned per merchant and only
  grants access to your own files.
</Note>

## Get Your SFTP Credentials

Connection only supports SSH key authentication.

1. Generate an SSH key pair on your side and keep the private key secure:
   ```bash theme={null}
   ssh-keygen -t ed25519 -f clink_sftp
   ```
2. Go to your merchant dashboard and open the **Developer** menu
3. Click **Request SFTP** and:
   * Paste the contents of your **public key** (`clink_sftp.pub`). It must be
     a **single line**. Use `tr -d '\r\n' < clink_sftp.pub` to remove line
     breaks before copying
   * Supported key algorithms are Ed25519, ECDSA, and RSA (at least 2048
     bits). DSA is not supported
   * Add 1 to 5 IP allowlist entries. Each entry must use a CIDR prefix from `/24` to `/32` (e.g. `203.0.113.7/32`, `203.0.113.0/24`)

Connection details:

* **Host**: `sftp.clinkbill.com`
* **Port**: `2022`
* **Username**: your merchant ID
* **Authentication**: SSH key only

## Manage Your SFTP Configuration

### Rotate Your Public Key

To rotate a key or replace a compromised key, open the SFTP configuration
from the **Developer** menu, click **Edit**, and replace the public key.

<Warning>
  Replacing the public key immediately disconnects active SFTP sessions and
  interrupts downloads in progress. Make this change outside your scheduled
  download window, then reconnect using the matching private key.
</Warning>

### Request Historical Files

The scheduled job generates only the previous day's file. Settlement files
from before your first SFTP request are not added to `/statements`
automatically. Contact Clink support to request historical files.

## Connect

Using the OpenSSH client:

```bash theme={null}
sftp -P 2022 -i clink_sftp <merchant_id>@sftp.clinkbill.com
```

You can also connect with an SFTP client application (FileZilla, WinSCP, or
Cyberduck) using the host, port, merchant ID, and private key above.

## Settlement Files

Settlement files are placed in the `/statements` directory at the root:

```
/statements/settlement_report_20260804.csv
```

A new file for the previous day is generated daily at **02:00 UTC**, named
`settlement_report_YYYYMMDD.csv`.

## Download Files

```bash theme={null}
sftp -P 2022 -i clink_sftp <merchant_id>@sftp.clinkbill.com <<'EOF'
cd /statements
get settlement_report_20260804.csv
bye
EOF
```
