{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xpoz-ai/json-schema/xpoz-ai-purchase-result-schema.json",
  "title": "PurchaseResult",
  "description": "Either the charge succeeded, or the card requires additional action (3DS) and the client must confirm the payment intent, then call the matching `/confirm` endpoint.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xpoz-ai-openapi.json#/components/schemas/PurchaseResult",
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "charged": {
          "type": "boolean",
          "const": true
        },
        "newBalance": {
          "type": "number"
        }
      },
      "required": [
        "charged",
        "newBalance"
      ]
    },
    {
      "type": "object",
      "properties": {
        "charged": {
          "type": "boolean",
          "const": false
        },
        "requiresAction": {
          "type": "boolean",
          "const": true
        },
        "paymentIntentClientSecret": {
          "type": "string"
        }
      },
      "required": [
        "charged",
        "requiresAction",
        "paymentIntentClientSecret"
      ]
    }
  ]
}