Recipe

Quote a Business Loan with the Node SDK

The Node SDK exposes the public quote endpoint as a typed async call. Await a quote for an amount and term; a range error throws a typed exception you can catch and clamp.

2 min read

Node.jsSDK
async/awaitTyped
14–84 daysTerm range

Create and await

import { PublicClient } from '@credicorp/sdk';
const credicorp = new PublicClient();
const quote = await credicorp.quote.oneTime({ amount: 300, term: 30, frequency: 'weekly' });
console.log(quote.totalRepayable);

The public client needs no token — quotes are on the public ring.

Catch the range error

try {
  const quote = await credicorp.quote.oneTime({ amount, term });
} catch (e) {
  if (e instanceof RangeError) { /* clamp to 50-500 / 14-84 */ }
}

Front-end or server

You can run the public client in a Node server or, for a browser widget, call the endpoint directly with fetch — see the quote-widget recipe. For partner flows, the SDK handles token caching for you.

Frequently asked questions

Can I use the Node SDK in the browser?

For public reads, yes, though a direct fetch is often lighter. Never put partner credentials in the browser — partner-ring SDK use belongs on the server where the client secret is safe.

Is the quote call promise-based?

Yes. The Node SDK is async throughout — await the quote call and catch a typed RangeError for out-of-range inputs.

Funding for UK limited companies

Credicorp lends to your company, not to you personally — short-term working capital with no personal guarantee. See what your business could access.