From d40e534aea45a96f1c337582be4acfa204651779 Mon Sep 17 00:00:00 2001 From: emmagrob Date: Mon, 5 Sep 2022 15:49:37 +0300 Subject: [PATCH 01/11] DocWorks for ecom-additional-fees - 1 change detected changes: Service ecom-additional-fees is new --- .../ecom-additional-fees.service.json | 819 ++++++++++++++++++ 1 file changed, 819 insertions(+) create mode 100644 ecom-additional-fees/ecom-additional-fees.service.json diff --git a/ecom-additional-fees/ecom-additional-fees.service.json b/ecom-additional-fees/ecom-additional-fees.service.json new file mode 100644 index 0000000000..9e2d0b2a06 --- /dev/null +++ b/ecom-additional-fees/ecom-additional-fees.service.json @@ -0,0 +1,819 @@ +{ "name": "ecom-additional-fees", + "mixes": [], + "labels": + [ "new" ], + "location": + { "lineno": 1, + "filename": "additional-fees-index.js" }, + "docs": + { "summary": "The eCommerce Additional Fees SPI.", + "description": + [ ">**Note:** This API is currently in beta and is expecting upcoming changes.", + "", + "The Additional Fees SPI is a service provider interface that allows site owners and collaborators to add additional fees ", + "to the eCommerce Platform's cart and checkout. These additional fees are calculated and seen in all eCom platform pages, ", + "including cart, checkout, orders, and payments.", + "", + "Wix eCommerce calls the SPI endpoint [`calculateAdditionalFees`](https://www.wix.com/velo/reference/ecom-additional-fees/calculateadditionalfees) ", + "to retrieve the relevant data for a site collaborator to add additional fees. ", + "Collaborators can then implement their own logic to calculate addition fees, and return the calculated fees ", + "data in the structure provided by Wix eCommerce. ", + "", + "Note that `currency` in the [`calculateAdditionalFees`](https://www.wix.com/velo/reference/ecom-additional-fees/calculateadditionalfees) response must match ", + "your site's currency. You can find the currency of your site using the [`getPaymentCurrency`]", + "(https://www.wix.com/velo/reference/wix-site-backend/generalinfo-obj/getpaymentcurrency) API. ", + "", + "Learn more about [Additional Fees SPI custom integration](https://support.wix.com/en/article/velo-tutorial-ecommerce-custom-additional-fees-extension-beta)." ], + "links": [], + "examples": [], + "extra": + { } }, + "properties": [], + "operations": + [ { "name": "calculateAdditionalFees", + "labels": [], + "nameParams": [], + "params": + [ { "name": "options", + "type": "ecom-additional-fees.Options", + "doc": "Options for line items, shipping options and discounts." } ], + "ret": + { "type": + { "name": "Promise", + "typeParams": + [ "ecom-additional-fees.CalculateAdditionalFeesResponse" ] }, + "doc": "Fulfilled - Additional fees and currency info." }, + "locations": + [ { "lineno": 1, + "filename": "additional-fees.js" } ], + "docs": + { "summary": "Calculates additional fees to include in the cart and checkout.", + "description": + [ "The `calculateAdditionalFees` function calculates additional fees to appear in the cart and checkout pages of a store's site. ", + "The function is automatically called by Wix eCommerce when the cart totals are calculated, or when an action is performed in ", + "the cart and/or checkout. For example, when an item is added to the cart, or when a shipping location is specified." ], + "links": [], + "examples": + [ { "title": "Calculate Additional Fees for a product", + "body": + [ "import wixSiteBackend from 'wix-site-backend';", + "", + "export const calculateAdditionalFees = async (options) => {", + " let additionalFees = [];", + " const feePrice = calculateWrappingFee(options.lineItems);", + " const currency = await wixSiteBackend.generalInfo.getPaymentCurrency();", + "", + " if (feePrice) {", + " additionalFees.push({", + " code: 'fragile-packaging',", + " name: 'Fragile Packaging',", + " price: String(feePrice),", + " taxDetails: {", + " taxable: true", + " }", + " });", + " }", + "", + " return {", + " currency,", + " additionalFees", + " };", + "};", + "", + "// Check if an item is fragile.", + "function isFragile(item) {", + " const productName = item.productName.toLowerCase();", + " return productName.includes('glass') || productName.includes('ceramic');", + "}", + "", + "// Charge per fragile item.", + "// Give away free packaging when ordering at least 5 items.", + "function calculateWrappingFee(lineItems) {", + " const minItemsForFreeWrapping = 5;", + " let numFragileItems = 0;", + " lineItems.forEach((item) => {", + " isFragile(item) ? numFragileItems += item.quantity : 0", + " });", + " const shouldChargeFee = numFragileItems < minItemsForFreeWrapping;", + " const price = shouldChargeFee ? numFragileItems : 0;", + " return price;", + "}", + "" ], + "extra": + { "description": "This example calculates the additional fees for packaging fragile items from a store. If more than 5 fragile items are added to the cart,\nthe fragile packaging is free." } } ], + "extra": + { } }, + "extra": + { } } ], + "callbacks": [], + "messages": + [ { "name": "AdditionalFee", + "locations": + [ { "lineno": 39, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "code", + "type": "string", + "doc": "Unique code or ID for the additional fee.\n\nMax: 100 characters" }, + { "name": "name", + "type": "string", + "doc": "Name of additional fee. \n\nMax: 50 characters" }, + { "name": "price", + "type": "string", + "doc": "Additional fee's price." }, + { "name": "taxDetails", + "type": "ecom-additional-fees.TaxDetails", + "doc": "Tax details based on tax settings in the dashboard." } ], + "extra": + { }, + "labels": [] }, + { "name": "Address", + "locations": + [ { "lineno": 171, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "addressLine1", + "type": "string", + "doc": "Main address line, usually street and number, as free text.", + "optional": true }, + { "name": "streetAddress", + "type": "ecom-additional-fees.AddressInfo", + "doc": "Street address object, with number and name in separate fields.", + "optional": true }, + { "name": "addressLine2", + "type": "string", + "doc": "Free text providing more detailed address information, such as apartment, suite, or floor." }, + { "name": "city", + "type": "string", + "doc": "City name." }, + { "name": "subdivision", + "type": "string", + "doc": "Code for a subdivision (such as state, prefecture, or province) in an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format." }, + { "name": "country", + "type": "string", + "doc": "2-letter country code in an [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format." }, + { "name": "postalCode", + "type": "string", + "doc": "Postal or zip code." } ], + "extra": + { "oneOfGroups": + [ { "name": "street", + "members": + [ "addressLine1", + "streetAddress" ] } ] }, + "labels": [] }, + { "name": "AddressInfo", + "locations": + [ { "lineno": 184, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "number", + "type": "string", + "doc": "Street number." }, + { "name": "name", + "type": "string", + "doc": "Street name." } ], + "extra": + { }, + "labels": [] }, + { "name": "AppliedDiscount", + "locations": + [ { "lineno": 273, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "discountType", + "type": "string", + "doc": "Discount type. \n\nSupported values:\n - `\"GLOBAL\"`: Discount on the entire cart.\n - `\"SPECIFIC_ITEMS\"`: Discount on specific item.\n - `\"SHIPPING\"`: Discount on shipping." }, + { "name": "lineItemIds", + "type": + { "name": "Array", + "typeParams": + [ "string" ] }, + "doc": "Line item IDs the discount applies to." }, + { "name": "coupon", + "type": "ecom-additional-fees.Coupon", + "doc": "Coupon details.", + "optional": true }, + { "name": "merchantDiscount", + "type": "ecom-additional-fees.MerchantDiscount", + "doc": "Merchant discount.", + "optional": true }, + { "name": "discountRule", + "type": "ecom-additional-fees.DiscountRule", + "doc": "Discount rule.", + "optional": true } ], + "extra": + { "oneOfGroups": + [ { "name": "DiscountSource", + "members": + [ "coupon", + "merchantDiscount", + "discountRule" ] } ] }, + "labels": [] }, + { "name": "CalculateAdditionalFeesResponse", + "locations": + [ { "lineno": 30, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "additionalFees", + "type": + { "name": "Array", + "typeParams": + [ "ecom-additional-fees.AdditionalFee" ] }, + "doc": "List of additional fees." }, + { "name": "currency", + "type": "string", + "doc": "Currency of the additional fees as a three-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n\nThe `additionalFees` response won't be returned if `currency` doesn't match your site's currency." } ], + "extra": + { }, + "labels": [] }, + { "name": "CarrierServiceOption", + "locations": + [ { "lineno": 239, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "carrierId", + "type": "string", + "doc": "Carrier ID." } ], + "extra": + { }, + "labels": [] }, + { "name": "CatalogReference", + "locations": + [ { "lineno": 83, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "catalogItemId", + "type": "string", + "doc": "ID of the item within the [custom catalog](https://www.wix.com/velo/reference/ecom-catalog/getcatalogitems)." }, + { "name": "appId", + "type": "string", + "doc": "ID of the catalog app." }, + { "name": "options", + "type": "Object", + "doc": "Additional data passed by the catalog." } ], + "extra": + { }, + "labels": [] }, + { "name": "Coupon", + "locations": + [ { "lineno": 289, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "id", + "type": "string", + "doc": "Coupon ID." }, + { "name": "code", + "type": "string", + "doc": "Coupon code." }, + { "name": "amount", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Coupon value." }, + { "name": "name", + "type": "string", + "doc": "Coupon name." } ], + "extra": + { }, + "labels": [] }, + { "name": "DeliveryLogistics", + "locations": + [ { "lineno": 147, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "deliveryTime", + "type": "string", + "doc": "Expected delivery time in free text. For example, `'3-5 business days'`. \n\nMax: 500 characters" }, + { "name": "instructions", + "type": "string", + "doc": "Instructions for carrier. For example, `'Please deliver package during opening hours'`. \n\nMax: 1000 characters" }, + { "name": "pickupDetails", + "type": "ecom-additional-fees.PickupDetails", + "doc": "Pickup details." } ], + "extra": + { }, + "labels": [] }, + { "name": "DiscountRule", + "locations": + [ { "lineno": 304, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "id", + "type": "string", + "doc": "Discount Rule ID." }, + { "name": "name", + "type": "ecom-additional-fees.DiscountRuleName", + "doc": "Discount rule name." }, + { "name": "amount", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Discount value." } ], + "extra": + { }, + "labels": [] }, + { "name": "DiscountRuleName", + "locations": + [ { "lineno": 312, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "original", + "type": "string", + "doc": "Original discount rule name in the site/buyer's language." }, + { "name": "translated", + "type": "string", + "doc": "Discount rule name translated to a buyer's language. If not specified, defaults to the `original` value." } ], + "extra": + { }, + "labels": [] }, + { "name": "ItemTaxFullDetails", + "locations": + [ { "lineno": 209, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "taxableAmount", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Taxable amount." }, + { "name": "taxGroupId", + "type": "string", + "doc": "Tax group ID." }, + { "name": "taxRate", + "type": "string", + "doc": "Tax rate as a decimal value between 0 and 1." }, + { "name": "totalTax", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Calculated tax based on `taxableAmount` and `taxRate`." }, + { "name": "rateBreakdown", + "type": + { "name": "Array", + "typeParams": + [ "ecom-additional-fees.TaxRateBreakdown" ] }, + "doc": "Tax breakdown." } ], + "extra": + { }, + "labels": [] }, + { "name": "LineItem", + "locations": + [ { "lineno": 58, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "id", + "type": "string", + "doc": "The ID of the line item." }, + { "name": "quantity", + "type": "number", + "doc": "The quantity of the line item." }, + { "name": "catalogReference", + "type": "ecom-additional-fees.CatalogReference", + "doc": "Catalog and items reference info." }, + { "name": "productName", + "type": "string", + "doc": "Display name." }, + { "name": "price", + "type": "string", + "doc": "Price of the item." }, + { "name": "physicalProperties", + "type": "ecom-additional-fees.PhysicalProperties", + "doc": "Properties of a physical item in cart and/or checkout." }, + { "name": "paymentOption", + "type": "string", + "doc": "Type of selected payment option for the current item. Defaults to `\"FULL_PAYMENT_ONLINE\"`. \n\nSupported values:\n+ `\"FULL_PAYMENT_ONLINE\"` - Entire payment for the item happens as part of the checkout.\n+ `\"FULL_PAYMENT_OFFLINE\"` - Entire payment for the item happens after the checkout. For example, when using cash, check, or other offline payment methods.\n+ `\"MEMBERSHIP\"` - Payment for the item is done by charging a membership. When the option is used, `lineItem.price.amount` is `0`.\n+ `\"DEPOSIT_ONLINE\"` - Partial payment to be paid upfront during the checkout. Amount to be paid is defined by `depositAmount` field.", + "optional": true }, + { "name": "serviceProperties", + "type": "ecom-additional-fees.ServiceProperties", + "doc": "Service properties. When relevant, contains information such as service date and number of participants. Used, among other things, when checking for valid memberships." }, + { "name": "rootCatalogItemId", + "type": "string", + "doc": "In cases where `catalogReference.catalogItemId` is not the actual catalog item ID, this field returns the true item's ID.\n+ For example, for Wix Bookings, `catalogReference.catalogItemId` is the booking ID. Therefore this value is set to the service ID.\n+ In most cases, this field is the same as `catalogReference.catalogItemId`.\n+ Used in membership validation." }, + { "name": "depositAmount", + "type": "string", + "doc": "Partial payment to be paid upfront during the checkout.\nEligible for items where `paymentOption` is `\"DEPOSIT_ONLINE\"` only. If omitted, the item's price is not split and is expected to be paid in a single installment." } ], + "extra": + { }, + "labels": [] }, + { "name": "MerchantDiscount", + "locations": + [ { "lineno": 298, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Discount value." } ], + "extra": + { }, + "labels": [] }, + { "name": "MultiCurrencyPrice", + "locations": + [ { "lineno": 200, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "string", + "doc": "Amount." }, + { "name": "convertedAmount", + "type": "string", + "doc": "Converted amount." }, + { "name": "formattedAmount", + "type": "string", + "doc": "Formatted amount with currency symbol." }, + { "name": "formattedConvertedAmount", + "type": "string", + "doc": "Converted amount formatted with currency symbol." } ], + "extra": + { }, + "labels": [] }, + { "name": "Options", + "locations": + [ { "lineno": 21, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "lineItems", + "type": + { "name": "Array", + "typeParams": + [ "ecom-additional-fees.LineItem" ] }, + "doc": "Line items.\n\nMax: 100 line items" }, + { "name": "shippingInfo", + "type": "ecom-additional-fees.ShippingInfo", + "doc": "Shipping information." } ], + "extra": + { }, + "labels": [] }, + { "name": "OtherCharge", + "locations": + [ { "lineno": 262, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "type", + "type": "string", + "doc": "Type of additional charge.\n \nSupported values:\n - `'HANDLING_FEE'`\n - `'INSURANCE'`" }, + { "name": "price", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Price of added charge." } ], + "extra": + { }, + "labels": [] }, + { "name": "PhysicalProperties", + "locations": + [ { "lineno": 91, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "weight", + "type": "number", + "doc": "Item weight." }, + { "name": "sku", + "type": "string", + "doc": "Stock keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku)." }, + { "name": "shippable", + "type": "boolean", + "doc": "Whether the item is shippable." } ], + "extra": + { }, + "labels": [] }, + { "name": "PickupDetails", + "locations": + [ { "lineno": 159, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "address", + "type": "ecom-additional-fees.Address", + "doc": "Pickup address." }, + { "name": "businessLocation", + "type": "boolean", + "doc": "Whether the pickup address is a business address. May affect tax calculation." }, + { "name": "pickupMethod", + "type": "string", + "doc": "Pickup method.\n\nSupported values:\n - `\"STORE_PICKUP\"`\n - `\"PICKUP_POINT\"`" } ], + "extra": + { }, + "labels": [] }, + { "name": "SelectedCarrierSeriveOptionPrices", + "locations": + [ { "lineno": 191, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "totalPriceAfterTax", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Total shipping price after discount and tax." }, + { "name": "taxDetails", + "type": "ecom-additional-fees.ItemTaxFullDetails", + "doc": "Tax details." }, + { "name": "totalDiscount", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Shipping discount before tax." }, + { "name": "price", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Shipping price before discount and tax." } ], + "extra": + { }, + "labels": [] }, + { "name": "SelectedCarrierServiceOption", + "locations": + [ { "lineno": 133, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "code", + "type": "string", + "doc": "Unique identifier of a selected option. For example, `'usps_std_overnight'`." }, + { "name": "title", + "type": "string", + "doc": "Title of the selected carrier service option. For example, `'USPS Standard Overnight Delivery'`, `'Standard'`,\nor `'First-Class Package International'`.\n\nMax: 250 characters" }, + { "name": "logistics", + "type": "ecom-additional-fees.DeliveryLogistics", + "doc": "Delivery logistics." }, + { "name": "requestedShippingOption", + "type": "boolean", + "doc": "Whether the requested shipping option exists in `carrierServiceOptions`. If `false`, the first \nitem in `carrierServiceOptions` is used." }, + { "name": "carrierId", + "type": "string", + "doc": "Selected carrier's ID." } ], + "extra": + { }, + "labels": [] }, + { "name": "SelectedCarrierServiceOptionsOtherCharge", + "locations": + [ { "lineno": 227, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "type", + "type": "string", + "doc": "Type of additional charge.\n \nSupported values:\n - `'HANDLING_FEE'`\n - `'INSURANCE'`" }, + { "name": "details", + "type": "string", + "doc": "Charge details. For example, 'Full Coverage Insurance up to 80% value of shipment'." }, + { "name": "price", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Price of added charge." } ], + "extra": + { }, + "labels": [] }, + { "name": "ServiceProperties", + "locations": + [ { "lineno": 111, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "scheduledDate", + "type": "string", + "doc": "Date and time the service is to be provided. For example, the time of the a class." }, + { "name": "numberOfParticipants", + "type": "number", + "doc": "Number of people participating in the service.\nFor example, the number of people attending a yoga class or the number of people per hotel room." } ], + "extra": + { }, + "labels": [] }, + { "name": "ShippingInfo", + "locations": + [ { "lineno": 119, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "selectedCarrierServiceOption", + "type": "ecom-additional-fees.SelectedCarrierServiceOption", + "doc": "Selected shipping option." }, + { "name": "carrierServiceOptions", + "type": + { "name": "Array", + "typeParams": + [ "ecom-additional-fees.CarrierServiceOption" ] }, + "doc": "List of all shipping options." } ], + "extra": + { }, + "labels": [] }, + { "name": "ShippingOption", + "locations": + [ { "lineno": 245, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "code", + "type": "string", + "doc": "Unique code of provided shipping option. For example, `'usps_std_overnight'`." }, + { "name": "title", + "type": "string", + "doc": "Title of the selected carrier service option. For example, `'USPS Standard Overnight Delivery'`, `'Standard'`,\nor `'First-Class Package International'`." }, + { "name": "logistics", + "type": "ecom-additional-fees.DeliveryLogistics", + "doc": "Delivery logistics." }, + { "name": "cost", + "type": "ecom-additional-fees.ShippingPrice", + "doc": "Shipping price info." } ], + "extra": + { }, + "labels": [] }, + { "name": "ShippingPrice", + "locations": + [ { "lineno": 255, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "price", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Shipping price." }, + { "name": "otherCharges", + "type": + { "name": "Array", + "typeParams": + [ "ecom-additional-fees.OtherCharge" ] }, + "doc": "Other costs. For example, insurance or handling and packaging fees." } ], + "extra": + { }, + "labels": [] }, + { "name": "ShippingRegion", + "locations": + [ { "lineno": 126, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "id", + "type": "string", + "doc": "Reserved for internal use." }, + { "name": "name", + "type": "string", + "doc": "Shipping region name." } ], + "extra": + { }, + "labels": [] }, + { "name": "SubscriptionSettings", + "locations": + [ { "lineno": 99, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "frequency", + "type": "string", + "doc": "The frequency of recurring paymenent based on every day, week, month, or year.\n\nSupported values:\n - `\"DAY\"`\n - `\"WEEK\"`\n - `\"MONTH\"`\n - `\"YEAR\"`" } ], + "extra": + { }, + "labels": [] }, + { "name": "TaxDetails", + "locations": + [ { "lineno": 52, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "taxable", + "type": "boolean", + "doc": "Whether the additional fee is taxable." } ], + "extra": + { }, + "labels": [] }, + { "name": "TaxRateBreakdown", + "locations": + [ { "lineno": 219, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "name", + "type": "string", + "doc": "Type of tax calculated." }, + { "name": "rate", + "type": "string", + "doc": "Tax rate." }, + { "name": "tax", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Tax amount." } ], + "extra": + { }, + "labels": [] } ], + "extra": + { } } \ No newline at end of file From ca4ccaa879a4c2485567d90b9fab1f280b4632a9 Mon Sep 17 00:00:00 2001 From: emmagrob Date: Mon, 5 Sep 2022 15:52:00 +0300 Subject: [PATCH 02/11] DocWorks for ecom-additional-fees - 1 change detected changes: Service ecom-additional-fees has changed description --- ecom-additional-fees/ecom-additional-fees.service.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ecom-additional-fees/ecom-additional-fees.service.json b/ecom-additional-fees/ecom-additional-fees.service.json index 9e2d0b2a06..3d41398cd3 100644 --- a/ecom-additional-fees/ecom-additional-fees.service.json +++ b/ecom-additional-fees/ecom-additional-fees.service.json @@ -1,14 +1,14 @@ { "name": "ecom-additional-fees", "mixes": [], "labels": - [ "new" ], + [ "changed" ], "location": { "lineno": 1, "filename": "additional-fees-index.js" }, "docs": { "summary": "The eCommerce Additional Fees SPI.", "description": - [ ">**Note:** This API is currently in beta and is expecting upcoming changes.", + [ ">**Note:** This SPI is currently in Beta and is subject to change.", "", "The Additional Fees SPI is a service provider interface that allows site owners and collaborators to add additional fees ", "to the eCommerce Platform's cart and checkout. These additional fees are calculated and seen in all eCom platform pages, ", From 764d262cd0cf89f1acc70d88e83896beeb8a53b5 Mon Sep 17 00:00:00 2001 From: emmagrob Date: Mon, 5 Sep 2022 15:55:52 +0300 Subject: [PATCH 03/11] DocWorks for ecom-additional-fees - 1 change detected changes: Service ecom-additional-fees has changed description --- ecom-additional-fees/ecom-additional-fees.service.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ecom-additional-fees/ecom-additional-fees.service.json b/ecom-additional-fees/ecom-additional-fees.service.json index 3d41398cd3..baaf693133 100644 --- a/ecom-additional-fees/ecom-additional-fees.service.json +++ b/ecom-additional-fees/ecom-additional-fees.service.json @@ -20,8 +20,7 @@ "data in the structure provided by Wix eCommerce. ", "", "Note that `currency` in the [`calculateAdditionalFees`](https://www.wix.com/velo/reference/ecom-additional-fees/calculateadditionalfees) response must match ", - "your site's currency. You can find the currency of your site using the [`getPaymentCurrency`]", - "(https://www.wix.com/velo/reference/wix-site-backend/generalinfo-obj/getpaymentcurrency) API. ", + "your site's currency. You can find the currency of your site using the [`getPaymentCurrency`](https://www.wix.com/velo/reference/wix-site-backend/generalinfo-obj/getpaymentcurrency) API. ", "", "Learn more about [Additional Fees SPI custom integration](https://support.wix.com/en/article/velo-tutorial-ecommerce-custom-additional-fees-extension-beta)." ], "links": [], From efdab2f20092d1710255e4f2d3691de27c64afda Mon Sep 17 00:00:00 2001 From: emmagrob Date: Mon, 5 Sep 2022 16:00:37 +0300 Subject: [PATCH 04/11] DocWorks for ecom-additional-fees - 2 changes detected changes: Service ecom-additional-fees message CarrierServiceOption has a new member shippingOptions Service ecom-additional-fees message ShippingOption member cost was removed --- .../ecom-additional-fees.service.json | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/ecom-additional-fees/ecom-additional-fees.service.json b/ecom-additional-fees/ecom-additional-fees.service.json index baaf693133..6421068fd3 100644 --- a/ecom-additional-fees/ecom-additional-fees.service.json +++ b/ecom-additional-fees/ecom-additional-fees.service.json @@ -263,10 +263,17 @@ "members": [ { "name": "carrierId", "type": "string", - "doc": "Carrier ID." } ], + "doc": "Carrier ID." }, + { "name": "shippingOptions", + "type": + { "name": "Array", + "typeParams": + [ "ecom-additional-fees.ShippingOption" ] }, + "doc": "Shipping options offered by the carrier." } ], "extra": { }, - "labels": [] }, + "labels": + [ "changed" ] }, { "name": "CatalogReference", "locations": [ { "lineno": 83, @@ -696,7 +703,7 @@ "labels": [] }, { "name": "ShippingOption", "locations": - [ { "lineno": 245, + [ { "lineno": 246, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -712,13 +719,11 @@ "doc": "Title of the selected carrier service option. For example, `'USPS Standard Overnight Delivery'`, `'Standard'`,\nor `'First-Class Package International'`." }, { "name": "logistics", "type": "ecom-additional-fees.DeliveryLogistics", - "doc": "Delivery logistics." }, - { "name": "cost", - "type": "ecom-additional-fees.ShippingPrice", - "doc": "Shipping price info." } ], + "doc": "Delivery logistics." } ], "extra": { }, - "labels": [] }, + "labels": + [ "changed" ] }, { "name": "ShippingPrice", "locations": [ { "lineno": 255, From dda0435de8c80e308ea532e1ca38723c33c62cd6 Mon Sep 17 00:00:00 2001 From: emmagrob Date: Mon, 5 Sep 2022 17:16:08 +0300 Subject: [PATCH 05/11] DocWorks for ecom-additional-fees - 4 changes detected changes: Service ecom-additional-fees has changed description Service ecom-additional-fees operation calculateAdditionalFees has changed param options doc Service ecom-additional-fees operation calculateAdditionalFees.examples[0] has changed body Service ecom-additional-fees message Options member lineItems has changed doc --- .../ecom-additional-fees.service.json | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/ecom-additional-fees/ecom-additional-fees.service.json b/ecom-additional-fees/ecom-additional-fees.service.json index 6421068fd3..7f89f2f2d6 100644 --- a/ecom-additional-fees/ecom-additional-fees.service.json +++ b/ecom-additional-fees/ecom-additional-fees.service.json @@ -8,7 +8,7 @@ "docs": { "summary": "The eCommerce Additional Fees SPI.", "description": - [ ">**Note:** This SPI is currently in Beta and is subject to change.", + [ ">**Note:** This SPI is currently in beta and is subject to change. Some SPI's are currently not available to all users. ", "", "The Additional Fees SPI is a service provider interface that allows site owners and collaborators to add additional fees ", "to the eCommerce Platform's cart and checkout. These additional fees are calculated and seen in all eCom platform pages, ", @@ -30,12 +30,13 @@ "properties": [], "operations": [ { "name": "calculateAdditionalFees", - "labels": [], + "labels": + [ "changed" ], "nameParams": [], "params": [ { "name": "options", "type": "ecom-additional-fees.Options", - "doc": "Options for line items, shipping options and discounts." } ], + "doc": "Options for line items and shipping options." } ], "ret": { "type": { "name": "Promise", @@ -90,9 +91,7 @@ "function calculateWrappingFee(lineItems) {", " const minItemsForFreeWrapping = 5;", " let numFragileItems = 0;", - " lineItems.forEach((item) => {", - " isFragile(item) ? numFragileItems += item.quantity : 0", - " });", + " lineItems.filter(isFragile).reduce((numFragileItems, curr) => numFragileItems + curr.quantity, 0);", " const shouldChargeFee = numFragileItems < minItemsForFreeWrapping;", " const price = shouldChargeFee ? numFragileItems : 0;", " return price;", @@ -272,8 +271,7 @@ "doc": "Shipping options offered by the carrier." } ], "extra": { }, - "labels": - [ "changed" ] }, + "labels": [] }, { "name": "CatalogReference", "locations": [ { "lineno": 83, @@ -515,13 +513,14 @@ { "name": "Array", "typeParams": [ "ecom-additional-fees.LineItem" ] }, - "doc": "Line items.\n\nMax: 100 line items" }, + "doc": "Line items.\n\nMax: 300 line items" }, { "name": "shippingInfo", "type": "ecom-additional-fees.ShippingInfo", "doc": "Shipping information." } ], "extra": { }, - "labels": [] }, + "labels": + [ "changed" ] }, { "name": "OtherCharge", "locations": [ { "lineno": 262, @@ -722,8 +721,7 @@ "doc": "Delivery logistics." } ], "extra": { }, - "labels": - [ "changed" ] }, + "labels": [] }, { "name": "ShippingPrice", "locations": [ { "lineno": 255, From 095d7327f782d06e1823199662c6aff35de79d23 Mon Sep 17 00:00:00 2001 From: emmagrob Date: Tue, 6 Sep 2022 09:44:42 +0300 Subject: [PATCH 06/11] DocWorks for ecom-additional-fees - 3 changes detected changes: Service ecom-additional-fees message AdditionalFee member taxDetails has changed doc Service ecom-additional-fees message CalculateAdditionalFeesResponse member currency has changed doc Service ecom-additional-fees message TaxDetails member taxable has changed doc --- .../ecom-additional-fees.service.json | 73 ++++++++++--------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/ecom-additional-fees/ecom-additional-fees.service.json b/ecom-additional-fees/ecom-additional-fees.service.json index 7f89f2f2d6..6bc66e21f6 100644 --- a/ecom-additional-fees/ecom-additional-fees.service.json +++ b/ecom-additional-fees/ecom-additional-fees.service.json @@ -30,8 +30,7 @@ "properties": [], "operations": [ { "name": "calculateAdditionalFees", - "labels": - [ "changed" ], + "labels": [], "nameParams": [], "params": [ { "name": "options", @@ -126,13 +125,14 @@ "doc": "Additional fee's price." }, { "name": "taxDetails", "type": "ecom-additional-fees.TaxDetails", - "doc": "Tax details based on tax settings in the dashboard." } ], + "doc": "Tax details." } ], "extra": { }, - "labels": [] }, + "labels": + [ "changed" ] }, { "name": "Address", "locations": - [ { "lineno": 171, + [ { "lineno": 173, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -172,7 +172,7 @@ "labels": [] }, { "name": "AddressInfo", "locations": - [ { "lineno": 184, + [ { "lineno": 186, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -191,7 +191,7 @@ "labels": [] }, { "name": "AppliedDiscount", "locations": - [ { "lineno": 273, + [ { "lineno": 275, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -246,13 +246,14 @@ "doc": "List of additional fees." }, { "name": "currency", "type": "string", - "doc": "Currency of the additional fees as a three-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n\nThe `additionalFees` response won't be returned if `currency` doesn't match your site's currency." } ], + "doc": "Currency of the additional fees as a three-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n\nThe `additionalFees` response will be ignored if `currency` doesn't match your site's currency." } ], "extra": { }, - "labels": [] }, + "labels": + [ "changed" ] }, { "name": "CarrierServiceOption", "locations": - [ { "lineno": 239, + [ { "lineno": 241, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -274,7 +275,7 @@ "labels": [] }, { "name": "CatalogReference", "locations": - [ { "lineno": 83, + [ { "lineno": 85, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -296,7 +297,7 @@ "labels": [] }, { "name": "Coupon", "locations": - [ { "lineno": 289, + [ { "lineno": 291, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -321,7 +322,7 @@ "labels": [] }, { "name": "DeliveryLogistics", "locations": - [ { "lineno": 147, + [ { "lineno": 149, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -343,7 +344,7 @@ "labels": [] }, { "name": "DiscountRule", "locations": - [ { "lineno": 304, + [ { "lineno": 306, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -365,7 +366,7 @@ "labels": [] }, { "name": "DiscountRuleName", "locations": - [ { "lineno": 312, + [ { "lineno": 314, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -384,7 +385,7 @@ "labels": [] }, { "name": "ItemTaxFullDetails", "locations": - [ { "lineno": 209, + [ { "lineno": 211, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -415,7 +416,7 @@ "labels": [] }, { "name": "LineItem", "locations": - [ { "lineno": 58, + [ { "lineno": 60, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -459,7 +460,7 @@ "labels": [] }, { "name": "MerchantDiscount", "locations": - [ { "lineno": 298, + [ { "lineno": 300, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -475,7 +476,7 @@ "labels": [] }, { "name": "MultiCurrencyPrice", "locations": - [ { "lineno": 200, + [ { "lineno": 202, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -519,11 +520,10 @@ "doc": "Shipping information." } ], "extra": { }, - "labels": - [ "changed" ] }, + "labels": [] }, { "name": "OtherCharge", "locations": - [ { "lineno": 262, + [ { "lineno": 264, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -542,7 +542,7 @@ "labels": [] }, { "name": "PhysicalProperties", "locations": - [ { "lineno": 91, + [ { "lineno": 93, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -564,7 +564,7 @@ "labels": [] }, { "name": "PickupDetails", "locations": - [ { "lineno": 159, + [ { "lineno": 161, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -586,7 +586,7 @@ "labels": [] }, { "name": "SelectedCarrierSeriveOptionPrices", "locations": - [ { "lineno": 191, + [ { "lineno": 193, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -611,7 +611,7 @@ "labels": [] }, { "name": "SelectedCarrierServiceOption", "locations": - [ { "lineno": 133, + [ { "lineno": 135, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -639,7 +639,7 @@ "labels": [] }, { "name": "SelectedCarrierServiceOptionsOtherCharge", "locations": - [ { "lineno": 227, + [ { "lineno": 229, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -661,7 +661,7 @@ "labels": [] }, { "name": "ServiceProperties", "locations": - [ { "lineno": 111, + [ { "lineno": 113, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -680,7 +680,7 @@ "labels": [] }, { "name": "ShippingInfo", "locations": - [ { "lineno": 119, + [ { "lineno": 121, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -702,7 +702,7 @@ "labels": [] }, { "name": "ShippingOption", "locations": - [ { "lineno": 246, + [ { "lineno": 248, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -724,7 +724,7 @@ "labels": [] }, { "name": "ShippingPrice", "locations": - [ { "lineno": 255, + [ { "lineno": 257, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -746,7 +746,7 @@ "labels": [] }, { "name": "ShippingRegion", "locations": - [ { "lineno": 126, + [ { "lineno": 128, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -765,7 +765,7 @@ "labels": [] }, { "name": "SubscriptionSettings", "locations": - [ { "lineno": 99, + [ { "lineno": 101, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -791,13 +791,14 @@ "members": [ { "name": "taxable", "type": "boolean", - "doc": "Whether the additional fee is taxable." } ], + "doc": "Whether the additional fee is taxable. \n\nThe tax amount will be calculated based on the tax settings in the dashboard." } ], "extra": { }, - "labels": [] }, + "labels": + [ "changed" ] }, { "name": "TaxRateBreakdown", "locations": - [ { "lineno": 219, + [ { "lineno": 221, "filename": "additional-fees.js" } ], "docs": { "links": [], From 44eed9bd63a8ab9be7ddb5522b996a46d818d897 Mon Sep 17 00:00:00 2001 From: emmagrob Date: Tue, 6 Sep 2022 10:15:39 +0300 Subject: [PATCH 07/11] DocWorks for ecom-additional-fees - 12 changes detected changes: Service ecom-additional-fees has changed description Service ecom-additional-fees operation calculateAdditionalFees.examples[0] has changed title Service ecom-additional-fees operation calculateAdditionalFees.examples[0] has changed body Service ecom-additional-fees message AdditionalFee member price has changed doc Service ecom-additional-fees message CatalogReference member appId has changed doc Service ecom-additional-fees message CatalogReference member options has changed doc Service ecom-additional-fees message LineItem member quantity has changed doc Service ecom-additional-fees message LineItem member paymentOption has changed doc Service ecom-additional-fees message LineItem member serviceProperties has changed doc Service ecom-additional-fees message LineItem member rootCatalogItemId has changed doc Service ecom-additional-fees message SelectedCarrierServiceOptionsOtherCharge member details has changed doc Service ecom-additional-fees message SubscriptionSettings member frequency has changed doc --- .../ecom-additional-fees.service.json | 114 ++++++++++-------- 1 file changed, 61 insertions(+), 53 deletions(-) diff --git a/ecom-additional-fees/ecom-additional-fees.service.json b/ecom-additional-fees/ecom-additional-fees.service.json index 6bc66e21f6..5e88ae5f91 100644 --- a/ecom-additional-fees/ecom-additional-fees.service.json +++ b/ecom-additional-fees/ecom-additional-fees.service.json @@ -8,21 +8,22 @@ "docs": { "summary": "The eCommerce Additional Fees SPI.", "description": - [ ">**Note:** This SPI is currently in beta and is subject to change. Some SPI's are currently not available to all users. ", + [ ">**Note:** This SPI is currently in beta and is subject to change. Some SPIs are currently not available to all users. ", "", "The Additional Fees SPI is a service provider interface that allows site owners and collaborators to add additional fees ", - "to the eCommerce Platform's cart and checkout. These additional fees are calculated and seen in all eCom platform pages, ", + "to the eCommerce Platform's cart and checkout. These additional fees are calculated and seen in all eCommerce platform pages, ", "including cart, checkout, orders, and payments.", "", - "Wix eCommerce calls the SPI endpoint [`calculateAdditionalFees`](https://www.wix.com/velo/reference/ecom-additional-fees/calculateadditionalfees) ", + "Wix eCommerce calls the SPI endpoint [`calculateAdditionalFees()`](https://www.wix.com/velo/reference/ecom-additional-fees/calculateadditionalfees) ", "to retrieve the relevant data for a site collaborator to add additional fees. ", - "Collaborators can then implement their own logic to calculate addition fees, and return the calculated fees ", + "Collaborators can then implement their own logic to calculate additional fees, and return the calculated fee ", "data in the structure provided by Wix eCommerce. ", "", "Note that `currency` in the [`calculateAdditionalFees`](https://www.wix.com/velo/reference/ecom-additional-fees/calculateadditionalfees) response must match ", - "your site's currency. You can find the currency of your site using the [`getPaymentCurrency`](https://www.wix.com/velo/reference/wix-site-backend/generalinfo-obj/getpaymentcurrency) API. ", + "your site's currency. You can find the currency of your site using the [`getPaymentCurrency()`](https://www.wix.com/velo/reference/wix-site-backend/generalinfo-obj/getpaymentcurrency)", + "function. ", "", - "Learn more about [Additional Fees SPI custom integration](https://support.wix.com/en/article/velo-tutorial-ecommerce-custom-additional-fees-extension-beta)." ], + "Learn more about the [Additional Fees SPI custom extension](https://support.wix.com/en/article/velo-tutorial-ecommerce-custom-additional-fees-extension-beta)." ], "links": [], "examples": [], "extra": @@ -30,7 +31,8 @@ "properties": [], "operations": [ { "name": "calculateAdditionalFees", - "labels": [], + "labels": + [ "changed" ], "nameParams": [], "params": [ { "name": "options", @@ -53,7 +55,7 @@ "the cart and/or checkout. For example, when an item is added to the cart, or when a shipping location is specified." ], "links": [], "examples": - [ { "title": "Calculate Additional Fees for a product", + [ { "title": "Calculate additional fees for an order", "body": [ "import wixSiteBackend from 'wix-site-backend';", "", @@ -90,7 +92,11 @@ "function calculateWrappingFee(lineItems) {", " const minItemsForFreeWrapping = 5;", " let numFragileItems = 0;", - " lineItems.filter(isFragile).reduce((numFragileItems, curr) => numFragileItems + curr.quantity, 0);", + " lineItems.forEach((item) => {", + " if (isFragile(item)){", + " numFragileItems += item.quantity;", + " }", + " });", " const shouldChargeFee = numFragileItems < minItemsForFreeWrapping;", " const price = shouldChargeFee ? numFragileItems : 0;", " return price;", @@ -122,7 +128,7 @@ "doc": "Name of additional fee. \n\nMax: 50 characters" }, { "name": "price", "type": "string", - "doc": "Additional fee's price." }, + "doc": "Additional fee's price.\n\nNumber of decimal places should correspond to the site's currency according to the three-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format." }, { "name": "taxDetails", "type": "ecom-additional-fees.TaxDetails", "doc": "Tax details." } ], @@ -132,7 +138,7 @@ [ "changed" ] }, { "name": "Address", "locations": - [ { "lineno": 173, + [ { "lineno": 177, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -172,7 +178,7 @@ "labels": [] }, { "name": "AddressInfo", "locations": - [ { "lineno": 186, + [ { "lineno": 190, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -191,7 +197,7 @@ "labels": [] }, { "name": "AppliedDiscount", "locations": - [ { "lineno": 275, + [ { "lineno": 279, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -249,11 +255,10 @@ "doc": "Currency of the additional fees as a three-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n\nThe `additionalFees` response will be ignored if `currency` doesn't match your site's currency." } ], "extra": { }, - "labels": - [ "changed" ] }, + "labels": [] }, { "name": "CarrierServiceOption", "locations": - [ { "lineno": 241, + [ { "lineno": 245, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -275,7 +280,7 @@ "labels": [] }, { "name": "CatalogReference", "locations": - [ { "lineno": 85, + [ { "lineno": 89, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -288,16 +293,17 @@ "doc": "ID of the item within the [custom catalog](https://www.wix.com/velo/reference/ecom-catalog/getcatalogitems)." }, { "name": "appId", "type": "string", - "doc": "ID of the catalog app." }, + "doc": "ID of the Wix Catalog app." }, { "name": "options", "type": "Object", - "doc": "Additional data passed by the catalog." } ], + "doc": "Additional data passed by the Wix Catalog app." } ], "extra": { }, - "labels": [] }, + "labels": + [ "changed" ] }, { "name": "Coupon", "locations": - [ { "lineno": 291, + [ { "lineno": 295, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -322,7 +328,7 @@ "labels": [] }, { "name": "DeliveryLogistics", "locations": - [ { "lineno": 149, + [ { "lineno": 153, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -344,7 +350,7 @@ "labels": [] }, { "name": "DiscountRule", "locations": - [ { "lineno": 306, + [ { "lineno": 310, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -366,7 +372,7 @@ "labels": [] }, { "name": "DiscountRuleName", "locations": - [ { "lineno": 314, + [ { "lineno": 318, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -385,7 +391,7 @@ "labels": [] }, { "name": "ItemTaxFullDetails", "locations": - [ { "lineno": 211, + [ { "lineno": 215, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -416,7 +422,7 @@ "labels": [] }, { "name": "LineItem", "locations": - [ { "lineno": 60, + [ { "lineno": 62, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -429,7 +435,7 @@ "doc": "The ID of the line item." }, { "name": "quantity", "type": "number", - "doc": "The quantity of the line item." }, + "doc": "The quantity of the item." }, { "name": "catalogReference", "type": "ecom-additional-fees.CatalogReference", "doc": "Catalog and items reference info." }, @@ -444,23 +450,24 @@ "doc": "Properties of a physical item in cart and/or checkout." }, { "name": "paymentOption", "type": "string", - "doc": "Type of selected payment option for the current item. Defaults to `\"FULL_PAYMENT_ONLINE\"`. \n\nSupported values:\n+ `\"FULL_PAYMENT_ONLINE\"` - Entire payment for the item happens as part of the checkout.\n+ `\"FULL_PAYMENT_OFFLINE\"` - Entire payment for the item happens after the checkout. For example, when using cash, check, or other offline payment methods.\n+ `\"MEMBERSHIP\"` - Payment for the item is done by charging a membership. When the option is used, `lineItem.price.amount` is `0`.\n+ `\"DEPOSIT_ONLINE\"` - Partial payment to be paid upfront during the checkout. Amount to be paid is defined by `depositAmount` field.", + "doc": "Type of selected payment option for the current item. \n \nSupported values:\n+ `\"FULL_PAYMENT_ONLINE\"` - Entire payment for the item happens as part of the checkout.\n+ `\"FULL_PAYMENT_OFFLINE\"` - Entire payment for the item happens after the checkout. For example, when using cash, check, or other offline payment methods.\n+ `\"MEMBERSHIP\"` - Payment for the item is done by charging a membership. When the option is used, `lineItem.price.amount` is `0`.\n+ `\"DEPOSIT_ONLINE\"` - Partial payment to be paid upfront during the checkout. Amount to be paid is defined by `depositAmount` property.\n\nDefault:`\"FULL_PAYMENT_ONLINE\"`.", "optional": true }, { "name": "serviceProperties", "type": "ecom-additional-fees.ServiceProperties", - "doc": "Service properties. When relevant, contains information such as service date and number of participants. Used, among other things, when checking for valid memberships." }, + "doc": "Service properties. When relevant, contains information such as service date and number of participants. Used, for example, when checking for valid memberships." }, { "name": "rootCatalogItemId", "type": "string", - "doc": "In cases where `catalogReference.catalogItemId` is not the actual catalog item ID, this field returns the true item's ID.\n+ For example, for Wix Bookings, `catalogReference.catalogItemId` is the booking ID. Therefore this value is set to the service ID.\n+ In most cases, this field is the same as `catalogReference.catalogItemId`.\n+ Used in membership validation." }, + "doc": "In cases where `catalogReference.catalogItemId` is not the actual catalog item ID, this property returns the true item's ID.\n+ For example, for Wix Bookings, `catalogReference.catalogItemId` is the booking ID.\n+ In most cases, this property is the same as `catalogReference.catalogItemId`.\n+ Used when validating membership." }, { "name": "depositAmount", "type": "string", "doc": "Partial payment to be paid upfront during the checkout.\nEligible for items where `paymentOption` is `\"DEPOSIT_ONLINE\"` only. If omitted, the item's price is not split and is expected to be paid in a single installment." } ], "extra": { }, - "labels": [] }, + "labels": + [ "changed" ] }, { "name": "MerchantDiscount", "locations": - [ { "lineno": 300, + [ { "lineno": 304, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -476,7 +483,7 @@ "labels": [] }, { "name": "MultiCurrencyPrice", "locations": - [ { "lineno": 202, + [ { "lineno": 206, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -523,7 +530,7 @@ "labels": [] }, { "name": "OtherCharge", "locations": - [ { "lineno": 264, + [ { "lineno": 268, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -542,7 +549,7 @@ "labels": [] }, { "name": "PhysicalProperties", "locations": - [ { "lineno": 93, + [ { "lineno": 97, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -564,7 +571,7 @@ "labels": [] }, { "name": "PickupDetails", "locations": - [ { "lineno": 161, + [ { "lineno": 165, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -586,7 +593,7 @@ "labels": [] }, { "name": "SelectedCarrierSeriveOptionPrices", "locations": - [ { "lineno": 193, + [ { "lineno": 197, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -611,7 +618,7 @@ "labels": [] }, { "name": "SelectedCarrierServiceOption", "locations": - [ { "lineno": 135, + [ { "lineno": 139, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -639,7 +646,7 @@ "labels": [] }, { "name": "SelectedCarrierServiceOptionsOtherCharge", "locations": - [ { "lineno": 229, + [ { "lineno": 233, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -652,16 +659,17 @@ "doc": "Type of additional charge.\n \nSupported values:\n - `'HANDLING_FEE'`\n - `'INSURANCE'`" }, { "name": "details", "type": "string", - "doc": "Charge details. For example, 'Full Coverage Insurance up to 80% value of shipment'." }, + "doc": "Charge details. For example, 'Full coverage insurance up to 80% value of shipment'." }, { "name": "price", "type": "ecom-additional-fees.MultiCurrencyPrice", "doc": "Price of added charge." } ], "extra": { }, - "labels": [] }, + "labels": + [ "changed" ] }, { "name": "ServiceProperties", "locations": - [ { "lineno": 113, + [ { "lineno": 117, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -680,7 +688,7 @@ "labels": [] }, { "name": "ShippingInfo", "locations": - [ { "lineno": 121, + [ { "lineno": 125, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -702,7 +710,7 @@ "labels": [] }, { "name": "ShippingOption", "locations": - [ { "lineno": 248, + [ { "lineno": 252, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -724,7 +732,7 @@ "labels": [] }, { "name": "ShippingPrice", "locations": - [ { "lineno": 257, + [ { "lineno": 261, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -746,7 +754,7 @@ "labels": [] }, { "name": "ShippingRegion", "locations": - [ { "lineno": 128, + [ { "lineno": 132, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -765,7 +773,7 @@ "labels": [] }, { "name": "SubscriptionSettings", "locations": - [ { "lineno": 101, + [ { "lineno": 105, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -775,13 +783,14 @@ "members": [ { "name": "frequency", "type": "string", - "doc": "The frequency of recurring paymenent based on every day, week, month, or year.\n\nSupported values:\n - `\"DAY\"`\n - `\"WEEK\"`\n - `\"MONTH\"`\n - `\"YEAR\"`" } ], + "doc": "The frequency of recurring payments based on every day, week, month, or year.\n\nSupported values:\n - `\"DAY\"`\n - `\"WEEK\"`\n - `\"MONTH\"`\n - `\"YEAR\"`" } ], "extra": { }, - "labels": [] }, + "labels": + [ "changed" ] }, { "name": "TaxDetails", "locations": - [ { "lineno": 52, + [ { "lineno": 54, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -794,11 +803,10 @@ "doc": "Whether the additional fee is taxable. \n\nThe tax amount will be calculated based on the tax settings in the dashboard." } ], "extra": { }, - "labels": - [ "changed" ] }, + "labels": [] }, { "name": "TaxRateBreakdown", "locations": - [ { "lineno": 221, + [ { "lineno": 225, "filename": "additional-fees.js" } ], "docs": { "links": [], From 2f0e93baa7b1b65d2746c8e13d2eb125f48487b6 Mon Sep 17 00:00:00 2001 From: emmagrob Date: Tue, 6 Sep 2022 11:01:02 +0300 Subject: [PATCH 08/11] DocWorks for ecom-additional-fees - 1 change detected changes: Service ecom-additional-fees message AdditionalFee member price has changed doc --- .../ecom-additional-fees.service.json | 71 +++++++++---------- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/ecom-additional-fees/ecom-additional-fees.service.json b/ecom-additional-fees/ecom-additional-fees.service.json index 5e88ae5f91..4155aee1ad 100644 --- a/ecom-additional-fees/ecom-additional-fees.service.json +++ b/ecom-additional-fees/ecom-additional-fees.service.json @@ -31,8 +31,7 @@ "properties": [], "operations": [ { "name": "calculateAdditionalFees", - "labels": - [ "changed" ], + "labels": [], "nameParams": [], "params": [ { "name": "options", @@ -128,7 +127,7 @@ "doc": "Name of additional fee. \n\nMax: 50 characters" }, { "name": "price", "type": "string", - "doc": "Additional fee's price.\n\nNumber of decimal places should correspond to the site's currency according to the three-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format." }, + "doc": "Additional fee's price.\n\nNumber of decimal places must correspond to the site's currency according to the currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) \nformat. For example, a `USD` currency code can accept up to 2 decimal places." }, { "name": "taxDetails", "type": "ecom-additional-fees.TaxDetails", "doc": "Tax details." } ], @@ -138,7 +137,7 @@ [ "changed" ] }, { "name": "Address", "locations": - [ { "lineno": 177, + [ { "lineno": 178, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -178,7 +177,7 @@ "labels": [] }, { "name": "AddressInfo", "locations": - [ { "lineno": 190, + [ { "lineno": 191, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -197,7 +196,7 @@ "labels": [] }, { "name": "AppliedDiscount", "locations": - [ { "lineno": 279, + [ { "lineno": 280, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -258,7 +257,7 @@ "labels": [] }, { "name": "CarrierServiceOption", "locations": - [ { "lineno": 245, + [ { "lineno": 246, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -280,7 +279,7 @@ "labels": [] }, { "name": "CatalogReference", "locations": - [ { "lineno": 89, + [ { "lineno": 90, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -299,11 +298,10 @@ "doc": "Additional data passed by the Wix Catalog app." } ], "extra": { }, - "labels": - [ "changed" ] }, + "labels": [] }, { "name": "Coupon", "locations": - [ { "lineno": 295, + [ { "lineno": 296, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -328,7 +326,7 @@ "labels": [] }, { "name": "DeliveryLogistics", "locations": - [ { "lineno": 153, + [ { "lineno": 154, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -350,7 +348,7 @@ "labels": [] }, { "name": "DiscountRule", "locations": - [ { "lineno": 310, + [ { "lineno": 311, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -372,7 +370,7 @@ "labels": [] }, { "name": "DiscountRuleName", "locations": - [ { "lineno": 318, + [ { "lineno": 319, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -391,7 +389,7 @@ "labels": [] }, { "name": "ItemTaxFullDetails", "locations": - [ { "lineno": 215, + [ { "lineno": 216, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -422,7 +420,7 @@ "labels": [] }, { "name": "LineItem", "locations": - [ { "lineno": 62, + [ { "lineno": 63, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -463,11 +461,10 @@ "doc": "Partial payment to be paid upfront during the checkout.\nEligible for items where `paymentOption` is `\"DEPOSIT_ONLINE\"` only. If omitted, the item's price is not split and is expected to be paid in a single installment." } ], "extra": { }, - "labels": - [ "changed" ] }, + "labels": [] }, { "name": "MerchantDiscount", "locations": - [ { "lineno": 304, + [ { "lineno": 305, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -483,7 +480,7 @@ "labels": [] }, { "name": "MultiCurrencyPrice", "locations": - [ { "lineno": 206, + [ { "lineno": 207, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -530,7 +527,7 @@ "labels": [] }, { "name": "OtherCharge", "locations": - [ { "lineno": 268, + [ { "lineno": 269, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -549,7 +546,7 @@ "labels": [] }, { "name": "PhysicalProperties", "locations": - [ { "lineno": 97, + [ { "lineno": 98, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -571,7 +568,7 @@ "labels": [] }, { "name": "PickupDetails", "locations": - [ { "lineno": 165, + [ { "lineno": 166, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -593,7 +590,7 @@ "labels": [] }, { "name": "SelectedCarrierSeriveOptionPrices", "locations": - [ { "lineno": 197, + [ { "lineno": 198, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -618,7 +615,7 @@ "labels": [] }, { "name": "SelectedCarrierServiceOption", "locations": - [ { "lineno": 139, + [ { "lineno": 140, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -646,7 +643,7 @@ "labels": [] }, { "name": "SelectedCarrierServiceOptionsOtherCharge", "locations": - [ { "lineno": 233, + [ { "lineno": 234, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -665,11 +662,10 @@ "doc": "Price of added charge." } ], "extra": { }, - "labels": - [ "changed" ] }, + "labels": [] }, { "name": "ServiceProperties", "locations": - [ { "lineno": 117, + [ { "lineno": 118, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -688,7 +684,7 @@ "labels": [] }, { "name": "ShippingInfo", "locations": - [ { "lineno": 125, + [ { "lineno": 126, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -710,7 +706,7 @@ "labels": [] }, { "name": "ShippingOption", "locations": - [ { "lineno": 252, + [ { "lineno": 253, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -732,7 +728,7 @@ "labels": [] }, { "name": "ShippingPrice", "locations": - [ { "lineno": 261, + [ { "lineno": 262, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -754,7 +750,7 @@ "labels": [] }, { "name": "ShippingRegion", "locations": - [ { "lineno": 132, + [ { "lineno": 133, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -773,7 +769,7 @@ "labels": [] }, { "name": "SubscriptionSettings", "locations": - [ { "lineno": 105, + [ { "lineno": 106, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -786,11 +782,10 @@ "doc": "The frequency of recurring payments based on every day, week, month, or year.\n\nSupported values:\n - `\"DAY\"`\n - `\"WEEK\"`\n - `\"MONTH\"`\n - `\"YEAR\"`" } ], "extra": { }, - "labels": - [ "changed" ] }, + "labels": [] }, { "name": "TaxDetails", "locations": - [ { "lineno": 54, + [ { "lineno": 55, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -806,7 +801,7 @@ "labels": [] }, { "name": "TaxRateBreakdown", "locations": - [ { "lineno": 225, + [ { "lineno": 226, "filename": "additional-fees.js" } ], "docs": { "links": [], From 33a8149228c89fc3c0a0278577e759c7dfd54fa8 Mon Sep 17 00:00:00 2001 From: emmagrob Date: Tue, 6 Sep 2022 11:08:33 +0300 Subject: [PATCH 09/11] DocWorks for ecom-additional-fees - 3 changes detected changes: Service ecom-additional-fees has changed description Service ecom-additional-fees operation calculateAdditionalFees has changed summary Service ecom-additional-fees operation calculateAdditionalFees has changed description --- .../ecom-additional-fees.service.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ecom-additional-fees/ecom-additional-fees.service.json b/ecom-additional-fees/ecom-additional-fees.service.json index 4155aee1ad..4e364d383a 100644 --- a/ecom-additional-fees/ecom-additional-fees.service.json +++ b/ecom-additional-fees/ecom-additional-fees.service.json @@ -11,7 +11,7 @@ [ ">**Note:** This SPI is currently in beta and is subject to change. Some SPIs are currently not available to all users. ", "", "The Additional Fees SPI is a service provider interface that allows site owners and collaborators to add additional fees ", - "to the eCommerce Platform's cart and checkout. These additional fees are calculated and seen in all eCommerce platform pages, ", + "to their site. These additional fees are calculated and seen in all eCommerce platform pages, ", "including cart, checkout, orders, and payments.", "", "Wix eCommerce calls the SPI endpoint [`calculateAdditionalFees()`](https://www.wix.com/velo/reference/ecom-additional-fees/calculateadditionalfees) ", @@ -31,7 +31,8 @@ "properties": [], "operations": [ { "name": "calculateAdditionalFees", - "labels": [], + "labels": + [ "changed" ], "nameParams": [], "params": [ { "name": "options", @@ -47,11 +48,11 @@ [ { "lineno": 1, "filename": "additional-fees.js" } ], "docs": - { "summary": "Calculates additional fees to include in the cart and checkout.", + { "summary": "Calculates additional fees to include in the cart and checkout pages.", "description": [ "The `calculateAdditionalFees` function calculates additional fees to appear in the cart and checkout pages of a store's site. ", "The function is automatically called by Wix eCommerce when the cart totals are calculated, or when an action is performed in ", - "the cart and/or checkout. For example, when an item is added to the cart, or when a shipping location is specified." ], + "the cart and/or checkout pages. For example, when an item is added to the cart, or when a shipping location is specified." ], "links": [], "examples": [ { "title": "Calculate additional fees for an order", @@ -133,8 +134,7 @@ "doc": "Tax details." } ], "extra": { }, - "labels": - [ "changed" ] }, + "labels": [] }, { "name": "Address", "locations": [ { "lineno": 178, From 26ed9a9e15384a36d854b68eccb3f2c5627dea47 Mon Sep 17 00:00:00 2001 From: roysha-wix Date: Wed, 29 May 2024 11:51:47 +0300 Subject: [PATCH 10/11] DocWorks for ecom-additional-fees - 1 change detected changes: Service ecom-additional-fees is new --- .../ecom-additional-fees.service.json | 980 ++++++++++++++++++ 1 file changed, 980 insertions(+) create mode 100644 ecom-additional-fees/ecom-additional-fees.service.json diff --git a/ecom-additional-fees/ecom-additional-fees.service.json b/ecom-additional-fees/ecom-additional-fees.service.json new file mode 100644 index 0000000000..c11967aa84 --- /dev/null +++ b/ecom-additional-fees/ecom-additional-fees.service.json @@ -0,0 +1,980 @@ +{ "name": "ecom-additional-fees", + "mixes": [], + "labels": + [ "new" ], + "location": + { "lineno": 1, + "filename": "additional-fees-index.js" }, + "docs": + { "summary": "The eCommerce Additional Fees Service Plugin.", + "description": + [ "The Additional Fees service plugin (formerly SPI) is a service provider interface that allows site owners and collaborators to add additional fee calculations that don't come ", + "natively with Wix to their site. The service plugin allows you to change how apps, such as Wix Stores and Wix Bookings, calculate charges during checkout. Additional fees are calculated and ", + "seen in all eCommerce platform pages including cart, checkout, orders, and payments. Examples of additional fees are surcharges based on customer location, special ", + "handling during shipping, or gift wrapping.", + "", + "Wix eCommerce calls the service plugin endpoint [`calculateAdditionalFees()`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-additional-fees/calculateadditionalfees) to ", + "retrieve the relevant data for a site collaborator to add additional fees. Collaborators can then implement their own logic to calculate additional fees, and return ", + "the calculated fee data in the structure provided by Wix eCommerce.", + "", + "Note that `currency` in the [`calculateAdditionalFees`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-additional-fees/calculateadditionalfees) response must match ", + "your site's currency. You can find the currency of your site using the [`getPaymentCurrency()`](https://www.wix.com/velo/reference/wix-site-backend/generalinfo-obj/getpaymentcurrency)", + "function.", + "", + "Learn more:", + " + [Velo: Custom App Extensions Using SPIs](https://support.wix.com/en/article/velo-custom-business-app-extensions-using-spis-beta)", + " + [Additional Fees SPI custom extension](https://support.wix.com/en/article/velo-tutorial-ecommerce-additional-fees-custom-extension)", + "", + "### To add a service plugin", + "1. [Add the plugin to your site](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/integrations/custom-extensions-spis/custom-app-extensions-using-sp-is#step-1-create-a-new-extension-on-your-wix-site).", + "2. Update the [`getConfig()`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-additional-fees/getconfig) function in the **-config.js** file that is added to your site during step 1.", + "3. Update the [`calculateAdditionalFees()`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-additional-fees/calculateadditionalfees) function in the **.js** file that is added to your site during step 1." ], + "links": [], + "examples": [], + "extra": + { } }, + "properties": [], + "operations": + [ { "name": "calculateAdditionalFees", + "labels": [], + "nameParams": [], + "params": + [ { "name": "options", + "type": "ecom-additional-fees.Options", + "doc": "Options for line items and shipping options." } ], + "ret": + { "type": + { "name": "Promise", + "typeParams": + [ "ecom-additional-fees.CalculateAdditionalFeesResponse" ] }, + "doc": "Fulfilled - Additional fees and currency info." }, + "locations": + [ { "lineno": 26, + "filename": "additional-fees.js" } ], + "docs": + { "summary": "Calculates additional fees to include in the cart and checkout pages.", + "description": + [ "The `calculateAdditionalFees` function calculates additional fees to appear in the cart and checkout pages of a store's site.", + "The function is automatically called by Wix when the cart totals are calculated, or when an action is performed in", + "the cart and/or checkout pages. For example, when an item is added to the cart, or when a shipping location is specified.", + "", + "### Where to find `calculateAdditionalFees()`", + "When you [add the Additional Fees service plugin](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/e-commerce-additional-fees-custom-extension#step-1-create-a-new-additional-fees-custom-extension), ", + "a folder is automatically added to your site. Use the `.js` file in the folder to write the code to calculate any additional fees to add to the cart or checkout. ", + "", + "For more information on calculating your additional fees, see [Tutorial: Additional Fees Custom Extension](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/e-commerce-additional-fees-custom-extension#my-extension-namejs)." ], + "links": [], + "examples": + [ { "title": "Calculate additional fees for an order", + "body": + [ "import wixSiteBackend from 'wix-site-backend';", + "", + "export const calculateAdditionalFees = async (options) => {", + " let additionalFees = [];", + " const feePrice = calculateWrappingFee(options.lineItems);", + " const currency = await wixSiteBackend.generalInfo.getPaymentCurrency();", + "", + " if (feePrice) {", + " additionalFees.push({", + " code: 'fragile-packaging',", + " name: 'Fragile Packaging',", + " price: String(feePrice),", + " taxDetails: {", + " taxable: true", + " }", + " });", + " }", + "", + " return {", + " currency,", + " additionalFees", + " };", + "};", + "", + "// Check if an item is fragile.", + "function isFragile(item) {", + " const productName = item.productName.toLowerCase();", + " return productName.includes('glass') || productName.includes('ceramic');", + "}", + "", + "// Charge per fragile item.", + "// Give away free packaging when ordering at least 5 items.", + "function calculateWrappingFee(lineItems) {", + " const minItemsForFreeWrapping = 5;", + " let numFragileItems = 0;", + " lineItems.forEach((item) => {", + " if (isFragile(item)){", + " numFragileItems += item.quantity;", + " }", + " });", + " const shouldChargeFee = numFragileItems < minItemsForFreeWrapping;", + " const price = shouldChargeFee ? numFragileItems : 0;", + " return price;", + "}", + "" ], + "extra": + { "description": "This example calculates the additional fees for packaging fragile items from a store. If more than 5 fragile items are added to the cart,\nthe fragile packaging is free." } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "getConfig", + "labels": [], + "nameParams": [], + "params": [], + "ret": + { "type": + { "name": "Promise", + "typeParams": + [ "ecom-additional-fees.AdditionalFeesConfigResponse" ] }, + "doc": "Fulfilled - The configuration settings." }, + "locations": + [ { "lineno": 1, + "filename": "additional-fees.js" } ], + "docs": + { "summary": "Retrieves the configuration of your additional fees plugin.", + "description": + [ "Set your additional fees configuration in the `return` of the `getConfig()` function. Wix calls this function when you publish your site. ", + "Changes to the configuration don't take effect until you publish your site.", + "", + "Currently no configurations are available for this plugin, so set `getConfig()` to return an empty object.", + "", + "### Where to find `getConfig()`", + "When you [add the Additional Fees service plugin](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/e-commerce-additional-fees-custom-extension#step-1-create-a-new-additional-fees-custom-extension), ", + "a folder is automatically added to your site. Use the `-config.js` file in the folder to set the default configuration for your ", + "implementation of the service plugin.", + "", + "For more information on setting your configuration, see [Tutorial: Additional Fees Service Plugin](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/e-commerce-additional-fees-custom-extension#my-extension-name-configjs)." ], + "links": [], + "examples": + [ { "title": "Example of a configuration file", + "body": + [ "// Place this code in the -config.js file", + "// in the 'ecom-additional-fees' folder of the", + "// Custom Extensions section on your site.", + "", + "export function getConfig() {", + " return {};", + "};" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { "customLabels": + [ { "id": "maturity-beta" } ] } } ], + "callbacks": [], + "messages": + [ { "name": "AdditionalFee", + "locations": + [ { "lineno": 68, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "code", + "type": "string", + "doc": "Unique code or ID for the additional fee.\n\nMax: 100 characters" }, + { "name": "name", + "type": "string", + "doc": "Name of additional fee.\n\nMax: 50 characters" }, + { "name": "price", + "type": "string", + "doc": "Additional fee's price.\n\nNumber of decimal places must correspond to the site's currency according to the currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)\nformat. For example, a `USD` currency code can accept up to 2 decimal places." }, + { "name": "taxDetails", + "type": "ecom-additional-fees.TaxDetails", + "doc": "Tax details.\n\n>**Note:** Tax is not calculated in the returned `price` even when `taxDetails.taxable` is `true`." } ], + "extra": + { }, + "labels": [] }, + { "name": "AdditionalFeesConfigResponse", + "locations": + [ { "lineno": 23, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": [], + "extra": + { }, + "labels": [] }, + { "name": "AddressDetails", + "locations": + [ { "lineno": 111, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "addressLine", + "type": "string", + "doc": "Main address line, usually street and number." }, + { "name": "addressLine2", + "type": "string", + "doc": "Detailed address information, such as apartment, suite, or floor in free text.", + "optional": true }, + { "name": "streetAddress", + "type": "ecom-additional-fees.StreetAddressInfo", + "doc": "Street address object, with street number and name in separate properties.", + "optional": true }, + { "name": "city", + "type": "string", + "doc": "City name." }, + { "name": "subdivision", + "type": "string", + "doc": "Code for a subdivision, such as state, prefecture, or province, in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.", + "optional": true }, + { "name": "subdivisionFullname", + "type": "string", + "doc": "Subdivision's full name." }, + { "name": "country", + "type": "string", + "doc": "2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format." }, + { "name": "countryFullname", + "type": "string", + "doc": "Country's full name." }, + { "name": "postalCode", + "type": "string", + "doc": "Postal or zip code." } ], + "extra": + { }, + "labels": [] }, + { "name": "AppliedDiscount", + "locations": + [ { "lineno": 330, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "discountType", + "type": "string", + "doc": "Discount type.\n\nSupported values:\n - `\"GLOBAL\"`: Discount on the entire cart.\n - `\"SPECIFIC_ITEMS\"`: Discount on specific item.\n - `\"SHIPPING\"`: Discount on shipping." }, + { "name": "lineItemIds", + "type": + { "name": "Array", + "typeParams": + [ "string" ] }, + "doc": "Line item IDs the discount applies to." }, + { "name": "coupon", + "type": "ecom-additional-fees.Coupon", + "doc": "Coupon details.", + "optional": true }, + { "name": "merchantDiscount", + "type": "ecom-additional-fees.MerchantDiscount", + "doc": "Merchant discount.", + "optional": true }, + { "name": "discountRule", + "type": "ecom-additional-fees.DiscountRule", + "doc": "Discount rule.", + "optional": true } ], + "extra": + { "oneOfGroups": + [ { "name": "DiscountSource", + "members": + [ "coupon", + "merchantDiscount", + "discountRule" ] } ] }, + "labels": [] }, + { "name": "BuyerDetails", + "locations": + [ { "lineno": 106, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "contactDetails", + "type": "ecom-additional-fees.ContactDetails", + "doc": "Contact details." } ], + "extra": + { }, + "labels": [] }, + { "name": "CalculateAdditionalFeesResponse", + "locations": + [ { "lineno": 59, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "additionalFees", + "type": + { "name": "Array", + "typeParams": + [ "ecom-additional-fees.AdditionalFee" ] }, + "doc": "List of additional fees." }, + { "name": "currency", + "type": "string", + "doc": "Currency of the additional fees as a three-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.\n\nThe `additionalFees` response will be ignored if `currency` doesn't match your site's currency." } ], + "extra": + { }, + "labels": [] }, + { "name": "CatalogReference", + "locations": + [ { "lineno": 150, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "catalogItemId", + "type": "string", + "doc": "ID of the item within the [custom catalog](https://www.wix.com/velo/reference/ecom-catalog/getcatalogitems)." }, + { "name": "appId", + "type": "string", + "doc": "ID of the Wix Catalog app." }, + { "name": "options", + "type": "Object", + "doc": "Additional data passed by the Wix Catalog app." } ], + "extra": + { }, + "labels": [] }, + { "name": "ContactDetails", + "locations": + [ { "lineno": 131, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "firstName", + "type": "string", + "doc": "Buyer's first name." }, + { "name": "lastName", + "type": "string", + "doc": "Buyer's last name." }, + { "name": "phone", + "type": "string", + "doc": "Buyer's phone number." }, + { "name": "company", + "type": "string", + "doc": "Company name.", + "optional": true }, + { "name": "email", + "type": "string", + "doc": "Email.", + "optional": true }, + { "name": "vatId", + "type": "ecom-additional-fees.VatId", + "doc": "Tax information (for Brazil only). If `vatId.id` is provided, `vatId.type` must also be set.", + "optional": true } ], + "extra": + { }, + "labels": [] }, + { "name": "Coupon", + "locations": + [ { "lineno": 346, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "id", + "type": "string", + "doc": "Coupon ID." }, + { "name": "code", + "type": "string", + "doc": "Coupon code." }, + { "name": "amount", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Coupon value." }, + { "name": "name", + "type": "string", + "doc": "Coupon name." } ], + "extra": + { }, + "labels": [] }, + { "name": "DeliveryLogistics", + "locations": + [ { "lineno": 212, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "deliveryTime", + "type": "string", + "doc": "Expected delivery time in free text. For example, `'3-5 business days'`.\n\nMax: 500 characters" }, + { "name": "instructions", + "type": "string", + "doc": "Instructions for carrier. For example, `'Please deliver package during business hours'`.\n\nMax: 1000 characters" }, + { "name": "pickupDetails", + "type": "ecom-additional-fees.PickupDetails", + "doc": "Pickup details." } ], + "extra": + { }, + "labels": [] }, + { "name": "DiscountRule", + "locations": + [ { "lineno": 361, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "id", + "type": "string", + "doc": "Discount Rule ID." }, + { "name": "name", + "type": "ecom-additional-fees.DiscountRuleName", + "doc": "Discount rule name." }, + { "name": "amount", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Discount value." } ], + "extra": + { }, + "labels": [] }, + { "name": "DiscountRuleName", + "locations": + [ { "lineno": 369, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "original", + "type": "string", + "doc": "Original discount rule name in the site/buyer's language." }, + { "name": "translated", + "type": "string", + "doc": "Discount rule name translated to a buyer's language. If not specified, defaults to the `original` value." } ], + "extra": + { }, + "labels": [] }, + { "name": "ItemTaxFullDetails", + "locations": + [ { "lineno": 273, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "taxableAmount", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Taxable amount." }, + { "name": "taxGroupId", + "type": "string", + "doc": "Tax group ID." }, + { "name": "taxRate", + "type": "string", + "doc": "Tax rate as a decimal value between 0 and 1." }, + { "name": "totalTax", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Calculated tax based on `taxableAmount` and `taxRate`." }, + { "name": "rateBreakdown", + "type": + { "name": "Array", + "typeParams": + [ "ecom-additional-fees.TaxRateBreakdown" ] }, + "doc": "Tax breakdown." } ], + "extra": + { }, + "labels": [] }, + { "name": "LineItem", + "locations": + [ { "lineno": 94, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "id", + "type": "string", + "doc": "The ID of the line item." }, + { "name": "quantity", + "type": "number", + "doc": "The quantity of the item." }, + { "name": "catalogReference", + "type": "ecom-additional-fees.CatalogReference", + "doc": "Catalog and items reference info." }, + { "name": "productName", + "type": "string", + "doc": "Display name." }, + { "name": "price", + "type": "string", + "doc": "Price of the item." }, + { "name": "physicalProperties", + "type": "ecom-additional-fees.PhysicalProperties", + "doc": "Properties of a physical item in cart and/or checkout." }, + { "name": "depositAmount", + "type": "string", + "doc": "Partial payment to be paid upfront during the checkout.\nEligible for items where `paymentOption` is `\"DEPOSIT_ONLINE\"` only. If omitted, the item's price is not split and is expected to be paid in a single installment." } ], + "extra": + { }, + "labels": [] }, + { "name": "MerchantDiscount", + "locations": + [ { "lineno": 355, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Discount value." } ], + "extra": + { }, + "labels": [] }, + { "name": "MultiCurrencyPrice", + "locations": + [ { "lineno": 264, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "string", + "doc": "Amount." }, + { "name": "convertedAmount", + "type": "string", + "doc": "Converted amount." }, + { "name": "formattedAmount", + "type": "string", + "doc": "Formatted amount with currency symbol." }, + { "name": "formattedConvertedAmount", + "type": "string", + "doc": "Converted amount formatted with currency symbol." } ], + "extra": + { }, + "labels": [] }, + { "name": "Options", + "locations": + [ { "lineno": 50, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "lineItems", + "type": + { "name": "Array", + "typeParams": + [ "ecom-additional-fees.LineItem" ] }, + "doc": "Line items. Max: 300 line items" }, + { "name": "shippingAddress", + "type": "ecom-additional-fees.AddressDetails", + "doc": "Shipping address." }, + { "name": "shippingInfo", + "type": "ecom-additional-fees.ShippingInfo", + "doc": "Shipping information." }, + { "name": "buyerDetails", + "type": "ecom-additional-fees.BuyerDetails", + "doc": "Buyer details." }, + { "name": "purchaseFlowId", + "type": "string", + "doc": "Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order." } ], + "extra": + { }, + "labels": [] }, + { "name": "OtherCharge", + "locations": + [ { "lineno": 319, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "type", + "type": "string", + "doc": "Type of additional charge.\n\nSupported values:\n - `'HANDLING_FEE'`\n - `'INSURANCE'`" }, + { "name": "price", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Price of added charge." } ], + "extra": + { }, + "labels": [] }, + { "name": "OtherCharges", + "locations": + [ { "lineno": 231, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "type", + "type": "string", + "doc": "Type of additional cost.\n\nSupported values:\n - `\"HANDLING_FEE\"`\n - `\"INSURANCE\"`" }, + { "name": "details", + "type": "string", + "doc": "Details of the charge. For example, \"Full coverage insurance of up to 80% of value of shipment\"." }, + { "name": "cost", + "type": "ecom-additional-fees.SelectedCarrierServiceOptionCost", + "doc": "Cost of additional charge." } ], + "extra": + { }, + "labels": [] }, + { "name": "PhysicalProperties", + "locations": + [ { "lineno": 158, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "weight", + "type": "number", + "doc": "Item weight." }, + { "name": "sku", + "type": "string", + "doc": "Stock keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku)." }, + { "name": "shippable", + "type": "boolean", + "doc": "Whether the item is shippable." } ], + "extra": + { }, + "labels": [] }, + { "name": "PickupDetails", + "locations": + [ { "lineno": 243, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "address", + "type": "ecom-additional-fees.AddressDetails", + "doc": "Pickup address." }, + { "name": "businessLocation", + "type": "boolean", + "doc": "Whether the pickup address is a business address. May affect tax calculation." }, + { "name": "pickupMethod", + "type": "string", + "doc": "Pickup method.\n\nSupported values:\n - `\"STORE_PICKUP\"`\n - `\"PICKUP_POINT\"`" } ], + "extra": + { }, + "labels": [] }, + { "name": "SelectedCarrierSeriveOptionPrices", + "locations": + [ { "lineno": 255, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "totalPriceAfterTax", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Total shipping price after discount and tax." }, + { "name": "taxDetails", + "type": "ecom-additional-fees.ItemTaxFullDetails", + "doc": "Tax details." }, + { "name": "totalDiscount", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Shipping discount before tax." }, + { "name": "price", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Shipping price before discount and tax." } ], + "extra": + { }, + "labels": [] }, + { "name": "SelectedCarrierServiceOption", + "locations": + [ { "lineno": 199, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "code", + "type": "string", + "doc": "Unique identifier of a selected option. For example, `'usps_std_overnight'`." }, + { "name": "title", + "type": "string", + "doc": "Title of the selected carrier service option. For example, `'USPS Standard Overnight Delivery'`, `'Standard'`,\nor `'First-Class Package International'`.\n\nMax: 250 characters" }, + { "name": "logistics", + "type": "ecom-additional-fees.DeliveryLogistics", + "doc": "Delivery logistics." }, + { "name": "cost", + "type": "ecom-additional-fees.SelectedCarrierServiceOptionCost", + "doc": "Shipping cost." }, + { "name": "otherCharges", + "type": + { "name": "Array", + "typeParams": + [ "ecom-additional-fees.OtherCharges" ] }, + "doc": "Other charges." } ], + "extra": + { }, + "labels": [] }, + { "name": "SelectedCarrierServiceOptionCost", + "locations": + [ { "lineno": 224, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "price", + "type": "string", + "doc": "Price of shipping." }, + { "name": "totalDiscount", + "type": "string", + "doc": "Total discounts applied to shipping cost." } ], + "extra": + { }, + "labels": [] }, + { "name": "SelectedCarrierServiceOptionsOtherCharge", + "locations": + [ { "lineno": 291, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "type", + "type": "string", + "doc": "Type of additional charge.\n\nSupported values:\n - `'HANDLING_FEE'`\n - `'INSURANCE'`" }, + { "name": "details", + "type": "string", + "doc": "Charge details. For example, 'Full coverage insurance up to 80% value of shipment'." }, + { "name": "price", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Price of added charge." } ], + "extra": + { }, + "labels": [] }, + { "name": "ServiceProperties", + "locations": + [ { "lineno": 178, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "scheduledDate", + "type": "string", + "doc": "Date and time the service is to be provided. For example, the time of the a class." }, + { "name": "numberOfParticipants", + "type": "number", + "doc": "Number of people participating in the service.\nFor example, the number of people attending a yoga class or the number of people per hotel room." } ], + "extra": + { }, + "labels": [] }, + { "name": "ShippingInfo", + "locations": + [ { "lineno": 186, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "selectedCarrierServiceOption", + "type": "ecom-additional-fees.SelectedCarrierServiceOption", + "doc": "Selected shipping option." } ], + "extra": + { }, + "labels": [] }, + { "name": "ShippingOption", + "locations": + [ { "lineno": 303, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "code", + "type": "string", + "doc": "Unique code of provided shipping option. For example, `'usps_std_overnight'`." }, + { "name": "title", + "type": "string", + "doc": "Title of the selected carrier service option. For example, `'USPS Standard Overnight Delivery'`, `'Standard'`,\nor `'First-Class Package International'`." }, + { "name": "logistics", + "type": "ecom-additional-fees.DeliveryLogistics", + "doc": "Delivery logistics." } ], + "extra": + { }, + "labels": [] }, + { "name": "ShippingPrice", + "locations": + [ { "lineno": 312, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "price", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Shipping price." }, + { "name": "otherCharges", + "type": + { "name": "Array", + "typeParams": + [ "ecom-additional-fees.OtherCharge" ] }, + "doc": "Other costs. For example, insurance or handling and packaging fees." } ], + "extra": + { }, + "labels": [] }, + { "name": "ShippingRegion", + "locations": + [ { "lineno": 192, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "id", + "type": "string", + "doc": "Reserved for internal use." }, + { "name": "name", + "type": "string", + "doc": "Shipping region name." } ], + "extra": + { }, + "labels": [] }, + { "name": "StreetAddressInfo", + "locations": + [ { "lineno": 125, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "number", + "type": "string", + "doc": "Street number." }, + { "name": "name", + "type": "string", + "doc": "Street name." } ], + "extra": + { }, + "labels": [] }, + { "name": "SubscriptionSettings", + "locations": + [ { "lineno": 166, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "frequency", + "type": "string", + "doc": "The frequency of recurring payments based on every day, week, month, or year.\n\nSupported values:\n - `\"DAY\"`\n - `\"WEEK\"`\n - `\"MONTH\"`\n - `\"YEAR\"`" } ], + "extra": + { }, + "labels": [] }, + { "name": "TaxDetails", + "locations": + [ { "lineno": 86, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "taxable", + "type": "boolean", + "doc": "Whether the additional fee is taxable.\n\nThe tax amount will be calculated based on the tax settings in the dashboard." } ], + "extra": + { }, + "labels": [] }, + { "name": "TaxRateBreakdown", + "locations": + [ { "lineno": 283, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "name", + "type": "string", + "doc": "Type of tax calculated." }, + { "name": "rate", + "type": "string", + "doc": "Tax rate." }, + { "name": "tax", + "type": "ecom-additional-fees.MultiCurrencyPrice", + "doc": "Tax amount." } ], + "extra": + { }, + "labels": [] }, + { "name": "VatId", + "locations": + [ { "lineno": 141, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "id", + "type": "string", + "doc": "Buyer's tax ID." }, + { "name": "type", + "type": "string", + "doc": "VAT type.\nSupported values:\n - `\"CPF\"`\n - `\"CNPJ\"`" } ], + "extra": + { }, + "labels": [] } ], + "extra": + { } } \ No newline at end of file From 3c5674f790a0f789c64685627cb8e76f4d7ba3ac Mon Sep 17 00:00:00 2001 From: roysha-wix <62389977+roysha-wix@users.noreply.github.com> Date: Wed, 29 May 2024 16:25:33 +0300 Subject: [PATCH 11/11] Revert "DocWorks for ecom-additional-fees - 1 change detected" --- .../ecom-additional-fees.service.json | 423 ++++++------------ 1 file changed, 134 insertions(+), 289 deletions(-) diff --git a/ecom-additional-fees/ecom-additional-fees.service.json b/ecom-additional-fees/ecom-additional-fees.service.json index c11967aa84..4e364d383a 100644 --- a/ecom-additional-fees/ecom-additional-fees.service.json +++ b/ecom-additional-fees/ecom-additional-fees.service.json @@ -1,34 +1,29 @@ { "name": "ecom-additional-fees", "mixes": [], "labels": - [ "new" ], + [ "changed" ], "location": { "lineno": 1, "filename": "additional-fees-index.js" }, "docs": - { "summary": "The eCommerce Additional Fees Service Plugin.", + { "summary": "The eCommerce Additional Fees SPI.", "description": - [ "The Additional Fees service plugin (formerly SPI) is a service provider interface that allows site owners and collaborators to add additional fee calculations that don't come ", - "natively with Wix to their site. The service plugin allows you to change how apps, such as Wix Stores and Wix Bookings, calculate charges during checkout. Additional fees are calculated and ", - "seen in all eCommerce platform pages including cart, checkout, orders, and payments. Examples of additional fees are surcharges based on customer location, special ", - "handling during shipping, or gift wrapping.", + [ ">**Note:** This SPI is currently in beta and is subject to change. Some SPIs are currently not available to all users. ", "", - "Wix eCommerce calls the service plugin endpoint [`calculateAdditionalFees()`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-additional-fees/calculateadditionalfees) to ", - "retrieve the relevant data for a site collaborator to add additional fees. Collaborators can then implement their own logic to calculate additional fees, and return ", - "the calculated fee data in the structure provided by Wix eCommerce.", + "The Additional Fees SPI is a service provider interface that allows site owners and collaborators to add additional fees ", + "to their site. These additional fees are calculated and seen in all eCommerce platform pages, ", + "including cart, checkout, orders, and payments.", "", - "Note that `currency` in the [`calculateAdditionalFees`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-additional-fees/calculateadditionalfees) response must match ", - "your site's currency. You can find the currency of your site using the [`getPaymentCurrency()`](https://www.wix.com/velo/reference/wix-site-backend/generalinfo-obj/getpaymentcurrency)", - "function.", + "Wix eCommerce calls the SPI endpoint [`calculateAdditionalFees()`](https://www.wix.com/velo/reference/ecom-additional-fees/calculateadditionalfees) ", + "to retrieve the relevant data for a site collaborator to add additional fees. ", + "Collaborators can then implement their own logic to calculate additional fees, and return the calculated fee ", + "data in the structure provided by Wix eCommerce. ", "", - "Learn more:", - " + [Velo: Custom App Extensions Using SPIs](https://support.wix.com/en/article/velo-custom-business-app-extensions-using-spis-beta)", - " + [Additional Fees SPI custom extension](https://support.wix.com/en/article/velo-tutorial-ecommerce-additional-fees-custom-extension)", + "Note that `currency` in the [`calculateAdditionalFees`](https://www.wix.com/velo/reference/ecom-additional-fees/calculateadditionalfees) response must match ", + "your site's currency. You can find the currency of your site using the [`getPaymentCurrency()`](https://www.wix.com/velo/reference/wix-site-backend/generalinfo-obj/getpaymentcurrency)", + "function. ", "", - "### To add a service plugin", - "1. [Add the plugin to your site](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/integrations/custom-extensions-spis/custom-app-extensions-using-sp-is#step-1-create-a-new-extension-on-your-wix-site).", - "2. Update the [`getConfig()`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-additional-fees/getconfig) function in the **-config.js** file that is added to your site during step 1.", - "3. Update the [`calculateAdditionalFees()`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-additional-fees/calculateadditionalfees) function in the **.js** file that is added to your site during step 1." ], + "Learn more about the [Additional Fees SPI custom extension](https://support.wix.com/en/article/velo-tutorial-ecommerce-custom-additional-fees-extension-beta)." ], "links": [], "examples": [], "extra": @@ -36,7 +31,8 @@ "properties": [], "operations": [ { "name": "calculateAdditionalFees", - "labels": [], + "labels": + [ "changed" ], "nameParams": [], "params": [ { "name": "options", @@ -49,20 +45,14 @@ [ "ecom-additional-fees.CalculateAdditionalFeesResponse" ] }, "doc": "Fulfilled - Additional fees and currency info." }, "locations": - [ { "lineno": 26, + [ { "lineno": 1, "filename": "additional-fees.js" } ], "docs": { "summary": "Calculates additional fees to include in the cart and checkout pages.", "description": - [ "The `calculateAdditionalFees` function calculates additional fees to appear in the cart and checkout pages of a store's site.", - "The function is automatically called by Wix when the cart totals are calculated, or when an action is performed in", - "the cart and/or checkout pages. For example, when an item is added to the cart, or when a shipping location is specified.", - "", - "### Where to find `calculateAdditionalFees()`", - "When you [add the Additional Fees service plugin](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/e-commerce-additional-fees-custom-extension#step-1-create-a-new-additional-fees-custom-extension), ", - "a folder is automatically added to your site. Use the `.js` file in the folder to write the code to calculate any additional fees to add to the cart or checkout. ", - "", - "For more information on calculating your additional fees, see [Tutorial: Additional Fees Custom Extension](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/e-commerce-additional-fees-custom-extension#my-extension-namejs)." ], + [ "The `calculateAdditionalFees` function calculates additional fees to appear in the cart and checkout pages of a store's site. ", + "The function is automatically called by Wix eCommerce when the cart totals are calculated, or when an action is performed in ", + "the cart and/or checkout pages. For example, when an item is added to the cart, or when a shipping location is specified." ], "links": [], "examples": [ { "title": "Calculate additional fees for an order", @@ -117,57 +107,12 @@ "extra": { } }, "extra": - { } }, - { "name": "getConfig", - "labels": [], - "nameParams": [], - "params": [], - "ret": - { "type": - { "name": "Promise", - "typeParams": - [ "ecom-additional-fees.AdditionalFeesConfigResponse" ] }, - "doc": "Fulfilled - The configuration settings." }, - "locations": - [ { "lineno": 1, - "filename": "additional-fees.js" } ], - "docs": - { "summary": "Retrieves the configuration of your additional fees plugin.", - "description": - [ "Set your additional fees configuration in the `return` of the `getConfig()` function. Wix calls this function when you publish your site. ", - "Changes to the configuration don't take effect until you publish your site.", - "", - "Currently no configurations are available for this plugin, so set `getConfig()` to return an empty object.", - "", - "### Where to find `getConfig()`", - "When you [add the Additional Fees service plugin](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/e-commerce-additional-fees-custom-extension#step-1-create-a-new-additional-fees-custom-extension), ", - "a folder is automatically added to your site. Use the `-config.js` file in the folder to set the default configuration for your ", - "implementation of the service plugin.", - "", - "For more information on setting your configuration, see [Tutorial: Additional Fees Service Plugin](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/e-commerce-additional-fees-custom-extension#my-extension-name-configjs)." ], - "links": [], - "examples": - [ { "title": "Example of a configuration file", - "body": - [ "// Place this code in the -config.js file", - "// in the 'ecom-additional-fees' folder of the", - "// Custom Extensions section on your site.", - "", - "export function getConfig() {", - " return {};", - "};" ], - "extra": - { } } ], - "extra": - { } }, - "extra": - { "customLabels": - [ { "id": "maturity-beta" } ] } } ], + { } } ], "callbacks": [], "messages": [ { "name": "AdditionalFee", "locations": - [ { "lineno": 68, + [ { "lineno": 39, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -180,32 +125,19 @@ "doc": "Unique code or ID for the additional fee.\n\nMax: 100 characters" }, { "name": "name", "type": "string", - "doc": "Name of additional fee.\n\nMax: 50 characters" }, + "doc": "Name of additional fee. \n\nMax: 50 characters" }, { "name": "price", "type": "string", - "doc": "Additional fee's price.\n\nNumber of decimal places must correspond to the site's currency according to the currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)\nformat. For example, a `USD` currency code can accept up to 2 decimal places." }, + "doc": "Additional fee's price.\n\nNumber of decimal places must correspond to the site's currency according to the currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) \nformat. For example, a `USD` currency code can accept up to 2 decimal places." }, { "name": "taxDetails", "type": "ecom-additional-fees.TaxDetails", - "doc": "Tax details.\n\n>**Note:** Tax is not calculated in the returned `price` even when `taxDetails.taxable` is `true`." } ], - "extra": - { }, - "labels": [] }, - { "name": "AdditionalFeesConfigResponse", - "locations": - [ { "lineno": 23, - "filename": "additional-fees.js" } ], - "docs": - { "links": [], - "examples": [], - "extra": - { } }, - "members": [], + "doc": "Tax details." } ], "extra": { }, "labels": [] }, - { "name": "AddressDetails", + { "name": "Address", "locations": - [ { "lineno": 111, + [ { "lineno": 178, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -213,42 +145,58 @@ "extra": { } }, "members": - [ { "name": "addressLine", - "type": "string", - "doc": "Main address line, usually street and number." }, - { "name": "addressLine2", + [ { "name": "addressLine1", "type": "string", - "doc": "Detailed address information, such as apartment, suite, or floor in free text.", + "doc": "Main address line, usually street and number, as free text.", "optional": true }, { "name": "streetAddress", - "type": "ecom-additional-fees.StreetAddressInfo", - "doc": "Street address object, with street number and name in separate properties.", + "type": "ecom-additional-fees.AddressInfo", + "doc": "Street address object, with number and name in separate fields.", "optional": true }, + { "name": "addressLine2", + "type": "string", + "doc": "Free text providing more detailed address information, such as apartment, suite, or floor." }, { "name": "city", "type": "string", "doc": "City name." }, { "name": "subdivision", "type": "string", - "doc": "Code for a subdivision, such as state, prefecture, or province, in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.", - "optional": true }, - { "name": "subdivisionFullname", - "type": "string", - "doc": "Subdivision's full name." }, + "doc": "Code for a subdivision (such as state, prefecture, or province) in an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format." }, { "name": "country", "type": "string", - "doc": "2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format." }, - { "name": "countryFullname", - "type": "string", - "doc": "Country's full name." }, + "doc": "2-letter country code in an [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format." }, { "name": "postalCode", "type": "string", "doc": "Postal or zip code." } ], + "extra": + { "oneOfGroups": + [ { "name": "street", + "members": + [ "addressLine1", + "streetAddress" ] } ] }, + "labels": [] }, + { "name": "AddressInfo", + "locations": + [ { "lineno": 191, + "filename": "additional-fees.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "number", + "type": "string", + "doc": "Street number." }, + { "name": "name", + "type": "string", + "doc": "Street name." } ], "extra": { }, "labels": [] }, { "name": "AppliedDiscount", "locations": - [ { "lineno": 330, + [ { "lineno": 280, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -258,7 +206,7 @@ "members": [ { "name": "discountType", "type": "string", - "doc": "Discount type.\n\nSupported values:\n - `\"GLOBAL\"`: Discount on the entire cart.\n - `\"SPECIFIC_ITEMS\"`: Discount on specific item.\n - `\"SHIPPING\"`: Discount on shipping." }, + "doc": "Discount type. \n\nSupported values:\n - `\"GLOBAL\"`: Discount on the entire cart.\n - `\"SPECIFIC_ITEMS\"`: Discount on specific item.\n - `\"SHIPPING\"`: Discount on shipping." }, { "name": "lineItemIds", "type": { "name": "Array", @@ -285,25 +233,9 @@ "merchantDiscount", "discountRule" ] } ] }, "labels": [] }, - { "name": "BuyerDetails", - "locations": - [ { "lineno": 106, - "filename": "additional-fees.js" } ], - "docs": - { "links": [], - "examples": [], - "extra": - { } }, - "members": - [ { "name": "contactDetails", - "type": "ecom-additional-fees.ContactDetails", - "doc": "Contact details." } ], - "extra": - { }, - "labels": [] }, { "name": "CalculateAdditionalFeesResponse", "locations": - [ { "lineno": 59, + [ { "lineno": 30, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -323,9 +255,9 @@ "extra": { }, "labels": [] }, - { "name": "CatalogReference", + { "name": "CarrierServiceOption", "locations": - [ { "lineno": 150, + [ { "lineno": 246, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -333,21 +265,21 @@ "extra": { } }, "members": - [ { "name": "catalogItemId", + [ { "name": "carrierId", "type": "string", - "doc": "ID of the item within the [custom catalog](https://www.wix.com/velo/reference/ecom-catalog/getcatalogitems)." }, - { "name": "appId", - "type": "string", - "doc": "ID of the Wix Catalog app." }, - { "name": "options", - "type": "Object", - "doc": "Additional data passed by the Wix Catalog app." } ], + "doc": "Carrier ID." }, + { "name": "shippingOptions", + "type": + { "name": "Array", + "typeParams": + [ "ecom-additional-fees.ShippingOption" ] }, + "doc": "Shipping options offered by the carrier." } ], "extra": { }, "labels": [] }, - { "name": "ContactDetails", + { "name": "CatalogReference", "locations": - [ { "lineno": 131, + [ { "lineno": 90, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -355,33 +287,21 @@ "extra": { } }, "members": - [ { "name": "firstName", - "type": "string", - "doc": "Buyer's first name." }, - { "name": "lastName", - "type": "string", - "doc": "Buyer's last name." }, - { "name": "phone", - "type": "string", - "doc": "Buyer's phone number." }, - { "name": "company", + [ { "name": "catalogItemId", "type": "string", - "doc": "Company name.", - "optional": true }, - { "name": "email", + "doc": "ID of the item within the [custom catalog](https://www.wix.com/velo/reference/ecom-catalog/getcatalogitems)." }, + { "name": "appId", "type": "string", - "doc": "Email.", - "optional": true }, - { "name": "vatId", - "type": "ecom-additional-fees.VatId", - "doc": "Tax information (for Brazil only). If `vatId.id` is provided, `vatId.type` must also be set.", - "optional": true } ], + "doc": "ID of the Wix Catalog app." }, + { "name": "options", + "type": "Object", + "doc": "Additional data passed by the Wix Catalog app." } ], "extra": { }, "labels": [] }, { "name": "Coupon", "locations": - [ { "lineno": 346, + [ { "lineno": 296, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -406,7 +326,7 @@ "labels": [] }, { "name": "DeliveryLogistics", "locations": - [ { "lineno": 212, + [ { "lineno": 154, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -416,10 +336,10 @@ "members": [ { "name": "deliveryTime", "type": "string", - "doc": "Expected delivery time in free text. For example, `'3-5 business days'`.\n\nMax: 500 characters" }, + "doc": "Expected delivery time in free text. For example, `'3-5 business days'`. \n\nMax: 500 characters" }, { "name": "instructions", "type": "string", - "doc": "Instructions for carrier. For example, `'Please deliver package during business hours'`.\n\nMax: 1000 characters" }, + "doc": "Instructions for carrier. For example, `'Please deliver package during opening hours'`. \n\nMax: 1000 characters" }, { "name": "pickupDetails", "type": "ecom-additional-fees.PickupDetails", "doc": "Pickup details." } ], @@ -428,7 +348,7 @@ "labels": [] }, { "name": "DiscountRule", "locations": - [ { "lineno": 361, + [ { "lineno": 311, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -450,7 +370,7 @@ "labels": [] }, { "name": "DiscountRuleName", "locations": - [ { "lineno": 369, + [ { "lineno": 319, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -469,7 +389,7 @@ "labels": [] }, { "name": "ItemTaxFullDetails", "locations": - [ { "lineno": 273, + [ { "lineno": 216, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -500,7 +420,7 @@ "labels": [] }, { "name": "LineItem", "locations": - [ { "lineno": 94, + [ { "lineno": 63, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -526,6 +446,16 @@ { "name": "physicalProperties", "type": "ecom-additional-fees.PhysicalProperties", "doc": "Properties of a physical item in cart and/or checkout." }, + { "name": "paymentOption", + "type": "string", + "doc": "Type of selected payment option for the current item. \n \nSupported values:\n+ `\"FULL_PAYMENT_ONLINE\"` - Entire payment for the item happens as part of the checkout.\n+ `\"FULL_PAYMENT_OFFLINE\"` - Entire payment for the item happens after the checkout. For example, when using cash, check, or other offline payment methods.\n+ `\"MEMBERSHIP\"` - Payment for the item is done by charging a membership. When the option is used, `lineItem.price.amount` is `0`.\n+ `\"DEPOSIT_ONLINE\"` - Partial payment to be paid upfront during the checkout. Amount to be paid is defined by `depositAmount` property.\n\nDefault:`\"FULL_PAYMENT_ONLINE\"`.", + "optional": true }, + { "name": "serviceProperties", + "type": "ecom-additional-fees.ServiceProperties", + "doc": "Service properties. When relevant, contains information such as service date and number of participants. Used, for example, when checking for valid memberships." }, + { "name": "rootCatalogItemId", + "type": "string", + "doc": "In cases where `catalogReference.catalogItemId` is not the actual catalog item ID, this property returns the true item's ID.\n+ For example, for Wix Bookings, `catalogReference.catalogItemId` is the booking ID.\n+ In most cases, this property is the same as `catalogReference.catalogItemId`.\n+ Used when validating membership." }, { "name": "depositAmount", "type": "string", "doc": "Partial payment to be paid upfront during the checkout.\nEligible for items where `paymentOption` is `\"DEPOSIT_ONLINE\"` only. If omitted, the item's price is not split and is expected to be paid in a single installment." } ], @@ -534,7 +464,7 @@ "labels": [] }, { "name": "MerchantDiscount", "locations": - [ { "lineno": 355, + [ { "lineno": 305, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -550,7 +480,7 @@ "labels": [] }, { "name": "MultiCurrencyPrice", "locations": - [ { "lineno": 264, + [ { "lineno": 207, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -575,7 +505,7 @@ "labels": [] }, { "name": "Options", "locations": - [ { "lineno": 50, + [ { "lineno": 21, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -588,25 +518,16 @@ { "name": "Array", "typeParams": [ "ecom-additional-fees.LineItem" ] }, - "doc": "Line items. Max: 300 line items" }, - { "name": "shippingAddress", - "type": "ecom-additional-fees.AddressDetails", - "doc": "Shipping address." }, + "doc": "Line items.\n\nMax: 300 line items" }, { "name": "shippingInfo", "type": "ecom-additional-fees.ShippingInfo", - "doc": "Shipping information." }, - { "name": "buyerDetails", - "type": "ecom-additional-fees.BuyerDetails", - "doc": "Buyer details." }, - { "name": "purchaseFlowId", - "type": "string", - "doc": "Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order." } ], + "doc": "Shipping information." } ], "extra": { }, "labels": [] }, { "name": "OtherCharge", "locations": - [ { "lineno": 319, + [ { "lineno": 269, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -616,38 +537,16 @@ "members": [ { "name": "type", "type": "string", - "doc": "Type of additional charge.\n\nSupported values:\n - `'HANDLING_FEE'`\n - `'INSURANCE'`" }, + "doc": "Type of additional charge.\n \nSupported values:\n - `'HANDLING_FEE'`\n - `'INSURANCE'`" }, { "name": "price", "type": "ecom-additional-fees.MultiCurrencyPrice", "doc": "Price of added charge." } ], "extra": { }, "labels": [] }, - { "name": "OtherCharges", - "locations": - [ { "lineno": 231, - "filename": "additional-fees.js" } ], - "docs": - { "links": [], - "examples": [], - "extra": - { } }, - "members": - [ { "name": "type", - "type": "string", - "doc": "Type of additional cost.\n\nSupported values:\n - `\"HANDLING_FEE\"`\n - `\"INSURANCE\"`" }, - { "name": "details", - "type": "string", - "doc": "Details of the charge. For example, \"Full coverage insurance of up to 80% of value of shipment\"." }, - { "name": "cost", - "type": "ecom-additional-fees.SelectedCarrierServiceOptionCost", - "doc": "Cost of additional charge." } ], - "extra": - { }, - "labels": [] }, { "name": "PhysicalProperties", "locations": - [ { "lineno": 158, + [ { "lineno": 98, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -669,7 +568,7 @@ "labels": [] }, { "name": "PickupDetails", "locations": - [ { "lineno": 243, + [ { "lineno": 166, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -678,7 +577,7 @@ { } }, "members": [ { "name": "address", - "type": "ecom-additional-fees.AddressDetails", + "type": "ecom-additional-fees.Address", "doc": "Pickup address." }, { "name": "businessLocation", "type": "boolean", @@ -691,7 +590,7 @@ "labels": [] }, { "name": "SelectedCarrierSeriveOptionPrices", "locations": - [ { "lineno": 255, + [ { "lineno": 198, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -716,7 +615,7 @@ "labels": [] }, { "name": "SelectedCarrierServiceOption", "locations": - [ { "lineno": 199, + [ { "lineno": 140, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -733,40 +632,18 @@ { "name": "logistics", "type": "ecom-additional-fees.DeliveryLogistics", "doc": "Delivery logistics." }, - { "name": "cost", - "type": "ecom-additional-fees.SelectedCarrierServiceOptionCost", - "doc": "Shipping cost." }, - { "name": "otherCharges", - "type": - { "name": "Array", - "typeParams": - [ "ecom-additional-fees.OtherCharges" ] }, - "doc": "Other charges." } ], - "extra": - { }, - "labels": [] }, - { "name": "SelectedCarrierServiceOptionCost", - "locations": - [ { "lineno": 224, - "filename": "additional-fees.js" } ], - "docs": - { "links": [], - "examples": [], - "extra": - { } }, - "members": - [ { "name": "price", - "type": "string", - "doc": "Price of shipping." }, - { "name": "totalDiscount", + { "name": "requestedShippingOption", + "type": "boolean", + "doc": "Whether the requested shipping option exists in `carrierServiceOptions`. If `false`, the first \nitem in `carrierServiceOptions` is used." }, + { "name": "carrierId", "type": "string", - "doc": "Total discounts applied to shipping cost." } ], + "doc": "Selected carrier's ID." } ], "extra": { }, "labels": [] }, { "name": "SelectedCarrierServiceOptionsOtherCharge", "locations": - [ { "lineno": 291, + [ { "lineno": 234, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -776,7 +653,7 @@ "members": [ { "name": "type", "type": "string", - "doc": "Type of additional charge.\n\nSupported values:\n - `'HANDLING_FEE'`\n - `'INSURANCE'`" }, + "doc": "Type of additional charge.\n \nSupported values:\n - `'HANDLING_FEE'`\n - `'INSURANCE'`" }, { "name": "details", "type": "string", "doc": "Charge details. For example, 'Full coverage insurance up to 80% value of shipment'." }, @@ -788,7 +665,7 @@ "labels": [] }, { "name": "ServiceProperties", "locations": - [ { "lineno": 178, + [ { "lineno": 118, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -807,7 +684,7 @@ "labels": [] }, { "name": "ShippingInfo", "locations": - [ { "lineno": 186, + [ { "lineno": 126, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -817,13 +694,19 @@ "members": [ { "name": "selectedCarrierServiceOption", "type": "ecom-additional-fees.SelectedCarrierServiceOption", - "doc": "Selected shipping option." } ], + "doc": "Selected shipping option." }, + { "name": "carrierServiceOptions", + "type": + { "name": "Array", + "typeParams": + [ "ecom-additional-fees.CarrierServiceOption" ] }, + "doc": "List of all shipping options." } ], "extra": { }, "labels": [] }, { "name": "ShippingOption", "locations": - [ { "lineno": 303, + [ { "lineno": 253, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -845,7 +728,7 @@ "labels": [] }, { "name": "ShippingPrice", "locations": - [ { "lineno": 312, + [ { "lineno": 262, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -867,7 +750,7 @@ "labels": [] }, { "name": "ShippingRegion", "locations": - [ { "lineno": 192, + [ { "lineno": 133, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -884,28 +767,9 @@ "extra": { }, "labels": [] }, - { "name": "StreetAddressInfo", - "locations": - [ { "lineno": 125, - "filename": "additional-fees.js" } ], - "docs": - { "links": [], - "examples": [], - "extra": - { } }, - "members": - [ { "name": "number", - "type": "string", - "doc": "Street number." }, - { "name": "name", - "type": "string", - "doc": "Street name." } ], - "extra": - { }, - "labels": [] }, { "name": "SubscriptionSettings", "locations": - [ { "lineno": 166, + [ { "lineno": 106, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -921,7 +785,7 @@ "labels": [] }, { "name": "TaxDetails", "locations": - [ { "lineno": 86, + [ { "lineno": 55, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -931,13 +795,13 @@ "members": [ { "name": "taxable", "type": "boolean", - "doc": "Whether the additional fee is taxable.\n\nThe tax amount will be calculated based on the tax settings in the dashboard." } ], + "doc": "Whether the additional fee is taxable. \n\nThe tax amount will be calculated based on the tax settings in the dashboard." } ], "extra": { }, "labels": [] }, { "name": "TaxRateBreakdown", "locations": - [ { "lineno": 283, + [ { "lineno": 226, "filename": "additional-fees.js" } ], "docs": { "links": [], @@ -956,25 +820,6 @@ "doc": "Tax amount." } ], "extra": { }, - "labels": [] }, - { "name": "VatId", - "locations": - [ { "lineno": 141, - "filename": "additional-fees.js" } ], - "docs": - { "links": [], - "examples": [], - "extra": - { } }, - "members": - [ { "name": "id", - "type": "string", - "doc": "Buyer's tax ID." }, - { "name": "type", - "type": "string", - "doc": "VAT type.\nSupported values:\n - `\"CPF\"`\n - `\"CNPJ\"`" } ], - "extra": - { }, "labels": [] } ], "extra": { } } \ No newline at end of file