Create a Digital Wallet
To create a wallet, follow these steps:
- Create a new entity.
- Create a new wallet owned by the entity.
Create Entity
Each wallet is owned by an entity, and each entity can own several wallets. Therefore, to create a wallet, you first need to create an entity.
ENTITY_DID=$(curl --request POST \
--url "https://api.truvity.com/api/wallet/v1/entity" \
--header "X-API-KEY: ${TRUVITY_API_KEY}" | jq -r '.EntityDid' )
Create Wallet for Entity
Now you can create a new wallet for the entity using the created entity's DID. To do this, call the create wallet endpoint.
WALLET_DID=$(curl --request POST \
--url "https://api.truvity.com/api/wallet/v1/wallet?entityDid=${ENTITY_DID}" \
--header "X-API-KEY: ${TRUVITY_API_KEY}" | jq -r '.WalletDid')