{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading"]},"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 validation requirements for PayPal payout data in your Android app."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The PayPal Android SDK validates payout data at multiple stages to ensure successful transactions. Understanding these validation rules helps you prevent errors and provide better user experiences."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"validation-stages","__idx":2},"children":["Validation stages"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Validation occurs at three key stages:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SDK initialisation"]},": Validates transaction data and configuration."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Component creation"]},": Validates component-specific configuration."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Payout submission"]},": Validates wallet details and payout parameters before sending to the backend."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"transaction-data-validation","__idx":3},"children":["Transaction data validation"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"amount-validation","__idx":4},"children":["Amount validation"]},{"$$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":"Rule"},"children":["Rule"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error"},"children":["Error"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Amount required"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Amount must be provided."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Validation error."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Positive value"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Amount must be greater than zero."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PO02"]},": \"Transaction amount should be greater than 0.\""]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Numeric value"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Amount must be a valid number."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Validation error."]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"// Valid amounts\ntransactionData = TransactionData(\n    amount = 100.0,    // Valid\n    amount = 0.01,     // Valid: minimum positive value\n    amount = 999999.99 // Valid\n)\n\n// Invalid amounts\ntransactionData = TransactionData(\n    amount = 0.0,      // Invalid: must be > 0\n    amount = -50.0     // Invalid: cannot be negative\n)\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"currency-validation","__idx":5},"children":["Currency validation"]},{"$$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":"Rule"},"children":["Rule"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error"},"children":["Error"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Currency required"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Currency must be provided."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Validation error."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Format"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Must be a valid 3-letter ISO currency code."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PO03"]},": \"Invalid currency code\"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Supported"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Must be supported by PayPal."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Validation error."]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"// Valid currencies\ntransactionData = TransactionData(\n    currency = \"USD\",  // Valid\n    currency = \"EUR\",  // Valid\n    currency = \"GBP\"   // Valid\n)\n\n// Invalid currencies\ntransactionData = TransactionData(\n    currency = \"\",      // Invalid: empty\n    currency = \"US\",    // Invalid: not 3 letters\n    currency = \"DOLLAR\" // Invalid: not ISO code\n)\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"entry-type-validation","__idx":6},"children":["Entry type validation"]},{"$$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":"Rule"},"children":["Rule"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error"},"children":["Error"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Entry type required"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Entry type must be provided."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Error during initialisation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Value"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Must be ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EntryType.Ecom"]}," for payouts."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Error during initialisation."]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"// Valid entry type for payouts\ntransactionData = TransactionData(\n    entryType = EntryType.Ecom  // Required for payouts\n)\n\n// Invalid entry types\ntransactionData = TransactionData(\n    entryType = EntryType.Moto  // Not supported for payouts\n)\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"intent-validation","__idx":7},"children":["Intent validation"]},{"$$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":"Rule"},"children":["Rule"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error"},"children":["Error"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Intent required"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Intent must be provided."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Error during initialisation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Value"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Must be ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TransactionIntentData(paypal = IntentType.Payout)"]}," for payouts."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Error during initialisation."]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"// Valid intent for payouts\ntransactionData = TransactionData(\n    intent = TransactionIntentData(paypal = IntentType.Payout)  // Required for payouts\n)\n\n// Invalid intents\ntransactionData = TransactionData(\n    intent = TransactionIntentData(paypal = IntentType.Purchase)      // Not for payouts\n    intent = TransactionIntentData(paypal = IntentType.Authorisation) // Not for payouts\n)\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"wallet-data-validation","__idx":8},"children":["Wallet data validation"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"paypal-wallet-validation","__idx":9},"children":["PayPal wallet validation"]},{"$$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":"Rule"},"children":["Rule"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error"},"children":["Error"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Email required"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PayPal email must be provided for withdrawal flow."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PO04"]},": \"Receiver cannot be empty\"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PayerId required"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PayPal payer ID must be provided for withdrawal flow."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PO04"]},": \"Payer ID is required for PayPal wallet payout\"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Email format"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Email must be valid format (max 127 characters)."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PO04"]},": \"Invalid email format\"."]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"// Valid PayPal wallet (withdrawal flow)\npaypalConfig = PaypalConfig(\n    payout = PayoutConfig(\n        proceedPayoutWithSdk = true,\n        paypalWallet = PayPalPayOutWalletConfig(\n            email = \"customer@example.com\",  // Required\n            payerId = \"PAYER_ID_XXX\"         // Required\n        )\n    )\n)\n\n// Invalid PayPal wallet\npaypalConfig = PaypalConfig(\n    payout = PayoutConfig(\n        proceedPayoutWithSdk = true,\n        paypalWallet = PayPalPayOutWalletConfig(\n            email = \"customer@example.com\",\n            payerId = \"\"  // Invalid: empty payer ID\n        )\n    )\n)\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"component-validation","__idx":10},"children":["Component validation"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"recipient-wallet-validation","__idx":11},"children":["Recipient wallet validation"]},{"$$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":"Rule"},"children":["Rule"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error"},"children":["Error"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Supported values"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Only \"Paypal\" is currently supported (case-sensitive)."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PO04"]},": \"Invalid recipient wallet. Only 'Paypal' is supported.\""]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Default value"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Empty/blank values default to \"Paypal\"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["N/A"]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"// Valid recipient wallet\nPayoutSubmissionComponentConfig(\n    recipientWallet = \"Paypal\"  // Valid (case-sensitive)\n)\n\nPayoutSubmissionComponentConfig(\n    recipientWallet = \"\"  // Valid: empty/blank defaults to \"Paypal\"\n)\n\n// Invalid recipient wallet\nPayoutSubmissionComponentConfig(\n    recipientWallet = \"Venmo\"   // Not supported on Android\n)\n\nPayoutSubmissionComponentConfig(\n    recipientWallet = \"paypal\"  // Invalid: case-sensitive (must be \"Paypal\")\n)\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"validation-error-codes","__idx":12},"children":["Validation error codes"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"payout-error-codes","__idx":13},"children":["Payout error codes"]},{"$$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":"Solution"},"children":["Solution"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PO02"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transaction amount should be greater than 0."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provide a positive amount value."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PO03"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid currency code."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use a valid 3-letter ISO currency code."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PO04"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid recipient."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ensure ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paypalWallet.email"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paypalWallet.payerId"]}," are provided correctly."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PO07"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid merchant transaction date."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use ISO 8601 format (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2025-10-28T10:00:00Z"]},")."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"validation-best-practices","__idx":14},"children":["Validation best practices"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"validate-early","__idx":15},"children":["Validate early"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Validate data before SDK initialisation:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"fun validatePayoutData(amount: Double, currency: String): ValidationResult {\n    return when {\n        amount <= 0 -> ValidationResult(\n            isValid = false,\n            message = \"Amount must be greater than zero\"\n        )\n        currency.length != 3 -> ValidationResult(\n            isValid = false,\n            message = \"Currency must be 3-letter ISO code\"\n        )\n        else -> ValidationResult(isValid = true)\n    }\n}\n\n// Use validation before initialisation\nval validation = validatePayoutData(amount, currency)\nif (!validation.isValid) {\n    showError(validation.message)\n    return\n}\n\n// Proceed with SDK initialisation\nval pxpCheckout = PxpCheckout.builder()\n    .withConfig(config)\n    .build()\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"provide-clear-error-messages","__idx":16},"children":["Provide clear error messages"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Show user-friendly error messages:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"onError = { error ->\n    val userMessage = when (error.errorCode) {\n        \"PO02\" -> \"The payout amount must be greater than zero.\"\n        \"PO03\" -> \"Please specify a valid currency.\"\n        \"PO04\" -> \"Please verify your PayPal account information.\"\n        \"PO07\" -> \"Invalid transaction date.\"\n        else -> \"An error occurred: ${error.errorReason}\"\n    }\n    \n    showError(userMessage)\n}\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"log-validation-errors","__idx":17},"children":["Log validation errors"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implement comprehensive error logging:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"onError = { error ->\n    // Log for debugging\n    Log.e(\"Payout\", \"\"\"\n        Validation error occurred:\n        Code: ${error.errorCode}\n        Reason: ${error.errorReason}\n        HTTP Status: ${error.httpStatusCode}\n        Correlation ID: ${error.correlationId}\n    \"\"\".trimIndent())\n    \n    // Track in analytics\n    trackEvent(\"payout_validation_error\", mapOf(\n        \"errorCode\" to error.errorCode,\n        \"errorReason\" to error.errorReason\n    ))\n    \n    // Show user-friendly message\n    showError(getUserFriendlyMessage(error))\n}\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"handle-validation-in-onprepayoutsubmit","__idx":18},"children":["Handle validation in onPrePayoutSubmit"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Perform custom validation before payout:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"onPrePayoutSubmit = {\n    // Validate balance\n    val balance = getUserBalance()\n    if (balance < payoutAmount) {\n        showError(\"Insufficient balance. Available: $$balance\")\n        return@PayoutSubmissionComponentConfig PrePayoutSubmitResult(isApproved = false)\n    }\n    \n    // Validate daily limit\n    val dailyTotal = getTodayPayoutTotal()\n    if (dailyTotal + payoutAmount > DAILY_LIMIT) {\n        showError(\"Daily payout limit exceeded\")\n        return@PayoutSubmissionComponentConfig PrePayoutSubmitResult(isApproved = false)\n    }\n    \n    // Validate minimum payout\n    if (payoutAmount < MINIMUM_PAYOUT) {\n        showError(\"Minimum payout amount is $$MINIMUM_PAYOUT\")\n        return@PayoutSubmissionComponentConfig PrePayoutSubmitResult(isApproved = false)\n    }\n    \n    // All validations passed\n    PrePayoutSubmitResult(isApproved = true)\n}\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"custom-validation-rules","__idx":19},"children":["Custom validation rules"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implement your own business rules:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"data class PayoutValidationRules(\n    val minimumAmount: Double = 10.0,\n    val maximumAmount: Double = 10000.0,\n    val dailyLimit: Double = 5000.0,\n    val requiredVerificationLevel: Int = 2\n)\n\nfun validatePayout(\n    amount: Double,\n    customerVerificationLevel: Int,\n    todayTotal: Double\n): ValidationResult {\n    val rules = PayoutValidationRules()\n    \n    return when {\n        amount < rules.minimumAmount -> ValidationResult(\n            isValid = false,\n            message = \"Minimum payout is $${rules.minimumAmount}\"\n        )\n        amount > rules.maximumAmount -> ValidationResult(\n            isValid = false,\n            message = \"Maximum payout is $${rules.maximumAmount}\"\n        )\n        todayTotal + amount > rules.dailyLimit -> ValidationResult(\n            isValid = false,\n            message = \"Daily limit of $${rules.dailyLimit} would be exceeded\"\n        )\n        customerVerificationLevel < rules.requiredVerificationLevel -> ValidationResult(\n            isValid = false,\n            message = \"Account verification required for payouts\"\n        )\n        else -> ValidationResult(isValid = true)\n    }\n}\n","lang":"kotlin"},"children":[]}]},"headings":[{"value":"Data validation","id":"data-validation","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Validation stages","id":"validation-stages","depth":2},{"value":"Transaction data validation","id":"transaction-data-validation","depth":2},{"value":"Amount validation","id":"amount-validation","depth":3},{"value":"Currency validation","id":"currency-validation","depth":3},{"value":"Entry type validation","id":"entry-type-validation","depth":3},{"value":"Intent validation","id":"intent-validation","depth":3},{"value":"Wallet data validation","id":"wallet-data-validation","depth":2},{"value":"PayPal wallet validation","id":"paypal-wallet-validation","depth":3},{"value":"Component validation","id":"component-validation","depth":2},{"value":"Recipient wallet validation","id":"recipient-wallet-validation","depth":3},{"value":"Validation error codes","id":"validation-error-codes","depth":2},{"value":"Payout error codes","id":"payout-error-codes","depth":3},{"value":"Validation best practices","id":"validation-best-practices","depth":2},{"value":"Validate early","id":"validate-early","depth":3},{"value":"Provide clear error messages","id":"provide-clear-error-messages","depth":3},{"value":"Log validation errors","id":"log-validation-errors","depth":3},{"value":"Handle validation in onPrePayoutSubmit","id":"handle-validation-in-onprepayoutsubmit","depth":3},{"value":"Custom validation rules","id":"custom-validation-rules","depth":2}],"frontmatter":{"seo":{"title":"Data validation"}},"lastModified":"2026-02-26T12:14:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/android/paypal/payouts/data-validation","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}