{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/paytrail/json-schema/paytrail-add-card-form-request-schema.json",
  "title": "AddCardFormRequest",
  "description": "Add card form request",
  "x-generated": "2026-11-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/paytrail-openapi.yml#/components/schemas/AddCardFormRequest",
  "type": "object",
  "required": [
    "checkout-account",
    "checkout-algorithm",
    "checkout-redirect-success-url",
    "checkout-redirect-cancel-url"
  ],
  "properties": {
    "checkout-account": {
      "type": "integer",
      "description": "Merchant ID"
    },
    "checkout-algorithm": {
      "type": "string",
      "description": "HMAC algorithm",
      "enum": [
        "sha256",
        "sha512"
      ]
    },
    "checkout-method": {
      "type": "string",
      "description": "HTTP method of the request",
      "enum": [
        "GET",
        "POST"
      ]
    },
    "checkout-nonce": {
      "type": "string",
      "description": "Unique random identifier"
    },
    "checkout-timestamp": {
      "type": "string",
      "description": "Current timestamp in ISO 8601 format",
      "format": "date-time"
    },
    "checkout-redirect-success-url": {
      "type": "string",
      "format": "url",
      "description": "Merchant's url for user redirect on successful card addition"
    },
    "checkout-redirect-cancel-url": {
      "type": "string",
      "format": "url",
      "description": "Merchant's url for user redirect on failed card addition"
    },
    "checkout-callback-success-url": {
      "type": "string",
      "format": "url",
      "description": "Merchant's url called on successful card addition"
    },
    "checkout-callback-cancel-url": {
      "type": "string",
      "format": "url",
      "description": "Merchant's url called on failed card addition"
    },
    "language": {
      "type": "string",
      "enum": [
        "FI",
        "SV",
        "EN"
      ],
      "description": "Alpha-2 language code for the card addition form"
    },
    "signature": {
      "type": "string",
      "description": "HMAC signature calculated over the request headers and payload"
    }
  }
}