import { h as CalculateTotalsRequest$1, a as CalculateTotalsResponse$1, b as CalculateTotalsResponseNonNullableFields$1 } from './ecom-v1-totals-calculation-totals-calculator.universal-B4ibfdS1.mjs'; interface CalculateTotalsRequest extends CalculateTotalsRequestCouponOneOf, CalculateTotalsRequestGiftCardOneOf { /** Coupon ID. */ couponId?: string | null; /** Coupon code. */ couponCode?: string | null; /** Gift card ID. */ giftCardId?: string | null; /** Gift card code. */ giftCardCode?: string | null; /** * Calculation ID. An identifier of the entity that you are calculating totals for, for example, cart ID or checkout ID. * This value will be used in order to optimise calculations by caching. * If not passed, calculation might be slower in some cases. */ calculationId?: string | null; /** Line items for calculation. */ lineItems?: LineItem[]; /** Shipping address for tax and shipping calculation (if applicable). */ shippingAddress?: Address; /** Billing address. Used for calculating tax if all the items in the cart are not shippable. */ billingAddress?: Address; /** Details about selected shipping option. */ selectedShippingOption?: SelectedShippingOption; /** * Merchant discounts to apply to specific line items. If no `lineItemIds` are passed, the discount will be applied to the whole cart/checkout. * @deprecated */ merchantDiscounts?: MerchantDiscountInput[]; /** Buyer email. Used to enforce coupon [single-use per customer](https://support.wix.com/en/article/wix-stores-limiting-coupon-usage). If not passed, single coupon usage per customer will not be enforced. */ buyerEmail?: string | null; /** * Member id to use for this calculation * When not provided, given that the caller is a member, its member id will be used * Providing this require elevated permissions - ECOM.ADMIN_CALCULATE_TOTALS */ memberId?: string | null; /** * The selected memberships and which line items they apply to * When not provided, default selection will be returned * You can also set it to empty selection */ selectedMemberships?: SelectedMemberships; /** Buyer phone number. Used to get shipping rates. */ buyerPhone?: string | null; /** Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order. */ purchaseFlowId?: string | null; } /** @oneof */ interface CalculateTotalsRequestCouponOneOf { /** Coupon ID. */ couponId?: string | null; /** Coupon code. */ couponCode?: string | null; } /** @oneof */ interface CalculateTotalsRequestGiftCardOneOf { /** Gift card ID. */ giftCardId?: string | null; /** Gift card code. */ giftCardCode?: string | null; } interface LineItem { /** Line item ID. */ id?: string; /** Quantity. */ quantity?: number | null; /** * Optional references to the line item's origin catalog. * See [Catalog SPI](https://bo.wix.com/wix-docs/rest/ecommerce/catalog-spi/introduction) for more details. * This field may be empty in the case of a custom line item. * currently we only use the catalog app id to set tax=0 for specific apps. */ catalogReference?: CatalogReference; /** Product/booking/event name. */ productName?: string | null; /** Price. */ price?: string; /** Physical properties (if applicable). */ physicalProperties?: PhysicalProperties; /** Subscription settings. */ subscriptionSettings?: SubscriptionSettings; /** * Type of selected payment option for current item. * * Default: `FULL_PAYMENT_ONLINE` */ paymentOption?: PaymentOptionType; /** Service properties. When relevant, this contains information such as date and number of participants. */ serviceProperties?: ServiceProperties; /** * In cases where `catalogReference.catalogItemId` is NOT the actual catalog item ID, this field will return the true item's ID. * + For example, for Wix Bookings, `catalogReference.catalogItemId` is the booking ID. Therefore this value is set to the service ID. * + In most cases, this field has the same value as `catalogReference.catalogItemId`. * + Used in membership validation. */ rootCatalogItemId?: string | null; /** * Optional - partial amount of item's price to be paid now for checkout cases with DEPOSIT_ONLINE payment option * If omitted - item's price will not be split and is expected to be paid in single installment */ depositAmount?: string | null; /** full price of the item before all the discounts */ fullPrice?: string | null; /** The Item's Delivery Profile Id */ deliveryProfileId?: string | null; /** Item type. Either a preset type or custom. */ itemType?: ItemType; } /** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */ interface CatalogReference { /** ID of the item within the catalog it belongs to. */ catalogItemId?: string; /** * ID of the app providing the catalog. * * 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; /** * Additional item details in key:value pairs. Use this optional field to provide more specificity with item selection. The `options` field values differ depending on which catalog is providing the items. * * For products and variants from a Wix Stores catalog, learn more about [eCommerce integration](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration). */ options?: Record | null; } interface PhysicalProperties { /** Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request. */ weight?: number | null; /** Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku). */ sku?: string | null; /** Whether this line item is shippable. */ shippable?: boolean; } interface SubscriptionSettings { /** Frequency of recurring payment. Every day/week/month/year. */ frequency?: SubscriptionFrequency; } /** Frequency unit of recurring payment */ declare enum SubscriptionFrequency { UNDEFINED = "UNDEFINED", DAY = "DAY", WEEK = "WEEK", MONTH = "MONTH", YEAR = "YEAR" } /** Type of selected payment option for catalog item */ declare enum PaymentOptionType { /** The entire payment for this item happens as part of the checkout. */ FULL_PAYMENT_ONLINE = "FULL_PAYMENT_ONLINE", /** The entire payment for this item happens after checkout. For example, when using cash, check, or other offline payment methods. */ FULL_PAYMENT_OFFLINE = "FULL_PAYMENT_OFFLINE", /** Payment for this item is done by charging a membership. When selected, `price` is `0`. */ MEMBERSHIP = "MEMBERSHIP", /** Partial payment to be paid upfront during checkout. The initial amount to be paid for each line item is specified in `depositAmount`. */ DEPOSIT_ONLINE = "DEPOSIT_ONLINE", /** Payment for this item can only be done by charging a membership and must be manually redeemed in the dashboard by the site admin. When selected, `price` is `0`. */ MEMBERSHIP_OFFLINE = "MEMBERSHIP_OFFLINE" } interface ServiceProperties { /** * Date and time the service is to be provided, in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format. * For example, the start time of a class. */ scheduledDate?: Date | null; /** The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room. */ numberOfParticipants?: number | null; } interface ItemType extends ItemTypeItemTypeDataOneOf { /** Preset item type. */ preset?: ItemTypeItemType; /** Custom item type. When none of the preset types are suitable, specifies the custom type. */ custom?: string; } /** @oneof */ interface ItemTypeItemTypeDataOneOf { /** Preset item type. */ preset?: ItemTypeItemType; /** Custom item type. When none of the preset types are suitable, specifies the custom type. */ custom?: string; } declare enum ItemTypeItemType { UNRECOGNISED = "UNRECOGNISED", PHYSICAL = "PHYSICAL", DIGITAL = "DIGITAL", GIFT_CARD = "GIFT_CARD", SERVICE = "SERVICE" } /** Physical address */ interface Address { /** Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format. */ country?: string | null; /** Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format. */ subdivision?: string | null; /** City name. */ city?: string | null; /** Postal or zip code. */ postalCode?: string | null; /** Street address. */ streetAddress?: StreetAddress; /** Main address line (usually street name and number). */ addressLine?: string | null; /** Free text providing more detailed address info. Usually contains apt, suite, floor. */ addressLine2?: string | null; /** * Country's full name. * @readonly */ countryFullname?: string | null; /** * Subdivision full-name. * @readonly */ subdivisionFullname?: string | null; } interface StreetAddress { /** Street number. */ number?: string; /** Street name. */ name?: string; } interface SelectedShippingOption { /** Carrier ID. */ carrierId?: string | null; /** Selected shipping option code. For example, "usps_std_overnight". */ code?: string; } interface MerchantDiscountInput { /** Discount amount. */ amount?: string; /** IDs of line items the discount applies to. */ lineItemIds?: string[]; } interface SelectedMemberships { /** Selected memberships. */ memberships?: SelectedMembership[]; } interface SelectedMembership { /** Membership ID. */ id?: string; /** ID of the app providing this payment option. */ appId?: string; /** IDs of the line items this membership applies to. */ lineItemIds?: string[]; } interface ShippingOption { /** * Unique code of provided shipping option like "usps_std_overnight". * For legacy calculators this would be the UUID of the option. */ code?: string; /** * Title of the option, such as USPS Standard Overnight Delivery (in the requested locale). * For example, "Standard" or "First-Class Package International". */ title?: string; /** Delivery logistics. */ logistics?: DeliveryLogistics; /** Sipping price information. */ cost?: ShippingPrice; /** Delivery solution allocations to different delivery carriers and delivery regions */ deliveryAllocations?: DeliveryAllocation[]; /** If the delivery solution is a partial and doesn't apply to all items. */ partial?: boolean | null; } interface DeliveryLogistics { /** Expected delivery time, in free text. For example, "3-5 business days". */ deliveryTime?: string | null; /** Instructions for caller, e.g for pickup: "Please deliver during opening hours, and please don't park in disabled parking spot". */ instructions?: string | null; /** Pickup details. */ pickupDetails?: PickupDetails; } interface PickupDetails { /** Pickup address. */ address?: Address; /** * Whether the pickup address is that of a business - this may effect tax calculation. * @deprecated */ businessLocation?: boolean; /** Pickup method */ pickupMethod?: PickupMethod; } declare enum PickupMethod { UNKNOWN_METHOD = "UNKNOWN_METHOD", STORE_PICKUP = "STORE_PICKUP", PICKUP_POINT = "PICKUP_POINT" } interface ShippingPrice { /** Shipping price. */ price?: MultiCurrencyPrice; /** Other costs such as insurance, handling & packaging for fragile items, etc. */ otherCharges?: OtherCharge[]; } interface MultiCurrencyPrice { /** Amount. */ amount?: string; /** * Converted amount. * @readonly */ convertedAmount?: string; /** * Amount formatted with currency symbol. * @readonly */ formattedAmount?: string; /** * Converted amount formatted with currency symbol. * @readonly */ formattedConvertedAmount?: string; } interface OtherCharge { /** Type of additional cost. */ type?: ChargeType; /** Price of added cost. */ price?: MultiCurrencyPrice; } declare enum ChargeType { HANDLING_FEE = "HANDLING_FEE", INSURANCE = "INSURANCE" } interface DeliveryAllocation { /** The delivery option's carrier details, could be multiple if the delivery option is a combination of multiple carriers */ deliveryCarrier?: Carrier; /** The delivery region that are relevant for this delivery solution. */ deliveryRegion?: Region; /** Populated if the delivery solution is a partially supplied by this carrier. */ applicableLineItems?: ApplicableLineItems; } interface Carrier { /** The carrier app id */ appId?: string | null; /** Unique code that acts as an ID for a shipping rate. For example, `"usps_std_overnight"`. */ code?: string; } interface Region { /** The delivery region id. */ id?: string | null; /** The delivery region name. */ name?: string | null; } interface ApplicableLineItems { /** Line items that the delivery solution is for. */ lineItemIds?: string[]; } interface AppliedDiscount extends AppliedDiscountDiscountSourceOneOf { /** Coupon details. */ coupon?: Coupon; /** Merchant discount. */ merchantDiscount?: MerchantDiscount; /** Discount rule */ discountRule?: DiscountRule; /** Discount type. */ discountType?: DiscountType; /** * IDs of line items the discount applies to. * @deprecated IDs of line items the discount applies to. * @replacedBy line_items_discounts * @targetRemovalDate 2024-06-01 */ lineItemIds?: string[]; } /** @oneof */ interface AppliedDiscountDiscountSourceOneOf { /** Coupon details. */ coupon?: Coupon; /** Merchant discount. */ merchantDiscount?: MerchantDiscount; /** Discount rule */ discountRule?: DiscountRule; } declare enum DiscountType { GLOBAL = "GLOBAL", SPECIFIC_ITEMS = "SPECIFIC_ITEMS", SHIPPING = "SHIPPING" } /** Coupon */ interface Coupon { /** Coupon ID. */ id?: string; /** Coupon code. */ code?: string; /** Coupon value. */ amount?: MultiCurrencyPrice; /** Coupon name. */ name?: string; } interface MerchantDiscount { /** Discount value. */ amount?: MultiCurrencyPrice; /** Discount Percentage. Will be calculated from items price before other discounts. */ percentage?: number | null; } interface DiscountRule { /** Discount rule ID */ id?: string; /** Discount rule name */ name?: DiscountRuleName; /** Discount value. */ amount?: MultiCurrencyPrice; } interface DiscountRuleName { /** Original discount rule name (in site's default language). */ original?: string; /** Translated discount rule name according to buyer language. Defaults to `original` when not provided. */ translated?: string | null; } interface CalculateTotalsResponse { /** Calculate line items. */ calculatedLineItems?: CalculatedLineItem[]; /** Price summary. */ priceSummary?: PriceSummary; /** Details of applied gift card. */ giftCard?: GiftCard; /** Tax summary. */ taxSummary?: TaxSummary; /** Shipping information. */ shippingInfo?: ShippingInformation; /** Applied discounts. */ appliedDiscounts?: AppliedDiscount[]; /** Calculation errors. */ calculationErrors?: CalculationErrors; /** Weight unit. */ weightUnit?: WeightUnit; /** Currency. */ currency?: string; /** * This is the display currency. Converted prices are presented in this currency. * @readonly */ conversionCurrency?: string; /** Whether tax is included in price. */ taxIncludedInPrice?: boolean; /** * Minimal amount to pay in order to place the order. * @readonly */ payNow?: PriceSummary; /** * Remaining amount for the order to be fully paid. * @readonly */ payLater?: PriceSummary; /** Information about valid and invalid memberships, and which ones are selected for usage. */ membershipOptions?: MembershipOptions; /** Additional Fees */ additionalFees?: V1AdditionalFee[]; /** * The site currency. * @readonly */ siteCurrency?: string; /** * The rate used when converting from the site currency to the checkout currency. * @readonly */ checkoutConversionRate?: string | null; /** * The pay now total amount after the gift card is applied. * @readonly */ payNowTotalAfterGiftCard?: MultiCurrencyPrice; /** * The total amount after gift card is applied. * @readonly */ totalAfterGiftCard?: MultiCurrencyPrice; } interface CalculatedLineItem { /** Line item ID. */ lineItemId?: string; /** Price breakdown for this line item. */ pricesBreakdown?: LineItemPricesData; /** * Type of selected payment option for current item. Supported values: * + `"FULL_PAYMENT_ONLINE"` - The entire payment for this item will happen as part of the checkout * + `"FULL_PAYMENT_OFFLINE"` - The entire payment for this item will happen after the checkout * + `"MEMBERSHIP"` - This item cannot be paid via monetary payment options, only via non monetary option such membership. When this option is used, price must be set to 0 * + `"DEPOSIT_ONLINE"` - Partial payment of the given item will happen as part of the checkout. Amount to be paid is defined by deposit_amount field. */ paymentOption?: PaymentOptionType; } interface LineItemPricesData { /** Total price after discounts and after tax. */ totalPriceAfterTax?: MultiCurrencyPrice; /** Total price after discounts, and before tax. */ totalPriceBeforeTax?: MultiCurrencyPrice; /** Tax details. */ taxDetails?: ItemTaxFullDetails; /** Total discount applied for the line item. */ totalDiscount?: MultiCurrencyPrice; /** Catalog price **after** catalog-defined discount and automatic discounts. */ price?: MultiCurrencyPrice; /** Item price **before** automatic discounts, coupons, and global discounts, **after** catalog-defined discount. Defaults to `price` when not provided. */ priceBeforeDiscounts?: MultiCurrencyPrice; /** Total price **after** catalog-defined discount and automatic discounts, taking line item's quantity into account. */ lineItemPrice?: MultiCurrencyPrice; /** Item price **before** all discounts. Defaults to `price` when not provided. */ fullPrice?: MultiCurrencyPrice; } interface ItemTaxFullDetails { /** Amount for which tax is calculated. */ taxableAmount?: MultiCurrencyPrice; /** Tax rate %, as a decimal point between 0 and 1. */ taxRate?: string; /** Calculated tax, based on `taxable_amount` and `tax_rate`. */ totalTax?: MultiCurrencyPrice; /** * If breakdown exists, the sum of rates in the breakdown must equal `tax_rate`. Deprecated - use 'tax_breakdown' instead. * @readonly * @deprecated */ rateBreakdown?: TaxRateBreakdown[]; } interface TaxRateBreakdown { /** Name of tax against which the calculation was performed. */ name?: string; /** Rate at which this tax detail was calculated. */ rate?: string; /** Amount of tax for this tax detail. */ tax?: MultiCurrencyPrice; } /** JurisdictionType represents the type of the jurisdiction in which this tax detail applies (e.g. Country,State,County,City,Special). */ declare enum JurisdictionType { UNDEFINED = "UNDEFINED", COUNTRY = "COUNTRY", STATE = "STATE", COUNTY = "COUNTY", CITY = "CITY", SPECIAL = "SPECIAL" } interface PriceSummary { /** Subtotal of all line items, before discounts and before tax. */ subtotal?: MultiCurrencyPrice; /** Total shipping price, before discounts and before tax. */ shipping?: MultiCurrencyPrice; /** Total tax. */ tax?: MultiCurrencyPrice; /** Total calculated discount value. */ discount?: MultiCurrencyPrice; /** Total price after discounts, gift cards, and tax. */ total?: MultiCurrencyPrice; /** Total additional fees price before tax. */ additionalFees?: MultiCurrencyPrice; } interface GiftCard { /** * Gift Card ID. * @deprecated */ id?: string; /** Gift card obfuscated code. */ obfuscatedCode?: string; /** Gift card value. */ amount?: MultiCurrencyPrice; /** App ID of the gift card provider. */ appId?: string; /** * External ID in the gift card provider's system. * Used for integration and tracking across different platforms. */ externalId?: string | null; } interface TaxSummary { /** * Amount for which tax is calculated, added from line items. * @readonly */ taxableAmount?: MultiCurrencyPrice; /** * Calculated tax, added from line items. * @readonly */ totalTax?: MultiCurrencyPrice; /** * Tax calculator that was active when the order was created. * @deprecated */ calculationDetails?: TaxCalculationDetails; } interface TaxCalculationDetails extends TaxCalculationDetailsCalculationDetailsOneOf { /** Reason the manual calculation was used. */ manualRateReason?: ManualCalculationReason; /** Details of the fallback rate calculation. */ autoTaxFallbackDetails?: AutoTaxFallbackCalculationDetails; /** Rate calculation type. */ rateType?: RateType; } /** @oneof */ interface TaxCalculationDetailsCalculationDetailsOneOf { /** Reason the manual calculation was used. */ manualRateReason?: ManualCalculationReason; /** Details of the fallback rate calculation. */ autoTaxFallbackDetails?: AutoTaxFallbackCalculationDetails; } declare enum RateType { /** no tax being collected for this request due to location of purchase */ NO_TAX_COLLECTED = "NO_TAX_COLLECTED", /** manual rate used for calculation */ MANUAL_RATE = "MANUAL_RATE", /** autotax rate used for calculation */ AUTO_RATE = "AUTO_RATE", /** fallback rate used for calculation */ FALLBACK_RATE = "FALLBACK_RATE" } declare enum ManualCalculationReason { /** user set calculator in Business Manager to be Manual */ GLOBAL_SETTING_TO_MANUAL = "GLOBAL_SETTING_TO_MANUAL", /** specific region is on manual even though Global setting is Auto-tax */ REGION_SETTING_TO_MANUAL = "REGION_SETTING_TO_MANUAL" } interface AutoTaxFallbackCalculationDetails { /** reason for fallback */ fallbackReason?: FallbackReason; /** invalid request (i.e. address), timeout, internal error, license error, and others will be encoded here */ error?: ApplicationError; } declare enum FallbackReason { /** auto-tax failed to be calculated */ AUTO_TAX_FAILED = "AUTO_TAX_FAILED", /** auto-tax was temporarily deactivated on a system-level */ AUTO_TAX_DEACTIVATED = "AUTO_TAX_DEACTIVATED" } interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } interface ShippingInformation { /** Shipping region. */ region?: ShippingRegion; /** Selected shipping option. */ selectedCarrierServiceOption?: SelectedCarrierServiceOption; /** All shipping options. */ carrierServiceOptions?: CarrierServiceOption[]; } interface ShippingRegion { /** * Shipping region ID. * @readonly */ id?: string; /** Shipping region name. */ name?: string; } interface SelectedCarrierServiceOption { /** Unique identifier of selected option. For example, "usps_std_overnight". */ code?: string; /** * Title of the option, such as USPS Standard Overnight Delivery (in the requested locale). * For example, "Standard" or "First-Class Package International". * @readonly */ title?: string; /** * Delivery logistics. * @readonly */ logistics?: DeliveryLogistics; /** * Shipping costs. * @readonly */ cost?: SelectedCarrierServiceOptionPrices; /** * Were we able to find the requested shipping option, or otherwise we fallback to the default one (the first) * @readonly */ requestedShippingOption?: boolean; /** Other charges */ otherCharges?: SelectedCarrierServiceOptionOtherCharge[]; /** This carrier's unique ID */ carrierId?: string | null; /** Delivery solution allocations to different delivery carriers and delivery regions */ deliveryAllocations?: DeliveryAllocation[]; /** If the delivery solution is a partial and doesn't apply to all items. */ partial?: boolean | null; } interface SelectedCarrierServiceOptionPrices { /** Total shipping price, after discount and after tax. */ totalPriceAfterTax?: MultiCurrencyPrice; /** Total price of shipping after discounts (when relevant), and before tax. */ totalPriceBeforeTax?: MultiCurrencyPrice; /** Tax details. */ taxDetails?: ItemTaxFullDetails; /** Shipping discount before tax. */ totalDiscount?: MultiCurrencyPrice; /** Shipping price before discount and before tax. */ price?: MultiCurrencyPrice; } interface SelectedCarrierServiceOptionOtherCharge { /** Type of additional cost. */ type?: ChargeType; /** Details of the charge, such as 'Full Coverage Insurance of up to 80% of value of shipment'. */ details?: string | null; /** Price of added charge. */ cost?: SelectedCarrierServiceOptionPrices; } interface CarrierServiceOption { /** Carrier ID. */ carrierId?: string; /** Shipping options offered by this carrier for this request. */ shippingOptions?: ShippingOption[]; } interface CalculationErrors extends CalculationErrorsShippingCalculationErrorOneOf { /** General shipping calculation error. */ generalShippingCalculationError?: Details; /** Carrier errors. */ carrierErrors?: CarrierErrors; /** Tax calculation error. */ taxCalculationError?: Details; /** Coupon calculation error. */ couponCalculationError?: Details; /** Gift card calculation error. */ giftCardCalculationError?: Details; /** Order validation errors. */ orderValidationErrors?: ApplicationError[]; /** * Membership payment methods calculation errors * For example, will indicate that a line item that must be paid with membership payment doesn't have one or selected memberships are invalid */ membershipError?: Details; /** Discount Rule calculation error. */ discountsCalculationError?: Details; } /** @oneof */ interface CalculationErrorsShippingCalculationErrorOneOf { /** General shipping calculation error. */ generalShippingCalculationError?: Details; /** Carrier errors. */ carrierErrors?: CarrierErrors; } interface Details extends DetailsKindOneOf { applicationError?: ApplicationError; validationError?: ValidationError; systemError?: SystemError; /** * deprecated in API's - to enable migration from rendering arbitrary tracing to rest response * @deprecated */ tracing?: Record; } /** @oneof */ interface DetailsKindOneOf { applicationError?: ApplicationError; validationError?: ValidationError; systemError?: SystemError; } /** * example result: * { * "fieldViolations": [ * { * "field": "fieldA", * "description": "invalid music note. supported notes: [do,re,mi,fa,sol,la,ti]", * "violatedRule": "OTHER", * "ruleName": "INVALID_NOTE", * "data": { * "value": "FI" * } * }, * { * "field": "fieldB", * "description": "field value out of range. supported range: [0-20]", * "violatedRule": "MAX", * "data": { * "threshold": 20 * } * }, * { * "field": "fieldC", * "description": "invalid phone number. provide a valid phone number of size: [7-12], supported characters: [0-9, +, -, (, )]", * "violatedRule": "FORMAT", * "data": { * "type": "PHONE" * } * } * ] * } */ interface ValidationError { fieldViolations?: FieldViolation[]; } declare enum RuleType { VALIDATION = "VALIDATION", OTHER = "OTHER", MAX = "MAX", MIN = "MIN", MAX_LENGTH = "MAX_LENGTH", MIN_LENGTH = "MIN_LENGTH", MAX_SIZE = "MAX_SIZE", MIN_SIZE = "MIN_SIZE", FORMAT = "FORMAT", DECIMAL_LTE = "DECIMAL_LTE", DECIMAL_GTE = "DECIMAL_GTE", DECIMAL_LT = "DECIMAL_LT", DECIMAL_GT = "DECIMAL_GT", DECIMAL_MAX_SCALE = "DECIMAL_MAX_SCALE", INVALID_ENUM_VALUE = "INVALID_ENUM_VALUE", REQUIRED_FIELD = "REQUIRED_FIELD", FIELD_NOT_ALLOWED = "FIELD_NOT_ALLOWED", ONE_OF_ALIGNMENT = "ONE_OF_ALIGNMENT", EXACT_LENGTH = "EXACT_LENGTH", EXACT_SIZE = "EXACT_SIZE", REQUIRED_ONE_OF_FIELD = "REQUIRED_ONE_OF_FIELD" } interface FieldViolation { field?: string; description?: string; violatedRule?: RuleType; /** applicable when violated_rule=OTHER */ ruleName?: string | null; data?: Record | null; } interface SystemError { /** Error code. */ errorCode?: string | null; } interface CarrierErrors { /** Carrier errors. */ errors?: CarrierError[]; } interface CarrierError { /** Carrier ID. */ carrierId?: string; /** Error details. */ error?: Details; } declare enum WeightUnit { /** Weight unit can't be classified, due to an error */ UNSPECIFIED_WEIGHT_UNIT = "UNSPECIFIED_WEIGHT_UNIT", /** Kilograms */ KG = "KG", /** Pounds */ LB = "LB" } interface MembershipOptions { /** List of payment options that can be used. */ eligibleMemberships?: Membership[]; /** List of payment options that are owned by the member, but cannot be used due to reason provided. */ invalidMemberships?: InvalidMembership[]; /** The selected membership payment options and which line items they apply to. */ selectedMemberships?: SelectedMembership[]; } interface Membership { /** Membership ID. */ id?: string; /** ID of the application providing this payment option. */ appId?: string; /** The name of this membership. */ name?: MembershipName; /** Line item IDs which are "paid" for by this membership. */ lineItemIds?: string[]; /** Optional - For a membership that has limited credits, information about credit usage. */ credits?: MembershipPaymentCredits; /** Optional - TMembership expiry date. */ expirationDate?: Date | null; /** Additional data about this membership. */ additionalData?: Record | null; } interface MembershipName { /** Membership name. */ original?: string; /** Translated membership name. Defaults to `original` when not provided. */ translated?: string | null; } interface MembershipPaymentCredits { /** Membership's total amount of credits. */ total?: number; /** Membership's remaining amount of credits. */ remaining?: number; } interface InvalidMembership { /** Membership details. */ membership?: Membership; /** Reason why this membership is invalid and cannot be used. */ reason?: string; } interface V1AdditionalFee { /** Additional fee's unique code (or ID) for future processing. */ code?: string | null; /** Translated additional fee's name. */ name?: string; /** Additional fee's price. */ price?: MultiCurrencyPrice; /** Tax details. */ taxDetails?: ItemTaxFullDetails; /** Provider's app id. */ providerAppId?: string | null; /** Additional fee's price before tax. */ priceBeforeTax?: MultiCurrencyPrice; /** Additional fee's price after tax. */ priceAfterTax?: MultiCurrencyPrice; /** * Optional - Line items associated with this additional fee. * If no `lineItemIds` are provided, the fee will be associated with the whole cart/checkout/order. */ lineItemIds?: string[]; /** the source the additional fee was added from */ source?: AdditionalFeeSource; } declare enum AdditionalFeeSource { UNKNOWN_ADDITIONAL_FEE_SOURCE = "UNKNOWN_ADDITIONAL_FEE_SOURCE", /** The additional fee was added by an additional fee service plugin */ SERVICE_PLUGIN = "SERVICE_PLUGIN", /** The additional fee was added on the item either via the catalog or on custom line item */ ITEM = "ITEM", /** The additional fee was added manually on the request */ MANUAL = "MANUAL" } interface MultiCurrencyPriceNonNullableFields { amount: string; convertedAmount: string; formattedAmount: string; formattedConvertedAmount: string; } interface TaxRateBreakdownNonNullableFields { name: string; rate: string; tax?: MultiCurrencyPriceNonNullableFields; exemptAmount?: MultiCurrencyPriceNonNullableFields; exemptionIds: number[]; taxableAmount?: MultiCurrencyPriceNonNullableFields; } interface TaxBreakdownNonNullableFields { nonTaxableAmount?: MultiCurrencyPriceNonNullableFields; taxAmount?: MultiCurrencyPriceNonNullableFields; taxableAmount?: MultiCurrencyPriceNonNullableFields; jurisdictionType: JurisdictionType; } interface ItemTaxFullDetailsNonNullableFields { taxableAmount?: MultiCurrencyPriceNonNullableFields; taxRate: string; totalTax?: MultiCurrencyPriceNonNullableFields; rateBreakdown: TaxRateBreakdownNonNullableFields[]; exemptAmount?: MultiCurrencyPriceNonNullableFields; taxBreakdown: TaxBreakdownNonNullableFields[]; } interface LineItemPricesDataNonNullableFields { totalPriceAfterTax?: MultiCurrencyPriceNonNullableFields; totalPriceBeforeTax?: MultiCurrencyPriceNonNullableFields; taxDetails?: ItemTaxFullDetailsNonNullableFields; totalDiscount?: MultiCurrencyPriceNonNullableFields; price?: MultiCurrencyPriceNonNullableFields; priceBeforeDiscounts?: MultiCurrencyPriceNonNullableFields; lineItemPrice?: MultiCurrencyPriceNonNullableFields; fullPrice?: MultiCurrencyPriceNonNullableFields; } interface CalculatedLineItemNonNullableFields { lineItemId: string; pricesBreakdown?: LineItemPricesDataNonNullableFields; paymentOption: PaymentOptionType; } interface PriceSummaryNonNullableFields { subtotal?: MultiCurrencyPriceNonNullableFields; shipping?: MultiCurrencyPriceNonNullableFields; tax?: MultiCurrencyPriceNonNullableFields; discount?: MultiCurrencyPriceNonNullableFields; total?: MultiCurrencyPriceNonNullableFields; additionalFees?: MultiCurrencyPriceNonNullableFields; } interface GiftCardNonNullableFields { id: string; obfuscatedCode: string; amount?: MultiCurrencyPriceNonNullableFields; appId: string; } interface ApplicationErrorNonNullableFields { code: string; description: string; } interface AutoTaxFallbackCalculationDetailsNonNullableFields { fallbackReason: FallbackReason; error?: ApplicationErrorNonNullableFields; } interface TaxCalculationDetailsNonNullableFields { manualRateReason: ManualCalculationReason; autoTaxFallbackDetails?: AutoTaxFallbackCalculationDetailsNonNullableFields; rateType: RateType; } interface AggregatedTaxBreakdownNonNullableFields { taxName: string; taxType: string; jurisdiction: string; jurisdictionTypeEnum: JurisdictionType; rate: string; aggregatedTaxAmount?: MultiCurrencyPriceNonNullableFields; aggregatedTaxableAmount?: MultiCurrencyPriceNonNullableFields; } interface TaxSummaryNonNullableFields { taxableAmount?: MultiCurrencyPriceNonNullableFields; totalTax?: MultiCurrencyPriceNonNullableFields; manualTaxRate: string; calculationDetails?: TaxCalculationDetailsNonNullableFields; totalExempt?: MultiCurrencyPriceNonNullableFields; aggregatedTaxBreakdown: AggregatedTaxBreakdownNonNullableFields[]; } interface ShippingRegionNonNullableFields { id: string; name: string; } interface StreetAddressNonNullableFields { number: string; name: string; apt: string; } interface AddressNonNullableFields { streetAddress?: StreetAddressNonNullableFields; } interface PickupDetailsNonNullableFields { address?: AddressNonNullableFields; businessLocation: boolean; pickupMethod: PickupMethod; } interface DeliveryLogisticsNonNullableFields { pickupDetails?: PickupDetailsNonNullableFields; } interface SelectedCarrierServiceOptionPricesNonNullableFields { totalPriceAfterTax?: MultiCurrencyPriceNonNullableFields; totalPriceBeforeTax?: MultiCurrencyPriceNonNullableFields; taxDetails?: ItemTaxFullDetailsNonNullableFields; totalDiscount?: MultiCurrencyPriceNonNullableFields; price?: MultiCurrencyPriceNonNullableFields; } interface SelectedCarrierServiceOptionOtherChargeNonNullableFields { type: ChargeType; cost?: SelectedCarrierServiceOptionPricesNonNullableFields; } interface CarrierNonNullableFields { code: string; } interface ApplicableLineItemsNonNullableFields { lineItemIds: string[]; } interface DeliveryAllocationNonNullableFields { deliveryCarrier?: CarrierNonNullableFields; applicableLineItems?: ApplicableLineItemsNonNullableFields; } interface SelectedCarrierServiceOptionNonNullableFields { code: string; title: string; logistics?: DeliveryLogisticsNonNullableFields; cost?: SelectedCarrierServiceOptionPricesNonNullableFields; requestedShippingOption: boolean; otherCharges: SelectedCarrierServiceOptionOtherChargeNonNullableFields[]; deliveryAllocations: DeliveryAllocationNonNullableFields[]; } interface OtherChargeNonNullableFields { type: ChargeType; price?: MultiCurrencyPriceNonNullableFields; } interface ShippingPriceNonNullableFields { price?: MultiCurrencyPriceNonNullableFields; otherCharges: OtherChargeNonNullableFields[]; } interface ShippingOptionNonNullableFields { code: string; title: string; logistics?: DeliveryLogisticsNonNullableFields; cost?: ShippingPriceNonNullableFields; deliveryAllocations: DeliveryAllocationNonNullableFields[]; } interface CarrierServiceOptionNonNullableFields { carrierId: string; shippingOptions: ShippingOptionNonNullableFields[]; } interface ShippingInformationNonNullableFields { region?: ShippingRegionNonNullableFields; selectedCarrierServiceOption?: SelectedCarrierServiceOptionNonNullableFields; carrierServiceOptions: CarrierServiceOptionNonNullableFields[]; } interface CouponNonNullableFields { id: string; code: string; amount?: MultiCurrencyPriceNonNullableFields; name: string; couponType: string; } interface MerchantDiscountNonNullableFields { amount?: MultiCurrencyPriceNonNullableFields; } interface DiscountRuleNameNonNullableFields { original: string; } interface DiscountRuleNonNullableFields { id: string; name?: DiscountRuleNameNonNullableFields; amount?: MultiCurrencyPriceNonNullableFields; } interface LineItemDiscountNonNullableFields { id: string; totalDiscountAmount?: MultiCurrencyPriceNonNullableFields; } interface AppliedDiscountNonNullableFields { coupon?: CouponNonNullableFields; merchantDiscount?: MerchantDiscountNonNullableFields; discountRule?: DiscountRuleNonNullableFields; discountType: DiscountType; lineItemIds: string[]; lineItemDiscounts: LineItemDiscountNonNullableFields[]; } interface FieldViolationNonNullableFields { field: string; description: string; violatedRule: RuleType; } interface ValidationErrorNonNullableFields { fieldViolations: FieldViolationNonNullableFields[]; } interface DetailsNonNullableFields { applicationError?: ApplicationErrorNonNullableFields; validationError?: ValidationErrorNonNullableFields; } interface CarrierErrorNonNullableFields { carrierId: string; error?: DetailsNonNullableFields; } interface CarrierErrorsNonNullableFields { errors: CarrierErrorNonNullableFields[]; } interface CalculationErrorsNonNullableFields { generalShippingCalculationError?: DetailsNonNullableFields; carrierErrors?: CarrierErrorsNonNullableFields; taxCalculationError?: DetailsNonNullableFields; couponCalculationError?: DetailsNonNullableFields; giftCardCalculationError?: DetailsNonNullableFields; orderValidationErrors: ApplicationErrorNonNullableFields[]; membershipError?: DetailsNonNullableFields; discountsCalculationError?: DetailsNonNullableFields; } interface MembershipNameNonNullableFields { original: string; } interface MembershipPaymentCreditsNonNullableFields { total: number; remaining: number; } interface MembershipNonNullableFields { id: string; appId: string; name?: MembershipNameNonNullableFields; lineItemIds: string[]; credits?: MembershipPaymentCreditsNonNullableFields; } interface InvalidMembershipNonNullableFields { membership?: MembershipNonNullableFields; reason: string; } interface SelectedMembershipNonNullableFields { id: string; appId: string; lineItemIds: string[]; } interface MembershipOptionsNonNullableFields { eligibleMemberships: MembershipNonNullableFields[]; invalidMemberships: InvalidMembershipNonNullableFields[]; selectedMemberships: SelectedMembershipNonNullableFields[]; } interface V1AdditionalFeeNonNullableFields { name: string; price?: MultiCurrencyPriceNonNullableFields; taxDetails?: ItemTaxFullDetailsNonNullableFields; priceBeforeTax?: MultiCurrencyPriceNonNullableFields; priceAfterTax?: MultiCurrencyPriceNonNullableFields; lineItemIds: string[]; source: AdditionalFeeSource; } interface CalculateTotalsResponseNonNullableFields { calculatedLineItems: CalculatedLineItemNonNullableFields[]; priceSummary?: PriceSummaryNonNullableFields; giftCard?: GiftCardNonNullableFields; taxSummary?: TaxSummaryNonNullableFields; shippingInfo?: ShippingInformationNonNullableFields; appliedDiscounts: AppliedDiscountNonNullableFields[]; calculationErrors?: CalculationErrorsNonNullableFields; weightUnit: WeightUnit; currency: string; conversionCurrency: string; taxIncludedInPrice: boolean; payNow?: PriceSummaryNonNullableFields; payLater?: PriceSummaryNonNullableFields; membershipOptions?: MembershipOptionsNonNullableFields; additionalFees: V1AdditionalFeeNonNullableFields[]; siteCurrency: string; payNowTotalAfterGiftCard?: MultiCurrencyPriceNonNullableFields; totalAfterGiftCard?: MultiCurrencyPriceNonNullableFields; } type __PublicMethodMetaInfo = { getUrl: (context: any) => string; httpMethod: K; path: string; pathParams: M; __requestType: T; __originalRequestType: S; __responseType: Q; __originalResponseType: R; }; declare function calculateTotals(): __PublicMethodMetaInfo<'POST', {}, CalculateTotalsRequest$1, CalculateTotalsRequest, CalculateTotalsResponse$1 & CalculateTotalsResponseNonNullableFields$1, CalculateTotalsResponse & CalculateTotalsResponseNonNullableFields>; export { type __PublicMethodMetaInfo, calculateTotals };