# 收款方添加

> 创建可用于后续 Transfer 打款的收款方。

```yaml
openapi: 3.1.0
info:
  title: 收款方添加
  version: 1.0.0
  description: 创建可用于后续 Transfer 打款的收款方。
paths:
  /api/v1/beneficiary/add:
    post:
      summary: 收款方添加
      description: 创建可用于后续 Transfer 打款的收款方。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantNo:
                  type: string
                  description: Onerway 分配的商户号。通常在沙盒或生产商户开通后，从商户后台或开户材料中获取。
                merchantRefId:
                  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
                - bankCountry
                - payoutCurrency
                - entityType
                - paymentMethod
                - receiverInfo
                - address
                - accountInfomation
                - sign
            examples:
              create-ewallet-beneficiary:
                summary: 创建电子钱包收款人
                value:
                  accountInfomation: '{"walletType":"EASYPAISA","walletPhone":"03001234567"}'
                  address: '{"countryCode":"PK","state":"Punjab","city":"Lahore","addressLine1":"12
                    Demo Street","postalCode":"54000"}'
                  bankCountry: PK
                  entityType: "1"
                  merchantNo: "801129"
                  merchantRefId: bene_demo_001
                  paymentMethod: E_WALLET
                  payoutCurrency: PKR
                  receiverInfo: '{"firstName":"Beta","lastName":"Tester","areaCode":"+92","phone":"3001234567","email":"beneficiary@example.com","identityType":"NID","identityNumber":"3520212345671"}'
                  sign: "{{SIGN}}"
      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-created:
                  summary: 收款人创建成功
                  value:
                    respCode: "20000"
                    respMsg: null
                    data:
                      beneficiaryId: "1984102812163112960"
                      payeeStatus: unnecessary
```
