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

# Settlement Reports & Exports

> How Waffo calculates every amount in your settlement reports, which rounding rule applies to each column, how to use Settlement History, Settlement Batch and Customized Export, and why a settlement file may be missing or empty.

This page explains **how the numbers in your settlement reports are produced** and
how to get the data out of the Merchant Portal. Field definitions, CSV layouts and
SFTP paths live in [Reconciliation reports](/docs/en/developer-docs/tools-and-references/references/reconciliation-reports).

## How is each amount calculated, and why is my fee one cent off?

Each detail row is calculated per transaction, in the settlement currency:

| Transaction type | Settlement Amount |
| - | - |
| `PAYMENT` | Order Amount (Settlement Currency) − Fee − Tax |
| `REFUND` | −Order Amount (Settlement Currency) − Fee − Tax (+ returned fee, if your contract has one) |
| `CHARGEBACK` | −Chargeback Amount (Settlement Currency) − Chargeback Fee |

The one-cent gap comes from the rounding rules, which differ by column:

| Rule | Meaning | Applied to |
| - | - | - |
| `ROUND2` | Round half up, 2 decimals | Amount conversion into the settlement currency, and the summary `TOTAL` |
| `ROUNDUP2` | Round **up**, 2 decimals | Fee amount, tax amount |
| `ROUNDDOWN2` | Round **down**, 2 decimals | The returned fee on a refund row |

On a 2-decimal account fees and taxes round up, so a figure you compute with
ordinary half-up rounding can land a cent below the report. On a **6-decimal**
account the fee is rounded **half up at 6 decimals** instead — see
[Settlement Calculation Explained](/docs/en/support/settlement-calculation-explained).
A chargeback fee is taken as reported
for that case, not recalculated from your fee rate, so it never matches a
rate × amount formula. The summary `TOTAL` is the detail rows summed and rounded
once at the end: `TOTAL = ROUND2(Σ detail Settlement Amount)`.

## Do I get the original payment fee back when I refund?

If your contract includes a returned fee, the refund row carries it back as a
**positive** component of that row's Settlement Amount, pro-rated against the
original transaction:

```
Returned fee = ROUNDDOWN2( refund amount / original order amount × original fee amount )
```

The settlement-currency figure is pro-rated the same way, using `ROUND2`. A
partial refund returns only the matching share; a full refund returns all of it.
With no returned fee in your contract, the row has no such component.

## Why does Forex Currency Pair have a value when my order currency matches the settlement currency?

Fees and taxes can be billed in a third currency. The pair is resolved by
priority — the first condition that matches wins:

| Order of evaluation | Condition | Pair |
| - | - | - |
| 1 | Settlement Currency ≠ Order Currency | `Settlement/Order` |
| 2 | Settlement Currency ≠ Fee Currency | `Settlement/Fee` |
| 3 | Settlement Currency ≠ Tax Currency | `Settlement/Tax` |
| — | None of the above | empty (no FX involved) |

`Forex Rate` is empty whenever `Forex Currency Pair` is empty.

## Settlement History or Settlement Batch — which one should I use?

| Menu | Unit | Default window | Use it for |
| - | - | - | - |
| **Settlement History** | One settlement instruction | Most recent 90 days (UTC+8) | Status (`Succeeded` / `Failed` / `Unsettled`) and the execution timeline, including retries |
| **Settlement Batch** | Merchant + actual settlement date + settlement currency | Most recent 30 days | Reconciling what landed in your settlement account, and downloading batch transaction details |

Instructions still in their initial state are not listed. Batches are packed by
**settlement currency**, so one batch and one set of files cover every order
currency inside it, with the forex rate shown per transaction; date fields are
labelled `(UTC+8)`. `Settlement Original Amount` is the net amount summed in the
**order currency**; `Settlement Target Amount` is the same money **after
conversion** — identical when both currencies match, and empty until conversion
completes rather than missing data.

## What can Customized Export give me, and where do I download it?

| Option | Choices |
| - | - |
| Time dimension | Payment Date or Settlement Date |
| Currency | One currency, or all currencies — order currency for the daily summary, settlement currency for the other two types |
| Export type | *Transaction Settlement Detail*, *Daily Settlement Summary* or *Selected Period Summary* |
| Report Language | English, 中文 or にほんご for the detail and period summary types; the daily summary is English |

All columns of the chosen type are emitted; there is no per-column selection. In a
daily summary, `Order Amount` is **payment − refund − chargeback**, not gross
payments. A day is one row when the transaction currency equals the fee currency;
when they differ, or several fee currencies exist, the day splits into one row per
fee currency, with the tax currency folded into the fee currency. Summarising needs
a single settlement currency, so where several are involved the export is split into
separate files.

Detail exports are paginated at **60,000 rows** per file and run asynchronously —
start the export, then collect the file from the **Reports** module. The full
option set, span limits and column layouts are in
[Settlement Reports Module](/docs/en/support/settlement-reports-export-faq).

## What is in the batch transaction detail file?

Download it from a batch to reconcile transaction by transaction against your
settlement account entries. It is named
`SETTLEMENT_{MID}_{settlement success date YYYYMMDD}_{SETTLEMENT_REFERENCE_ID}.csv`,
Its columns are built to join against your own records: the settlement reference
and date, your own order / payment-request / refund-order identifiers, the Waffo
order and refund identifiers, the transaction type (payment or refund), the
transaction success time, and the order, fee, tax and settlement amount/currency
pairs. For the exact column headers and their formats, always read
[Reconciliation reports](/docs/en/developer-docs/tools-and-references/references/reconciliation-reports)
and [Settlement file specification](/docs/en/support/settlement-file-specification-faq)
rather than hard-coding names from this page.

## There is no settlement file today — did settlement fail, or did the file fail?

By default, no settlement means no file: `GENERATE_ON_VALID_SETTLEMENT` produces
details and summary files only when a valid settlement occurred. To always
receive a file, so "nothing to settle" is never confused with "file generation
problem", ask support to switch your account to `GENERATE_ALWAYS`. You then get a
**header-only file on every scheduled settlement date**, deferred ones included,
named with an all-zero batch id placeholder:

```
settlement_details_{merchant id}_S000...000_{settlement date}_{settlement currency}.csv
settlement_summary_{merchant id}_S000...000_{settlement date}_{settlement currency}.csv
```

Those placeholders are a delivery signal only — no Settlement Batch record is
created in the Merchant Portal, which is how you tell them apart from a real
settlement.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.