Onerway
POST

Create a beneficiary

Create and persist a beneficiary, returning the stored details and identifier.

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:
entityType
Entity type. See enum values.
Allowed values
INDIVIDUAL
Individual
BUSINESS
Business
merchantRefId
External reference assigned by the merchant to the beneficiary.
Condition: Required when entityType is INDIVIDUAL; omit for the other entity type.
Individual information. Applies only when entityType is INDIVIDUAL.
Condition: Required when entityType is BUSINESS; omit for the other entity type.
Business information. Applies only when entityType is BUSINESS.
Contact details
Address details
Recipient account
onBehalfOf
Merchant number that the request applies to. Supply it only when making a request on behalf of another merchant.
paymentMethod
Payment method. See enum values.
Allowed values
BANK_TRANSFER
Bank transfer
SWIFT
SWIFT transfer
E_WALLET
E-wallet

Request example

curl -X POST 'https://sandbox-transfer-api.onerway.com/api/v3/beneficiary/add' \
  -H 'ApiKey: replace_with_account_service_apikey' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "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"
    }
  }
}'

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
Structured failure information; not present for every failure path

Response example

{
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "beneficiaryId": "10001",
    "merchantNo": "10000",
    "status": "unnecessary",
    "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"
      }
    }
  }
}
20040004

Supplying account without countryCode.

Trigger: Supplying account without countryCode.

Example

{
  "respCode": "40004",
  "respMsg": "Validation Failed",
  "error": {
    "type": "validation_error",
    "code": "beneficiary_create_failed",
    "message": "Beneficiary create request 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"
  }
}