Onerway
POST

Retrieve beneficiary field rules

Retrieve beneficiary field definitions and validation rules for a merchant, country, currency, entity type and payment method.

Request

ApiKey
Account service API key assigned by Onerway, supplied in the request header. Use the key for the same environment as the request domain.
Example:
Content-Type
Request media type.
Example:
destinationCountry
Recipient account country or region. See country/region enums.
Constraints
Rule
Maximum length: 12.
targetCurrency
Target currency. See currency enums.
Constraints
Rule
Maximum length: 128.
paymentMethod
Payment method. See enum values.
Allowed values
BANK_TRANSFER
Bank transfer
SWIFT
SWIFT transfer
E_WALLET
E-wallet
entityType
Entity type. See enum values.
Allowed values
INDIVIDUAL
Individual
BUSINESS
Business
walletProvider
Condition: Required when paymentMethod is E_WALLET.
Wallet provider. See wallet providers.
Constraints
Rule
Required when paymentMethod is E_WALLET.
Consistency
Supply walletProvider and walletFormat as a pair valid for the merchant, account country, currency and entity type.
Rule
Maximum length: 64.
walletFormat
Condition: Required when paymentMethod is E_WALLET.
Wallet account format for the selected walletProvider. See wallet account formats.
Constraints
Rule
Required when paymentMethod is E_WALLET.
Rule
Maximum length: 64.
onBehalfOf
Merchant number that the request applies to. Supply it only when making a request on behalf of another merchant.

Request example

curl -X POST 'https://sandbox-transfer-api.onerway.com/api/v3/beneficiary/schema' \
  -H 'ApiKey: replace_with_account_service_apikey' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "destinationCountry": "US",
  "targetCurrency": "USD",
  "paymentMethod": "BANK_TRANSFER",
  "entityType": "BUSINESS"
}'

Response

respCode
Response code; 20000 indicates successful request processing. All other values are error codes.
respMsg
Human-readable description of the response code.
Business data on success; do not consume as valid business data on failure
Constraints
Rule
The query fails if applicable routing or validation rules are not configured. A failure does not mean that no fields are required.
Structured failure information; not present for every failure path

Response example

{
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "condition": {
      "merchantNo": "10000",
      "destinationCountry": "US",
      "targetCurrency": "USD",
      "paymentMethod": "BANK_TRANSFER",
      "entityType": "BUSINESS"
    },
    "fields": [
      {
        "path": "account.countryCode",
        "required": "MANDATORY",
        "type": "STRING",
        "description": "account country",
        "example": "US",
        "rules": []
      },
      {
        "path": "account.currency",
        "required": "MANDATORY",
        "type": "STRING",
        "description": "account currency",
        "example": "USD",
        "rules": []
      },
      {
        "path": "business.companyName",
        "required": "OPTIONAL",
        "type": "STRING",
        "description": "business company name",
        "rules": [
          {
            "ruleType": "LENGTH_RANGE",
            "params": {
              "max": 64
            },
            "message": "business.companyName length cannot exceed 64"
          }
        ]
      }
    ]
  }
}
20040004

The wallet provider and account format do not match an available wallet configuration.

Trigger: The wallet configuration query succeeds, but no configuration matches the supplied walletProvider and walletFormat.

Example

{
  "respCode": "40004",
  "respMsg": "Illegal parameter [walletProvider/walletFormat]",
  "error": {
    "type": "validation_error",
    "code": "invalid_wallet_selection",
    "message": "walletProvider and walletFormat must match an available wallet configuration",
    "param": "walletProvider",
    "requestId": "req_00000000000000000000000000000001",
    "errorDetails": []
  }
}
20050097

The requested country, currency and payment method do not form a supported scenario.

Trigger: The requested country, currency and payment method do not form a supported scenario.

Example

{
  "respCode": "50097",
  "respMsg": "payment country is not surpport this payment method",
  "error": {
    "type": "business_error",
    "code": "invalid_schema_scene",
    "message": "destinationCountry, targetCurrency and paymentMethod do not form a supported schema scene",
    "requestId": "req_00000000000000000000000000000001",
    "errorDetails": [],
    "param": "destinationCountry"
  }
}