Skip to content
StagePay

Products · Settlement

Per-currency settlement, down to the calculation

We show how the payout was calculated, one transaction at a time. A batch moves on to approval only when three independent calculations agree.

Abstract image of neatly stacked translucent ledger sheets and alignment lines
Settlement batchSTL-20261128-sample-KRW-0001Example
  1. DRAFT

  2. VERIFIED

  3. APPROVED

  4. PAID

Transactions
100
Gross
₩3,300,000
Refunds
−₩33,000
Fees
−₩82,500
VAT
−₩8,300
Net payout
₩3,176,200
  • Engine calculation

    ₩3,176,200

  • DB aggregation

    ₩3,176,200

  • Line totals

    ₩3,176,200

Checksum sha256:9c1f…a07eApprover differs from creator

The problem

Common settlement disputes

  • Statements with totals only

    With only a total, there is no way to tell which transactions were left out or how the fee was calculated.

  • Mixed currencies

    When several currencies are rolled into one total, you cannot trace where exchange-rate or rounding differences came from.

  • Payouts approved by whoever created them

    When one person both calculates and approves, nothing catches mistakes or changes.

Settlement policy

StagePay operators register a policy per app and currency to match the contract. Every save increases the version, and each batch keeps a snapshot of the policy it used.

Settlement policy
FieldMeaning
feeRateBpsPercentage fee. 1 bps = 0.01%
fixedFeeMinorFixed fee per transaction (minor units)
vatRateBpsVAT rate charged on the fee (default 10%)
refundFeeRefundableWhether the fee is returned on refunds
cycleSettlement cycle: DAILY · WEEKLY · MONTHLY
holdDaysPayout hold (T+N). Payout due = period end + N days
minPayoutMinorMinimum payout. Below it, the batch carries forward
timezoneTime zone used to cut settlement periods
effectiveFromSettlement start. Only transactions paid after it are included

Features

Only verified batches get paid

  1. A calculation record for every transaction

    A batch stores one line per transaction (or per adjustment), recording exactly how the fee and VAT were calculated. All arithmetic uses integers (BigInt), and rounding happens only per transaction, half-up.

    • Refunds within the same batch are deducted from the net
    • Refunds of already-settled transactions become negative adjustment lines in the next batch
    • If the net is below the minimum payout, the batch is CARRIED_FORWARD
    Calculating one transactionbigint
    gross = amountMinor
    fee   = round_half_up(gross * feeRateBps / 10000) + fixedFeeMinor
    vat   = round_half_up(fee * vatRateBps / 10000)
    net   = Σgross − Σrefund − Σfee − Σvat + Σadjustment + carriedIn
    
    # KRW 33000 · feeRateBps 250 · fixedFeeMinor 0 · vatRateBps 1000
    fee = 825 · vat = 83 (82.5 → half-up) · line net = 32092
  2. Three-way verification and checksum

    An engine recalculation, a MongoDB aggregation and the stored line totals are computed independently, and every figure from count to net must match for VERIFIED. A SHA-256 checksum of the batch also detects later changes.

    • Any difference keeps the batch in DRAFT and records the mismatches
    • A mismatch on re-verification sends VERIFIED back to DRAFT
    • Merchants can keep the checksum they received and compare it later
    Settlement batchDRAFT → VERIFIEDExample
    fieldEngine calculationDB aggregationLine totals
    count100100100
    grossMinor330000033000003300000
    refundMinor330003300033000
    feeMinor825008250082500
    vatMinor830083008300
    netMinor317620031762003176200
    Checksum sha256:9c1f…a07eVERIFIED
  3. Four-eyes approval and audit log

    Whoever created a batch cannot approve it. Three-way verification runs again right before approval, and every state change is written to the audit log with the actor and before and after values.

    • Simultaneous state changes: only one succeeds (the other gets 409)
    • A payout reference is required to mark a batch paid
    • PAID batches cannot change; differences are adjusted in the next batch
    history[]Example
    1. DRAFTcreatedBy: system:scheduler03:00
    2. VERIFIEDengine = db = lines · checksum03:00
    3. APPROVEDapprovedBy: admin_02 (≠ createdBy)10:12
    4. PAIDpayoutRef: BANK-TRX-…447114:30

    Approver differs from creator · audit_logs (before / after)

  4. Read it in the console or REST API

    In the merchant console, see the batch list and details, the policy snapshot, verification results and per-line calculations, and download CSV. Reconciliation servers fetch the same data over the REST API with a settlement:read key.

    • GET /api/v1/settlements · /:batchNo · /:batchNo/lines
    • Accept: text/csv returns lines as CSV
    • DRAFT and CANCELLED batches are not exposed over REST
    Downloading settlement lines as CSVbash
    curl https://api.stagepay.io/api/v1/settlements/STL-20261101-<APP_ID>-KRW-0001/lines \
      -H "Authorization: Bearer $STAGEPAY_KEY_ID:$STAGEPAY_KEY_SECRET" \
      -H "Accept: text/csv" \
      -o settlement-lines.csv

Batch lifecycle

Batches move only in the order DRAFT → VERIFIED → APPROVED → PAID. Before payout, a batch can be cancelled with a reason.

  1. DRAFT

    Eligible transactions are locked and a batch is built on the policy's cycle. No transaction can land in two batches.

  2. VERIFIED

    When engine calculation, DB aggregation and line totals match, the batch is verified and a checksum is recorded.

  3. APPROVED

    Someone other than the batch's creator approves it.

  4. PAID

    The payout is completed and its payout reference is stored on the batch.

CARRIED_FORWARD

If the payout is below the minimum payout, the batch is carried forward and its amount is added to the next batch.

CANCELLED

Cancelling a batch before payout, with a reason, releases the transaction locks and carry-overs, and those transactions are settled again in the next batch.

Frequently asked questions

When are settlement batches created?

A batch is created for the previous period according to the policy cycle (daily, weekly or monthly). With automatic creation on, a batch is created for each active policy at 03:00 Korea time every day and verified immediately.

Can the same transaction be settled twice?

No. Creating a batch locks its transactions with the batch ID, and if the number locked differs from the number calculated, everything is rolled back. Batches with overlapping periods for the same app and currency cannot be created either.

What happens to refunds after settlement?

Refunds of already-settled transactions appear as negative adjustment lines in the next batch. Whether the fee is returned follows the policy's refundFeeRefundable setting.

Can merchants change the settlement policy?

Only StagePay operators register and change policies and create, approve and pay out batches. Merchants check the policy snapshot and batches in the console and contact us with the batch number if they disagree.

Start with one integration

Follow the quickstart to create an app, create a payment and verify a callback signature.