Skip to main content

Customers Scope

Source: src/sdk/customers.ts

Use sdk.customers for customer creation, retrieval, updates, deletion, and customer-address lookup.

Methods

create(dto: CreateCustomerDto): Promise<Customer>

Endpoint

POST /api/v1/account-manager/customers

How it works

Creates a customer through Account Manager.

Arguments

ArgumentTypeRequiredNotes
dto.externalIdstringYesExternal customer identifier.
dto.statusCustomerStatusYesExample: CustomerStatus.ACTIVE.

Returns

Promise<Customer>

Request Example

import { CustomerStatus } from '@ledgerlink/link-sdk';

const customer = await sdk.customers.create({
externalId: 'customer-ext-001',
status: CustomerStatus.ACTIVE,
});

Response Example

{
id: 'customer-id',
externalId: 'customer-ext-001',
status: 'active',
participantId: 'participant-123',
accounts: [],
createdAt: '2026-04-02T09:00:00.000Z',
updatedAt: '2026-04-02T09:00:00.000Z',
}

findAll(): Promise<Customer[]>

Endpoint

GET /api/v1/account-manager/customers

How it works

Returns all customers from the current endpoint without SDK-side filtering.

Arguments

This method does not accept arguments.

Returns

Promise<Customer[]>

Request Example

const customers = await sdk.customers.findAll();

Response Example

[
{
id: 'customer-id',
externalId: 'customer-ext-001',
status: 'active',
participantId: 'participant-123',
accounts: [],
createdAt: '2026-04-02T09:00:00.000Z',
updatedAt: '2026-04-02T09:00:00.000Z',
},
]

getById(id: string): Promise<Customer>

Endpoint

GET /api/v1/account-manager/customers/:id

How it works

Fetches one customer by ID.

Arguments

ArgumentTypeRequiredNotes
idstringYesCustomer identifier.

Returns

Promise<Customer>

Request Example

const customer = await sdk.customers.getById('customer-id');

Response Example

{
id: 'customer-id',
externalId: 'customer-ext-001',
status: 'active',
participantId: 'participant-123',
accounts: [],
createdAt: '2026-04-02T09:00:00.000Z',
updatedAt: '2026-04-02T09:00:00.000Z',
}

update(id: string, dto: UpdateCustomerDto): Promise<Customer>

Endpoint

PUT /api/v1/account-manager/customers/:id

How it works

Updates a customer using the current SDK DTO.

Arguments

ArgumentTypeRequiredNotes
idstringYesCustomer identifier.
dto.statusCustomerStatusYesCurrent SDK DTO only exposes status.

Returns

Promise<Customer>

Request Example

const updated = await sdk.customers.update('customer-id', {
status: CustomerStatus.INACTIVE,
});

Response Example

{
id: 'customer-id',
externalId: 'customer-ext-001',
status: 'inactive',
participantId: 'participant-123',
accounts: [],
createdAt: '2026-04-02T09:00:00.000Z',
updatedAt: '2026-04-02T09:15:00.000Z',
}

delete(id: string): Promise<void>

Endpoint

DELETE /api/v1/account-manager/customers/:id

How it works

Calls the delete endpoint and resolves without a return value.

Arguments

ArgumentTypeRequiredNotes
idstringYesCustomer identifier.

Returns

Promise<void>

Request Example

await sdk.customers.delete('customer-id');

getAllAddressesForCustomer(id: string): Promise<string[]>

Endpoint

GET /api/v1/account-manager/customers/:id/accounts/addresses

How it works

Returns addresses for accounts associated with the specified customer.

Arguments

ArgumentTypeRequiredNotes
idstringYesCustomer identifier.

Returns

Promise<string[]>

Request Example

const addresses = await sdk.customers.getAllAddressesForCustomer('customer-id');

Response Example

[
'0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
'7Y5P4E1XwP1h5ya9Lz7h2n3VgJY6QmE1K4m6mV9S1E2f',
]