{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/freeport-gg/json-schema/freeport-gg-balance-transaction-schema.json",
  "title": "BalanceTransaction",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/freeport-gg-api-openapi.json#/components/schemas/BalanceTransaction",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The ledger entry this line is."
    },
    "type": {
      "type": "string",
      "description": "The ledger posting this entry belongs to, by the kind the ledger records it under. Known kinds: `order.completed` (a sale credited, pending), `order.dispute_completed` (a sale a dispute ended for you), `order.dispute_split` (your share of a split dispute), `payout.hold_released` (a sale's hold ended: one line out of pending, one into available), `payout.requested` (a withdrawal asked for), `payout.rejected` and `payout.failed` (its money back), `payout.returned` (your bank sent it back, and the money is back in your balance), `refund.seller_fee` (the refund fee you carry when a sale is refunded after you accepted it, taken from your available balance), `payout.topped_up` (Freeport's own money added so a withdrawal it filed reaches the smallest payout your bank can be sent), `chargeback.sale_held` (a completed sale's money held while the buyer's bank disputes its payment, out of pending, available or both), `chargeback.sale_released` (that money back where it came from, once the bank decides for you or Freeport carries the loss), `chargeback.loss_freeport` (your part of an order the bank's chargeback ended, yours again as a sale's money, pending, when Freeport carries the loss), `chargeback.loss_undone` (a loss placed on you undone: what it took that never left your balance, available again), `chargeback.given_back` (the same: what it took that had left your balance, sent back and available), `chargeback.seller_fee` (the payment provider's fee you carry on an order a chargeback ended, taken from your available balance), `affiliate.commission_accrued` and `affiliate.hold_released` (a partner's commission, on lines from before 16 October 2026: since then commissions are a balance of their own and appear in none of these lines). A new kind is added here as the ledger gains one; a client should show one it does not know rather than fail."
    },
    "amount": {
      "type": "string",
      "pattern": "^-?\\d+(\\.\\d+)?$",
      "description": "Gross amount: `net` plus `fee`. A sale before the commission and the payout fee; a withdrawal as sent, before any fee taken from it."
    },
    "fee": {
      "type": "string",
      "pattern": "^-?\\d+(\\.\\d+)?$",
      "description": "The fee assessed in this posting, positive when charged. A sale's commission as the order kept it (a coupon already off), its payout fee, and any fees you owed that the sale paid; a withdrawal's fee taken from your balance, negative on the line that gives it back (a withdrawal to your bank account carries none). 0.00 where none was assessed, and on a dispute split, which stores none."
    },
    "net": {
      "type": "string",
      "pattern": "^-?\\d+(\\.\\d+)?$",
      "description": "The impact on your balance: positive adds to it, negative takes from it. Summing `net` over every line is your available plus your pending balance, `GET /v1/me/balance`."
    },
    "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "available"
      ],
      "description": "`pending` for money still inside the payout hold, `available` for money you can withdraw."
    },
    "available_on": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the money becomes yours to withdraw: a pending sale's release date, and the line's own moment for money that is available. Null where no date was fixed."
    },
    "created": {
      "type": "string",
      "format": "date-time",
      "description": "When the ledger recorded it."
    },
    "source": {
      "type": [
        "string",
        "null"
      ],
      "description": "What this line is for: the order or the withdrawal, or the refund's or the chargeback's own id on a line posted under it (`refund.seller_fee`, `chargeback.seller_fee`, `chargeback.loss_undone`, `chargeback.given_back`). Null for a partner's commission, whose order is somebody else's purchase."
    }
  },
  "required": [
    "id",
    "type",
    "amount",
    "fee",
    "net",
    "currency",
    "status",
    "available_on",
    "created",
    "source"
  ],
  "additionalProperties": false
}