import { CalculateTaxRequest as CalculateTaxRequest$1, CalculateTaxResponse as CalculateTaxResponse$1, ListTaxCalculatorsRequest as ListTaxCalculatorsRequest$1, ListTaxCalculatorsResponse as ListTaxCalculatorsResponse$1 } from './index.typings.js'; import '@wix/sdk-types'; interface TaxCalculationGateway { /** @format GUID */ id?: string | null; } interface CalculateTaxRequest { /** * Optional ID of the entity that tax is being calculated for. For example, a cart ID. * @format GUID * @immutable */ externalId?: string | null; /** * 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. * @format CURRENCY */ currency?: string; /** * Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`. * @minSize 1 * @maxSize 3 */ addresses: Address[]; /** * Line items to calculate tax for. * @minSize 1 * @maxSize 300 */ lineItems: LineItem[]; } /** Wix common address format for physical address to use if you plan to store addresses in your service. */ interface Address { /** * 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. * @format COUNTRY */ country?: string | null; /** * Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format. * @maxLength 50 */ subdivision?: string | null; /** * City name. * @maxLength 100 */ city?: string | null; /** * Postal or zip code. * @maxLength 50 */ postalCode?: string | null; /** * Main address line, usually street and number as free text. * @maxLength 200 */ addressLine?: string | null; /** * Free text providing more detailed address information, such as apartment, suite, or floor. * @maxLength 200 */ addressLine2?: string | null; } /** Line items to calculate tax for. */ interface LineItem { /** * Line item ID. * @minLength 1 * @maxLength 100 */ id?: string; /** * Line item name to display. * @maxLength 250 */ itemName?: string | null; /** * Line item quantity. * @min 1 * @max 100000 */ quantity?: number; /** * Line item price. * @format DECIMAL_VALUE * @decimalValue options { lte:1000000000000000 } */ price?: string; /** * Stock keeping unit for this line item. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku). * @maxLength 40 */ itemCode?: string | null; /** * Tax group ID for this line item. If not provided, the default tax group applies. * @format GUID */ taxGroupId?: string | null; /** * ID of the app providing the catalog for this line item. * * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/). * * For items from Wix catalogs, the following values always apply: * + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` * + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` * + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"` * @format GUID */ appId?: string | null; /** Whether tax is included in the price. */ taxIncludedInPrice?: boolean | null; /** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */ addressIndex?: AddressIndex; } /** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */ interface AddressIndex extends AddressIndexAddressIndexOptionsOneOf { /** Single address to use for a sale location when only one address is required for tax calculations. The index is zero-based. */ singleAddress?: number; /** * Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item is shipped from, * as well as the address the item is shipped to. */ multipleAddresses?: MultipleAddresses; } /** @oneof */ interface AddressIndexAddressIndexOptionsOneOf { /** Single address to use for a sale location when only one address is required for tax calculations. The index is zero-based. */ singleAddress?: number; /** * Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item is shipped from, * as well as the address the item is shipped to. */ multipleAddresses?: MultipleAddresses; } /** * Multiple addresses to use for a sale. For example, some tax calculations may require both the address where an item * is shipped from, as well as the address the item is shipped to. */ interface MultipleAddresses { /** Index of the origin address. */ origin?: number; /** Index of the destination address. */ destination?: number; } interface ExemptCalculationDetails extends ExemptCalculationDetailsExemptByOptionsOneOf { /** Supports different logic for calculating the exempt group id. */ exemptBy?: ExemptByWithLiterals; } /** @oneof */ interface ExemptCalculationDetailsExemptByOptionsOneOf { } declare enum ExemptBy { UNKNOWN_EXEMPT_BY = "UNKNOWN_EXEMPT_BY", /** Exempt calculation should be based on tax exempt group. */ EXEMPT_GROUP = "EXEMPT_GROUP", /** Exempt calculation should be based on contactId. */ CONTACT = "CONTACT" } /** @enumType */ type ExemptByWithLiterals = ExemptBy | 'UNKNOWN_EXEMPT_BY' | 'EXEMPT_GROUP' | 'CONTACT'; interface CalculateTaxResponse { /** * Optional ID of the entity that tax is being calculated for. For example, a cart ID. * @format GUID * @immutable */ externalId?: string | null; /** * 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. * @format CURRENCY */ currency?: string; /** * Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`. * @minSize 1 * @maxSize 3 */ addresses?: Address[]; /** Summary of the tax calculated. */ taxSummary?: TaxSummary; /** * Details of each tax applied to each line item. * @minSize 1 * @maxSize 300 */ lineItemTaxDetails?: LineItemTaxDetails[]; /** * Errors that occurred during the tax calculation. * @maxSize 100 */ errors?: ApplicationError[]; } interface TaxSummary { /** * Total price for all line items. * @format DECIMAL_VALUE * @decimalValue options { maxScale:4 } */ totalAmount?: string; /** * Total amount of tax calculated for all line items. * Note that due to rounding, `totalTax` may not equal the sum of `lineItemTaxDetails.taxSummary.taxAmount`. * @format DECIMAL_VALUE * @decimalValue options { maxScale:4 } */ totalTax?: string; /** * Total taxable amount for all line items. * @format DECIMAL_VALUE * @decimalValue options { maxScale:4 } */ totalTaxableAmount?: string; /** * Total amount of `totalTax` that is included in price. Applies to line items with `taxIncludedInPrice` set to `true`. * @format DECIMAL_VALUE * @decimalValue options { maxScale:4 } */ totalTaxIncludedInPrice?: string; /** * Array of each tax applied, grouped by `"jurisdiction"`, `"jurisdictionType"`, `"taxType"`, `"taxName"` and `"rate"`. * @maxSize 50 */ aggregatedTaxBreakdown?: AggregatedTaxBreakdown[]; } /** * The summary of the tax breakdown for all the line items. It will hold for each tax name, the aggregated tax amount paid for it and the tax rate. * Tax breakdown is the tax amount split to the tax authorities that applied on the line item. * * Note: Because that the tax is calculated only on the taxable amount, the tax amount may be looks strange. * e.g. if you pay 100$ and the tax applies only on 50$ from it with tax rate of 10%, * then the tax rate will be remain 10% but tax amount in the breakdown will be 5$ instead of 10$. */ interface AggregatedTaxBreakdown { /** * Name of the tax that was calculated. * @maxLength 200 */ taxName?: string; /** * Type of tax that was calculated. * @maxLength 200 */ taxType?: string; /** * Jurisdiction that taxes were calculated for. * @maxLength 200 */ jurisdiction?: string; /** Type of jurisdiction that taxes were calculated for. */ jurisdictionType?: JurisdictionTypeWithLiterals; /** * Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `"0.1000"` and 200% tax is `"2.0000"`. * @decimalValue options { gte:0, maxScale:6 } */ rate?: string; /** * Total amount of this tax for this jurisdiction. * @format DECIMAL_VALUE * @decimalValue options { maxScale:4 } */ aggregatedTaxAmount?: string; } /** Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"County"`, `"City"`, `"Special"`, etc. */ declare enum JurisdictionType { UNDEFINED = "UNDEFINED", COUNTRY = "COUNTRY", STATE = "STATE", COUNTY = "COUNTY", CITY = "CITY", SPECIAL = "SPECIAL" } /** @enumType */ type JurisdictionTypeWithLiterals = JurisdictionType | 'UNDEFINED' | 'COUNTRY' | 'STATE' | 'COUNTY' | 'CITY' | 'SPECIAL'; /** Tax details for a specific line item. */ interface LineItemTaxDetails { /** * Line item ID. * @minLength 1 * @maxLength 100 */ id?: string; /** * Line item name to display. * @maxLength 250 */ itemName?: string | null; /** * Line item quantity. * @min 1 * @max 100000 */ quantity?: number; /** * Array of each tax applied, grouped by `jurisdiction`. * @maxSize 7 */ taxBreakdown?: TaxBreakdown[]; /** Summary of this line item's total price and tax. */ taxSummary?: LineItemTaxSummary; /** Index of the address from `addresses` to use to calculate tax for this specific line item. The index is zero-based. */ addressIndex?: AddressIndex; /** Whether tax is included in the price. */ taxIncludedInPrice?: boolean; } /** A detailed description of all the tax authorities applied on this item. */ interface TaxBreakdown { /** * Jurisdiction that taxes were calculated for. * @maxLength 200 */ jurisdiction?: string | null; /** * Non-taxable amount of the price. * @format DECIMAL_VALUE * @decimalValue options { maxScale:4, gte:0 } */ nonTaxableAmount?: string | null; /** * Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `"0.1000"` and 200% tax is `"2.0000"`. * @format DECIMAL_VALUE * @decimalValue options { maxScale:6, gte:0 } */ rate?: string | null; /** * Amount of this tax calculated for this jurisdiction. * @format DECIMAL_VALUE * @decimalValue options { maxScale:4 } */ taxAmount?: string | null; /** * Taxable amount of the price. * @format DECIMAL_VALUE * @decimalValue options { maxScale:4, gte:0 } */ taxableAmount?: string | null; /** * Type of tax that was calculated. For example, `"Sales Tax"`, `"Income Tax"`, `"Value Added Tax"`, etc. * @maxLength 200 */ taxType?: string | null; /** * Name of the tax that was calculated. For example, `"NY State Sales Tax"`, `"Quebec GST"`, etc. * @maxLength 200 */ taxName?: string | null; /** Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"Çounty"`, `"City"`, `"Special"`, etc. */ jurisdictionType?: JurisdictionTypeWithLiterals; } interface LineItemTaxSummary { /** * Total price for this line item. * To determine the price for each individual unit of this line item, divide by `quantity`. * @format DECIMAL_VALUE * @decimalValue options { lte:1000000000000000 } */ fullPrice?: string | null; /** * Total amount of tax calculated for this line item. * @format DECIMAL_VALUE * @decimalValue options { maxScale:4 } */ taxAmount?: string; /** * Total taxable amount for this line item. * @format DECIMAL_VALUE * @decimalValue options { maxScale:4 } */ taxableAmount?: string; /** * ID of the calculator app that calculated tax for this line item. * @maxLength 50 */ appId?: string | null; } interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } interface ListTaxCalculatorsRequest { } interface ListTaxCalculatorsResponse { /** * Retrieved tax calculators. * @maxSize 10 */ taxCalculatorDetails?: TaxCalculatorDetails[]; } interface TaxCalculatorDetails { /** * ID of the tax calculator. * @format GUID */ appId?: string; /** * Display name of the tax calculator. * @minLength 1 * @maxLength 200 */ displayName?: string; /** * List of countries, in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format, that the calculator does not support. * @format COUNTRY * @maxSize 195 */ unsupportedCountries?: string[]; } interface AggregateTaxBreakdownsRequest { /** * Array of tax breakdowns to aggregate. * @maxSize 200 */ taxBreakdowns?: TaxBreakdown[]; /** * 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. * @format CURRENCY */ currency?: string; } interface AggregateTaxBreakdownsResponse { /** * Array of each aggregated tax breakdowns, grouped by `"jurisdiction"`, `"jurisdictionType"`, `"taxType"`, `"taxName"` and `"rate"`. * @maxSize 50 */ aggregatedTaxBreakdown?: AggregatedTaxBreakdown[]; } /** @docsIgnore */ type CalculateTaxApplicationErrors = { code?: 'INVALID_LINE_ITEM_ADDRESS_INDEX'; description?: string; data?: Record; } | { code?: 'MISSING_TAXABLE_ADDRESS'; description?: string; data?: Record; } | { code?: 'MISSING_COUNTRY_IN_ADDRESS'; description?: string; data?: Record; } | { code?: 'MISSING_SUBDIVISION_IN_ADDRESS'; description?: string; data?: Record; }; type __PublicMethodMetaInfo = { getUrl: (context: any) => string; httpMethod: K; path: string; pathParams: M; __requestType: T; __originalRequestType: S; __responseType: Q; __originalResponseType: R; }; declare function calculateTax(): __PublicMethodMetaInfo<'POST', {}, CalculateTaxRequest$1, CalculateTaxRequest, CalculateTaxResponse$1, CalculateTaxResponse>; declare function listTaxCalculators(): __PublicMethodMetaInfo<'GET', {}, ListTaxCalculatorsRequest$1, ListTaxCalculatorsRequest, ListTaxCalculatorsResponse$1, ListTaxCalculatorsResponse>; export { type AddressIndexAddressIndexOptionsOneOf as AddressIndexAddressIndexOptionsOneOfOriginal, type AddressIndex as AddressIndexOriginal, type Address as AddressOriginal, type AggregateTaxBreakdownsRequest as AggregateTaxBreakdownsRequestOriginal, type AggregateTaxBreakdownsResponse as AggregateTaxBreakdownsResponseOriginal, type AggregatedTaxBreakdown as AggregatedTaxBreakdownOriginal, type ApplicationError as ApplicationErrorOriginal, type CalculateTaxApplicationErrors as CalculateTaxApplicationErrorsOriginal, type CalculateTaxRequest as CalculateTaxRequestOriginal, type CalculateTaxResponse as CalculateTaxResponseOriginal, ExemptBy as ExemptByOriginal, type ExemptByWithLiterals as ExemptByWithLiteralsOriginal, type ExemptCalculationDetailsExemptByOptionsOneOf as ExemptCalculationDetailsExemptByOptionsOneOfOriginal, type ExemptCalculationDetails as ExemptCalculationDetailsOriginal, JurisdictionType as JurisdictionTypeOriginal, type JurisdictionTypeWithLiterals as JurisdictionTypeWithLiteralsOriginal, type LineItem as LineItemOriginal, type LineItemTaxDetails as LineItemTaxDetailsOriginal, type LineItemTaxSummary as LineItemTaxSummaryOriginal, type ListTaxCalculatorsRequest as ListTaxCalculatorsRequestOriginal, type ListTaxCalculatorsResponse as ListTaxCalculatorsResponseOriginal, type MultipleAddresses as MultipleAddressesOriginal, type TaxBreakdown as TaxBreakdownOriginal, type TaxCalculationGateway as TaxCalculationGatewayOriginal, type TaxCalculatorDetails as TaxCalculatorDetailsOriginal, type TaxSummary as TaxSummaryOriginal, type __PublicMethodMetaInfo, calculateTax, listTaxCalculators };