Class: LocationsService
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:27
Extends
BaseService
Constructors
Constructor
new LocationsService(
client):LocationsService
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:12
Parameters
client
Returns
LocationsService
Inherited from
BaseService.constructor
Properties
client
protectedclient:TanqoryClient
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:10
Inherited from
BaseService.client
Methods
buildQuery()
protectedbuildQuery(options?):Record<string,any>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:26
Build query parameters
Parameters
options?
Returns
Record<string, any>
Inherited from
BaseService.buildQuery
create()
create(
storeId,data):Promise<{address: {address:string;apartment?:string;city:string;country:string;phone:string;phoneCountryCode:string;postalCode:string;province?:string; };code?:string;createdAt:string;fulfillsOnlineOrders:boolean;id:string;isActive:boolean;isDefault:boolean;metafields?:object[];name:string;shipsInventory:boolean;type:"STORE"|"WAREHOUSE"|"DROPSHIPPER";updatedAt:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:71
Create a new location
Parameters
storeId
string
data
address
{ address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }
address.address
string
address.apartment?
string
address.city
string
address.country
string
address.phone
string
address.phoneCountryCode
string
address.postalCode
string
address.province?
string
code?
string
fulfillsOnlineOrders
boolean
metafields?
object[]
name
string
shipsInventory
boolean
type
"STORE" | "WAREHOUSE" | "DROPSHIPPER"
Returns
Promise<{ address: { address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }; code?: string; createdAt: string; fulfillsOnlineOrders: boolean; id: string; isActive: boolean; isDefault: boolean; metafields?: object[]; name: string; shipsInventory: boolean; type: "STORE" | "WAREHOUSE" | "DROPSHIPPER"; updatedAt: string; }>
createLocation()
createLocation(
storeId,data):Promise<{address: {address:string;apartment?:string;city:string;country:string;phone:string;phoneCountryCode:string;postalCode:string;province?:string; };code?:string;createdAt:string;fulfillsOnlineOrders:boolean;id:string;isActive:boolean;isDefault:boolean;metafields?:object[];name:string;shipsInventory:boolean;type:"STORE"|"WAREHOUSE"|"DROPSHIPPER";updatedAt:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:183
Parameters
storeId
string
data
address
{ address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }
address.address
string
address.apartment?
string
address.city
string
address.country
string
address.phone
string
address.phoneCountryCode
string
address.postalCode
string
address.province?
string
code?
string
fulfillsOnlineOrders
boolean
metafields?
object[]
name
string
shipsInventory
boolean
type
"STORE" | "WAREHOUSE" | "DROPSHIPPER"
Returns
Promise<{ address: { address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }; code?: string; createdAt: string; fulfillsOnlineOrders: boolean; id: string; isActive: boolean; isDefault: boolean; metafields?: object[]; name: string; shipsInventory: boolean; type: "STORE" | "WAREHOUSE" | "DROPSHIPPER"; updatedAt: string; }>
Deprecated
Use create() instead
deactivate()
deactivate(
storeId,locationId,inheritLocationId):Promise<{address: {address:string;apartment?:string;city:string;country:string;phone:string;phoneCountryCode:string;postalCode:string;province?:string; };code?:string;createdAt:string;fulfillsOnlineOrders:boolean;id:string;isActive:boolean;isDefault:boolean;metafields?:object[];name:string;shipsInventory:boolean;type:"STORE"|"WAREHOUSE"|"DROPSHIPPER";updatedAt:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:115
Deactivate a location and transfer all inventory to the inherit location
Parameters
storeId
string
locationId
string
inheritLocationId
string
Returns
Promise<{ address: { address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }; code?: string; createdAt: string; fulfillsOnlineOrders: boolean; id: string; isActive: boolean; isDefault: boolean; metafields?: object[]; name: string; shipsInventory: boolean; type: "STORE" | "WAREHOUSE" | "DROPSHIPPER"; updatedAt: string; }>
deactivateLocation()
deactivateLocation(
storeId,locationId,inheritLocationId):Promise<{address: {address:string;apartment?:string;city:string;country:string;phone:string;phoneCountryCode:string;postalCode:string;province?:string; };code?:string;createdAt:string;fulfillsOnlineOrders:boolean;id:string;isActive:boolean;isDefault:boolean;metafields?:object[];name:string;shipsInventory:boolean;type:"STORE"|"WAREHOUSE"|"DROPSHIPPER";updatedAt:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:207
Parameters
storeId
string
locationId
string
inheritLocationId
string
Returns
Promise<{ address: { address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }; code?: string; createdAt: string; fulfillsOnlineOrders: boolean; id: string; isActive: boolean; isDefault: boolean; metafields?: object[]; name: string; shipsInventory: boolean; type: "STORE" | "WAREHOUSE" | "DROPSHIPPER"; updatedAt: string; }>
Deprecated
Use deactivate() instead
delete()
delete(
storeId,locationId):Promise<DeletedResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:95
Delete a location
Parameters
storeId
string
locationId
string
Returns
Promise<DeletedResponse>
deleteLocation()
deleteLocation(
storeId,locationId):Promise<DeletedResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:197
Parameters
storeId
string
locationId
string
Returns
Promise<DeletedResponse>
Deprecated
Use delete() instead
generateIdempotencyKey()
protectedgenerateIdempotencyKey(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
getCountries()
getCountries(
storeId):Promise<object[]>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:140
Get list of supported countries
Parameters
storeId
string
Returns
Promise<object[]>
getExportMimeType()
protectedgetExportMimeType(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
getLocation()
getLocation(
storeId,locationId):Promise<{address: {address:string;apartment?:string;city:string;country:string;phone:string;phoneCountryCode:string;postalCode:string;province?:string; };code?:string;createdAt:string;fulfillsOnlineOrders:boolean;id:string;isActive:boolean;isDefault:boolean;metafields?:object[];name:string;shipsInventory:boolean;type:"STORE"|"WAREHOUSE"|"DROPSHIPPER";updatedAt:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:173
Parameters
storeId
string
locationId
string
Returns
Promise<{ address: { address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }; code?: string; createdAt: string; fulfillsOnlineOrders: boolean; id: string; isActive: boolean; isDefault: boolean; metafields?: object[]; name: string; shipsInventory: boolean; type: "STORE" | "WAREHOUSE" | "DROPSHIPPER"; updatedAt: string; }>
Deprecated
Use retrieve() instead
getLocations()
getLocations(
storeId):Promise<ListResponse<{address: {address:string;apartment?:string;city:string;country:string;phone:string;phoneCountryCode:string;postalCode:string;province?:string; };code?:string;createdAt:string;fulfillsOnlineOrders:boolean;id:string;isActive:boolean;isDefault:boolean;metafields?:object[];name:string;shipsInventory:boolean;type:"STORE"|"WAREHOUSE"|"DROPSHIPPER";updatedAt:string; }>>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:159
Parameters
storeId
string
Returns
Promise<ListResponse<{ address: { address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }; code?: string; createdAt: string; fulfillsOnlineOrders: boolean; id: string; isActive: boolean; isDefault: boolean; metafields?: object[]; name: string; shipsInventory: boolean; type: "STORE" | "WAREHOUSE" | "DROPSHIPPER"; updatedAt: string; }>>
Deprecated
Use list() instead
getLocationsPaginated()
getLocationsPaginated(
storeId,page?,limit?):Promise<ListResponse<{address: {address:string;apartment?:string;city:string;country:string;phone:string;phoneCountryCode:string;postalCode:string;province?:string; };code?:string;createdAt:string;fulfillsOnlineOrders:boolean;id:string;isActive:boolean;isDefault:boolean;metafields?:object[];name:string;shipsInventory:boolean;type:"STORE"|"WAREHOUSE"|"DROPSHIPPER";updatedAt:string; }>>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:164
Parameters
storeId
string
page?
number = 1
limit?
number = 10
Returns
Promise<ListResponse<{ address: { address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }; code?: string; createdAt: string; fulfillsOnlineOrders: boolean; id: string; isActive: boolean; isDefault: boolean; metafields?: object[]; name: string; shipsInventory: boolean; type: "STORE" | "WAREHOUSE" | "DROPSHIPPER"; updatedAt: string; }>>
Deprecated
Use list() instead
getLocationStats()
getLocationStats(
storeId):Promise<{activeLocations:number;inactiveLocations:number;planLimit:number;totalLocations:number; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:178
Parameters
storeId
string
Returns
Promise<{ activeLocations: number; inactiveLocations: number; planLimit: number; totalLocations: number; }>
Deprecated
Use getStats() instead
getPOSSubscription()
getPOSSubscription(
storeId):Promise<{installed:boolean;status:"ACTIVE"|"INACTIVE"; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:130
Get POS subscription status for a store
Parameters
storeId
string
Returns
Promise<{ installed: boolean; status: "ACTIVE" | "INACTIVE"; }>
getProvinces()
getProvinces(
storeId,countryCode):Promise<object[]>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:147
Get provinces for a country
Parameters
storeId
string
countryCode
string
Returns
Promise<object[]>
getStats()
getStats(
storeId):Promise<{activeLocations:number;inactiveLocations:number;planLimit:number;totalLocations:number; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:60
Get location statistics for a store
Parameters
storeId
string
Returns
Promise<{ activeLocations: number; inactiveLocations: number; planLimit: number; totalLocations: number; }>
list()
list(
storeId,page?,limit?):Promise<ListResponse<{address: {address:string;apartment?:string;city:string;country:string;phone:string;phoneCountryCode:string;postalCode:string;province?:string; };code?:string;createdAt:string;fulfillsOnlineOrders:boolean;id:string;isActive:boolean;isDefault:boolean;metafields?:object[];name:string;shipsInventory:boolean;type:"STORE"|"WAREHOUSE"|"DROPSHIPPER";updatedAt:string; }>>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:31
List locations for a store (paginated)
Parameters
storeId
string
page?
number = 1
limit?
number = 20
Returns
Promise<ListResponse<{ address: { address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }; code?: string; createdAt: string; fulfillsOnlineOrders: boolean; id: string; isActive: boolean; isDefault: boolean; metafields?: object[]; name: string; shipsInventory: boolean; type: "STORE" | "WAREHOUSE" | "DROPSHIPPER"; updatedAt: string; }>>
retrieve()
retrieve(
storeId,locationId):Promise<{address: {address:string;apartment?:string;city:string;country:string;phone:string;phoneCountryCode:string;postalCode:string;province?:string; };code?:string;createdAt:string;fulfillsOnlineOrders:boolean;id:string;isActive:boolean;isDefault:boolean;metafields?:object[];name:string;shipsInventory:boolean;type:"STORE"|"WAREHOUSE"|"DROPSHIPPER";updatedAt:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:49
Retrieve a single location by ID
Parameters
storeId
string
locationId
string
Returns
Promise<{ address: { address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }; code?: string; createdAt: string; fulfillsOnlineOrders: boolean; id: string; isActive: boolean; isDefault: boolean; metafields?: object[]; name: string; shipsInventory: boolean; type: "STORE" | "WAREHOUSE" | "DROPSHIPPER"; updatedAt: string; }>
setDefault()
setDefault(
storeId,locationId):Promise<{address: {address:string;apartment?:string;city:string;country:string;phone:string;phoneCountryCode:string;postalCode:string;province?:string; };code?:string;createdAt:string;fulfillsOnlineOrders:boolean;id:string;isActive:boolean;isDefault:boolean;metafields?:object[];name:string;shipsInventory:boolean;type:"STORE"|"WAREHOUSE"|"DROPSHIPPER";updatedAt:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:105
Set a location as the default
Parameters
storeId
string
locationId
string
Returns
Promise<{ address: { address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }; code?: string; createdAt: string; fulfillsOnlineOrders: boolean; id: string; isActive: boolean; isDefault: boolean; metafields?: object[]; name: string; shipsInventory: boolean; type: "STORE" | "WAREHOUSE" | "DROPSHIPPER"; updatedAt: string; }>
setDefaultLocation()
setDefaultLocation(
storeId,locationId):Promise<{address: {address:string;apartment?:string;city:string;country:string;phone:string;phoneCountryCode:string;postalCode:string;province?:string; };code?:string;createdAt:string;fulfillsOnlineOrders:boolean;id:string;isActive:boolean;isDefault:boolean;metafields?:object[];name:string;shipsInventory:boolean;type:"STORE"|"WAREHOUSE"|"DROPSHIPPER";updatedAt:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:202
Parameters
storeId
string
locationId
string
Returns
Promise<{ address: { address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }; code?: string; createdAt: string; fulfillsOnlineOrders: boolean; id: string; isActive: boolean; isDefault: boolean; metafields?: object[]; name: string; shipsInventory: boolean; type: "STORE" | "WAREHOUSE" | "DROPSHIPPER"; updatedAt: string; }>
Deprecated
Use setDefault() instead
update()
update(
storeId,locationId,data):Promise<{address: {address:string;apartment?:string;city:string;country:string;phone:string;phoneCountryCode:string;postalCode:string;province?:string; };code?:string;createdAt:string;fulfillsOnlineOrders:boolean;id:string;isActive:boolean;isDefault:boolean;metafields?:object[];name:string;shipsInventory:boolean;type:"STORE"|"WAREHOUSE"|"DROPSHIPPER";updatedAt:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:80
Update an existing location
Parameters
storeId
string
locationId
string
data
address?
{ address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }
address.address
string
address.apartment?
string
address.city
string
address.country
string
address.phone
string
address.phoneCountryCode
string
address.postalCode
string
address.province?
string
code?
string
expected_updated_at?
string
fulfillsOnlineOrders?
boolean
isActive?
boolean
metafields?
object[]
name?
string
shipsInventory?
boolean
type?
"STORE" | "WAREHOUSE" | "DROPSHIPPER"
Returns
Promise<{ address: { address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }; code?: string; createdAt: string; fulfillsOnlineOrders: boolean; id: string; isActive: boolean; isDefault: boolean; metafields?: object[]; name: string; shipsInventory: boolean; type: "STORE" | "WAREHOUSE" | "DROPSHIPPER"; updatedAt: string; }>
updateLocation()
updateLocation(
storeId,locationId,data):Promise<{address: {address:string;apartment?:string;city:string;country:string;phone:string;phoneCountryCode:string;postalCode:string;province?:string; };code?:string;createdAt:string;fulfillsOnlineOrders:boolean;id:string;isActive:boolean;isDefault:boolean;metafields?:object[];name:string;shipsInventory:boolean;type:"STORE"|"WAREHOUSE"|"DROPSHIPPER";updatedAt:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/locations.ts:188
Parameters
storeId
string
locationId
string
data
address?
{ address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }
address.address
string
address.apartment?
string
address.city
string
address.country
string
address.phone
string
address.phoneCountryCode
string
address.postalCode
string
address.province?
string
code?
string
expected_updated_at?
string
fulfillsOnlineOrders?
boolean
isActive?
boolean
metafields?
object[]
name?
string
shipsInventory?
boolean
type?
"STORE" | "WAREHOUSE" | "DROPSHIPPER"
Returns
Promise<{ address: { address: string; apartment?: string; city: string; country: string; phone: string; phoneCountryCode: string; postalCode: string; province?: string; }; code?: string; createdAt: string; fulfillsOnlineOrders: boolean; id: string; isActive: boolean; isDefault: boolean; metafields?: object[]; name: string; shipsInventory: boolean; type: "STORE" | "WAREHOUSE" | "DROPSHIPPER"; updatedAt: string; }>
Deprecated
Use update() instead