{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/payments-ai/json-schema/payments-ai-public-api-create-transaction-request-schema.json",
  "title": "PublicApiCreateTransactionRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/payments-ai-transactions-api-openapi.yml#/components/schemas/PublicApiCreateTransactionRequest",
  "type": "object",
  "required": [
    "amount",
    "currency",
    "confirmationToken",
    "returnUrl"
  ],
  "properties": {
    "amount": {
      "allOf": [
        {
          "$ref": "#/$defs/SharedTypes.MoneyAmountValue"
        }
      ],
      "description": "Charge amount in major currency units. Minimums are enforced per currency."
    },
    "currency": {
      "$ref": "#/$defs/SharedTypes.CurrencyCode"
    },
    "confirmationToken": {
      "type": "string",
      "description": "Payment token (`ctok_…`) from the client SDK. Never send card numbers or PANs."
    },
    "returnUrl": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "recurring": {
      "$ref": "#/$defs/PublicApiCreateTransactionRecurring"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Optional string map stored with the charge and in audit logs. At most 25 keys; keys ≤64 chars, values ≤500 chars. Do not send card numbers, CVV, or PAN-like data."
    }
  },
  "$defs": {
    "PublicApiCreateTransactionRecurring": {
      "type": "object",
      "required": [
        "amount",
        "intervalDays"
      ],
      "properties": {
        "amount": {
          "$ref": "#/$defs/SharedTypes.MoneyAmountValue"
        },
        "intervalDays": {
          "type": "integer",
          "format": "int32",
          "minimum": 2
        },
        "trialDays": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        }
      }
    },
    "SharedTypes.CurrencyCode": {
      "type": "string",
      "pattern": "^[a-z]{3}$",
      "description": "ISO 4217 currency code. Always lowercase (e.g. 'usd', 'eur')."
    },
    "SharedTypes.MoneyAmountValue": {
      "type": "number",
      "format": "decimal",
      "description": "Decimal money amount for financial values."
    }
  }
}