Skip to main content

Class: MarketsService

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:55

Extends​

  • BaseService

Constructors​

Constructor​

new MarketsService(client): MarketsService

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:12

Parameters​

client​

TanqoryClient

Returns​

MarketsService

Inherited from​

BaseService.constructor

Properties​

client​

protected client: TanqoryClient

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:10

Inherited from​

BaseService.client

Methods​

addProductsToCatalog()​

addProductsToCatalog(storeId, catalogId, data): Promise<{ data: { added?: number; catalogId: string; productSelection: "all" | "specific"; removed?: number; }; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:295

Parameters​

storeId​

string

catalogId​

string

data​
productIds​

string[]

Returns​

Promise<{ data: { added?: number; catalogId: string; productSelection: "all" | "specific"; removed?: number; }; }>


buildQuery()​

protected buildQuery(options?): Record<string, any>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:26

Build query parameters

Parameters​

options?​

ListOptions

Returns​

Record<string, any>

Inherited from​

BaseService.buildQuery


bulkDeleteCatalogs()​

bulkDeleteCatalogs(storeId, data): Promise<{ data: { deleted: number; }; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:247

Parameters​

storeId​

string

data​
catalogIds​

string[]

Returns​

Promise<{ data: { deleted: number; }; }>


bulkDeleteMarkets()​

bulkDeleteMarkets(storeId, data): Promise<BulkDeleteMarketsResponse>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:117

Parameters​

storeId​

string

data​
marketIds​

string[]

Returns​

Promise<BulkDeleteMarketsResponse>


bulkUpdateCatalogStatus()​

bulkUpdateCatalogStatus(storeId, data): Promise<{ data: { catalogs: object[]; updated: number; }; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:236

Parameters​

storeId​

string

data​
catalogIds​

string[]

status​

"active" | "draft" | "archived" | "inactive"

Returns​

Promise<{ data: { catalogs: object[]; updated: number; }; }>


bulkUpdateMarketStatus()​

bulkUpdateMarketStatus(storeId, data): Promise<BulkUpdateMarketStatusResponse>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:106

Parameters​

storeId​

string

data​
marketIds​

string[]

status​

"active" | "inactive" | "suspended"

Returns​

Promise<BulkUpdateMarketStatusResponse>


createCatalog()​

createCatalog(storeId, data): Promise<{ data: { createdAt: string; createdBy?: string; currency: string; id: string; marketIds: string[]; markets?: object[]; name: string; priceAdjustment?: { applyTo: "all" | "specific"; type: "percentage" | "fixed"; value: number; }; productIds: string[]; productOverrides?: Record<string, { compareAtPrice?: number; customPrice?: number; isExcluded?: boolean; priceAdjustment?: number; productId: string; variantPricing?: Record<string, { compareAtPrice?: number; customPrice?: number; variantId: string; }>; }>; products?: object[]; productsCount: number; productSelection: "all" | "specific"; status: "active" | "draft" | "archived" | "inactive"; storeId: string; updatedAt: string; updatedBy?: string; }; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:193

Parameters​

storeId​

string

data​
currency?​

string

marketIds​

string[]

name​

string

priceAdjustment?​

{ applyTo: "all" | "specific"; enabled: boolean; includeCompareAtPrice: boolean; type: "percentage" | "fixed"; value: number; }

priceAdjustment.applyTo​

"all" | "specific"

priceAdjustment.enabled​

boolean

priceAdjustment.includeCompareAtPrice​

boolean

priceAdjustment.type​

"percentage" | "fixed"

priceAdjustment.value​

number

productIds?​

string[]

productOverrides?​

Record<string, { compareAtPrice?: number; customPrice?: number; isExcluded?: boolean; priceAdjustment?: number; productId: string; variantPricing?: Record<string, { compareAtPrice?: number; customPrice?: number; variantId: string; }>; }>

products​

object[]

productSelection​

"all" | "specific"

status​

"active" | "draft" | "archived" | "inactive"

Returns​

Promise<{ data: { createdAt: string; createdBy?: string; currency: string; id: string; marketIds: string[]; markets?: object[]; name: string; priceAdjustment?: { applyTo: "all" | "specific"; type: "percentage" | "fixed"; value: number; }; productIds: string[]; productOverrides?: Record<string, { compareAtPrice?: number; customPrice?: number; isExcluded?: boolean; priceAdjustment?: number; productId: string; variantPricing?: Record<string, { compareAtPrice?: number; customPrice?: number; variantId: string; }>; }>; products?: object[]; productsCount: number; productSelection: "all" | "specific"; status: "active" | "draft" | "archived" | "inactive"; storeId: string; updatedAt: string; updatedBy?: string; }; }>


createMarket()​

createMarket(storeId, data): Promise<MarketItem>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:80

Parameters​

storeId​

string

data​
catalogId?​

string

catalogIds?​

string[]

currency​

string

currencySettings?​

{ baseCurrency: string; conversionFeePercent: number; mode: "single" | "local"; priceRounding: "round_up" | "no_rounding"; }

currencySettings.baseCurrency​

string

currencySettings.conversionFeePercent​

number

currencySettings.mode​

"single" | "local"

currencySettings.priceRounding​

"round_up" | "no_rounding"

domain?​

string

exchangeRate?​

{ manualRate?: number; rateType: "manual" | "dynamic"; }

exchangeRate.manualRate?​

number

exchangeRate.rateType​

"manual" | "dynamic"

languages​

string[]

metafields?​

object[]

name​

string

paymentGateways?​

string[]

pricingAdjustment?​

number

regions​

string[]

status​

"active" | "inactive" | "suspended"

taxRegion?​

string

Returns​

Promise<MarketItem>


deleteCatalog()​

deleteCatalog(id, storeId): Promise<{ message?: string; success: boolean; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:209

Parameters​

id​

string

storeId​

string

Returns​

Promise<{ message?: string; success: boolean; }>


deleteMarket()​

deleteMarket(id, storeId): Promise<DeletedResponse>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:88

Parameters​

id​

string

storeId​

string

Returns​

Promise<DeletedResponse>


duplicateCatalog()​

duplicateCatalog(id, storeId): Promise<{ data: { createdAt: string; createdBy?: string; currency: string; id: string; marketIds: string[]; markets?: object[]; name: string; priceAdjustment?: { applyTo: "all" | "specific"; type: "percentage" | "fixed"; value: number; }; productIds: string[]; productOverrides?: Record<string, { compareAtPrice?: number; customPrice?: number; isExcluded?: boolean; priceAdjustment?: number; productId: string; variantPricing?: Record<string, { compareAtPrice?: number; customPrice?: number; variantId: string; }>; }>; products?: object[]; productsCount: number; productSelection: "all" | "specific"; status: "active" | "draft" | "archived" | "inactive"; storeId: string; updatedAt: string; updatedBy?: string; }; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:213

Parameters​

id​

string

storeId​

string

Returns​

Promise<{ data: { createdAt: string; createdBy?: string; currency: string; id: string; marketIds: string[]; markets?: object[]; name: string; priceAdjustment?: { applyTo: "all" | "specific"; type: "percentage" | "fixed"; value: number; }; productIds: string[]; productOverrides?: Record<string, { compareAtPrice?: number; customPrice?: number; isExcluded?: boolean; priceAdjustment?: number; productId: string; variantPricing?: Record<string, { compareAtPrice?: number; customPrice?: number; variantId: string; }>; }>; products?: object[]; productsCount: number; productSelection: "all" | "specific"; status: "active" | "draft" | "archived" | "inactive"; storeId: string; updatedAt: string; updatedBy?: string; }; }>


exportCatalogs()​

exportCatalogs(storeId, data): Promise<{ data: { downloadUrl: string; expiresAt: string; }; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:278

Parameters​

storeId​

string

data​
includeMarketAssociations​

boolean

includePriceAdjustments​

boolean

includeProductCustomizations​

boolean

scope​

"all" | "selected" | "current-view"

selectedIds?​

string[]

Returns​

Promise<{ data: { downloadUrl: string; expiresAt: string; }; }>


generateIdempotencyKey()​

protected generateIdempotencyKey(prefix): string

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:19

Generate idempotency key

Parameters​

prefix​

string

Returns​

string

Inherited from​

BaseService.generateIdempotencyKey


getCatalogCountsTimeseries()​

getCatalogCountsTimeseries(storeId, params): Promise<{ active: object[]; all: object[]; archived: object[]; draft: object[]; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:346

Get catalog counts time-series data

Parameters​

storeId​

string

params​
from​

string

groupBy?​

"day" | "week" | "month"

to​

string

Returns​

Promise<{ active: object[]; all: object[]; archived: object[]; draft: object[]; }>


getExportMimeType()​

protected getExportMimeType(format): string

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:45

Get MIME type for export format

Parameters​

format​

string

Returns​

string

Inherited from​

BaseService.getExportMimeType


getMarketsForCatalog()​

getMarketsForCatalog(storeId, params?): Promise<ListResponse<{ currency: string; currencySettings?: { baseCurrency: string; conversionFeePercent: number; mode: "single" | "local"; priceRounding: "round_up" | "no_rounding"; }; exchangeRate?: { fetchedAt?: string; rate: number; rateType: "manual" | "dynamic"; sourceCurrency: string; targetCurrency: string; }; id: string; name: string; regionsCount: number; status: "active" | "inactive" | "suspended"; }>>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:147

Parameters​

storeId​

string

params?​
limit​

number

page​

number

string

Returns​

Promise<ListResponse<{ currency: string; currencySettings?: { baseCurrency: string; conversionFeePercent: number; mode: "single" | "local"; priceRounding: "round_up" | "no_rounding"; }; exchangeRate?: { fetchedAt?: string; rate: number; rateType: "manual" | "dynamic"; sourceCurrency: string; targetCurrency: string; }; id: string; name: string; regionsCount: number; status: "active" | "inactive" | "suspended"; }>>


getMarketStats()​

getMarketStats(storeId): Promise<{ activeMarkets: number; revenueByMarket: object[]; totalMarkets: number; totalRegions: number; totalRevenue: number; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:132

Parameters​

storeId​

string

Returns​

Promise<{ activeMarkets: number; revenueByMarket: object[]; totalMarkets: number; totalRegions: number; totalRevenue: number; }>


importCatalogs()​

importCatalogs(storeId, data): Promise<{ data: { created: number; errors: object[]; updated: number; }; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:262

Parameters​

storeId​

string

data​
createNewOnly​

boolean

file​

any

updateExisting​

boolean

Returns​

Promise<{ data: { created: number; errors: object[]; updated: number; }; }>


listCatalogs()​

listCatalogs(storeId, params?): Promise<{ data: object[]; meta?: { hasMore: boolean; limit: number; offset: number; totalCount: number; }; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:168

Parameters​

storeId​

string

params?​
hasProducts?​

"all" | "specific" | "empty"

limit?​

number

marketId?​

string

offset?​

number

priceAdjustmentMax?​

number

priceAdjustmentMin?​

number

search?​

string

sortBy?​

"name" | "products" | "updated"

sortOrder?​

"asc" | "desc"

status?​

"all" | "active" | "draft" | "archived" | "inactive"

Returns​

Promise<{ data: object[]; meta?: { hasMore: boolean; limit: number; offset: number; totalCount: number; }; }>


listMarketActivities()​

listMarketActivities(storeId, params?): Promise<ListResponse<{ action: "deleted" | "updated" | "created" | "status_changed"; details?: Record<string, any>; id: string; marketId: string; timestamp: string; userId: string; userName: string; }>>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:136

Parameters​

storeId​

string

params?​
limit​

number

marketId?​

string

page​

number

Returns​

Promise<ListResponse<{ action: "deleted" | "updated" | "created" | "status_changed"; details?: Record<string, any>; id: string; marketId: string; timestamp: string; userId: string; userName: string; }>>


listMarkets()​

listMarkets(storeId, params?): Promise<ListResponse<MarketItem>>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:60

Parameters​

storeId​

string

params?​
currency?​

string

hasCustomizations?​

"yes" | "no"

limit​

number

page​

number

regionsCountMax?​

number

regionsCountMin?​

number

search?​

string

sortBy?​

"name-asc" | "name-desc" | "updated-newest" | "updated-oldest" | "regions-desc" | "regions-asc"

status?​

"all" | "active" | "inactive" | "suspended"

Returns​

Promise<ListResponse<MarketItem>>


listProductsForPicker()​

listProductsForPicker(storeId, params?): Promise<{ data: object[]; meta?: { hasMore: boolean; limit: number; offset: number; totalCount: number; }; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:323

Parameters​

storeId​

string

params?​
collection?​

string

limit?​

number

offset?​

number

productType?​

string

search?​

string

status?​

string

Returns​

Promise<{ data: object[]; meta?: { hasMore: boolean; limit: number; offset: number; totalCount: number; }; }>


removeProductsFromCatalog()​

removeProductsFromCatalog(storeId, catalogId, data): Promise<{ data: { added?: number; catalogId: string; productSelection: "all" | "specific"; removed?: number; }; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:307

Parameters​

storeId​

string

catalogId​

string

data​
productIds​

string[]

Returns​

Promise<{ data: { added?: number; catalogId: string; productSelection: "all" | "specific"; removed?: number; }; }>


retrieveCatalog()​

retrieveCatalog(id, storeId): Promise<{ data: { createdAt: string; createdBy?: string; currency: string; id: string; marketIds: string[]; markets?: object[]; name: string; priceAdjustment?: { applyTo: "all" | "specific"; type: "percentage" | "fixed"; value: number; }; productIds: string[]; productOverrides?: Record<string, { compareAtPrice?: number; customPrice?: number; isExcluded?: boolean; priceAdjustment?: number; productId: string; variantPricing?: Record<string, { compareAtPrice?: number; customPrice?: number; variantId: string; }>; }>; products?: object[]; productsCount: number; productSelection: "all" | "specific"; status: "active" | "draft" | "archived" | "inactive"; storeId: string; updatedAt: string; updatedBy?: string; }; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:189

Parameters​

id​

string

storeId​

string

Returns​

Promise<{ data: { createdAt: string; createdBy?: string; currency: string; id: string; marketIds: string[]; markets?: object[]; name: string; priceAdjustment?: { applyTo: "all" | "specific"; type: "percentage" | "fixed"; value: number; }; productIds: string[]; productOverrides?: Record<string, { compareAtPrice?: number; customPrice?: number; isExcluded?: boolean; priceAdjustment?: number; productId: string; variantPricing?: Record<string, { compareAtPrice?: number; customPrice?: number; variantId: string; }>; }>; products?: object[]; productsCount: number; productSelection: "all" | "specific"; status: "active" | "draft" | "archived" | "inactive"; storeId: string; updatedAt: string; updatedBy?: string; }; }>


retrieveMarket()​

retrieveMarket(id, storeId): Promise<MarketItem>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:76

Parameters​

id​

string

storeId​

string

Returns​

Promise<MarketItem>


updateCatalog()​

updateCatalog(id, storeId, data): Promise<{ data: { createdAt: string; createdBy?: string; currency: string; id: string; marketIds: string[]; markets?: object[]; name: string; priceAdjustment?: { applyTo: "all" | "specific"; type: "percentage" | "fixed"; value: number; }; productIds: string[]; productOverrides?: Record<string, { compareAtPrice?: number; customPrice?: number; isExcluded?: boolean; priceAdjustment?: number; productId: string; variantPricing?: Record<string, { compareAtPrice?: number; customPrice?: number; variantId: string; }>; }>; products?: object[]; productsCount: number; productSelection: "all" | "specific"; status: "active" | "draft" | "archived" | "inactive"; storeId: string; updatedAt: string; updatedBy?: string; }; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:199

Parameters​

id​

string

storeId​

string

data​
currency?​

string

marketIds?​

string[]

name?​

string

priceAdjustment?​

{ applyTo: "all" | "specific"; enabled: boolean; includeCompareAtPrice: boolean; type: "percentage" | "fixed"; value: number; }

priceAdjustment.applyTo​

"all" | "specific"

priceAdjustment.enabled​

boolean

priceAdjustment.includeCompareAtPrice​

boolean

priceAdjustment.type​

"percentage" | "fixed"

priceAdjustment.value​

number

productIds?​

string[]

productOverrides?​

Record<string, { compareAtPrice?: number; customPrice?: number; isExcluded?: boolean; priceAdjustment?: number; productId: string; variantPricing?: Record<string, { compareAtPrice?: number; customPrice?: number; variantId: string; }>; }>

products?​

object[]

productSelection?​

"all" | "specific"

status?​

"active" | "draft" | "archived" | "inactive"

Returns​

Promise<{ data: { createdAt: string; createdBy?: string; currency: string; id: string; marketIds: string[]; markets?: object[]; name: string; priceAdjustment?: { applyTo: "all" | "specific"; type: "percentage" | "fixed"; value: number; }; productIds: string[]; productOverrides?: Record<string, { compareAtPrice?: number; customPrice?: number; isExcluded?: boolean; priceAdjustment?: number; productId: string; variantPricing?: Record<string, { compareAtPrice?: number; customPrice?: number; variantId: string; }>; }>; products?: object[]; productsCount: number; productSelection: "all" | "specific"; status: "active" | "draft" | "archived" | "inactive"; storeId: string; updatedAt: string; updatedBy?: string; }; }>


updateCatalogStatus()​

updateCatalogStatus(id, storeId, data): Promise<{ data: { createdAt: string; createdBy?: string; currency: string; id: string; marketIds: string[]; markets?: object[]; name: string; priceAdjustment?: { applyTo: "all" | "specific"; type: "percentage" | "fixed"; value: number; }; productIds: string[]; productOverrides?: Record<string, { compareAtPrice?: number; customPrice?: number; isExcluded?: boolean; priceAdjustment?: number; productId: string; variantPricing?: Record<string, { compareAtPrice?: number; customPrice?: number; variantId: string; }>; }>; products?: object[]; productsCount: number; productSelection: "all" | "specific"; status: "active" | "draft" | "archived" | "inactive"; storeId: string; updatedAt: string; updatedBy?: string; }; }>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:224

Parameters​

id​

string

storeId​

string

data​
status​

"active" | "draft" | "archived" | "inactive"

Returns​

Promise<{ data: { createdAt: string; createdBy?: string; currency: string; id: string; marketIds: string[]; markets?: object[]; name: string; priceAdjustment?: { applyTo: "all" | "specific"; type: "percentage" | "fixed"; value: number; }; productIds: string[]; productOverrides?: Record<string, { compareAtPrice?: number; customPrice?: number; isExcluded?: boolean; priceAdjustment?: number; productId: string; variantPricing?: Record<string, { compareAtPrice?: number; customPrice?: number; variantId: string; }>; }>; products?: object[]; productsCount: number; productSelection: "all" | "specific"; status: "active" | "draft" | "archived" | "inactive"; storeId: string; updatedAt: string; updatedBy?: string; }; }>


updateMarket()​

updateMarket(id, storeId, data): Promise<MarketItem>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:84

Parameters​

id​

string

storeId​

string

data​
catalogId?​

string

catalogIds?​

string[]

currency?​

string

currencySettings?​

{ baseCurrency: string; conversionFeePercent: number; mode: "single" | "local"; priceRounding: "round_up" | "no_rounding"; }

currencySettings.baseCurrency​

string

currencySettings.conversionFeePercent​

number

currencySettings.mode​

"single" | "local"

currencySettings.priceRounding​

"round_up" | "no_rounding"

domain?​

string

exchangeRate?​

{ manualRate?: number; rateType: "manual" | "dynamic"; }

exchangeRate.manualRate?​

number

exchangeRate.rateType​

"manual" | "dynamic"

languages?​

string[]

metafields?​

object[]

name?​

string

paymentGateways?​

string[]

pricingAdjustment?​

number

regions?​

string[]

status?​

"active" | "inactive" | "suspended"

taxRegion?​

string

Returns​

Promise<MarketItem>


updateMarketStatus()​

updateMarketStatus(id, storeId, data): Promise<MarketItem>

Defined in: tanqory-platform-packages/packages/api/sdk/src/services/markets.ts:96

Parameters​

id​

string

storeId​

string

data​
status​

"active" | "inactive" | "suspended"

Returns​

Promise<MarketItem>