Settlement Query API
How to query settlement batches and lines as JSON or CSV (Accept text/csv) with GET /api/v1/settlements, /{batchNo}, and /{batchNo}/lines, and the response fields.
The merchant server can query its own app's settlement batches via the REST API.
- Authentication: API key, requires the
settlement:readscope (not included inread:all) - Only batches for the app linked to the key are returned. Batch numbers of other apps return
404 DRAFTandCANCELLEDbatches, which are internal working states, are not exposed (404)- Responses are not cached (
Cache-Control: no-store)
Batch list
GET /api/v1/settlements?status=APPROVED&from=2026-01-01T00:00:00%2B09:00&to=2026-04-01T00:00:00%2B09:00&limit=50&skip=0| Query | Description |
|---|---|
status | One of VERIFIED, APPROVED, PAID, CARRIED_FORWARD |
from / to | Range based on the period start (periodStart): from ≤ periodStart < to (ISO 8601) |
limit / skip | Default 50 / 0; limit up to 500 |
Results are sorted by period start, descending. total is the total number of exposed batches that match the filter (DRAFT and CANCELLED are excluded at query time, so they are not counted either). If skip + data.length < total, there is a next page.
{
"data": [
{
"batchNo": "STL-20260101-6650f0c2a1b2c3d4e5f60718-KRW-0007",
"appId": "6650f0c2a1b2c3d4e5f60718",
"currency": "KRW",
"periodStart": "2025-12-31T15:00:00.000Z",
"periodEnd": "2026-01-31T15:00:00.000Z",
"payoutDueDate": "2026-02-15T15:00:00.000Z",
"status": "APPROVED",
"carryReason": null,
"totals": {
"count": 4,
"saleCount": 3,
"adjustmentCount": 1,
"grossMinor": "20300",
"refundMinor": "9300",
"feeMinor": "385",
"vatMinor": "39",
"adjustmentMinor": "-3846",
"carriedInMinor": "0",
"netMinor": "10576"
},
"checksum": "5d0c4f6e…",
"verified": true,
"paidAt": null,
"payoutRef": null
}
],
"total": 1
}Batch fields
| Field | Description |
|---|---|
batchNo | Batch number (format) |
periodStart / periodEnd | Settlement period [start, end). Values are in UTC but aligned to midnight in the policy timezone (example above: January in KST) |
payoutDueDate | Payout due date (periodEnd + holdDays) |
status | Batch status |
carryReason | Carry-forward reason NEGATIVE_NET / BELOW_MIN_PAYOUT, or null |
totals.*Minor | Totals (minor unit, strings). For definitions, see Batch totals |
totals.netMinor | Payout (or carry-forward) amount |
checksum | Batch checksum |
verified | Whether the last verification result matched |
paidAt / payoutRef | Payout time / payout reference number (when PAID) |
Batch details
GET /api/v1/settlements/STL-20260101-6650f0c2a1b2c3d4e5f60718-KRW-0007The response is { "data": <batch object> }.
Settlement lines
GET /api/v1/settlements/{batchNo}/lines?limit=200&skip=0
Accept: application/json| Query | Description |
|---|---|
limit / skip | Default 200 / 0; limit up to 5000. Sort: kind → tid |
{
"data": [
{
"kind": "REFUND_ADJUSTMENT",
"tid": "STRIPE-20251220110000654321-d4e5f6-1a2b3c4d",
"refundId": "rf_01JH2X8Q4M3N",
"grossMinor": "0",
"refundMinor": "4000",
"percentFeeMinor": "-140",
"fixedFeeMinor": "0",
"feeMinor": "-140",
"vatMinor": "-14",
"netMinor": "-3846",
"formula": "-refund 4000 - fee(-140+0) - vat -14 = -3846 [orig STL-20251201-6650f0c2a1b2c3d4e5f60718-KRW-0006]",
"refOriginalBatchNo": "STL-20251201-6650f0c2a1b2c3d4e5f60718-KRW-0006"
},
{
"kind": "SALE",
"tid": "KCP-20260115120000123456-a1b2c3-9f8e7d6c",
"paidAt": "2026-01-15T03:00:00.000Z",
"grossMinor": "5000",
"refundMinor": "2000",
"percentFeeMinor": "105",
"fixedFeeMinor": "0",
"feeMinor": "105",
"vatMinor": "11",
"netMinor": "2884",
"formula": "gross 5000 - refund 2000 - fee(105+0) - vat 11 = 2884 [fee 350bps, vat 1000bps]"
}
],
"total": 4
}| Field | Description |
|---|---|
kind | SALE (sale) or REFUND_ADJUSTMENT (refund adjustment for a transaction from a previous batch) |
tid | Transaction ID |
refundId | Refund ID of an adjustment line (absent for sale lines) |
paidAt | Payment confirmation time of the original transaction |
grossMinor … netMinor | Each item from the calculation (strings; can be negative for adjustment lines) |
formula | Human-readable basis for the calculation |
refOriginalBatchNo | Adjustment lines: the batch in which the original transaction was settled |
CSV download
Send Accept: text/csv to the same path to receive all lines of the batch as a CSV file (limit/skip are ignored).
curl -H "Authorization: Bearer $STAGEPAY_KEY_ID:$STAGEPAY_KEY_SECRET" \
-H "Accept: text/csv" \
-o settlement.csv \
https://api.stagepay.io/api/v1/settlements/STL-20260101-6650f0c2a1b2c3d4e5f60718-KRW-0007/lines- File name:
Content-Disposition: attachment; filename="{batchNo}.csv" - Encoding: UTF-8 BOM + CRLF line endings (opens directly in Excel)
- Structure: ① 2 batch header rows → blank row → ② line header + lines → blank row → ③
TOTALrow
batchNo,appId,currency,periodStart,periodEnd,status,checksum
STL-20260101-6650f0c2a1b2c3d4e5f60718-KRW-0007,6650f0c2a1b2c3d4e5f60718,KRW,2025-12-31T15:00:00.000Z,2026-01-31T15:00:00.000Z,APPROVED,5d0c4f6e…
kind,tid,refundId,paidAt,grossMinor,refundMinor,percentFeeMinor,fixedFeeMinor,feeMinor,vatMinor,netMinor,formula
REFUND_ADJUSTMENT,STRIPE-20251220110000654321-d4e5f6-1a2b3c4d,rf_01JH2X8Q4M3N,,0,4000,-140,0,-140,-14,-3846,'-refund 4000 - fee(-140+0) - vat -14 = -3846 [orig STL-20251201-…-0006]
SALE,KCP-20260115120000123456-a1b2c3-9f8e7d6c,,2026-01-15T03:00:00.000Z,5000,2000,105,0,105,11,2884,gross 5000 - refund 2000 - fee(105+0) - vat 11 = 2884 [fee 350bps, vat 1000bps]
TOTAL,,,,20300,9300,,,385,39,10576,carriedIn 0To prevent formula injection, text values (other than integers) that start with =, +, -, or @ are prefixed with '. This is why the adjustment line's formula in the example above starts with '-refund …. As in JSON, lines are ordered by kind (REFUND_ADJUSTMENT → SALE) → tid.
Reconciliation
- Each month, query batches with
status=APPROVEDorPAIDand comparenetMinorwith the amount actually received. - Match the lines'
tidagainst your merchant order DB to check for omissions and duplicates. - Link
REFUND_ADJUSTMENTlines to their original batches viarefOriginalBatchNofor refund accounting. - Store the received
checksumand confirm it is unchanged when you query again.
Batch Status, Verification, and Approval
The settlement batch state machine (DRAFT→VERIFIED→APPROVED→PAID, CARRIED_FORWARD, CANCELLED), three-way reconciliation, checksums, four-eyes approval, payout processing, and cancellation rules.
Merchant Console
How to manage app settings, webhook secrets, products, API keys, transaction and callback history, logs, and settlement in the merchant console.