Embedded Banking customer management — onboard retail, sole trader, and legal entity customers onto your platform, backed by ClearBank.
Customer types
- Retail — individual consumers (personal accounts)
- Sole Trader — self-employed individuals trading under their own name
- Legal Entity — companies, LLPs, partnerships, and other incorporated entities
KYC
Customer records are separate from KYC status. After creating a customer,
use ClearBank.EmbeddedBanking.Kyc to submit and query KYC data.
Examples
# Create a retail customer
{:ok, customer} = ClearBank.EmbeddedBanking.Customers.create_retail(client, %{
first_name: "Alice",
last_name: "Smith",
date_of_birth: "1990-05-15",
email: "alice@example.com",
phone: "+447700900000"
})
# Create a legal entity
{:ok, entity} = ClearBank.EmbeddedBanking.Customers.create_legal_entity(client, %{
company_name: "ACME Ltd",
registration_number: "12345678",
registered_country: "GB",
company_type: "PrivateLimitedCompany"
})
Summary
Functions
Creates a legal entity (company, LLP, etc.) customer.
Creates a retail (individual consumer) customer.
Creates a sole trader customer.
Returns a customer by ID (any type).
Returns all customers for your institution.
Updates a customer record.
Updates a legal entity customer.
Updates a sole trader customer.
Functions
@spec create_legal_entity(ClearBank.Client.t(), map()) :: ClearBank.HTTP.result()
Creates a legal entity (company, LLP, etc.) customer.
Required params
:company_name- registered company name:registration_number- companies house / equivalent registration number:registered_country- ISO 3166-1 alpha-2, e.g."GB":company_type- e.g."PrivateLimitedCompany","PublicLimitedCompany","LLP"
Optional params
:email,:phone,:external_customer_id:registered_address- address map:trading_address- address map:sic_code- Standard Industrial Classification code:vat_number:beneficial_owners- list of beneficial owner maps
@spec create_retail(ClearBank.Client.t(), map()) :: ClearBank.HTTP.result()
Creates a retail (individual consumer) customer.
Required params
:first_name:last_name:date_of_birth- ISO 8601 date string, e.g."1990-05-15"
Optional params
:email- contact email:phone- E.164 phone number:external_customer_id- your internal customer reference:address- map with:line1,:line2,:city,:post_code,:country:nationality- ISO 3166-1 alpha-2 country code:tax_country- ISO 3166-1 alpha-2 tax residency country
@spec create_sole_trader(ClearBank.Client.t(), map()) :: ClearBank.HTTP.result()
Creates a sole trader customer.
Required params
:first_name,:last_name,:date_of_birth:trading_name- business trading name
Optional params
:email,:phone,:external_customer_id:business_address- trading address map:utr- Unique Taxpayer Reference
@spec get(ClearBank.Client.t(), String.t()) :: ClearBank.HTTP.result()
Returns a customer by ID (any type).
Examples
{:ok, customer} = ClearBank.EmbeddedBanking.Customers.get(client, "cust-uuid")
@spec list( ClearBank.Client.t(), keyword() ) :: ClearBank.HTTP.result()
Returns all customers for your institution.
Options
:page_number,:page_size:customer_type- filter:"Retail"|"SoleTrader"|"LegalEntity":external_customer_id- filter by your own reference
Examples
{:ok, customers} = ClearBank.EmbeddedBanking.Customers.list(client)
{:ok, customers} = ClearBank.EmbeddedBanking.Customers.list(client, customer_type: "Retail")
@spec update(ClearBank.Client.t(), String.t(), map()) :: ClearBank.HTTP.result()
Updates a customer record.
Examples
{:ok, _} = ClearBank.EmbeddedBanking.Customers.update(client, "cust-uuid", %{
email: "newemail@example.com"
})
@spec update_legal_entity(ClearBank.Client.t(), String.t(), map()) :: ClearBank.HTTP.result()
Updates a legal entity customer.
@spec update_sole_trader(ClearBank.Client.t(), String.t(), map()) :: ClearBank.HTTP.result()
Updates a sole trader customer.
Optional params
:email,:phone:business_address- trading address map
Examples
{:ok, _} = ClearBank.EmbeddedBanking.Customers.update_sole_trader(client, "cust-uuid", %{
email: "newemail@example.com"
})