{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/emporix/main/json-schema/emporix-authorize-payment-request-schema.json",
  "title": "authorizePaymentRequest",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emporix-payment-gateway-openapi.yml#/components/schemas/authorizePaymentRequest",
  "allOf": [
    {
      "$ref": "#/$defs/authorizeFrontendPaymentRequest"
    },
    {
      "type": "object",
      "properties": {
        "amountToAuthorize": {
          "type": "number",
          "description": "Amount that should be authorized."
        },
        "currency": {
          "type": "string",
          "description": "Currency for the amount that should be authorized."
        }
      }
    }
  ],
  "$defs": {
    "authorizeFrontendPaymentRequest": {
      "title": "authorizeFrontendPaymentRequest",
      "allOf": [
        {
          "$ref": "#/$defs/initializePaymentRequest"
        },
        {
          "type": "object",
          "properties": {
            "threeDSToken": {
              "type": "string",
              "description": "Contains a token generated during the 3DS authentication process."
            },
            "browserInfo": {
              "type": "string",
              "description": "Holds information related to the user's web browser."
            },
            "clientIP": {
              "type": "string",
              "description": "Stores the IP address of the client or user making the request."
            }
          }
        }
      ]
    },
    "initializePaymentRequest": {
      "title": "initializePaymentRequest",
      "type": "object",
      "properties": {
        "order": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Identifier of an order for which the payment should be authorized."
            }
          }
        },
        "paymentModeId": {
          "type": "string",
          "description": "Identifier of a payment mode configured in the payment-gateway service for a given tenant."
        },
        "creditCardToken": {
          "type": "string",
          "description": "Indicates a payment method token, usually generated on a frontend site, when an user provides a credit card information."
        }
      }
    }
  }
}