# 收款方编辑

> 更新已有收款人的资料信息。

```yaml
openapi: 3.1.0
info:
  title: 收款方编辑
  version: 1.0.0
  description: 更新已有收款人的资料信息。
paths:
  /api/v1/beneficiary/edit:
    post:
      summary: 收款方编辑
      description: 更新已有收款人的资料信息。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantNo:
                  type: string
                  description: Onerway 分配的商户号。通常在沙盒或生产商户开通后，从商户后台或开户材料中获取。
                merchantRefId:
                  type: string
                  description: 商户侧收款人引用 ID。
                beneficiaryId:
                  type: string
                  description: 需要更新的收款人 ID。
                bankCountry:
                  type: string
                  description: 收款人目标国家。
                payoutCurrency:
                  type: string
                  description: 收款人打款币种。
                entityType:
                  type: string
                  description: 收款主体类型；`0` 表示企业，`1` 表示个人。
                paymentMethod:
                  type: string
                  description: 配置的付款方式。
                receiverInfo:
                  type: string
                  description: 以 JSON 字符串编码的收款人身份信息。
                  contentMediaType: application/json
                  contentSchema:
                    type: object
                    properties:
                      companyName:
                        type: string
                        description: companyName 字段。
                      lastName:
                        type: string
                        description: lastName 字段。
                      firstName:
                        type: string
                        description: firstName 字段。
                      areaCode:
                        type: string
                        description: areaCode 字段。
                      phone:
                        type: string
                        description: phone 字段。
                      birthDate:
                        type: string
                        description: birthDate 字段。
                      email:
                        type: string
                        description: email 字段。
                      identityType:
                        type: string
                        description: identityType 字段。
                      identityNumber:
                        type: string
                        description: identityNumber 字段。
                      vatNumber:
                        type: string
                        description: vatNumber 字段。
                  x-onerway-format: json_string
                address:
                  type: string
                  description: 以 JSON 字符串编码的收款地址信息。
                  contentMediaType: application/json
                  contentSchema:
                    type: object
                    properties:
                      countryCode:
                        type: string
                        description: countryCode 字段。
                      state:
                        type: string
                        description: state 字段。
                      city:
                        type: string
                        description: city 字段。
                      townName:
                        type: string
                        description: townName 字段。
                      addressLine1:
                        type: string
                        description: addressLine1 字段。
                      addressLine2:
                        type: string
                        description: addressLine2 字段。
                      addressLine3:
                        type: string
                        description: addressLine3 字段。
                      postalCode:
                        type: string
                        description: postalCode 字段。
                  x-onerway-format: json_string
                accountInfomation:
                  type: string
                  description: 以 JSON 字符串编码的收款账户信息。
                  contentMediaType: application/json
                  contentSchema:
                    type: object
                    properties:
                      cardNumber:
                        type: string
                        description: cardNumber 字段。
                      accountType:
                        type: string
                        description: accountType 字段。
                      swiftCode:
                        type: string
                        description: swiftCode 字段。
                      bankName:
                        type: string
                        description: bankName 字段。
                      sortCode:
                        type: string
                        description: sortCode 字段。
                      branchCode:
                        type: string
                        description: branchCode 字段。
                      bankHolderName:
                        type: string
                        description: bankHolderName 字段。
                      bankAccount:
                        type: string
                        description: bankAccount 字段。
                      walletType:
                        type: string
                        description: walletType 字段。
                      walletPhone:
                        type: string
                        description: walletPhone 字段。
                      pickUpBankName:
                        type: string
                        description: pickUpBankName 字段。
                      pickUpBankBranchName:
                        type: string
                        description: pickUpBankBranchName 字段。
                      pickUpBankBranchId:
                        type: string
                        description: pickUpBankBranchId 字段。
                      pickUpBankBranchAddress:
                        type: string
                        description: pickUpBankBranchAddress 字段。
                  x-onerway-format: json_string
                sign:
                  type: string
                  description: 请求签名字符串，需使用商户私钥按 Transfer 请求签名规则生成。
              required:
                - merchantNo
                - beneficiaryId
                - bankCountry
                - payoutCurrency
                - entityType
                - paymentMethod
                - receiverInfo
                - address
                - accountInfomation
                - sign
            examples:
              update-beneficiary:
                summary: 收款方编辑请求示例
                value:
                  accountInfomation: '{"cardNumber":null,"accountType":null,"swiftCode":null,"bankName":"MCB
                    BankLimited","sortCode":null,"branchCode":null,"bankHolderName":null,"walletType":"EASYPAISA","walletPhone":"03079770877","pickUpBankName":null,"pickUpBankBranchName":null,"pickUpBankBranchId":null,"pickUpBankBranchAddress":null}'
                  address: '{"countryCode":null,"state":"NY","city":"Adin","townName":null,"addressLine1":"testdsgddfs1233","addressLine2":null,"addressLine3":null,"postalCode":"10005"}'
                  bankCountry: PK
                  beneficiaryId: "1984102812163112960"
                  entityType: "1"
                  merchantNo: 801129
                  paymentMethod: E_WALLET
                  payoutCurrency: PKR
                  receiverInfo: '{"companyName":"helloBoy","lastName":"testData","firstName":"betaData","areaCode":"+92","phone":"2313019452","birthDate":"1990-12-04","email":"jing.yuan1@onerway.com","identityType":"SSN","vatNumber":"8859884832"}'
                  sign: d2ea92efff636320122021f65b613201403f6d34334cfbc7e589ce9f842284a3
      responses:
        "200":
          description: 收款方编辑响应示例
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: Onerway 返回的响应码。
                  respMsg:
                    type:
                      - string
                      - "null"
                    description: Onerway 返回的响应信息。
                    x-onerway-value:
                      nullable: true
                      when:
                        en: No response message is returned.
                        zh: 未返回响应信息时为 `null`。
                  data:
                    type: object
                    properties:
                      beneficiaryId:
                        type: string
                        description: 已更新的收款人 ID。
                      payeeStatus:
                        type: string
                        description: 更新后的收款人审核状态。
                    description: 更新收款人的结果。
              examples:
                beneficiary-updated:
                  summary: 收款方编辑响应示例
                  value:
                    respCode: "20000"
                    respMsg: null
                    data:
                      beneficiaryId: "1984102812163112960"
                      payeeStatus: unnecessary
```
