Accounts

Learn how to create accounts for your Account Holders (users) to manage their crypto assets.

Before You Begin

Make sure you've created an Account Holder and noted down the id attribute.

Create an Account

1. Make a POST request to https://sandbox.conduit.financial/accounts with the following body but replace the Account Holder id with the one you noted down:

Copy
Copied
{
  "data": {
    "relationships": {
      "account-holders": {
        "data": [
          {"type": "account-holder", "id": "id:ahl:2J8Ocs7KFZJt3CMPi9f0x8UCCQ0"}
        ]
      }
    }
  }
}

2. If successful, you will see a similar response from the API.

Tip

Note down the account id attribute and allocation id (e.g. id:allc:2J8OkA50iEKCUdAP64xbgU14Irf) so you can use it later.

Copy
Copied
{
  "data": {
    "id": "id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE",
    "type": "account",
    "attributes": {
      "balances": {
        "available": [
          {
            "assetType": "asset:eth:ETH",
            "amount": "0"
          },
          {
            "assetType": "asset:eth:USDC",
            "amount": "0"
          }
        ],
        "pending": [
          {
            "assetType": "asset:eth:ETH",
            "amount": "0"
          },
          {
            "assetType": "asset:eth:USDC",
            "amount": "0"
          }
        ]
      }
    },
    "relationships": {
      "account-holders": {
        "links": {
          "self": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/relationships/account-holders",
          "related": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/account-holders"
        },
        "data": [
          {
            "id": "id:ahl:2J8Ocs7KFZJt3CMPi9f0x8UCCQ0",
            "type": "account-holder"
          }
        ]
      },
      "allocations": {
        "links": {
          "self": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/relationships/allocations",
          "first": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/relationships/allocations",
          "next": null,
          "related": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/allocations"
        },
        "data": [
          {
            "id": "id:allc:2J8OkA50iEKCUdAP64xbgU14Irf",
            "type": "allocation"
          }
        ]
      },
      "wallets": {
        "links": {
          "self": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/relationships/wallets",
          "related": "/accounts/id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE/wallets"
        },
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "id:allc:2J8OkA50iEKCUdAP64xbgU14Irf",
      "type": "allocation",
      "attributes": {
        "effectiveYieldRate": "0",
        "conduitTakeRate": "20",
        "clientTakeRate": "0",
        "poolId": "id:pool:2H1E3EPxcafvzFKOyoLUwO2PfcK",
        "poolYieldRate": "0",
        "accountId": "id:acct:2J8Ok1bfIrvpNcX2V8QwDMigUKE",
        "poolName": "default_pool_usdc",
        "balances": {
          "available": [
            {
              "assetType": "asset:eth:ETH",
              "amount": "0"
            },
            {
              "assetType": "asset:eth:USDC",
              "amount": "0"
            }
          ],
          "pending": [
            {
              "assetType": "asset:eth:ETH",
              "amount": "0"
            },
            {
              "assetType": "asset:eth:USDC",
              "amount": "0"
            }
          ],
          "accruedYield": [
            {
              "assetType": "asset:eth:USDC",
              "amount": "0"
            }
          ]
        }
      }
    }
  ]
}

Next Steps

Now that you've successfully created your first account, let's create a deposit wallet so you can start depositing crypto.