--- displayed_sidebar: servicesSidebar --- import ParameterTypes from "@site/src/components/ParameterTypes" # 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":[]}]} /> ___ ## Accessors ### activeManager\_ #### Returns ___ ## Methods ### addCountry Adds a country to the region. #### Parameters #### Returns ___ ### addFulfillmentProvider Adds a fulfillment provider that is available in the region. Fails if the provider doesn't exist. #### Parameters #### Returns ___ ### addPaymentProvider Adds a payment provider that is available in the region. Fails if the provider doesn't exist. #### Parameters #### 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":[]}]} /> #### Returns ___ ### create Creates a region. #### Parameters #### Returns ___ ### delete Deletes a region. #### 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 ___ ### removeCountry Removes a country from a Region. #### Parameters #### Returns ___ ### removeFulfillmentProvider Removes a fulfillment provider from a region. Is idempotent. #### Parameters #### Returns ___ ### removePaymentProvider Removes a payment provider from a region. Is idempotent. #### Parameters #### Returns ___ ### retrieve Retrieves a region by its id. #### Parameters #### Returns ___ ### retrieveByCountryCode Retrieve a region by country code. #### Parameters #### Returns ___ ### retrieveByName Retrieves a region by name. #### Parameters #### Returns ___ ### shouldRetryTransaction\_ #### Parameters ` \\| `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} /> #### Returns ___ ### update Updates a region #### Parameters #### Returns ___ ### validateCountry Validates a country code. Will normalize the code before checking for existence. #### Parameters #### Returns ___ ### validateCurrency Validates a currency code. Will throw if the currency code doesn't exist. #### Parameters #### Returns #### Throws if the provided currency code is invalid ___ ### 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 ___ ### withTransaction #### Parameters #### Returns