Services

The service layer provides typed methods for every Alviere Hive API operation the SDK supports. Each service is created via a factory method on AlviereCore. Underlying request/response schemas are documented at apidocs.alviere.com.

const core = new AlviereCore({ jwt });

const accounts = core.createAccountsService();
const payments = core.createPaymentsService();
const instruments = core.createPaymentInstrumentsService();
const wallets = core.createWalletsService();
const bankInfo = core.createBankInfoService();
const legalTexts = core.createLegalTextsService();
const auth = core.createAuthGateway();

AccountsApiService

core.createAccountsService()AccountsApiService

Account operations

Method Parameters Returns
createAccount(data) AccountRequest Promise<AccountResponse>
getAccount(accountUuid) string Promise<AccountResponse>
updateAccount(accountUuid, data) string, AccountUpdateRequest Promise<AccountResponse>
deleteAccount(accountUuid) string Promise<void>
listAccounts(params?) AccountListParams? Promise<AccountListResponse>
activateAccount(accountUuid) string Promise<void>
deactivateAccount(accountUuid) string Promise<void>
manageOnboarding(accountUuid, action) string, OnboardingAction Promise<void>

Address operations

Method Parameters Returns
createAddress(accountUuid, data) string, AddressRequest Promise<AddressResponse>
getAddresses(accountUuid, params?) string, AddressListParams? Promise<AddressListResponse>
updateAddress(accountUuid, addressUuid, data) string, string, AddressUpdateRequest Promise<AddressResponse>
deleteAddress(accountUuid, addressUuid) string, string Promise<void>

Dossier operations

Dossiers are KYC/AML document submissions associated with an account.

Method Parameters Returns HTTP verb
createDossier(accountUuid, data) string, DossierRequest Promise<DossierResponse> POST
getDossiers(accountUuid, params?) string, DossierListParams? Promise<DossierListResponse> GET
getDossier(accountUuid, dossierUuid) string, string Promise<DossierResponse> GET
updateDossier(accountUuid, dossierUuid, data) string, string, DossierUpdateRequest Promise<DossierResponse> PUT
replaceDossier(accountUuid, dossierUuid, data) string, string, DossierReplaceRequest Promise<DossierResponse> PATCH
deleteDossier(accountUuid, dossierUuid) string, string Promise<void> DELETE

Dossier verb semantics: updateDossier sends a PUT (full replacement of dossier documents). replaceDossier sends a PATCH (partial update). The names are counterintuitive relative to REST conventions — use replaceDossier when you only need to update a subset of documents.


PaymentProcessor

core.createPaymentsService()PaymentProcessor

Handles card and bank account linking. Methods with WithValidation run client-side field validation (via Validator) before the API call; without it, validation is skipped and errors surface as API responses.

Card

Method Parameters Returns
processAddCard(accountUuid, request) string, AddCardRequest Promise<AddCardResponse>
validateRequest(request) AddCardRequest void (throws on invalid)
processAddCardWithValidation(accountUuid, request) string, AddCardRequest Promise<AddCardResponse>

Bank account

Method Parameters Returns
processAddBankAccount(accountUuid, request) string, AddBankAccountRequest Promise<AddBankAccountResponse>
validateBankAccountRequest(request) AddBankAccountRequest void (throws on invalid)
processAddBankAccountWithValidation(accountUuid, request) string, AddBankAccountRequest Promise<AddBankAccountResponse>
processGetBankAccounts(accountUuid) string Promise<GetBankAccountsResponse>
processDeleteBankAccount(accountUuid, uuid) string, string Promise<void>
processUpdateBankAccount(accountUuid, uuid, request) string, string, UpdateBankAccountRequest Promise<GetBankAccountsResponse>

The validate* methods on PaymentProcessor throw on invalid input. This differs from the Validator utility, whose methods return an error string. See Utilities — Validator for the distinction.

Card payloads that include sensitive fields (PAN, CVV) are encrypted automatically when publicCertificate and publicCertificateId are configured.


PaymentInstrumentsApiService

core.createPaymentInstrumentsService()PaymentInstrumentsApiService

Method Parameters Returns
createPaymentInstrument(data) PaymentInstrumentRequest Promise<PaymentInstrumentResponse>
getPaymentInstrument(paymentInstrumentUuid) string Promise<PaymentInstrumentResponse>
deletePaymentInstrument(paymentInstrumentUuid) string Promise<void>
debitFunds(data) DebitFundsRequest Promise<DebitFundsResponse>
listCards(accountUuid, params?) string, CardListParams? Promise<CardListResponse>

WalletsApiService

core.createWalletsService()WalletsApiService

Method Parameters Returns
listWallets(accountUuid, params?) string, WalletListParams? Promise<WalletListResponse>
loadFunds(walletUuid, params) string, LoadFundsRequest Promise<WalletTransactionResponse>

Only listWallets and loadFunds are implemented in this version. Additional wallet operations (get, withdraw, send, transfer, credit) are in active development and will be documented when they land.


BankInfoApiService

core.createBankInfoService()BankInfoApiService

Method Parameters Returns
getBankInfo(routingNumber) string Promise<BankInfoResponse>

Resolves ACH routing number metadata (bank name, address) before initiating a bank account link.


LegalTextsApiService

core.createLegalTextsService()LegalTextsApiService

Method Parameters Returns
getLegalTexts(type, version?) string, string? Promise<LegalTextsResponse>

Retrieves compliance and legal disclosures. version selects a specific revision; omit to get the latest.


AuthGateway

core.createAuthGateway()AuthGateway

Method Parameters Returns
generateScopedToken(data) GenerateScopedTokenRequest Promise<ScopedTokenResponse>

The lower-level gateway behind AlviereCore.generateScopedToken(). Use core.generateScopedToken(accountUuid) in most cases — it handles updating the internal JWT automatically.