> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建子账户

> 以机构账户为主体，为客户创建一个新的子账户并登记账户持有人信息。

## 概述

本页说明 `POST /merchant/open/institution/v1/accounts/create` 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。

## 说明

* 认证方式使用 GatePay 标准签名请求头。
* 这个机构专属接口不使用 `X-GatePay-On-Behalf-Of`。
* 通用签名规则请参见 [/api-reference/version/100/cn/common/securityAndSignature](/api-reference/version/100/cn/common/securityAndSignature)。


## OpenAPI

````yaml api-reference/version/100/cn/openapi/institutional-openapi.json POST /merchant/open/institution/v1/accounts/create
openapi: 3.1.0
info:
  title: GatePay 机构 API
  description: Gate Pay 机构 API 接口文档
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://openplatform.gateapi.io
security: []
paths:
  /merchant/open/institution/v1/accounts/create:
    post:
      summary: 创建子账户
      description: 以机构账户为主体，为客户创建一个新的子账户并登记账户持有人信息。
      parameters:
        - $ref: '#/components/parameters/X-GatePay-Certificate-ClientId'
        - $ref: '#/components/parameters/X-GatePay-Timestamp'
        - $ref: '#/components/parameters/X-GatePay-Nonce'
        - $ref: '#/components/parameters/X-GatePay-Signature'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubAccountRequest'
            examples:
              businessExample:
                summary: 企业示例
                value:
                  request_id: '35778162074976257'
                  customer_id: '1234'
                  display_name: my test
                  account_holder:
                    entity_country: AF
                    entity_type: BUSINESS
                    entity_name: My Business Ltd
                    entity_id_type: BUSINESS_LICENSE
                    entity_id_number: abcd1234
                    entity_id_expiry:
                      valid_from: 1763538010509
                    address:
                      line1: 123 Main Street
                      country: AF
                    merchant_category: GENERAL_RETAIL
                    user_agreement: true
                    ubo_list:
                      - country: AF
                        full_name: 测试名字778
                        dob:
                          year: 2026
                          month: 3
                          day: 3
                        id_type: DRIVING_LICENSE
                        id_number: '130'
                        id_expiry:
                          valid_from: 1773135745000
                          valid_to: 1873135745000
                        relationship:
                          is_representative: false
                          is_owner: false
                          percent_ownership: '30'
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSubAccountResponseWrapper'
              examples:
                success:
                  summary: 成功响应
                  value:
                    status: SUCCESS
                    code: '000000'
                    errorMessage: ''
                    data:
                      request_id: '35778162074976257'
                      status: INIT
                      created: '1764139242707'
                      display_name: my test
                      customer_id: '1234'
                      account_holder:
                        entity_country: AF
                        entity_type: BUSINESS
                        entity_name: My Business Ltd
                        entity_id_type: BUSINESS_LICENSE
                        entity_id_number: abcd1234
                        entity_id_expiry:
                          valid_from: 1763538010509
                          valid_to: null
                        dob: null
                        business_registration: null
                        address:
                          line1: 123 Main Street
                          country: AF
                        merchant_category: GENERAL_RETAIL
                        website: null
                        user_agreement: true
                      metadata: null
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      description: 商户在Gate商户后台注册应用时分配的clientId
      schema:
        type: string
        example: 4186d0c6-6a35-55a9-8dc6-5312769dbff8
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: 请求生成时的UTC时间戳，milliseconds。请注意，GatePay不处理收到请求时间与这个时间戳差距大于10秒钟的请求
      schema:
        type: string
        example: '1672905655498'
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      description: 随机字符串，字符符合HTTP Header头部的规范，建议长度在32个字符以内，字符串组成为数字和字母
      schema:
        type: string
        example: '9578'
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      description: 请求签名。GatePay通过此签名来确定此请求是否合法
      schema:
        type: string
  schemas:
    CreateSubAccountRequest:
      type: object
      required:
        - request_id
        - customer_id
        - display_name
        - account_holder
      properties:
        request_id:
          type: string
          description: 请求方唯一ID
        customer_id:
          type: string
          description: 平台侧客户 ID
        display_name:
          type: string
          description: 子账户展示名
        account_holder:
          $ref: '#/components/schemas/AccountHolder'
        metadata:
          type: object
          description: 附加键值对
    CreateSubAccountResponseWrapper:
      type: object
      properties:
        status:
          type: string
        code:
          type: string
        errorMessage:
          type: string
        data:
          $ref: '#/components/schemas/CreateSubAccountResponse'
    AccountHolder:
      type: object
      required:
        - entity_country
        - entity_type
        - entity_name
        - entity_id_type
        - entity_id_number
        - entity_id_expiry
        - address
        - merchant_category
        - user_agreement
      properties:
        entity_country:
          type: string
          description: >-
            主体所在国家ISO代码，完整列表可参考 ISO 官方在线浏览平台或各类公开的 ISO 3166-1 alpha-2 对照表（例如
            IBAN 官网提供的国家代码列表: https://www.iban.com/country-codes ）
        entity_type:
          type: string
          enum:
            - INDIVIDUAL
            - BUSINESS
          description: 主体类型 个人-INDIVIDUAL 企业-BUSINESS
        entity_name:
          type: string
          description: 主体名称（个人姓名/企业法定名称）
        entity_id_type:
          type: string
          enum:
            - PASSPORT
            - NATIONAL_ID
            - DRIVING_LICENSE
            - BUSINESS_LICENSE
            - CERTIFICATE_OF_INCORPORATION
          description: 证件类型，详见证件类型枚举
        entity_id_number:
          type: string
          description: 证件号码
        entity_id_expiry:
          $ref: '#/components/schemas/EntityIdExpiry'
        dob:
          $ref: '#/components/schemas/Dob'
          description: 出生日期，当entity_type为INDIVIDUAL必填
        business_registration:
          $ref: '#/components/schemas/BusinessRegistration'
          description: 企业注册信息，当entity_type为INDIVIDUAL可填
        address:
          $ref: '#/components/schemas/Address'
          description: 主体所在地址
        merchant_category:
          type: string
          description: 商户大类，详见商户大类枚举
          enum:
            - GENERAL_RETAIL
            - SUPERMARKET_CONVENIENCE
            - FASHION_AND_ACCESSORIES
            - FOOD_AND_BEVERAGE
            - DIGITAL_CONTENT_AND_SAAS
            - GAMING_AND_ENTERTAINMENT
            - TRAVEL_AND_TICKETING
            - RIDE_HAILING_AND_TRANSPORT
            - HOSPITALITY_AND_LEISURE
            - EDUCATION
            - HEALTHCARE_AND_WELLNESS
            - FINANCIAL_SERVICES
            - CRYPTO_AND_WEB3
            - UTILITIES_AND_BILLS
            - CHARITY_AND_NONPROFIT
            - OTHER
        website:
          type: string
          description: 企业网站
        user_agreement:
          type: boolean
          description: 用户是否签署协议
        ubo_list:
          type: array
          description: 法人信息/UBO信息。当 entity_type 为 BUSINESS 时必填。
          items:
            $ref: '#/components/schemas/Ubo'
    CreateSubAccountResponse:
      type: object
      properties:
        request_id:
          type: string
          description: 创建申请单号
        status:
          type: string
          description: 账户状态 初始态-INIT 处理中-PENDING 已创建-ACTIVE 创建失败-FAIL
        created:
          type: string
          description: 创建时间（毫秒）
        customer_id:
          type: string
          description: 平台侧客户 ID
        display_name:
          type: string
          description: 展示名
        account_holder:
          $ref: '#/components/schemas/AccountHolder'
          description: 账户持有人（主体）信息
        metadata:
          type: object
          description: 附加键值对
    EntityIdExpiry:
      type: object
      required:
        - valid_from
      properties:
        valid_from:
          type: integer
          format: int64
          description: 生效日期毫秒时间戳
        valid_to:
          type: integer
          format: int64
          description: 失效日期毫秒时间戳
    Dob:
      type: object
      required:
        - year
        - month
        - day
      properties:
        year:
          type: integer
          description: 四位年份
        month:
          type: integer
          minimum: 1
          maximum: 12
          description: 月份，1-12
        day:
          type: integer
          minimum: 1
          maximum: 31
          description: 日，1-31
    BusinessRegistration:
      type: object
      properties:
        reg_number:
          type: string
          description: 注册号
        reg_country:
          type: string
          description: 注册国家
        established_at:
          type: integer
          format: int64
          description: 成立日期
    Address:
      type: object
      required:
        - line1
        - country
      properties:
        line1:
          type: string
          description: 地址行1
        line2:
          type: string
          description: 地址行2
        line3:
          type: string
          description: 地址行3
        country:
          type: string
          description: 国家代码
        city:
          type: string
          description: 城市
        state:
          type: string
          description: 省/州
        postal_code:
          type: string
          description: 邮编
    Ubo:
      type: object
      required:
        - country
        - full_name
        - dob
        - id_type
        - id_number
        - id_expiry
        - relationship
      properties:
        country:
          type: string
          description: 所在国家ISO代码
        full_name:
          type: string
          description: 个人姓名
        dob:
          $ref: '#/components/schemas/Dob'
          description: 出生日期
        id_type:
          type: string
          enum:
            - PASSPORT
            - NATIONAL_ID
            - DRIVING_LICENSE
          description: 证件类型，请填写个人证件类型
        id_number:
          type: string
          description: 证件号码
        id_expiry:
          $ref: '#/components/schemas/EntityIdExpiry'
          description: 证件有效期
        relationship:
          $ref: '#/components/schemas/Relationship'
          description: 人员和子商户的关系属性
    Relationship:
      type: object
      properties:
        is_representative:
          type: boolean
          description: 是否为法定代表人
        is_owner:
          type: boolean
          description: 是否为最终受益人
        percent_ownership:
          type: string
          description: is_owner 为 true 时必填；填写持股比例数字，示例：30.01

````