{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/paypal/json-schema/paypal-wallet-transaction-request-schema.json",
  "title": "WalletTransactionRequest",
  "description": "Defines the request object to create a wallet transaction.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/paypal-wallets-api-openapi.yml#/components/schemas/WalletTransactionRequest",
  "type": "object",
  "required": [
    "type"
  ],
  "properties": {
    "type": {
      "type": "string",
      "description": "Type of the wallet transaction applied on the wallet. Supported types are TOPUP, VOID.",
      "enum": [
        "TOPUP",
        "VOID"
      ],
      "x-enum-varnames": [
        "TOPUP",
        "VOID"
      ],
      "x-enum-description": [
        "Add funds to the wallet with the given credits.",
        "Deduct funds from the wallet with the given value."
      ]
    },
    "paid_credits": {
      "type": "string",
      "pattern": "^\\d+(\\.\\d+)?$",
      "description": "Number of paid credits to be added. Applicable only to TOPUP type of transaction"
    },
    "credits_to_void": {
      "type": "string",
      "pattern": "^\\d+(\\.\\d+)?$",
      "description": "Number of credits and Only for type VOID, this field need to be passed in request."
    },
    "granted_credits": {
      "type": "string",
      "pattern": "^\\d+(\\.\\d+)?$",
      "description": "Number of granted credits to be added. Applicable only to TOPUP type of transaction"
    },
    "metadata": {
      "type": "array",
      "description": "List of key-value pair contains the metadata about the wallet transaction.",
      "items": {
        "$ref": "#/$defs/StringMap"
      }
    }
  },
  "$defs": {
    "StringMap": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Name of the key"
        },
        "value": {
          "type": "string",
          "description": "Value associated with the key"
        }
      }
    }
  }
}