Class: TaxesService
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:124
Extends
BaseService
Constructors
Constructor
new TaxesService(
client):TaxesService
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/base.ts:12
Parameters
client
Returns
TaxesService
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
activateDuties()
activateDuties(
storeId,data):Promise<DutiesSettings>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:546
Activate duties collection API: POST /stores/:storeId/taxes/duties/activate
Parameters
storeId
string
data
Returns
Promise<DutiesSettings>
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
calculate()
calculate(
params):Promise<TaxCalculateResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:203
Calculate tax for a given amount and location API: POST /taxes/calculate
Parameters
params
Returns
Promise<TaxCalculateResponse>
calculateOssSales()
calculateOssSales(
storeId):Promise<{isAboveThreshold:boolean;totalSales:number; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:482
Calculate OSS sales API: GET /stores/:storeId/taxes/oss/sales
Parameters
storeId
string
Returns
Promise<{ isAboveThreshold: boolean; totalSales: number; }>
createIossRegistration()
createIossRegistration(
storeId,data):Promise<{country:string;id:string;iossNumber:string;isActive:boolean;registeredAt:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:502
Create or update IOSS registration API: POST /stores/:storeId/taxes/ioss
Parameters
storeId
string
data
country
string
iossNumber
string
registeredAt?
string
Returns
Promise<{ country: string; id: string; iossNumber: string; isActive: boolean; registeredAt: string; }>
createOssRegistration()
createOssRegistration(
storeId,data):Promise<{country:string;currentYearSales:number;id:string;isActive:boolean;lastCalculatedAt:string;registeredAt:string;registrationType:"OSS"|"MICROBUSINESS";vatNumber:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:450
Create or update OSS registration API: POST /stores/:storeId/taxes/oss
Parameters
storeId
string
data
country
string
registeredAt?
string
registrationType
"OSS" | "MICROBUSINESS"
vatNumber
string
Returns
Promise<{ country: string; currentYearSales: number; id: string; isActive: boolean; lastCalculatedAt: string; registeredAt: string; registrationType: "OSS" | "MICROBUSINESS"; vatNumber: string; }>
createTaxOverride()
createTaxOverride(
storeId,regionId,data):Promise<TaxOverride>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:272
Create tax override API: POST /stores/:storeId/taxes/regions/:regionId/overrides
Parameters
storeId
string
regionId
string
data
Returns
Promise<TaxOverride>
deactivateDuties()
deactivateDuties(
storeId):Promise<DutiesSettings>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:554
Deactivate duties collection API: POST /stores/:storeId/taxes/duties/deactivate
Parameters
storeId
string
Returns
Promise<DutiesSettings>
deleteIossRegistration()
deleteIossRegistration(
storeId):Promise<{deleted:true;id:string;object:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:524
Delete IOSS registration API: DELETE /stores/:storeId/taxes/ioss
Parameters
storeId
string
Returns
Promise<{ deleted: true; id: string; object: string; }>
deleteOssRegistration()
deleteOssRegistration(
storeId):Promise<{deleted:true;id:string;object:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:472
Delete OSS registration API: DELETE /stores/:storeId/taxes/oss
Parameters
storeId
string
Returns
Promise<{ deleted: true; id: string; object: string; }>
deleteTaxOverride()
deleteTaxOverride(
storeId,regionId,overrideId):Promise<{deleted:true;id:string;object:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:286
Delete tax override API: DELETE /stores/:storeId/taxes/regions/:regionId/overrides/:overrideId
Parameters
storeId
string
regionId
string
overrideId
string
Returns
Promise<{ deleted: true; id: string; object: string; }>
downloadSampleCustomsCSV()
downloadSampleCustomsCSV(
storeId):Promise<Blob>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:393
Download sample customs CSV API: GET /stores/:storeId/taxes/customs/sample
Parameters
storeId
string
Returns
Promise<Blob>
exportCustomsCSV()
exportCustomsCSV(
storeId,format):Promise<Blob>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:347
Export customs CSV API: GET /stores/:storeId/taxes/customs/export Returns a Blob that can be used with URL.createObjectURL()
Parameters
storeId
string
format
string
Returns
Promise<Blob>
exportCustomsCSVByEmail()
exportCustomsCSVByEmail(
storeId,storeName):Promise<{string;message:string;storeId:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:363
Export customs information via email (Tanqory-style) Generates CSV and sends it to the user via email API: POST /stores/:storeId/taxes/customs/export-email
Parameters
storeId
string
email
string
storeName
string
Returns
Promise<{ email: string; message: string; storeId: string; }>
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
getCategories()
getCategories():
Promise<TaxCategoriesResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:195
Get tax categories with external service mappings API: GET /taxes/categories
Returns
Promise<TaxCategoriesResponse>
getChildHsCodes()
getChildHsCodes(
code):Promise<HsCodesSearchResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:673
Get child HS codes API: GET /taxes/hs-codes/:code/children
Parameters
code
string
Returns
Promise<HsCodesSearchResponse>
getCountries()
getCountries(
options?):Promise<TaxCountriesResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:133
Get all countries with tax information API: GET /taxes/countries
Parameters
options?
economicZone?
string
isActive?
boolean
taxSystem?
string
Returns
Promise<TaxCountriesResponse>
getCountryByCode()
getCountryByCode(
code):Promise<TaxCountryDetail>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:147
Get country details by ISO code API: GET /taxes/countries/:code
Parameters
code
string
Returns
Promise<TaxCountryDetail>
getCountryRegions()
getCountryRegions(
countryCode):Promise<ListResponse<TaxRegionRef>>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:155
Get regions for a country API: GET /taxes/countries/:code/regions
Parameters
countryCode
string
Returns
Promise<ListResponse<TaxRegionRef>>
getCurrencies()
getCurrencies(
params?):Promise<{data:object[];meta?: {hasMore:boolean;limit:number;offset:number;totalCount:number; }; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:591
Get all supported currencies API: GET /taxes/currencies
Parameters
params?
excludeCrypto?
boolean
isActive?
boolean
isCrypto?
boolean
limit?
number
offset?
number
region?
"OTHER" | "AMERICAS" | "EUROPE" | "ASIA_PACIFIC" | "MIDDLE_EAST_AFRICA" | "CRYPTO"
search?
string
Returns
Promise<{ data: object[]; meta?: { hasMore: boolean; limit: number; offset: number; totalCount: number; }; }>
getCurrenciesByRegion()
getCurrenciesByRegion(
params?):Promise<{data:Partial<Record<"OTHER"|"AMERICAS"|"EUROPE"|"ASIA_PACIFIC"|"MIDDLE_EAST_AFRICA"|"CRYPTO",object[]>>; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:609
Get currencies grouped by region API: GET /taxes/currencies/by-region
Parameters
params?
excludeCrypto?
boolean
Returns
Promise<{ data: Partial<Record<"OTHER" | "AMERICAS" | "EUROPE" | "ASIA_PACIFIC" | "MIDDLE_EAST_AFRICA" | "CRYPTO", object[]>>; }>
getCurrencyByCode()
getCurrencyByCode(
code):Promise<{code:string;decimals:number;decimalSeparator?:string;locale?:string;name:string;region:"OTHER"|"AMERICAS"|"EUROPE"|"ASIA_PACIFIC"|"MIDDLE_EAST_AFRICA"|"CRYPTO";symbol:string;symbolPosition:"BEFORE"|"AFTER";thousandsSeparator?:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:601
Get a single currency by code API: GET /taxes/currencies/:code
Parameters
code
string
Returns
Promise<{ code: string; decimals: number; decimalSeparator?: string; locale?: string; name: string; region: "OTHER" | "AMERICAS" | "EUROPE" | "ASIA_PACIFIC" | "MIDDLE_EAST_AFRICA" | "CRYPTO"; symbol: string; symbolPosition: "BEFORE" | "AFTER"; thousandsSeparator?: string; }>
getCustomsInformation()
getCustomsInformation(
storeId):Promise<CustomsInfoResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:317
Get customs information API: GET /stores/:storeId/taxes/customs
Parameters
storeId
string
Returns
Promise<CustomsInfoResponse>
getCustomsProducts()
getCustomsProducts(
storeId):Promise<ListResponse<CustomsProductItem>>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:325
Get customs products API: GET /stores/:storeId/taxes/customs/products
Parameters
storeId
string
Returns
Promise<ListResponse<CustomsProductItem>>
getDutiesSettings()
getDutiesSettings(
storeId):Promise<DutiesSettings>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:538
Get duties settings for a store API: GET /stores/:storeId/taxes/duties
Parameters
storeId
string
Returns
Promise<DutiesSettings>
getEuVatRates()
getEuVatRates():
Promise<EuVatRatesResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:177
Get EU VAT rates with OSS/IOSS thresholds API: GET /taxes/eu-vat
Returns
Promise<EuVatRatesResponse>
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
getGlobalSettings()
getGlobalSettings(
storeId):Promise<GlobalTaxSettingsResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:419
Get global tax settings for store API: GET /stores/:storeId/taxes/settings
Parameters
storeId
string
Returns
Promise<GlobalTaxSettingsResponse>
getHsCodeByCode()
getHsCodeByCode(
code):Promise<HsCodeItem>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:639
Get HS code by exact code API: GET /taxes/hs-codes/:code
Parameters
code
string
Returns
Promise<HsCodeItem>
getHsCodeHierarchy()
getHsCodeHierarchy(
code):Promise<HsCodesSearchResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:647
Get HS code hierarchy (parent chain) API: GET /taxes/hs-codes/:code/hierarchy
Parameters
code
string
Returns
Promise<HsCodesSearchResponse>
getHsCodesBySection()
getHsCodesBySection(
sectionCode,level?):Promise<HsCodesSearchResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:663
Get HS codes by section API: GET /taxes/hs-sections/:sectionCode/codes
Parameters
sectionCode
string
level?
number
Returns
Promise<HsCodesSearchResponse>
getHsSections()
getHsSections():
Promise<HsSectionsResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:655
Get all HS sections API: GET /taxes/hs-sections
Returns
Promise<HsSectionsResponse>
getIossRegistration()
getIossRegistration(
storeId):Promise<{country:string;id:string;iossNumber:string;isActive:boolean;registeredAt:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:494
Get IOSS registration for store API: GET /stores/:storeId/taxes/ioss
Parameters
storeId
string
Returns
Promise<{ country: string; id: string; iossNumber: string; isActive: boolean; registeredAt: string; }>
getMarkets()
getMarkets(
storeId):Promise<ListResponse<MarketItem>>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:301
Get markets for duties setup API: GET /stores/:storeId/taxes/markets
Parameters
storeId
string
Returns
Promise<ListResponse<MarketItem>>
getOssRegistration()
getOssRegistration(
storeId):Promise<{country:string;currentYearSales:number;id:string;isActive:boolean;lastCalculatedAt:string;registeredAt:string;registrationType:"OSS"|"MICROBUSINESS";vatNumber:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:442
Get OSS registration for store API: GET /stores/:storeId/taxes/oss
Parameters
storeId
string
Returns
Promise<{ country: string; currentYearSales: number; id: string; isActive: boolean; lastCalculatedAt: string; registeredAt: string; registrationType: "OSS" | "MICROBUSINESS"; vatNumber: string; }>
getRates()
getRates(
options?):Promise<TaxRatesResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:163
Get tax rates (filterable) API: GET /taxes/rates
Parameters
options?
countryCode?
string
rateType?
string
regionCode?
string
Returns
Promise<TaxRatesResponse>
getTaxRegionDetail()
getTaxRegionDetail(
storeId,regionId):Promise<TaxRegionDetailItem>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:233
Get tax region detail with rates API: GET /stores/:storeId/taxes/regions/:regionId
Parameters
storeId
string
regionId
string
Returns
Promise<TaxRegionDetailItem>
getTaxRegions()
getTaxRegions(
storeId):Promise<ListResponse<TaxRegionListItem>>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:225
Get store tax regions (countries/regions where store collects tax) API: GET /stores/:storeId/taxes/regions
Parameters
storeId
string
Returns
Promise<ListResponse<TaxRegionListItem>>
getTaxService()
getTaxService(
storeId):Promise<TaxServiceResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:217
Get store tax service configuration API: GET /stores/:storeId/taxes/service
Parameters
storeId
string
Returns
Promise<TaxServiceResponse>
getUsSalesTax()
getUsSalesTax(
stateCode?):Promise<UsSalesTaxResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:185
Get US sales tax rates by state API: GET /taxes/us-sales-tax
Parameters
stateCode?
string
Returns
Promise<UsSalesTaxResponse>
importCustomsCSV()
importCustomsCSV(
storeId,file):Promise<{errors:string[];message:string;updated:number; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:377
Import customs CSV API: POST /stores/:storeId/taxes/customs/import
Parameters
storeId
string
file
File
Returns
Promise<{ errors: string[]; message: string; updated: number; }>
searchHsCodes()
searchHsCodes(
params):Promise<HsCodesSearchResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:625
Search HS codes by description or code API: GET /taxes/hs-codes?search=wheat&limit=20
Parameters
params
level?
number
limit?
number
search
string
Returns
Promise<HsCodesSearchResponse>
selectMarkets()
selectMarkets(
storeId,data):Promise<{success:true; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:309
Select markets for duties API: POST /stores/:storeId/taxes/markets
Parameters
storeId
string
data
marketIds
string[]
Returns
Promise<{ success: true; }>
updateCustomsProduct()
updateCustomsProduct(
storeId,productId,data):Promise<CustomsProductItem>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:405
Update customs product API: PATCH /stores/:storeId/taxes/customs/products/:productId
Parameters
storeId
string
productId
string
data
Returns
Promise<CustomsProductItem>
updateDefaultCountry()
updateDefaultCountry(
storeId,data):Promise<{success:true; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:333
Update default country of origin API: PUT /stores/:storeId/taxes/customs/default-country
Parameters
storeId
string
data
countryCode
string
Returns
Promise<{ success: true; }>
updateDutiesMarket()
updateDutiesMarket(
storeId,marketId,data):Promise<DutiesMarket>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:573
Update duties market settings API: PATCH /stores/:storeId/taxes/duties/markets/:marketId
Parameters
storeId
string
marketId
string
data
Returns
Promise<DutiesMarket>
updateDutiesSettings()
updateDutiesSettings(
storeId,data):Promise<DutiesSettings>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:562
Update duties settings API: PATCH /stores/:storeId/taxes/duties
Parameters
storeId
string
data
Returns
Promise<DutiesSettings>
updateGlobalSettings()
updateGlobalSettings(
storeId,data):Promise<GlobalTaxSettingsResponse>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:427
Update global tax settings for store API: PATCH /stores/:storeId/taxes/settings
Parameters
storeId
string
data
Returns
Promise<GlobalTaxSettingsResponse>
updateIossRegistration()
updateIossRegistration(
storeId,data):Promise<{country:string;id:string;iossNumber:string;isActive:boolean;registeredAt:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:513
Update IOSS registration API: PATCH /stores/:storeId/taxes/ioss
Parameters
storeId
string
data
country?
string
iossNumber?
string
isActive?
boolean
Returns
Promise<{ country: string; id: string; iossNumber: string; isActive: boolean; registeredAt: string; }>
updateOssRegistration()
updateOssRegistration(
storeId,data):Promise<{country:string;currentYearSales:number;id:string;isActive:boolean;lastCalculatedAt:string;registeredAt:string;registrationType:"OSS"|"MICROBUSINESS";vatNumber:string; }>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:461
Update OSS registration API: PATCH /stores/:storeId/taxes/oss
Parameters
storeId
string
data
country?
string
isActive?
boolean
registrationType?
"OSS" | "MICROBUSINESS"
vatNumber?
string
Returns
Promise<{ country: string; currentYearSales: number; id: string; isActive: boolean; lastCalculatedAt: string; registeredAt: string; registrationType: "OSS" | "MICROBUSINESS"; vatNumber: string; }>
updateSubRegionRate()
updateSubRegionRate(
storeId,regionId,subRegionId,data):Promise<TaxSubRegion>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:255
Update sub-region rate API: PUT /stores/:storeId/taxes/regions/:regionId/subregions/:subRegionId
Parameters
storeId
string
regionId
string
subRegionId
string
data
Returns
Promise<TaxSubRegion>
updateTaxRegion()
updateTaxRegion(
storeId,regionId,data):Promise<TaxRegionDetailItem>
Defined in: tanqory-platform-packages/packages/api/sdk/src/services/taxes.ts:241
Update tax region settings API: PUT /stores/:storeId/taxes/regions/:regionId
Parameters
storeId
string
regionId
string
data
Returns
Promise<TaxRegionDetailItem>