Entity Management

An Entity represents either your organization, or your individual customers. The following sections provide an example on how to manage entities. Please note that to manage your organization, use the entity id provided in your dashboard.

SDK References

SDK Examples

Creating Entity

import Dinari from '@dinari/api-sdk';

const client = new Dinari({
  apiKeyID: process.env['DINARI_API_KEY_ID'], // This is the default and can be omitted
  apiSecretKey: process.env['DINARI_API_SECRET_KEY'], // This is the default and can be omitted
  environment: 'sandbox', // defaults to 'production'
});

async function main() {
  const entity = await client.v2.entities.create({
    name: 'John Doe LLC',
  });

  console.log(entity);
}

main();
import os
from dinari_api_sdk import Dinari

client = Dinari(
    api_key_id=os.environ.get("DINARI_API_KEY_ID"),  # This is the default and can be omitted
    api_secret_key=os.environ.get("DINARI_API_SECRET_KEY"),  # This is the default and can be omitted
    environment="sandbox", # defaults to "production"
)

entity = client.v2.entities.create(
    name="John Doe",
)
package main

import (
	"context"
	"fmt"
	"log"

	dinari "github.com/dinaricrypto/dinari-api-sdk-go"
	"github.com/dinaricrypto/dinari-api-sdk-go/option"
)

func main() {
	// DINARI_API_KEY_ID and DINARI_API_SECRET_KEY are set as environment variables
	client := dinari.NewClient(
		option.WithEnvironmentSandbox(), // Defaults to production when omitted
	)

	params := dinari.V2EntityNewParams{
		Name: "Individual Name",
	}

	newEntity, err := client.V2.Entities.New(context.TODO(), params)
	if err != nil {
		log.Fatalf("Failed to create entity: %v", err)
	}

	fmt.Printf("New Entity ID: %+v\\n", newEntity.ID)
}