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

# Create Sub Account

> Guide on creating a wallet account.

#### Authorization

<ParamField header="Authorization" type="string" required="true">
  API Key
</ParamField>

<ParamField body="walletID" type="string">
  Unique identifier for the wallet. Must follow the format `RC_WAL-XXXXXX`.
</ParamField>

<ParamField body="createVirtualAccount" type="boolean">
  Set to `true` to create a virtual account alongside the wallet.
</ParamField>

<ParamField body="preferredBank" type="string">
  If available on provider's end you can send it here. Mostly available on production.
</ParamField>

<ParamField body="customer.psuId" type="string">
  Customer's unique identifier (e.g., BVN).
</ParamField>

<ParamField body="customer.externalCustomerID" type="string">
  Optional, this can be used to link an existing customer to a sub-account. This links the customer to their previous transactions; but doesn't link the transactions to the sub-account yet.
</ParamField>

<ParamField body="customer.psuIdType" type="string">
  Type of identifier (`BVN`, `NIN`, etc.).
</ParamField>

<ParamField body="customerID" type="string">
  Optional; used to enable multi-provider between wallets.
</ParamField>

<ParamField body="customer.name" type="string">
  Customer's full name.
</ParamField>

<ParamField body="customer.email" type="string">
  Customer's email address.
</ParamField>

<ParamField body="customer.phone" type="string">
  Customer's phone number (in international format).
</ParamField>

<ParamField body="customer.address" type="string">
  Customer's street address.
</ParamField>

<ParamField body="customer.city" type="string">
  Customer's city of residence.
</ParamField>

<ParamField body="customer.state" type="string">
  Customer's state of residence.
</ParamField>

<ParamField body="customer.postcode" type="string">
  Customer's postal code.
</ParamField>

<ParamField body="customer.country" type="string">
  Customer's country of residence.
</ParamField>

<RequestExample>
  ```bash Example Request theme={null}
  curl --location --request POST 'https://api.recital.finance/api/wallets/account' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <api-key>' \
  --data-raw '{
    "walletID": "RC_WAL-3CRWDOWVBO",
    "createVirtualAccount": true,
    "customer": {
      "psuId": "1232345465768",
      "psuIdType": "BVN",
      "name": "Donald Trump",
      "email": "e@x.com",
      "phone": "08011223344",
      "address": "test address",
      "city": "earth",
      "state": "mars",
      "postcode": "test",
      "country": "pluto"
    }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "walletId": "RC_WAL-6DB1M9XQ",
    "accountWalletId": "616b3434-6318-4593-9d29-78302ee19a08",
    "customerEmail": "e@x.com",
    "customerName": null,
    "bankName": "Mock Bank",
    "accountNumber": "0067100155",
    "currency": "NGN",
    "amount": 0,
    "createdAt": null,
    "updatedAt": null
  }
  ```

  ```json Error Response theme={null}
  {
    "message": "Invalid Wallet ID",
    "success": false
  }
  ```
</ResponseExample>
