{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/orboni-com/json-schema/orboni-com-refund-schema.json",
  "title": "Refund",
  "description": "A refund the merchant sent from its own wallet and recorded.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/orboni-com-openapi.yml#/components/schemas/Refund",
  "type": "object",
  "required": [
    "id",
    "object",
    "livemode",
    "amount",
    "currency",
    "checkout_session",
    "reason",
    "transaction",
    "note",
    "metadata",
    "source",
    "status",
    "voided_at",
    "created"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^re_[A-Za-z0-9]{24}$"
    },
    "object": {
      "const": "refund"
    },
    "livemode": {
      "type": "boolean"
    },
    "amount": {
      "type": "integer",
      "minimum": 1,
      "description": "In the smallest unit of the session’s currency."
    },
    "currency": {
      "type": "string",
      "enum": [
        "usd",
        "eur",
        "gbp",
        "chf",
        "pln",
        "czk",
        "huf",
        "ron",
        "dkk",
        "sek",
        "nok",
        "isk",
        "try",
        "jpy",
        "krw",
        "cny",
        "hkd",
        "sgd",
        "inr",
        "idr",
        "myr",
        "php",
        "thb",
        "ils",
        "aud",
        "nzd",
        "cad",
        "mxn",
        "brl",
        "zar",
        "uah",
        "ars",
        "clp",
        "aed",
        "sar",
        "twd",
        "vnd"
      ],
      "description": "The session’s currency."
    },
    "checkout_session": {
      "type": "string",
      "description": "The session refunded."
    },
    "reason": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "requested_by_customer",
        "duplicate",
        "fraudulent",
        "overpaid",
        "other",
        null
      ]
    },
    "transaction": {
      "type": [
        "string",
        "null"
      ],
      "description": "The hash of the refund transfer, or any reference you keep."
    },
    "note": {
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "$ref": "#/$defs/Metadata"
    },
    "source": {
      "type": "string",
      "enum": [
        "api",
        "dashboard"
      ],
      "description": "Where it was recorded."
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "voided"
      ],
      "description": "`voided` once a refund recorded by mistake was voided: it no longer counts."
    },
    "voided_at": {
      "type": [
        "integer",
        "null"
      ],
      "description": "When it was voided. Unix seconds."
    },
    "created": {
      "type": "integer",
      "description": "When it was recorded. Unix seconds."
    }
  },
  "$defs": {
    "Metadata": {
      "type": "object",
      "description": "Up to 50 string values of your own, returned as given: keys up to 40 characters, values up to 500, 8 KB in all as JSON (a character outside ASCII counts as 6 bytes).",
      "maxProperties": 50,
      "propertyNames": {
        "maxLength": 40
      },
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ],
        "maxLength": 500
      }
    }
  }
}