# 开立币种账户

> 为指定用户提交币种账户开户请求。

```yaml
openapi: 3.1.0
x-onerway-docs-version: original
x-onerway-spec-key: embedded-finance/currency-accounts/open-currency-account
info:
  title: 开立币种账户
  version: original
  description: 为指定用户提交币种账户开户请求。
servers:
  - url: https://sandbox-baas.onerway.com/embedded-finance
    description: sandbox
  - url: https://baas.onerway.com
    description: production
paths:
  /api/v2/currency-accounts/open:
    post:
      summary: 开立币种账户
      description: 为指定用户提交币种账户开户请求。
      parameters:
        - name: apiKey
          in: header
          required: true
          description: 用于访问嵌入式金融 API 的 API key。
          schema:
            type: string
            description: 用于访问嵌入式金融 API 的 API key。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: integer
                  description: 需要开立币种账户的用户 ID。
                currencyCode:
                  type: string
                  description: 待开立账户的币种代码。
              required:
                - userId
                - currencyCode
            examples:
              default:
                summary: 开立币种账户
                value:
                  userId: 123456789
                  currencyCode: GBP
      responses:
        "200":
          description: 开户请求成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: Onerway 返回的响应码；`20000` 表示成功。
                  respMsg:
                    type: string
                    description: 响应码对应的可读消息。
                  data:
                    type:
                      - object
                      - "null"
                    properties:
                      {}
                    description: 响应数据；成功示例中为 `null`。
                    x-onerway-value:
                      nullable: true
              examples:
                success:
                  summary: 开户请求成功
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data: null
      security:
        - apiKeyAuth:
            []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: apiKey
```
