Onerway
POST

编辑收款人

按 beneficiaryId 更新当前商户已有收款人的部分信息,返回更新后读回的详情。

请求

ApiKey
Onerway 分配的账户服务 API key 请求 Header;必须使用与请求域名相同环境的值。
示例:
Content-Type
请求体媒体类型。
示例:
merchantRefId
商户为收款人设置的外部标识。
个人主体信息,仅在收款人 entityType=INDIVIDUAL 时填写需要更新的内容。
企业主体信息,仅在收款人 entityType=BUSINESS 时填写需要更新的内容。
联系方式
收款人的地址信息。
收款账户信息
onBehalfOf
请求实际对应的商户号,仅在代其他商户发起请求时填写。
beneficiaryId
Onerway 收款人 ID(64 位整数)。
约束
规则
必须是请求实际对应商户名下且未删除的收款人编号。

请求示例

curl -X POST 'https://sandbox-transfer-api.onerway.com/api/v3/beneficiary/edit' \
  -H 'ApiKey: replace_with_account_service_apikey' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "beneficiaryId": 10001,
  "contact": {
    "email": "updated-demo@example.com"
  }
}'

响应

respCode
响应码;20000 表示请求处理成功,其余为错误码。
respMsg
响应码对应的可读说明。
成功业务数据;失败不作为有效业务数据读取
结构化失败信息;并非每个失败分支都有该字段

响应示例

{
  "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": "updated-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

尝试把已保存的付款方式修改为另一种付款方式。

触发条件: 尝试把已保存的付款方式修改为另一种付款方式。

示例

{
  "respCode": "40004",
  "respMsg": "Validation Failed",
  "error": {
    "type": "validation_error",
    "code": "beneficiary_edit_failed",
    "message": "Beneficiary edit request validation failed",
    "requestId": "req_00000000000000000000000000000001",
    "errorDetails": [
      {
        "fieldPath": "paymentMethod",
        "errorCode": "INVALID_PARAMETER",
        "message": "paymentMethod cannot be changed when editing beneficiary",
        "params": {}
      }
    ],
    "param": "paymentMethod"
  }
}