import { d as CalculateTaxRequest$1, a as CalculateTaxResponse$1, b as CalculateTaxResponseNonNullableFields$1, n as ListTaxCalculatorsRequest$1, L as ListTaxCalculatorsResponse$1, c as ListTaxCalculatorsResponseNonNullableFields$1 } from './gateways-billing-v1-tax-calculation-gateway-tax-calculation.universal-ByCUh6PW.js'; interface CalculateTaxRequest { /** Optional ID of the entity that tax is being calculated for. For example, a cart ID. */ externalId?: string | null; /** 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. */ currency?: string; /** Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`. */ addresses: Address[]; /** Line items to calculate tax for. */ 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. */ country?: string | null; /** Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format. */ subdivision?: string | null; /** City name. */ city?: string | null; /** Postal or zip code. */ postalCode?: string | null; /** Main address line, usually street and number as free text. */ addressLine?: string | null; /** Free text providing more detailed address information, such as apartment, suite, or floor. */ addressLine2?: string | null; } /** Line items to calculate tax for. */ interface LineItem { /** Line item ID. */ id?: string; /** Line item name to display. */ itemName?: string | null; /** Line item quantity. */ quantity?: number; /** Line item price. */ price?: string; /** Stock keeping unit for this line item. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku). */ itemCode?: string | null; /** Tax group ID for this line item. If not provided, the default tax group applies. */ 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"` */ 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 CalculateTaxResponse { /** Optional ID of the entity that tax is being calculated for. For example, a cart ID. */ externalId?: string | null; /** 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. */ currency?: string; /** Array of addresses. Each line item can individually reference the address to apply with `lineItems.addressIndex`. */ addresses?: Address[]; /** Summary of the tax calculated. */ taxSummary?: TaxSummary; /** Details of each tax applied to each line item. */ lineItemTaxDetails?: LineItemTaxDetails[]; /** Errors that occurred during the tax calculation. */ errors?: ApplicationError[]; } interface TaxSummary { /** Total price for all line items. */ 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`. */ totalTax?: string; /** Total taxable amount for all line items. */ totalTaxableAmount?: string; /** Total amount of `totalTax` that is included in price. Applies to line items with `taxIncludedInPrice` set to `true`. */ totalTaxIncludedInPrice?: string; /** Array of each tax applied, grouped by `"jurisdiction"`, `"jurisdictionType"`, `"taxType"`, `"taxName"` and `"rate"`. */ 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. */ taxName?: string; /** Type of tax that was calculated. */ taxType?: string; /** Jurisdiction that taxes were calculated for. */ jurisdiction?: string; /** Type of jurisdiction that taxes were calculated for. */ jurisdictionType?: JurisdictionType; /** Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `"0.1000"` and 200% tax is `"2.0000"`. */ rate?: string; /** Total amount of this tax for this jurisdiction. */ 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" } /** Tax details for a specific line item. */ interface LineItemTaxDetails { /** Line item ID. */ id?: string; /** Line item name to display. */ itemName?: string | null; /** Line item quantity. */ quantity?: number; /** Array of each tax applied, grouped by `jurisdiction`. */ 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. */ jurisdiction?: string | null; /** Non-taxable amount of the price. */ 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"`. */ rate?: string | null; /** Amount of this tax calculated for this jurisdiction. */ taxAmount?: string | null; /** Taxable amount of the price. */ taxableAmount?: string | null; /** Type of tax that was calculated. For example, `"Sales Tax"`, `"Income Tax"`, `"Value Added Tax"`, etc. */ taxType?: string | null; /** Name of the tax that was calculated. For example, `"NY State Sales Tax"`, `"Quebec GST"`, etc. */ taxName?: string | null; /** Type of jurisdiction that taxes were calculated for. For example, `"State"`, `"Çounty"`, `"City"`, `"Special"`, etc. */ jurisdictionType?: JurisdictionType; } interface LineItemTaxSummary { /** * Total price for this line item. * To determine the price for each individual unit of this line item, divide by `quantity`. */ fullPrice?: string | null; /** Total amount of tax calculated for this line item. */ taxAmount?: string; /** Total taxable amount for this line item. */ taxableAmount?: string; /** ID of the calculator app that calculated tax for this line item. */ 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. */ taxCalculatorDetails?: TaxCalculatorDetails[]; } interface TaxCalculatorDetails { /** ID of the tax calculator. */ appId?: string; /** Display name of the tax calculator. */ 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. */ unsupportedCountries?: string[]; } interface AggregatedTaxBreakdownNonNullableFields { taxName: string; taxType: string; jurisdiction: string; jurisdictionType: JurisdictionType; rate: string; aggregatedTaxAmount: string; aggregatedTaxableAmount: string; } interface TaxSummaryNonNullableFields { totalAmount: string; totalTax: string; totalTaxableAmount: string; totalTaxIncludedInPrice: string; aggregatedTaxBreakdown: AggregatedTaxBreakdownNonNullableFields[]; } interface TaxBreakdownNonNullableFields { jurisdictionType: JurisdictionType; } interface LineItemTaxSummaryNonNullableFields { taxAmount: string; taxableAmount: string; } interface MultipleAddressesNonNullableFields { origin: number; destination: number; } interface AddressIndexNonNullableFields { singleAddress: number; multipleAddresses?: MultipleAddressesNonNullableFields; } interface LineItemTaxDetailsNonNullableFields { id: string; quantity: number; taxBreakdown: TaxBreakdownNonNullableFields[]; taxSummary?: LineItemTaxSummaryNonNullableFields; addressIndex?: AddressIndexNonNullableFields; taxIncludedInPrice: boolean; } interface ApplicationErrorNonNullableFields { code: string; description: string; } interface CalculateTaxResponseNonNullableFields { currency: string; taxSummary?: TaxSummaryNonNullableFields; lineItemTaxDetails: LineItemTaxDetailsNonNullableFields[]; errors: ApplicationErrorNonNullableFields[]; } interface TaxCalculatorDetailsNonNullableFields { appId: string; displayName: string; unsupportedCountries: string[]; } interface ListTaxCalculatorsResponseNonNullableFields { taxCalculatorDetails: TaxCalculatorDetailsNonNullableFields[]; } 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 & CalculateTaxResponseNonNullableFields$1, CalculateTaxResponse & CalculateTaxResponseNonNullableFields>; declare function listTaxCalculators(): __PublicMethodMetaInfo<'GET', {}, ListTaxCalculatorsRequest$1, ListTaxCalculatorsRequest, ListTaxCalculatorsResponse$1 & ListTaxCalculatorsResponseNonNullableFields$1, ListTaxCalculatorsResponse & ListTaxCalculatorsResponseNonNullableFields>; export { type __PublicMethodMetaInfo, calculateTax, listTaxCalculators };