Broadleaf Microservices
  • v1.0.0-latest-prod

Application

An Application is the main container for all the data that your storefront maps to. In Broadleaf, all catalogs, products, offers, etc are assigned to an application. The following operations allow you to resolve the current application based on its Id, token or Url.

Resolve Application

Operation

TenantClient#getApplication(applicationParams, options);

Parameters

Parameter Type Required? Description

applicationParams

ApplicationRequestParams

Provide an application Id, Url or token

options

ClientCallOptions

Options passed to the HTTP request call to customize the request configuration.

Response

This function returns an ApplicationResolverResponse.

Example

Example of resolving an application by its Id
const response = await tenantClient.getApplication({id: '1'});

console.log(response);

Resolve Application By Id

This is a helper function to resolve an application by it’s Id.

Operation

TenantClient#getApplicationById(id, options);

Parameters

Parameter Type Required? Description

id

string

Provide an application Id to resolve

options

ClientCallOptions

Options passed to the HTTP request call to customize the request configuration.

Response

This function returns an ApplicationResolverResponse.

Example

Example of resolving an application by its Id
const response = await tenantClient.getApplicationById('1');

console.log(response);

Resolve Application By Url

This is a helper function to resolve an application by it’s Url.

Operation

TenantClient#getApplicationByUrl(url, options);

Parameters

Parameter Type Required? Description

url

string

Provide an application Url to resolve.

options

ClientCallOptions

Options passed to the HTTP request call to customize the request configuration.

Response

This function returns an ApplicationResolverResponse.

Example

Example of resolving an application by its Url
const response = await tenantClient.getApplicationByUrl('https://heatclinic.com');

console.log(response);

Resolve Application By Token

This is a helper function to resolve an application by it’s token.

Operation

TenantClient#getApplicationByToken(token, options);

Parameters

Parameter Type Required? Description

token

string

Provide an application token to resolve.

options

ClientCallOptions

Options passed to the HTTP request call to customize the request configuration.

Response

This function returns an ApplicationResolverResponse.

Example

Example of resolving an application by its token
const response = await tenantClient.getApplicationByToken('HEAT_CLINIC');

console.log(response);