# Validate a beneficiary

> Validate beneficiary fields, entity/account structure and applicable dynamic rules without persisting a beneficiary.

```yaml
openapi: 3.1.0
x-onerway-docs-version: original
x-onerway-spec-key: transfer/v3-beneficiaries/validate
info:
  title: Validate a beneficiary
  version: original
  description: Validate beneficiary fields, entity/account structure and
    applicable dynamic rules without persisting a beneficiary.
servers:
  - url: https://sandbox-transfer-api.onerway.com
    description: sandbox
  - url: https://transfer-api.onerway.com
    description: production
paths:
  /api/v3/beneficiary/validate:
    post:
      summary: Validate a beneficiary
      description: Validate beneficiary fields, entity/account structure and
        applicable dynamic rules without persisting a beneficiary.
      parameters:
        - name: ApiKey
          in: header
          required: true
          description: Account service API key assigned by Onerway, supplied in the
            request header. Use the key for the same environment as the request
            domain.
          schema:
            type: string
            description: Account service API key assigned by Onerway, supplied in the
              request header. Use the key for the same environment as the
              request domain.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                paymentMethod:
                  type: string
                  description: Payment method. See [enum
                    values](/transfer/api-reference/v3-enums#paymentmethod-payment-methods).
                  enum:
                    - BANK_TRANSFER
                    - SWIFT
                    - E_WALLET
                    - CASH_PICKUP
                  x-enum-descriptions:
                    BANK_TRANSFER: Bank transfer
                    SWIFT: SWIFT transfer
                    E_WALLET: E-wallet
                    CASH_PICKUP: Cash pickup
                entityType:
                  type: string
                  description: Entity type. See [enum
                    values](/transfer/api-reference/v3-enums#entitytype-entity-types).
                  enum:
                    - INDIVIDUAL
                    - BUSINESS
                  x-enum-descriptions:
                    INDIVIDUAL: Individual
                    BUSINESS: Business
                individual:
                  type: object
                  properties:
                    name:
                      type: object
                      properties:
                        firstName:
                          type: string
                          description: Beneficiary’s first name.
                          x-onerway-constraints:
                            - kind: rule
                              text: "When supplied: 1–50 characters; no leading or trailing whitespace or CJK
                                characters in U+4E00–U+9FFF. See [Query
                                beneficiary field
                                rules](/transfer/api-reference/endpoints/v3-ben\
                                eficiaries-schema)."
                            - kind: rule
                              text: For address country TR, the first character must be an uppercase letter in
                                A–Z or ÇĞIÖŞÜ.
                        lastName:
                          type: string
                          description: Beneficiary’s last name.
                          x-onerway-constraints:
                            - kind: rule
                              text: "When supplied: 1–50 characters; no leading or trailing whitespace or CJK
                                characters in U+4E00–U+9FFF. See [Query
                                beneficiary field
                                rules](/transfer/api-reference/endpoints/v3-ben\
                                eficiaries-schema)."
                            - kind: rule
                              text: For address country TR, the first character must be an uppercase letter in
                                A–Z or ÇĞIÖŞÜ.
                      description: Personal name
                    identity:
                      type: object
                      properties:
                        idType:
                          type: string
                          description: Identity document type
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 64. For an individual with address country AE, use GCC
                                ID, Passport, National ID or Emirates ID."
                        idNumber:
                          type: string
                          description: Identity document number
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 64."
                        issuingCountry:
                          type: string
                          description: Issuing country or region code. See [country/region
                            enums](/transfer/api-reference/v3-enums#countryregion-enums).
                          x-onerway-constraints:
                            - kind: rule
                              text: When supplied, use a two-letter uppercase country or region code.
                        expiryDate:
                          type: string
                          description: "Document expiry date; format: yyyy-MM-dd."
                          x-onerway-constraints:
                            - kind: rule
                              text: Use yyyy-MM-dd. The date must be today or later. Relative date limits are
                                enforced by beneficiary validation.
                        issueDate:
                          type: string
                          description: "Document issue date; format: yyyy-MM-dd."
                          x-onerway-constraints:
                            - kind: rule
                              text: Use yyyy-MM-dd. The date must be today or earlier. Relative date limits
                                are enforced by beneficiary validation.
                      description: Identity document
                    dateOfBirth:
                      type: string
                      description: "Date of birth; format: yyyy-MM-dd."
                      x-onerway-constraints:
                        - kind: rule
                          text: yyyy-MM-dd
                  description: Individual information. Applies only when entityType is INDIVIDUAL.
                  x-onerway-required: conditional
                  x-onerway-condition:
                    - Required when entityType is INDIVIDUAL; omit for the other
                      entity type.
                business:
                  type: object
                  properties:
                    companyName:
                      type: string
                      description: Beneficiary’s company name.
                      x-onerway-constraints:
                        - kind: rule
                          text: "When supplied: 1–64 characters; not entirely digits, no leading or
                            trailing whitespace or CJK characters in
                            U+4E00–U+9FFF. Country-specific character rules are
                            returned by the schema endpoint. See [Query
                            beneficiary field
                            rules](/transfer/api-reference/endpoints/v3-benefic\
                            iaries-schema)."
                        - kind: rule
                          text: For address country TR, the first character must be an uppercase letter in
                            A–Z or ÇĞIÖŞÜ.
                    tin:
                      type: string
                      description: Tax identification number
                      x-onerway-constraints:
                        - kind: rule
                          text: "Maximum length: 64."
                    registrationNumber:
                      type: string
                      description: Business registration number
                    registrationDate:
                      type: string
                      description: "Business registration date; format: yyyy-MM-dd."
                      x-onerway-constraints:
                        - kind: rule
                          text: yyyy-MM-dd
                  description: Business information. Applies only when entityType is BUSINESS.
                  x-onerway-required: conditional
                  x-onerway-condition:
                    - Required when entityType is BUSINESS; omit for the other
                      entity type.
                contact:
                  type: object
                  properties:
                    email:
                      type: string
                      description: Beneficiary’s email address.
                      x-onerway-constraints:
                        - kind: rule
                          text: When supplied, use a valid email address of 6–254 characters.
                    mobile:
                      type: object
                      properties:
                        areaCode:
                          type: string
                          description: International dialing code, including +
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 32."
                        number:
                          type: string
                          description: Telephone number without the dialing code
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 16."
                      description: Mobile telephone
                  description: Contact details
                address:
                  type: object
                  properties:
                    countryCode:
                      type: string
                      description: Country or region code. See [country/region
                        enums](/transfer/api-reference/v3-enums#countryregion-enums).
                      x-onerway-constraints:
                        - kind: rule
                          text: "Maximum length: 12."
                    state:
                      type: string
                      description: State or province. See the validation rules returned by [Query
                        beneficiary field
                        rules](/transfer/api-reference/endpoints/v3-beneficiaries-schema).
                      x-onerway-constraints:
                        - kind: rule
                          text: "When supplied: 1–50 characters. See [Query beneficiary field
                            rules](/transfer/api-reference/endpoints/v3-benefic\
                            iaries-schema)."
                    city:
                      type: string
                      description: City. See the validation rules returned by [Query beneficiary field
                        rules](/transfer/api-reference/endpoints/v3-beneficiaries-schema).
                      x-onerway-constraints:
                        - kind: rule
                          text: "When supplied: 1–50 characters. See [Query beneficiary field
                            rules](/transfer/api-reference/endpoints/v3-benefic\
                            iaries-schema)."
                    addressLine1:
                      type: string
                      description: Primary street address, usually including the building number and
                        street name.
                      x-onerway-constraints:
                        - kind: rule
                          text: "When supplied: 5–200 characters; CJK characters in U+4E00–U+9FFF are not
                            supported. See [Query beneficiary field
                            rules](/transfer/api-reference/endpoints/v3-benefic\
                            iaries-schema)."
                    addressLine2:
                      type: string
                      description: Additional address information, including building, floor, room, or
                        unit.
                      x-onerway-constraints:
                        - kind: rule
                          text: "When supplied: 5–200 characters; CJK characters in U+4E00–U+9FFF are not
                            supported. See [Query beneficiary field
                            rules](/transfer/api-reference/endpoints/v3-benefic\
                            iaries-schema)."
                    addressLine3:
                      type: string
                      description: Other necessary address information.
                      x-onerway-constraints:
                        - kind: rule
                          text: "When supplied: 5–200 characters; CJK characters in U+4E00–U+9FFF are not
                            supported. See [Query beneficiary field
                            rules](/transfer/api-reference/endpoints/v3-benefic\
                            iaries-schema)."
                    postalCode:
                      type: string
                      description: Postal code of the beneficiary’s address.
                      x-onerway-constraints:
                        - kind: rule
                          text: Format and length depend on the address country. See [Query beneficiary
                            field
                            rules](/transfer/api-reference/endpoints/v3-beneficiaries-schema).
                  description: Address details
                account:
                  type: object
                  properties:
                    countryCode:
                      type: string
                      description: Country or region code. See [country/region
                        enums](/transfer/api-reference/v3-enums#countryregion-enums).
                      x-onerway-constraints:
                        - kind: rule
                          text: "Maximum length: 12."
                    currency:
                      type: string
                      description: Account currency. See [currency
                        enums](/transfer/api-reference/v3-enums#currency-enums).
                      x-onerway-constraints:
                        - kind: rule
                          text: "Maximum length: 128."
                    bankAccount:
                      type: object
                      properties:
                        accountHolderName:
                          type: string
                          description: Bank account holder name
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 256."
                        bankName:
                          type: string
                          description: Beneficiary bank name.
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 256."
                        accountType:
                          type: string
                          description: Bank account type. See [enum
                            values](/transfer/api-reference/v3-enums#accounttype-bank-account-types).
                          enum:
                            - CHECKING
                            - SAVING
                            - ORDINARY
                          x-enum-descriptions:
                            CHECKING: Checking account
                            SAVING: Savings account
                            ORDINARY: Ordinary account
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 20."
                            - kind: rule
                              text: US and BR accounts support CHECKING or SAVING.
                        accountIdentifier:
                          type: object
                          properties:
                            type:
                              type: string
                              description: Bank account identifier type. See [enum
                                values](/transfer/api-reference/v3-enums#type-account-identifier-types).
                              enum:
                                - IBAN
                                - LOCAL_ACCOUNT
                              x-enum-descriptions:
                                IBAN: International Bank Account Number
                                LOCAL_ACCOUNT: Local bank account number
                            value:
                              type: string
                              description: IBAN or local bank account number matching type
                          description: Bank account identifier and type
                        swiftCode:
                          type: string
                          description: SWIFT/BIC code
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 100."
                        routingNumber:
                          type: string
                          description: "Bank code or local clearing routing code identifying the
                            beneficiary bank or its route in the local clearing
                            network. The code type depends on the destination
                            country: UK Sort Code for the United Kingdom; ABA
                            Routing Number for the United States."
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 24."
                        branchNumber:
                          type: string
                          description: Code identifying the bank branch where the beneficiary account is
                            held.
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 20."
                      description: Bank account
                    walletAccount:
                      type: object
                      properties:
                        walletProvider:
                          type: string
                          description: Wallet provider. See [wallet
                            providers](/transfer/api-reference/v3-enums#walletprovider-walletformat-wallet-providers-and-account-formats).
                            Supply it together with walletFormat; use the
                            beneficiary field rules for scenario-specific
                            requirements.
                          x-onerway-required: conditional
                          x-onerway-condition:
                            - Required when the beneficiary field rules mark the
                              wallet selection as MANDATORY, or when the other
                              wallet selection field is supplied.
                          x-onerway-constraints:
                            - kind: consistency
                              text: Supply walletProvider and walletFormat as a pair valid for the merchant,
                                account country, currency and entity type. V3
                                does not accept walletType as a wallet account
                                input. A REQUIRED error identifies a missing
                                public field. A system_error does not mean that
                                the supplied wallet selection is invalid.
                            - kind: rule
                              text: "Maximum length: 64."
                        walletFormat:
                          type: string
                          description: Wallet account format for the selected walletProvider. See [wallet
                            account
                            formats](/transfer/api-reference/v3-enums#walletprovider-walletformat-wallet-providers-and-account-formats).
                            Supply it together with walletProvider.
                          x-onerway-required: conditional
                          x-onerway-condition:
                            - Required when the beneficiary field rules mark the
                              wallet selection as MANDATORY, or when the other
                              wallet selection field is supplied.
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 64."
                        walletIdentifier:
                          type: string
                          description: Beneficiary wallet account identifier. The account format depends
                            on walletProvider and walletFormat.
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 64."
                      description: E-wallet account
                    cashPickupAccount:
                      type: object
                      properties:
                        pickupBankName:
                          type: string
                          description: Cash pickup institution
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 256."
                        pickupBranchId:
                          type: string
                          description: Pickup branch identifier
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 20."
                        pickupBranchName:
                          type: string
                          description: Pickup branch name
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 64."
                        pickupBranchAddress:
                          type: string
                          description: Pickup branch address
                          x-onerway-constraints:
                            - kind: rule
                              text: "Maximum length: 256."
                      description: Cash pickup location
                  required:
                    - countryCode
                    - currency
                  description: Recipient account
                onBehalfOf:
                  type: string
                  description: Merchant number that the request applies to. Supply it only when
                    making a request on behalf of another merchant.
              required:
                - paymentMethod
                - entityType
                - account
            examples:
              default:
                summary: Request structure (replace with your merchant data)
                value:
                  entityType: BUSINESS
                  paymentMethod: BANK_TRANSFER
                  business:
                    companyName: Example Demo Company
                    registrationNumber: demo_registration_001
                    registrationDate: 2020-01-01
                    tin: demo_tax_id
                  contact:
                    email: demo@example.com
                  address:
                    countryCode: US
                    state: Example State
                    city: Example City
                    addressLine1: Example Address
                    postalCode: "00000"
                  account:
                    countryCode: US
                    currency: USD
                    bankAccount:
                      accountHolderName: Example Demo Company
                      bankName: Example Bank
                      accountType: CHECKING
                      accountIdentifier:
                        type: LOCAL_ACCOUNT
                        value: demo_account_001
                      routingNumber: "000000000"
              wallet:
                summary: E-wallet
                value:
                  entityType: BUSINESS
                  paymentMethod: E_WALLET
                  business:
                    companyName: Example Demo Company
                    registrationNumber: demo_registration_001
                    registrationDate: 2020-01-01
                    tin: demo_tax_id
                  contact:
                    email: demo@example.com
                  address:
                    countryCode: US
                    state: Example State
                    city: Example City
                    addressLine1: Example Address
                    postalCode: "00000"
                  account:
                    countryCode: US
                    currency: USD
                    walletAccount:
                      walletProvider: PAYPAL
                      walletFormat: EMAIL
                      walletIdentifier: demo@example.com
      responses:
        "200":
          description: Success example
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      respCode:
                        type: string
                        description: Response code; `20000` indicates successful request processing. All
                          other values are error codes.
                      respMsg:
                        type: string
                        description: Human-readable description of the response code.
                      data:
                        type: object
                        properties:
                          success:
                            type: boolean
                            description: true when validation succeeds
                          errors:
                            type: array
                            description: Empty on successful validation; failures use the top-level error
                            items:
                              type: object
                              properties:
                                fieldPath:
                                  type: string
                                  description: Path of the field that failed validation.
                                errorCode:
                                  type: string
                                  description: Business or validation detail code.
                                message:
                                  type: string
                                  description: Readable error or rule message
                                ruleType:
                                  type: string
                                  description: Validation rule type. See [enum
                                    values](/transfer/api-reference/v3-enums#field-rules).
                                params:
                                  type: object
                                  properties:
                                    {}
                                  description: Rule parameters interpreted according to ruleType
                        description: Business data on success; do not consume as valid business data on
                          failure
                      error:
                        type: object
                        properties:
                          type:
                            type: string
                            description: Error type.
                          code:
                            type: string
                            description: Endpoint error identifier.
                          declineCode:
                            type: string
                            description: Decline reason code; may be empty.
                          message:
                            type: string
                            description: Detailed error description
                          param:
                            type: string
                            description: Failed field or condition; may be empty when no field is identified
                          docUrl:
                            type: string
                            description: Link to error documentation; may be empty.
                          requestId:
                            type: string
                            description: Server-generated error trace identifier, req_ plus 32 hexadecimal
                              characters; not the merchant requestId
                          errorDetails:
                            type: array
                            description: Error details; see the variants below
                            items:
                              type: object
                              properties:
                                errorCode:
                                  type: string
                                  description: Business or validation detail code.
                                message:
                                  type: string
                                  description: Detail message
                                fieldPath:
                                  type: string
                                  description: Path of the field that failed validation.
                                ruleType:
                                  type: string
                                  description: Rule type; may be empty for local semantic failures. See [enum
                                    values](/transfer/api-reference/v3-enums#field-rules).
                                params:
                                  type: object
                                  properties:
                                    required:
                                      type: boolean
                                      description: true for a local required-field error; other rules may omit this
                                        key.
                                  description: Rule parameters; may be an empty object for local semantic failures
                        description: Structured failure information; not present for every failure path
                  - type: object
                    properties:
                      respCode:
                        type: string
                      respMsg:
                        type: string
                      error:
                        type: object
                        properties:
                          type:
                            type: string
                          code:
                            type: string
                          message:
                            type: string
                          requestId:
                            type: string
                          errorDetails:
                            type: array
                            items:
                              type: object
                              properties:
                                fieldPath:
                                  type: string
                                errorCode:
                                  type: string
                                message:
                                  type: string
                                ruleType:
                                  type: string
                                params:
                                  type: object
                                  properties:
                                    required:
                                      type: boolean
                                  required:
                                    - required
                              required:
                                - fieldPath
                                - errorCode
                                - message
                                - ruleType
                                - params
                          param:
                            type: string
                        required:
                          - type
                          - code
                          - message
                          - requestId
                          - errorDetails
                          - param
                    required:
                      - respCode
                      - respMsg
                      - error
              examples:
                "40004":
                  summary: Supplying account without countryCode.
                  description: Supplying account without countryCode.
                  value:
                    respCode: "40004"
                    respMsg: Validation Failed
                    error:
                      type: validation_error
                      code: beneficiary_validate_failed
                      message: Beneficiary validation failed
                      requestId: req_00000000000000000000000000000001
                      errorDetails:
                        - fieldPath: account.countryCode
                          errorCode: INVALID_PARAMETER
                          message: account.countryCode is required
                          ruleType: REQUIRED
                          params:
                            required: true
                      param: account.countryCode
                success:
                  summary: Success example
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data:
                      success: true
                      errors:
                        []
                failure:
                  summary: Supplying account without countryCode.
                  value:
                    respCode: "40004"
                    respMsg: Validation Failed
                    error:
                      type: validation_error
                      code: beneficiary_validate_failed
                      message: Beneficiary validation failed
                      requestId: req_00000000000000000000000000000001
                      errorDetails:
                        - fieldPath: account.countryCode
                          errorCode: INVALID_PARAMETER
                          message: account.countryCode is required
                          ruleType: REQUIRED
                          params:
                            required: true
                      param: account.countryCode
```
