{"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 built-in validation and error handling for payout components."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The payout components include comprehensive validation to ensure data integrity and compliance with PayPal and Venmo requirements. All built-in validation is performed before executing payouts. If validation fails, the SDK will throw a specific exception with detailed error information."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can handle these errors through the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," callback and display appropriate messages to your customers."]},{"$$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 payout components validate that:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Required fields are provided (amount, currency, recipient wallet details)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Amount is a valid positive number greater than zero."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Currency codes are valid 3-letter ISO 4217 codes."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Email addresses are properly formatted."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Phone numbers contain only numeric characters (Venmo)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Recipient types match the provided receiver format."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Field lengths don't exceed maximum limits."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Venmo payouts use USD currency (the only supported currency for Venmo)."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"error-codes-reference","__idx":3},"children":["Error codes reference"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"sdk-configuration-errors","__idx":4},"children":["SDK configuration errors"]},{"$$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":{"width":"15%","data-label":"Error code"},"children":["Error code "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"35%","data-label":"Exception"},"children":["Exception "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"25%","data-label":"Description"},"children":["Description "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"25%","data-label":"Resolution"},"children":["Resolution "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK1000"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalConfigRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PayPal configuration is required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ensure ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paypalConfig"]}," is provided in SDK initialisation."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"amount-validation-errors","__idx":5},"children":["Amount validation errors"]},{"$$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":{"width":"15%","data-label":"Error code"},"children":["Error code "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"35%","data-label":"Exception"},"children":["Exception "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"25%","data-label":"Description"},"children":["Description "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"25%","data-label":"Resolution"},"children":["Resolution "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0810"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutAmountInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Amount must be a valid number."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provide a valid numeric amount."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0811"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutAmountNotPositiveException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Amount must be a positive number greater than 0."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ensure amount is greater than zero."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0812"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutAmountRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Amount is required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provide an amount in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData.amount"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"currency-validation-errors","__idx":6},"children":["Currency validation errors"]},{"$$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":{"width":"15%","data-label":"Error code"},"children":["Error code "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"35%","data-label":"Exception"},"children":["Exception "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"25%","data-label":"Description"},"children":["Description "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"25%","data-label":"Resolution"},"children":["Resolution "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0813"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutCurrencyRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Currency code must be a non-empty string."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provide a currency code in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData.currency"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0814"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutCurrencyLengthInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Currency code must be a 3-letter ISO 4217 code."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use a valid 3-letter code like ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["USD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EUR"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GBP"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0815"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutCurrencyCodeInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid currency code."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use a valid ISO 4217 currency code."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"paypal-receiver-validation-errors","__idx":7},"children":["PayPal receiver validation errors"]},{"$$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":{"width":"15%","data-label":"Error code"},"children":["Error code "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"35%","data-label":"Exception"},"children":["Exception "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"25%","data-label":"Description"},"children":["Description "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"25%","data-label":"Resolution"},"children":["Resolution "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0803"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutReceiverRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Receiver value is required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provide a PayPal email or Payer ID."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0804"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutReceiverTypeInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid receiver type."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Email"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Phone"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalId"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UserHandle"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0805"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutReceiverTypeEmailOnlyException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Receiver type must be ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Email"]},"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PayPal wallet requires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Email"]}," as receiver type."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0806"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutWalletInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid wallet value."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Paypal"]}," for PayPal payouts."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0807"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutWalletRequiresEmailException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Receiver type must be ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Email"]}," when wallet is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Paypal"]},"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ensure receiver type is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Email"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0808"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutEmailInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid email format."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provide a valid email address."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0809"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutPayerIdRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PayPal Payer ID is required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provide a PayPal Payer ID or email."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0816"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutReceiverTypeRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Receiver type is required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Specify the receiver type (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Email"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalId"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0818"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutFieldLengthExceededException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Field exceeds maximum length."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Reduce the field length to within limits."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"venmo-receiver-validation-errors","__idx":8},"children":["Venmo receiver validation errors"]},{"$$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":{"width":"15%","data-label":"Error code"},"children":["Error code "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"35%","data-label":"Exception"},"children":["Exception "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"25%","data-label":"Description"},"children":["Description "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"25%","data-label":"Resolution"},"children":["Resolution "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0900"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VenmoPayoutWalletInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Venmo wallet is required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provide ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["venmoWallet"]}," configuration."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0901"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VenmoPayoutReceiverRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Receiver value is required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provide a Venmo receiver (email, phone, or handle)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0902"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VenmoPayoutRecipientTypeRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Venmo recipient type is required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Specify ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["recipientType"]}," as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Email"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Phone"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UserHandle"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0903"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VenmoPayoutRecipientTypeInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid recipient type."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Email"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Phone"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UserHandle"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0904"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VenmoPayoutPhoneInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid phone format."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Phone number must contain only numeric characters."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0905"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VenmoPayoutCurrencyInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Venmo only supports USD currency."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["USD"]}," for Venmo payouts."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"payout-submission-errors","__idx":9},"children":["Payout submission errors"]},{"$$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":{"width":"15%","data-label":"Error code"},"children":["Error code "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"35%","data-label":"Exception"},"children":["Exception "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"25%","data-label":"Description"},"children":["Description "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"25%","data-label":"Resolution"},"children":["Resolution "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK1001"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutRecipientWalletRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Recipient wallet is required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Specify ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["recipientWallet"]}," as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Paypal"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Venmo"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK1002"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutReceiverAndRecipientTypeRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Receiver and recipient type are required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provide both receiver value and recipient type."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK1003"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UnsupportedPayoutRecipientWalletException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Unsupported recipient wallet."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Paypal"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Venmo"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK1004"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutNoteTooLongException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payout note exceeds maximum length."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Notes longer than 4000 characters will be automatically truncated with a console warning."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"error-handling","__idx":10},"children":["Error handling"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"basic-error-handling","__idx":11},"children":["Basic error handling"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Handle validation errors through the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," callback:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const submitConfig = {\n  recipientWallet: \"Paypal\",\n  \n  onError: (error) => {\n    console.error(\"Payout error:\", error.ErrorCode, error.message);\n    \n    // Display user-friendly message\n    showErrorMessage(error.message);\n  }\n};\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"comprehensive-error-handling","__idx":12},"children":["Comprehensive error handling"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implement detailed error handling based on error codes:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const submitConfig = {\n  recipientWallet: \"Paypal\",\n  \n  onError: (error) => {\n    console.error(\"Payout error:\", error);\n    \n    let userMessage: string;\n    let action: string = \"\";\n    \n    switch (error.ErrorCode) {\n      // Amount errors\n      case \"SDK0810\":\n        userMessage = \"Invalid withdrawal amount.\";\n        action = \"Please enter a valid number.\";\n        break;\n      case \"SDK0811\":\n        userMessage = \"Withdrawal amount must be greater than zero.\";\n        action = \"Please enter a positive amount.\";\n        break;\n      case \"SDK0812\":\n        userMessage = \"Withdrawal amount is missing.\";\n        action = \"Please contact support.\";\n        break;\n        \n      // Currency errors\n      case \"SDK0813\":\n      case \"SDK0814\":\n      case \"SDK0815\":\n        userMessage = \"Invalid currency configuration.\";\n        action = \"Please contact support.\";\n        break;\n        \n      // PayPal receiver errors\n      case \"SDK0803\":\n      case \"SDK0809\":\n        userMessage = \"PayPal account information is missing.\";\n        action = \"Please link your PayPal account.\";\n        break;\n      case \"SDK0808\":\n        userMessage = \"Invalid PayPal email address.\";\n        action = \"Please update your PayPal email.\";\n        break;\n      case \"SDK0818\":\n        userMessage = \"Account information exceeds maximum length.\";\n        action = \"Please contact support.\";\n        break;\n        \n      // Venmo receiver errors\n      case \"SDK0901\":\n        userMessage = \"Venmo account information is missing.\";\n        action = \"Please link your Venmo account.\";\n        break;\n      case \"SDK0903\":\n        userMessage = \"Invalid Venmo recipient type.\";\n        action = \"Please contact support.\";\n        break;\n      case \"SDK0904\":\n        userMessage = \"Invalid phone number format.\";\n        action = \"Please update your Venmo phone number.\";\n        break;\n      case \"SDK0905\":\n        userMessage = \"Venmo only supports USD withdrawals.\";\n        action = \"Please select a different payout method.\";\n        break;\n        \n      // Payout submission errors\n      case \"SDK1001\":\n      case \"SDK1002\":\n      case \"SDK1003\":\n        userMessage = \"Invalid payout configuration.\";\n        action = \"Please contact support.\";\n        break;\n      case \"SDK1004\":\n        userMessage = \"Payout note is too long.\";\n        action = \"Notes longer than 4000 characters will be truncated.\";\n        break;\n        \n      // Configuration errors\n      case \"SDK1000\":\n        userMessage = \"Payout is not configured correctly.\";\n        action = \"Please contact support.\";\n        break;\n        \n      default:\n        userMessage = \"An error occurred during withdrawal.\";\n        action = \"Please try again or contact support.\";\n    }\n    \n    // Display error to user\n    showErrorDialog({\n      title: \"Withdrawal Error\",\n      message: userMessage,\n      action: action,\n      errorCode: error.ErrorCode\n    });\n    \n    // Log for debugging\n    logError(\"payout_validation_error\", {\n      errorCode: error.ErrorCode,\n      errorMessage: error.message,\n      timestamp: new Date().toISOString()\n    });\n  }\n};\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"custom-validation","__idx":13},"children":["Custom validation"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"pre-payout-validation","__idx":14},"children":["Pre-payout validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Run validation before the payout is executed to catch issues early:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const submitConfig = {\n  recipientWallet: \"Paypal\",\n  \n  onPrePayoutSubmit: async () => {\n    try {\n      // 1. Validate withdrawal limits\n      const limitsCheck = await validateWithdrawalLimits({\n        userId: getCurrentUserId(),\n        amount: getPayoutAmount(),\n        currency: getPayoutCurrency()\n      });\n      \n      if (!limitsCheck.valid) {\n        showError(`Withdrawal limit exceeded. Maximum: ${limitsCheck.maxAmount}`);\n        return { isApproved: false };\n      }\n      \n      // 2. Verify sufficient balance\n      const balanceCheck = await verifyBalance({\n        userId: getCurrentUserId(),\n        amount: getPayoutAmount()\n      });\n      \n      if (!balanceCheck.sufficient) {\n        showError(\"Insufficient balance for this withdrawal.\");\n        return { isApproved: false };\n      }\n      \n      // 3. Compliance check\n      const complianceCheck = await performComplianceCheck({\n        userId: getCurrentUserId(),\n        amount: getPayoutAmount(),\n        recipientType: getRecipientType()\n      });\n      \n      if (!complianceCheck.passed) {\n        showError(\"This withdrawal requires additional verification.\");\n        return { isApproved: false };\n      }\n      \n      // 4. Fraud prevention\n      const fraudCheck = await checkFraudIndicators({\n        userId: getCurrentUserId(),\n        amount: getPayoutAmount(),\n        ipAddress: getClientIP(),\n        deviceFingerprint: getDeviceFingerprint()\n      });\n      \n      if (fraudCheck.riskLevel === \"HIGH\") {\n        showError(\"This withdrawal has been flagged for review.\");\n        return { isApproved: false };\n      }\n      \n      // All validations passed\n      return { isApproved: true };\n      \n    } catch (error) {\n      console.error(\"Pre-payout validation failed:\", error);\n      showError(\"Unable to validate withdrawal. Please try again.\");\n      return { isApproved: false };\n    }\n  }\n};\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"validate-withdrawal-limits","__idx":15},"children":["Validate withdrawal limits"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Check if the payout amount is within allowed limits:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"async function validateWithdrawalLimits(userId: string, amount: number, currency: string) {\n  // Get user's withdrawal limits\n  const limits = await getUserWithdrawalLimits(userId);\n  \n  // Check daily limit\n  const todayWithdrawals = await getTodayWithdrawals(userId);\n  const dailyTotal = todayWithdrawals.reduce((sum, w) => sum + w.amount, 0);\n  \n  if (dailyTotal + amount > limits.dailyLimit) {\n    return {\n      valid: false,\n      reason: \"daily_limit_exceeded\",\n      remaining: limits.dailyLimit - dailyTotal\n    };\n  }\n  \n  // Check monthly limit\n  const monthlyWithdrawals = await getMonthlyWithdrawals(userId);\n  const monthlyTotal = monthlyWithdrawals.reduce((sum, w) => sum + w.amount, 0);\n  \n  if (monthlyTotal + amount > limits.monthlyLimit) {\n    return {\n      valid: false,\n      reason: \"monthly_limit_exceeded\",\n      remaining: limits.monthlyLimit - monthlyTotal\n    };\n  }\n  \n  // Check minimum withdrawal amount\n  if (amount < limits.minimumWithdrawal) {\n    return {\n      valid: false,\n      reason: \"below_minimum\",\n      minimum: limits.minimumWithdrawal\n    };\n  }\n  \n  // Check maximum single withdrawal\n  if (amount > limits.maximumSingleWithdrawal) {\n    return {\n      valid: false,\n      reason: \"exceeds_maximum\",\n      maximum: limits.maximumSingleWithdrawal\n    };\n  }\n  \n  return { valid: true };\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"validate-recipient-account","__idx":16},"children":["Validate recipient account"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Verify the recipient account is valid and active:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"async function validateRecipientAccount(walletType: string, receiver: string) {\n  if (walletType === \"Paypal\") {\n    // Validate PayPal email format\n    const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n    if (!emailRegex.test(receiver)) {\n      return {\n        valid: false,\n        reason: \"invalid_email_format\"\n      };\n    }\n    \n    // Check if account is verified (if you have this capability)\n    const accountStatus = await checkPayPalAccountStatus(receiver);\n    if (accountStatus.restricted) {\n      return {\n        valid: false,\n        reason: \"account_restricted\"\n      };\n    }\n  }\n  \n  if (walletType === \"Venmo\") {\n    // Validate based on recipient type\n    const recipientType = getVenmoRecipientType();\n    \n    if (recipientType === \"Phone\") {\n      // Phone must be numeric\n      const phoneRegex = /^\\+?[0-9]+$/;\n      if (!phoneRegex.test(receiver)) {\n        return {\n          valid: false,\n          reason: \"invalid_phone_format\"\n        };\n      }\n    }\n    \n    if (recipientType === \"Email\") {\n      const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n      if (!emailRegex.test(receiver)) {\n        return {\n          valid: false,\n          reason: \"invalid_email_format\"\n        };\n      }\n    }\n  }\n  \n  return { valid: true };\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"calculate-fraud-risk-score","__idx":17},"children":["Calculate fraud risk score"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Assess the risk level of a payout request:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"async function calculatePayoutRiskScore(payoutData: PayoutData) {\n  const factors = {\n    // Check velocity - multiple payouts in short time\n    velocityScore: await checkPayoutVelocity(payoutData.userId),\n    \n    // Check if payout destination is new\n    destinationScore: await checkDestinationHistory(payoutData.userId, payoutData.receiver),\n    \n    // Check amount patterns\n    amountScore: await analyzeAmountPatterns(payoutData.userId, payoutData.amount),\n    \n    // Check device/location consistency\n    deviceScore: await checkDeviceConsistency(payoutData.userId, payoutData.deviceData),\n    \n    // Check time patterns\n    timeScore: await checkTimePatterns(payoutData.userId)\n  };\n  \n  // Calculate weighted average\n  const weights = {\n    velocityScore: 0.25,\n    destinationScore: 0.20,\n    amountScore: 0.20,\n    deviceScore: 0.20,\n    timeScore: 0.15\n  };\n  \n  const totalScore = Object.entries(factors).reduce((sum, [key, score]) => {\n    return sum + (score * weights[key as keyof typeof weights]);\n  }, 0);\n  \n  return {\n    score: totalScore,\n    riskLevel: totalScore > 0.8 ? \"HIGH\" : totalScore > 0.5 ? \"MEDIUM\" : \"LOW\",\n    factors: factors,\n    requiresReview: totalScore > 0.7\n  };\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"validation-best-practices","__idx":18},"children":["Validation best practices"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"client-side-validation","__idx":19},"children":["Client-side validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Always validate on the client side before submission:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"function validatePayoutBeforeSubmit() {\n  const errors: string[] = [];\n  \n  // Validate amount\n  const amount = getPayoutAmount();\n  if (!amount || amount <= 0) {\n    errors.push(\"Please enter a valid withdrawal amount.\");\n  }\n  \n  // Validate recipient is selected\n  const recipientWallet = getSelectedWallet();\n  if (!recipientWallet) {\n    errors.push(\"Please select a payout method.\");\n  }\n  \n  // Validate wallet-specific requirements\n  if (recipientWallet === \"Venmo\" && getCurrency() !== \"USD\") {\n    errors.push(\"Venmo only supports USD withdrawals.\");\n  }\n  \n  if (errors.length > 0) {\n    showValidationErrors(errors);\n    return false;\n  }\n  \n  return true;\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"display-meaningful-error-messages","__idx":20},"children":["Display meaningful error messages"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Map technical errors to user-friendly messages:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const errorMessages: Record<string, { title: string; message: string; action: string }> = {\n  \"SDK0810\": {\n    title: \"Invalid Amount\",\n    message: \"The withdrawal amount is not valid.\",\n    action: \"Please enter a valid number.\"\n  },\n  \"SDK0811\": {\n    title: \"Invalid Amount\",\n    message: \"The withdrawal amount must be greater than zero.\",\n    action: \"Please enter a positive amount.\"\n  },\n  \"SDK0808\": {\n    title: \"Invalid Email\",\n    message: \"The PayPal email address is not valid.\",\n    action: \"Please check your PayPal email and try again.\"\n  },\n  \"SDK0904\": {\n    title: \"Invalid Phone\",\n    message: \"The phone number format is not valid.\",\n    action: \"Please enter a valid phone number with only digits.\"\n  },\n  \"SDK0905\": {\n    title: \"Currency Not Supported\",\n    message: \"Venmo only supports USD withdrawals.\",\n    action: \"Please use PayPal for non-USD withdrawals.\"\n  },\n  \"SDK1004\": {\n    title: \"Note Too Long\",\n    message: \"The payout note exceeds the maximum length.\",\n    action: \"Notes longer than 4000 characters will be truncated.\"\n  }\n};\n\nfunction getErrorMessage(errorCode: string) {\n  return errorMessages[errorCode] || {\n    title: \"Error\",\n    message: \"An unexpected error occurred.\",\n    action: \"Please try again or contact support.\"\n  };\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"log-errors-for-debugging","__idx":21},"children":["Log errors for debugging"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Always log errors for troubleshooting:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"function logPayoutError(error: any, context: Record<string, any>) {\n  const errorLog = {\n    timestamp: new Date().toISOString(),\n    errorCode: error.ErrorCode,\n    errorMessage: error.message,\n    userId: context.userId,\n    payoutAmount: context.amount,\n    payoutCurrency: context.currency,\n    recipientWallet: context.recipientWallet,\n    userAgent: navigator.userAgent,\n    url: window.location.href\n  };\n  \n  // Send to logging service\n  sendToLoggingService(\"payout_error\", errorLog);\n  \n  // Console log for development\n  console.error(\"Payout error:\", errorLog);\n}\n","lang":"typescript"},"children":[]}]},"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":"Error codes reference","id":"error-codes-reference","depth":2},{"value":"SDK configuration errors","id":"sdk-configuration-errors","depth":3},{"value":"Amount validation errors","id":"amount-validation-errors","depth":3},{"value":"Currency validation errors","id":"currency-validation-errors","depth":3},{"value":"PayPal receiver validation errors","id":"paypal-receiver-validation-errors","depth":3},{"value":"Venmo receiver validation errors","id":"venmo-receiver-validation-errors","depth":3},{"value":"Payout submission errors","id":"payout-submission-errors","depth":3},{"value":"Error handling","id":"error-handling","depth":2},{"value":"Basic error handling","id":"basic-error-handling","depth":3},{"value":"Comprehensive error handling","id":"comprehensive-error-handling","depth":3},{"value":"Custom validation","id":"custom-validation","depth":2},{"value":"Pre-payout validation","id":"pre-payout-validation","depth":3},{"value":"Validate withdrawal limits","id":"validate-withdrawal-limits","depth":3},{"value":"Validate recipient account","id":"validate-recipient-account","depth":3},{"value":"Calculate fraud risk score","id":"calculate-fraud-risk-score","depth":3},{"value":"Validation best practices","id":"validation-best-practices","depth":2},{"value":"Client-side validation","id":"client-side-validation","depth":3},{"value":"Display meaningful error messages","id":"display-meaningful-error-messages","depth":3},{"value":"Log errors for debugging","id":"log-errors-for-debugging","depth":3}],"frontmatter":{"seo":{"title":"Data validation"}},"lastModified":"2026-02-26T12:14:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/web/paypal/payouts/data-validation","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}