Skip to main content
Skip to main content

retrieveCountry - Region Module Reference

This documentation provides a reference to the retrieveCountry method. This belongs to the Region Module.

This method retrieves a country by its 2 character ISO code.

Example

A simple example that retrieves a country by its 2 character ISO code:

const country =
await regionModuleService.retrieveCountry("us")

To specify relations that should be retrieved:

const country = await regionModuleService.retrieveCountry(
"us",
{
relations: ["region"],
}
)

Parameters

countryIdstringRequired
The country's ID, which is the 2 character ISO code.
The configurations determining how the country is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a country.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<RegionCountryDTO>Required
The retrieved country.
Was this section helpful?