--- displayed_sidebar: servicesSidebar --- import TypeList from "@site/src/components/TypeList" # RegionService Provides layer to manipulate regions. ## constructor ### Parameters ___ ## Properties `","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"__moduleDeclaration__","type":"`Record`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="RegionService"/> ___ ## Accessors ### activeManager\_ #### Returns ___ ## Methods ### withTransaction #### Parameters #### Returns ### shouldRetryTransaction\_ #### Parameters ` \\| `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="shouldRetryTransaction_"/> #### Returns ### atomicPhase\_ Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. #### Type Parameters #### Parameters Promise<TResult>","description":"the transactional work to be done","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationOrErrorHandler","type":"`IsolationLevel` \\| (`error`: TError) => Promise<void \\| TResult>","description":"the isolation level to be used for the work.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"maybeErrorHandlerOrDontFail","type":"(`error`: TError) => Promise<void \\| TResult>","description":"Potential error handler","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="atomicPhase_"/> #### Returns ### create Creates a region. #### Parameters #### Returns ### update Updates a region #### Parameters #### Returns ### validateFields Validates fields for creation and updates. If the region already exists the id can be passed to check that country updates are allowed. #### Type Parameters #### Parameters #### Returns ### validateTaxRate Validates a tax rate. Will throw if the tax rate is not between 0 and 1. #### Parameters #### Returns #### Throws if the tax rate isn't number between 0-100 ### validateCurrency Validates a currency code. Will throw if the currency code doesn't exist. #### Parameters #### Returns #### Throws if the provided currency code is invalid ### validateCountry Validates a country code. Will normalize the code before checking for existence. #### Parameters #### Returns ### retrieveByCountryCode Retrieve a region by country code. #### Parameters #### Returns ### retrieveByName Retrieves a region by name. #### Parameters #### Returns ### retrieve Retrieves a region by its id. #### Parameters #### Returns ### list Lists all regions based on a query #### Parameters #### Returns ### listAndCount Lists all regions based on a query and returns them along with count #### Parameters #### Returns ### delete Deletes a region. #### Parameters #### Returns ### addCountry Adds a country to the region. #### Parameters #### Returns ### removeCountry Removes a country from a Region. #### Parameters #### Returns ### addPaymentProvider Adds a payment provider that is available in the region. Fails if the provider doesn't exist. #### Parameters #### Returns ### addFulfillmentProvider Adds a fulfillment provider that is available in the region. Fails if the provider doesn't exist. #### Parameters #### Returns ### removePaymentProvider Removes a payment provider from a region. Is idempotent. #### Parameters #### Returns ### removeFulfillmentProvider Removes a fulfillment provider from a region. Is idempotent. #### Parameters #### Returns