Onerway
POST

Validate a transfer

Validate transfer fields and current business conditions without executing the transfer creation flow.

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:
requestId
Merchant-generated business reference for the payout.
Constraints
Rule
Maximum length: 64.
Amount, currencies and payment method
Beneficiary for this payment.
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/txn/validate' \
  -H 'ApiKey: replace_with_account_service_apikey' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "requestId": "demo_transfer_001",
  "transactionInfo": {
    "sourceAmount": 100,
    "sourceCurrency": "USD",
    "targetCurrency": "USD",
    "destinationCountry": "US",
    "paymentMethod": "BANK_TRANSFER",
    "transactionPurpose": "TRANSFER_TO_OWN_ACCOUNT",
    "chargeBearer": "CRED"
  },
  "beneficiary": {
    "beneficiaryId": 10001
  }
}'

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
On success, data.success is true and data.errors is empty. Precheck failures use the top-level error with a string array in error.errorDetails. Validation does not reserve funds, lock a rate or guarantee a later transfer.
Structured failure information; not present for every failure path

Response example

{
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "success": true,
    "errors": []
  }
}
20090001

Changing sourceAmount to 0 for CRED.

Trigger: Changing sourceAmount to 0 for CRED.

Example

{
  "respCode": "90001",
  "respMsg": "Source amount needs to be greater than zero",
  "error": {
    "type": "validation_error",
    "code": "payout_validate_failed",
    "message": "One or more request fields failed payout validation rules",
    "requestId": "req_00000000000000000000000000000001",
    "errorDetails": [
      "Source amount needs to be greater than zero"
    ]
  }
}