{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading","admonition"]},"type":"markdown"},"seo":{"title":"Data validation","description":"Transform your commerce with PXP's unified platform—seamless payments, real-time insights, and global growth in one powerful integration.","lang":"en-UK","siteUrl":"https://developer.pxp.io","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"data-validation","__idx":0},"children":["Data validation"]},{"$$mdtype":"Tag","name":"SubHeading","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Learn about built-in validation and implement additional scenarios for Paze web."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Paze component validates configuration, identity data, and transaction parameters before and during the payment flow. Validation runs at multiple stages:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Component initialisation:"]}," Session configuration, currency, and client presentation settings"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Presentment:"]}," Identity validation when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}," and/or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," are provided; dynamic mode requires both"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Checkout:"]}," Amount, billing preferences, shipping countries, cobrand configuration, and checkout identity (phone takes precedence over email when both are set)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Complete:"]}," Transaction type, amount, and currency for the Paze ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["complete()"]}," call"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Merchant callbacks:"]}," Optional custom validation before checkout and merchant approval after checkout"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If validation fails, the SDK throws a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BaseSdkException"]}," with a structured error code in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK12XX"]}," range."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"built-in-validation","__idx":2},"children":["Built-in validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["By default, the Paze component validates that:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["allowedFundingTypes.wallets.paze.clientId"]}," is present in the session."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The transaction currency is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["USD"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientName"]}," is 50 characters or fewer."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["siteName"]}," (brand name) is 50 characters or fewer."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentDescription"]}," (statement descriptor) is 25 characters or fewer."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Email addresses are valid RFC 5322 format and 128 characters or fewer when provided."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Phone numbers match ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," followed by 10 digits (11 characters total, no ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+"]},") when provided."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The transaction amount is greater than 0."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["billingPreference"]}," is one of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ALL"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ZIP_COUNTRY"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NONE"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["acceptedShippingCountries"]}," use valid ISO 3166-1 alpha-2 codes."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Each cobrand entry has a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cobrandName"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For dynamic presentment, both ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," are provided."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["When both ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," are set, the SDK passes both to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["canCheckout()"]}," in dynamic mode, but sends only ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," to Paze ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["checkout()"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"checkout-identity-precedence","__idx":3},"children":["Checkout identity precedence"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Component identity (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]},") is used for Paze presentment and checkout, not for Unity authorisation (that comes from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]},"). At checkout:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Configuration"},"children":["Configuration"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Sent to Paze checkout()"},"children":["Sent to Paze ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["checkout()"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Phone only"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mobileNumber"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Email only"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Both set"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," only (email omitted)"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In dynamic mode you must supply both fields for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["canCheckout()"]}," eligibility, even though checkout uses phone when both are present."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Paze component returns structured error codes for validation failures:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error code"},"children":["Error code"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Common causes"},"children":["Common causes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1202"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Missing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session.allowedFundingTypes.wallets.paze.clientId"]},"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Paze not configured in Unity Portal, or session created before configuration."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1203"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientName"]}," exceeds 50 characters."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientName"]}," on SDK initialisation is too long."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1204"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["siteName"]}," exceeds 50 characters."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["siteName"]}," on SDK initialisation is too long."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1205"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentDescription"]}," exceeds 25 characters."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Statement descriptor on component config is too long."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1207"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["canCheckout()"]}," did not return an eligibility result."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Paze SDK returned an unexpected response during dynamic presentment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1208"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Dynamic presentment requires both email and phone."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["buttonRenderMode: \"dynamic\""]}," without both identity fields."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1209"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Email address exceeds 128 characters."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}," value is too long."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1210"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Email address format is invalid."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}," is not a valid RFC 5322 address."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1211"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Phone number exceeds 15 characters."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," value is too long."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1212"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Phone number format is invalid."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," is not a US E.164 number without ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1213"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Currency not supported."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transaction currency is not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["USD"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1222"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]}," exceeds 255 characters."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional component ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]}," is too long."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1223"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionType"]}," for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["complete()"]},"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Internal complete request is not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PURCHASE"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1224"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionOptions"]}," is required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Complete request is missing transaction options."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1225"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionValue"]}," is required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Complete request is missing transaction value."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1226"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["billingPreference"]}," on component config."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Value is not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ALL"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ZIP_COUNTRY"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NONE"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1227"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["billingPreference"]}," in complete transaction options."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionOptions.billingPreference"]}," is not a supported value."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1228"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payloadTypeIndicator"]},"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionOptions.payloadTypeIndicator"]}," is not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PAYMENT"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1229"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transaction amount must be greater than 0."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Zero or negative amount at checkout or in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["complete()"]}," request."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1230"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid transaction currency code."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionCurrencyCode"]}," is not a 3-letter ISO code."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1231"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid shipping country codes."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["acceptedShippingCountries"]}," contains non-ISO alpha-2 codes."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1232"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Cobrand name is required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A cobrand entry is missing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cobrandName"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"validation-example","__idx":4},"children":["Validation example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import BaseSdkException from '@pxpio/web-components-sdk/src/types/sdkExceptions/BaseSdkException';\n\nconst pazeButton = pxpSdk.create('paze-button', {\n  buttonRenderMode: 'dynamic',\n  emailAddress: 'customer@example.com',\n  phoneNumber: '15551234567',\n\n  onError: (error: BaseSdkException) => {\n    switch (error.ErrorCode) {\n      case 'SDK1208':\n        console.error('Both email and phone are required for dynamic presentment');\n        break;\n      case 'SDK1210':\n        console.error('Invalid email format:', error.message);\n        showError('Please enter a valid email address.');\n        break;\n      case 'SDK1212':\n        console.error('Invalid phone format:', error.message);\n        showError('Please enter a valid US phone number.');\n        break;\n      case 'SDK1213':\n        console.error('Paze only supports USD');\n        showError('Paze is not available for this currency.');\n        break;\n      default:\n        console.error('Paze error:', error.ErrorCode, error.message);\n    }\n  }\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"custom-validation","__idx":5},"children":["Custom validation"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"pre-checkout-validation","__idx":6},"children":["Pre-checkout validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCustomValidation"]}," to run merchant-side checks before the Paze checkout popup opens. Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," to prevent checkout from starting."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const pazeButton = pxpSdk.create('paze-button', {\n  onCustomValidation: async () => {\n    // Validate cart state before opening Paze\n    if (!cartHasItems()) {\n      showError('Your cart is empty.');\n      return false;\n    }\n\n    if (!termsAccepted()) {\n      showError('Please accept the terms and conditions.');\n      return false;\n    }\n\n    return true;\n  }\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"post-checkout-merchant-validation","__idx":7},"children":["Post-checkout merchant validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutComplete"]}," to inspect checkout data and approve or reject before the SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["complete()"]},". Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," to treat the checkout as incomplete."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const pazeButton = pxpSdk.create('paze-button', {\n  onCheckoutComplete: async (result) => {\n    const decoded = result.checkoutDecodedResponse;\n\n    const isValid = await validateCheckoutOnBackend({\n      sessionId: decoded?.sessionId,\n      consumerEmail: decoded?.consumer?.emailAddress,\n      cardLast4: decoded?.maskedCard?.panLastFour,\n      cardNetwork: decoded?.maskedCard?.paymentCardNetwork\n    });\n\n    if (!isValid) {\n      return false;\n    }\n\n    return true;\n  },\n\n  onCheckoutIncomplete: async (result) => {\n    console.log('Checkout not completed:', result.reason);\n    showMessage('Payment was not completed. Please try again.');\n  }\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"pre-decryption-validation","__idx":8},"children":["Pre-decryption validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreDecryption"]}," to control whether the SDK decrypts the secured payload. Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," to handle decryption on your backend."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const pazeButton = pxpSdk.create('paze-button', {\n  onPreDecryption: async () => {\n    // Return false for manual backend decryption\n    return false;\n  },\n\n  onComplete: async (result) => {\n    const securedPayload = result.completeDecodedResponse?.securedPayload;\n    // Send securedPayload to your backend for decryption\n    await fetch('/api/paze/decrypt', {\n      method: 'POST',\n      headers: { 'Content-Type': 'application/json' },\n      body: JSON.stringify({ securedPayload })\n    });\n  }\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"pre-authorisation-validation","__idx":9},"children":["Pre-authorisation validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," to provide risk screening data or abort the transaction before submission."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const pazeButton = pxpSdk.create('paze-button', {\n  onPreAuthorisation: async () => {\n    // Return false to cancel authorisation\n    if (fraudCheckFailed()) {\n      return false;\n    }\n\n    // Optionally provide Kount risk screening data\n    return {\n      riskScreeningData: {\n        performRiskScreening: true,\n        userIp: '192.168.1.100',\n        account: {\n          id: 'shopper-123',\n          creationDateTime: '2024-01-15T10:30:00.000Z'\n        }\n      }\n    };\n  }\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"identity-validation-rules","__idx":10},"children":["Identity validation rules"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"email-address","__idx":11},"children":["Email address"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Rule"},"children":["Rule"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Requirement"},"children":["Requirement"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Format"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Valid RFC 5322 email address"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Maximum length"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["128 characters"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Static presentment"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Optional; validated when provided"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Dynamic presentment"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Required alongside ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"phone-number","__idx":12},"children":["Phone number"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Rule"},"children":["Rule"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Requirement"},"children":["Requirement"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Format"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["US E.164 without ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+"]}," prefix: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," followed by 10 digits"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Length"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Exactly 11 characters (e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["15551234567"]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Maximum length"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["15 characters (values longer than 15 throw ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1211"]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Static presentment"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Optional; validated when provided"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Dynamic presentment"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Required alongside ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Phone numbers must not include the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+"]}," prefix or formatting characters. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["15551234567"]},", not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+1 (555) 123-4567"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"whats-next","__idx":13},"children":["What's next?"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/web/paze/configuration"},"children":["Configuration"]},":"]}," View the full configuration reference."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/web/paze/events"},"children":["Events"]},":"]}," Read about callback payloads and event data structures."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/web/paze/troubleshooting"},"children":["Troubleshooting"]},":"]}," Diagnose validation and presentment issues."]}]}]},"headings":[{"value":"Data validation","id":"data-validation","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Built-in validation","id":"built-in-validation","depth":2},{"value":"Checkout identity precedence","id":"checkout-identity-precedence","depth":3},{"value":"Validation example","id":"validation-example","depth":3},{"value":"Custom validation","id":"custom-validation","depth":2},{"value":"Pre-checkout validation","id":"pre-checkout-validation","depth":3},{"value":"Post-checkout merchant validation","id":"post-checkout-merchant-validation","depth":3},{"value":"Pre-decryption validation","id":"pre-decryption-validation","depth":3},{"value":"Pre-authorisation validation","id":"pre-authorisation-validation","depth":3},{"value":"Identity validation rules","id":"identity-validation-rules","depth":2},{"value":"Email address","id":"email-address","depth":3},{"value":"Phone number","id":"phone-number","depth":3},{"value":"What's next?","id":"whats-next","depth":2}],"frontmatter":{"seo":{"title":"Data validation"}},"lastModified":"2026-06-22T13:13:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/web/paze/data-validation","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}