diff --git a/ecom-validations-spi/ecom-validations.service.json b/ecom-validations-spi/ecom-validations.service.json new file mode 100644 index 0000000000..0074048b49 --- /dev/null +++ b/ecom-validations-spi/ecom-validations.service.json @@ -0,0 +1,1260 @@ +{ "name": "ecom-validations", + "mixes": [], + "labels": + [ "new" ], + "location": + { "lineno": 1, + "filename": "validations-index.js" }, + "docs": + { "summary": "The eCommerce Validations Service Plugin.", + "description": + [ "The Validations [service plugin](https://support.wix.com/en/article/velo-custom-app-extensions-using-spis) (formerly SPI) allows site owners and collaborators to validate a site visitor's cart and checkout. For example, you can validate a specific line item’s quantity if the quantity per order is limited.", + "Site owners and collaborators can either write their own custom validation logic, or integrate with a 3rd-party validations provider.", + "", + "Wix eCommerce calls [`getValidationViolations()`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-validations/getvalidationviolations) to retrieve any violations in a site visitor's cart and checkout.", + "The custom validation plugin code validates the request, and returns any validation violation data in a site visitor's cart and checkout (using the structure provided by Wix eCommerce).", + "If there aren't any validation violations, the endpoint should return an object containing an empty array. Site visitors can see validation violations in their cart and checkout pages. For example, see the images below:", + "", + "The image below shows a cart page with both a general validation violation warning and a line item validation violation warning.", + "", + "![Cart page warning](..assets/images/img1.png \"Cart page warnings\")", + "", + "The images below show a checkout page with both a general validation violation error and a line item validation violation error:", + "", + "The general violation error appears at the top of the checkout page:", + "", + "![Checkout page errors - top](..assets/images/img2.png \"Checkout page errors\")", + "", + "The error appears again above the **Place Order & Pay** button at the end of the page. The button is disabled until the errors are resolved.", + "", + "![Checkout page errors - bottom](..assets/images/img3.png \"Checkout page errors\")", + "", + "For a step-by-step tutorial, see [Validation Violations service plugin](https://support.wix.com/en/article/tutorial-validations-custom-extension).", + "", + "Future functionality includes validating products and orders.", + "", + "## Before you begin", + "", + "By default, the Validations service plugin only validates a site visitor's checkout. If you want to also validate a site visitor's cart, set the `validateInCart` parameter to `true` in the service plugin's config file.", + "", + "## 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-validations/getconfig) function in the **-config.js** file that is added to your site during step 1.", + "3. Update the [`getValidationViolations()`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-validations/getvalidationviolations) function in the **.js** file that is added to your site during step 1.", + "", + "## Use Cases", + "", + "With the Validations service plugin you can define the validations for a cart and checkout that fit your site's needs. Possible validations include:", + " + Minimum subtotal amount to qualify for free shipping.", + " + Age of a customer before they proceed to checkout.", + " + Specific items to ship only to specific regions.", + " + Restrict purchases to site members only.", + " + Close checkout on certain days.", + "", + "## Terminology", + "", + " | Term | Definition |", + " | --- | --- |", + " | Severity |How severe the violation is. The violations are shown on the cart and checkout pages. A warning is displayed as yellow, and allows a site visitor to proceed with caution. An error is displayed as red, and doesn't allow a site visitor to proceed with the eCommerce flow. |", + " | Subscription Option |A store owner can create [subscriptions](https://support.wix.com/en/article/wix-stores-selling-product-subscriptions) to sell their products on a recurring basis. A line item can be a subscription. |", + " | Target |Target location on a checkout or cart page where the violation will be displayed. The target violation can either be in a particular `lineItem`, or in an `other` area of the cart or checkout page. |", + " | Violations |A list of any validation violations in a site visitor's cart or checkout. |" ], + "links": [], + "examples": [], + "extra": + { } }, + "properties": [], + "operations": + [ { "name": "getConfig", + "labels": [], + "nameParams": [], + "params": [], + "ret": + { "type": + { "name": "Promise", + "typeParams": + [ "ecom-validations.ValidationsConfigResponse" ] }, + "doc": "Fulfilled - The configuration settings." }, + "locations": + [ { "lineno": 1, + "filename": "validations.js" } ], + "docs": + { "summary": "Retrieves the configuration of your validations plugin.", + "description": + [ "Set your validations 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.", + "", + "By default, the Validations service plugin only validates a site visitor's checkout. To also validate a site visitor's cart, ", + "set `validateInCart` to `true`.", + "", + "### Where to find `getConfig()`", + "When you [add the Validations service plugin](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/tutorial-validations-custom-extension#step-1-create-a-new-validation-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: Validations Service Plugin](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/tutorial-validations-custom-extension#minimum-configjs)." ], + "links": [], + "examples": + [ { "title": "Example of a configuration file", + "body": + [ "// Place this code in the -config.js file", + "// in the 'ecom-validations' folder of the", + "// Custom Extensions section on your site.", + "", + "export function getConfig() {", + " return {", + " validateInCart: true", + " };", + "};" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { "customLabels": + [ { "id": "maturity-beta" } ] } }, + { "name": "getValidationViolations", + "labels": [], + "nameParams": [], + "params": + [ { "name": "options", + "type": "ecom-validations.Options", + "doc": "Validation options." } ], + "ret": + { "type": + { "name": "Promise", + "typeParams": + [ "ecom-validations.GetValidationViolationsResponse" ] }, + "doc": "Fulfilled - Validation violations." }, + "locations": + [ { "lineno": 31, + "filename": "validations.js" } ], + "docs": + { "summary": "Retrieves any validation violations in a site visitor's cart or checkout.", + "description": + [ "The `getValidationViolations` function validates a site visitor's cart or checkout and returns any validation violations. Site visitors can see the validation violations in their cart and checkout pages. If there aren't any validation violations, the endpoint returns an object containing an empty list.", + "", + "The function is automatically called by Wix eCommerce when certain actions are performed on a cart or checkout. For example, when an item is added to a cart, or when a coupon is added to a checkout. ", + "", + ">**Note:** By default, the Validations service plugin only validates a site visitor's checkout. If you want to also validate a site visitor's cart, set the `validateInCart` parameter to `true` in the service plugin's config file. ", + "", + "### Where to find `getValidationViolations()`", + "When you [add the Validations service plugin](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/tutorial-validations-custom-extension#step-1-create-a-new-validation-extension), ", + "a folder is automatically added to your site. Use the `.js` file in the folder to write the code to determine which validation violations to retrieve. ", + "", + "For more information on customizing your checkout validations plugin, see [Tutorial: Validations Service Plugin](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/tutorial-validations-custom-extension)." ], + "links": [], + "examples": + [ { "title": "Get Validation Violations", + "body": + [ "const goldRingItemId = \"37e5db61-d37d-442d-1bf5-ae755f82020b\";", + "", + "export const getValidationViolations = async (options, context) => {", + " const lineItems = options.validationInfo.lineItems;", + " let violations = [];", + "", + " if (hasExcessiveGoldRingQuantity(lineItems)) {", + " const source = options.sourceInfo.source;", + " const severity = getSourceSeverity(source);", + "", + " const target = {", + " lineItem: {", + " name: 'LINE_ITEM_DEFAULT',", + " _id: findGoldRingLineItemId(lineItems)", + " }", + " };", + "", + " const description = \"You can't purchase more than 5 gold rings.\";", + "", + " const violation = createViolation(severity, target, description);", + " violations.push(violation);", + " }", + "", + " return { violations };", + "};", + "", + "function getSourceSeverity(source) {", + " if (source === 'CART') {", + " return 'WARNING';", + " } else {", + " return 'ERROR';", + " }", + "}", + "", + "function hasExcessiveGoldRingQuantity(lineItems) {", + " for (const lineItem of lineItems) {", + " if (lineItem.catalogReference.catalogItemId === goldRingItemId && lineItem.quantity > 5) {", + " return true;", + " }", + " }", + " return false;", + "}", + "", + "function findGoldRingLineItemId(lineItems) {", + " for (const lineItem of lineItems) {", + " if (lineItem.catalogReference.catalogItemId === goldRingItemId) {", + " return lineItem._id;", + " }", + " }", + " return undefined;", + "}", + "", + "function createViolation(severity, target, description) {", + " return { severity, target, description };", + "}" ], + "extra": + { "description": "This example validates a cart and checkout. The quantity of gold rings is limited, and the site visitor isn't allowed to purchase more than 5." } } ], + "extra": + { } }, + "extra": + { "customLabels": + [ { "id": "maturity-beta" } ] } } ], + "callbacks": [], + "messages": + [ { "name": "AdditionalFees", + "locations": + [ { "lineno": 246, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "string", + "doc": "Amount." } ], + "extra": + { }, + "labels": [] }, + { "name": "AddressDetails", + "locations": + [ { "lineno": 264, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "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": "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": "city", + "type": "string", + "doc": "City name." }, + { "name": "postalCode", + "type": "string", + "doc": "Postal or zip code." }, + { "name": "streetAddress", + "type": "ecom-validations.StreetAddressInfo", + "doc": "Street address object, with street number and name in separate properties.", + "optional": true }, + { "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 } ], + "extra": + { }, + "labels": [] }, + { "name": "Amount", + "locations": + [ { "lineno": 334, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "string", + "doc": "Amount." } ], + "extra": + { }, + "labels": [] }, + { "name": "AmountMerchant", + "locations": + [ { "lineno": 344, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "string", + "doc": "Amount." } ], + "extra": + { }, + "labels": [] }, + { "name": "AmountRule", + "locations": + [ { "lineno": 363, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "string", + "doc": "Amount." } ], + "extra": + { }, + "labels": [] }, + { "name": "AppliedDiscounts", + "locations": + [ { "lineno": 315, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "discountType", + "type": "string", + "doc": "Discount type. \nSupported values: `GLOBAL`, `SPECIFIC_ITEMS`, `SHIPPING`." }, + { "name": "lineItemIds", + "type": + { "name": "Array", + "typeParams": + [ "string" ] }, + "doc": "IDs of the line items the discount applies to." }, + { "name": "coupon", + "type": "ecom-validations.Coupon", + "doc": "Coupon details.", + "optional": true }, + { "name": "merchantDiscount", + "type": "ecom-validations.MerchantDiscount", + "doc": "Merchant discount.", + "optional": true }, + { "name": "discountRule", + "type": "ecom-validations.DiscountRule", + "doc": "Discount rule.", + "optional": true } ], + "extra": + { "oneOfGroups": + [ { "name": "discountOneOf", + "members": + [ "coupon", + "merchantDiscount", + "discountRule" ] } ] }, + "labels": [] }, + { "name": "BillingInfo", + "locations": + [ { "lineno": 252, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "address", + "type": "ecom-validations.AddressDetails", + "doc": "Address." }, + { "name": "contactDetails", + "type": "ecom-validations.ContactDetails", + "doc": "Contact details." } ], + "extra": + { }, + "labels": [] }, + { "name": "BuyerDetails", + "locations": + [ { "lineno": 93, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "email", + "type": "string", + "doc": "Buyer's email address." }, + { "name": "contactId", + "type": "string", + "doc": "Contact ID if one exists." } ], + "extra": + { }, + "labels": [] }, + { "name": "CatalogReference", + "locations": + [ { "lineno": 131, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "catalogItemId", + "type": "string", + "doc": "Catalog item ID. For example, `productId` for Wix Stores or `eventId` for Wix Events." }, + { "name": "appId", + "type": "string", + "doc": "ID of the Wix Catalog app. For example, the Wix Stores `appId`." }, + { "name": "options", + "type": "Object", + "doc": "Additional info in key:value form. \nFor example, a size medium red t-shirt's options property would hold something like this:\n+ {\"Size\": \"M\", \"Color\": \"Red\"}" } ], + "extra": + { }, + "labels": [] }, + { "name": "ContactDetails", + "locations": + [ { "lineno": 281, + "filename": "validations.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": "vatId", + "type": "ecom-validations.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": 326, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "_id", + "type": "string", + "doc": "Coupon ID." }, + { "name": "code", + "type": "string", + "doc": "Coupon code." }, + { "name": "amount", + "type": "ecom-validations.Amount", + "doc": "Coupon value." }, + { "name": "name", + "type": "string", + "doc": "Coupon name." } ], + "extra": + { }, + "labels": [] }, + { "name": "CustomFields", + "locations": + [ { "lineno": 310, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "fields", + "type": + { "name": "Array", + "typeParams": + [ "ecom-validations.Field" ] }, + "doc": "List of custom fields." } ], + "extra": + { }, + "labels": [] }, + { "name": "Description", + "locations": + [ { "lineno": 204, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "original", + "type": "string", + "doc": "Subscription option description." }, + { "name": "translated", + "type": "string", + "doc": "Translated subscription option description." } ], + "extra": + { }, + "labels": [] }, + { "name": "Discount", + "locations": + [ { "lineno": 236, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "string", + "doc": "Amount." } ], + "extra": + { }, + "labels": [] }, + { "name": "DiscountRule", + "locations": + [ { "lineno": 349, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "_id", + "type": "string", + "doc": "Discount rule ID." }, + { "name": "name", + "type": "ecom-validations.NameRule", + "doc": "Discount rule name." }, + { "name": "amount", + "type": "ecom-validations.AmountRule", + "doc": "Discount value." } ], + "extra": + { }, + "labels": [] }, + { "name": "Field", + "locations": + [ { "lineno": 380, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "value", + "type": "ecom-validations.Value", + "doc": "Custom field value." }, + { "name": "title", + "type": "string", + "doc": "Custom field title." }, + { "name": "translatedTitle", + "type": "string", + "doc": "Translated custom field title." } ], + "extra": + { }, + "labels": [] }, + { "name": "GetValidationViolationsResponse", + "locations": + [ { "lineno": 387, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "violations", + "type": + { "name": "Array", + "typeParams": + [ "ecom-validations.Violation" ] }, + "doc": "List of validation violations." } ], + "extra": + { }, + "labels": [] }, + { "name": "ItemType", + "locations": + [ { "lineno": 165, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "preset", + "type": "string", + "doc": "Preset item type.\nSupported values:\n+ `\"UNRECOGNISED\"`\n+ `\"PHYSICAL\"` \n+ `\"DIGITAL\"`\n+ `\"GIFT_CARD\"`\n+ `\"SERVICE\"`", + "optional": true }, + { "name": "custom", + "type": "string", + "doc": "Custom item type.", + "optional": true } ], + "extra": + { "oneOfGroups": + [ { "name": "itemType", + "members": + [ "preset", + "custom" ] } ] }, + "labels": [] }, + { "name": "LineItem", + "locations": + [ { "lineno": 112, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "_id", + "type": "string", + "doc": "Line item ID." }, + { "name": "quantity", + "type": "number", + "doc": "Item quantity.\n\nMin: `1`\nMax: `100000`" }, + { "name": "catalogReference", + "type": "ecom-validations.CatalogReference", + "doc": "Catalog and item reference. Includes IDs for the item and the catalog it came from, as well as further optional info." }, + { "name": "productName", + "type": "ecom-validations.ProductName", + "doc": "Product name.\nFor example, \n+ Stores: `product.name` \n+ Bookings: `service.info.name` \n+ Events: `ticket.name`" }, + { "name": "price", + "type": "ecom-validations.Price", + "doc": "Price of the item **after** catalog-defined discount and line item discounts." }, + { "name": "physicalProperties", + "type": "ecom-validations.PhysicalProperties", + "doc": "Physical properties of the item. When relevant, contains information such as SKU, item weight, and shippability." }, + { "name": "itemType", + "type": "ecom-validations.ItemType", + "doc": "Item type." }, + { "name": "subscriptionOptionInfo", + "type": "ecom-validations.SubscriptionOptionInfo", + "doc": "[Subscription option](https://support.wix.com/en/article/wix-stores-selling-product-subscriptions) information. A subscription is a product that is sold on a recurring basis." } ], + "extra": + { }, + "labels": [] }, + { "name": "LineItemViolation", + "locations": + [ { "lineno": 419, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "name", + "type": "string", + "doc": "Where on the checkout and cart page the violation belonging to a specific line item will be displayed.\n \nSupported values:\n+ `\"LINE_ITEM_DEFAULT\"`: The default location on a checkout and cart page where a line item violation will be displayed. See image in the [introduction](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-validations/introduction)." }, + { "name": "_id", + "type": "string", + "doc": "ID of the line item containing the violation." } ], + "extra": + { }, + "labels": [] }, + { "name": "MerchantDiscount", + "locations": + [ { "lineno": 339, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "ecom-validations.AmountMerchant", + "doc": "Discount value." } ], + "extra": + { }, + "labels": [] }, + { "name": "NameRule", + "locations": + [ { "lineno": 356, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "original", + "type": "string", + "doc": "Original discount rule name (in the site's default language)." }, + { "name": "translated", + "type": "string", + "doc": "Translated discount rule name according to the buyer's language. \nDefault: `original` when not provided." } ], + "extra": + { }, + "labels": [] }, + { "name": "Options", + "locations": + [ { "lineno": 56, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "sourceInfo", + "type": "ecom-validations.SourceInfo", + "doc": "Information about the source of the request." }, + { "name": "validationInfo", + "type": "ecom-validations.ValidationInfo", + "doc": "Information to validate." } ], + "extra": + { }, + "labels": [] }, + { "name": "Other", + "locations": + [ { "lineno": 411, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "name", + "type": "string", + "doc": "Where on the checkout and cart page the violation will be displayed.\n \nSupported values:\n+ `\"OTHER_DEFAULT\"`: The default location on a checkout and cart page where a general (other) violation will be displayed. See image in the [introduction](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-validations/introduction)." } ], + "extra": + { }, + "labels": [] }, + { "name": "PhysicalProperties", + "locations": + [ { "lineno": 158, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "weight", + "type": "number", + "doc": "Line item weight. Measurement unit (KG or LB) is taken from `order.weightUnit`." }, + { "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 this line item is shippable." } ], + "extra": + { }, + "labels": [] }, + { "name": "Price", + "locations": + [ { "lineno": 153, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "string", + "doc": "Amount." } ], + "extra": + { }, + "labels": [] }, + { "name": "PriceSummary", + "locations": + [ { "lineno": 210, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "subtotal", + "type": "ecom-validations.Subtotal", + "doc": "Subtotal of all line items, before discounts and before tax." }, + { "name": "shipping", + "type": "ecom-validations.Shipping", + "doc": "Total shipping price, before discounts and before tax." }, + { "name": "tax", + "type": "ecom-validations.Tax", + "doc": "Total tax." }, + { "name": "discount", + "type": "ecom-validations.Discount", + "doc": "Total calculated discount value." }, + { "name": "total", + "type": "ecom-validations.Total", + "doc": "Total price **after** discounts, gift cards, and tax." }, + { "name": "additionalFees", + "type": "ecom-validations.AdditionalFees", + "doc": "Total additional fees price **before** tax." } ], + "extra": + { }, + "labels": [] }, + { "name": "ProductName", + "locations": + [ { "lineno": 140, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "original", + "type": "string", + "doc": "Original item name in site's default language.\n\nMin: 1 character\nMax: 80 characters" }, + { "name": "translated", + "type": "string", + "doc": "Optional. Translated item name according to buyer language.\n \nDefault: `original` \nMin: 1 character\nMax: 200 characters" } ], + "extra": + { }, + "labels": [] }, + { "name": "SelectedCarrierServiceOption", + "locations": + [ { "lineno": 305, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "code", + "type": "string", + "doc": "Unique identifier of selected option. For example, `\"usps_std_overnight\"`." } ], + "extra": + { }, + "labels": [] }, + { "name": "Shipping", + "locations": + [ { "lineno": 226, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "string", + "doc": "Amount." } ], + "extra": + { }, + "labels": [] }, + { "name": "ShippingAddress", + "locations": + [ { "lineno": 258, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "address", + "type": "ecom-validations.AddressDetails", + "doc": "Address." }, + { "name": "contactDetails", + "type": "ecom-validations.ContactDetails", + "doc": "Contact details." } ], + "extra": + { }, + "labels": [] }, + { "name": "ShippingInfo", + "locations": + [ { "lineno": 300, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "selectedCarrierServiceOption", + "type": "ecom-validations.SelectedCarrierServiceOption", + "doc": "Selected shipping option out of the options allowed for the `region`." } ], + "extra": + { }, + "labels": [] }, + { "name": "SourceInfo", + "locations": + [ { "lineno": 62, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "source", + "type": "string", + "doc": "Source of the request.\n \nSupported values:\n+ `\"CART\"`\n+ `\"CHECKOUT\"`\n+ `\"OTHER\"`" }, + { "name": "purchaseFlowId", + "type": "string", + "doc": "Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order." } ], + "extra": + { }, + "labels": [] }, + { "name": "StreetAddressInfo", + "locations": + [ { "lineno": 275, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "number", + "type": "string", + "doc": "Street number." }, + { "name": "name", + "type": "string", + "doc": "Street name." } ], + "extra": + { }, + "labels": [] }, + { "name": "SubscriptionOptionInfo", + "locations": + [ { "lineno": 178, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "subscriptionSettings", + "type": "ecom-validations.SubscriptionSettings", + "doc": "Subscription option settings." }, + { "name": "title", + "type": "ecom-validations.Title", + "doc": "Subscription option title." }, + { "name": "description", + "type": "ecom-validations.Description", + "doc": "Subscription option description." } ], + "extra": + { }, + "labels": [] }, + { "name": "SubscriptionSettings", + "locations": + [ { "lineno": 185, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "frequency", + "type": "string", + "doc": "Frequency of recurring payments.\n\nSupported values:\n - `\"DAY\"`\n - `\"WEEK\"`\n - `\"MONTH\"`\n - `\"YEAR\"`" }, + { "name": "autoRenewal", + "type": "boolean", + "doc": "Whether subscription is renewed automatically at the end of each period." }, + { "name": "billingCycles", + "type": "integer", + "doc": "Number of billing cycles before subscription ends. Ignored if `autoRenewal` is `true`." } ], + "extra": + { }, + "labels": [] }, + { "name": "Subtotal", + "locations": + [ { "lineno": 221, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "string", + "doc": "Amount." } ], + "extra": + { }, + "labels": [] }, + { "name": "Target", + "locations": + [ { "lineno": 404, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "other", + "type": "ecom-validations.Other", + "doc": "General (other) violation.", + "optional": true }, + { "name": "lineItem", + "type": "ecom-validations.LineItemViolation", + "doc": "Specific line item violation.", + "optional": true } ], + "extra": + { "oneOfGroups": + [ { "name": "violationDisplay", + "members": + [ "other", + "lineItem" ] } ] }, + "labels": [] }, + { "name": "Tax", + "locations": + [ { "lineno": 231, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "string", + "doc": "Amount." } ], + "extra": + { }, + "labels": [] }, + { "name": "Title", + "locations": + [ { "lineno": 198, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "original", + "type": "string", + "doc": "Subscription option name." }, + { "name": "translated", + "type": "string", + "doc": "Translated subscription option name." } ], + "extra": + { }, + "labels": [] }, + { "name": "Total", + "locations": + [ { "lineno": 241, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "string", + "doc": "Amount." } ], + "extra": + { }, + "labels": [] }, + { "name": "ValidationInfo", + "locations": + [ { "lineno": 73, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "buyerDetails", + "type": "ecom-validations.BuyerDetails", + "doc": "Buyer details." }, + { "name": "lineItems", + "type": + { "name": "Array", + "typeParams": + [ "ecom-validations.LineItem" ] }, + "doc": "Line items. Max: 300 line items" }, + { "name": "giftCard", + "type": "ecom-validations.giftCard", + "doc": "Applied gift card details." }, + { "name": "weightUnit", + "type": "string", + "doc": "Weight measurement unit.\n \nSupported values:\n+ `\"UNSPECIFIED_WEIGHT_UNIT\"`\n+ `\"KG\"`\n+ `\"LB\"`\nDefault: Site's weight unit" }, + { "name": "priceSummary", + "type": "ecom-validations.PriceSummary", + "doc": "Price summary." }, + { "name": "billingInfo", + "type": "ecom-validations.BillingInfo", + "doc": "Billing information." }, + { "name": "shippingAddress", + "type": "ecom-validations.ShippingAddress", + "doc": "Shipping address and contact details." }, + { "name": "shippingInfo", + "type": "ecom-validations.ShippingInfo", + "doc": "Shipping information." }, + { "name": "customFields", + "type": "ecom-validations.CustomFields", + "doc": "Custom fields." }, + { "name": "appliedDiscounts", + "type": "ecom-validations.AppliedDiscounts", + "doc": "Applied discounts." } ], + "extra": + { }, + "labels": [] }, + { "name": "ValidationsConfigResponse", + "locations": + [ { "lineno": 24, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "validateInCart", + "type": "boolean", + "doc": "Whether to validate the cart page in addition to the checkout page.\n\nDefault: `false`" } ], + "extra": + { }, + "labels": [] }, + { "name": "Value", + "locations": + [ { "lineno": 368, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "nullValue", + "type": "string", + "doc": "A null value. Supported value: \n+ `\"NULL_VALUE\"`", + "optional": true }, + { "name": "numberValue", + "type": "string", + "doc": "A number value.", + "optional": true }, + { "name": "stringValue", + "type": "string", + "doc": "A string value.", + "optional": true }, + { "name": "boolValue", + "type": "string", + "doc": "A boolean value.", + "optional": true }, + { "name": "structValue", + "type": "ecom-validations.StructValue", + "doc": "A structured value.", + "optional": true }, + { "name": "listValue", + "type": + { "name": "Array", + "typeParams": + [ "ecom-validations.Value" ] }, + "doc": "A repeated `value`.", + "optional": true } ], + "extra": + { "oneOfGroups": + [ { "name": "valueType", + "members": + [ "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" ] } ] }, + "labels": [] }, + { "name": "VatId", + "locations": + [ { "lineno": 290, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "_id", + "type": "string", + "doc": "Buyer's tax ID." }, + { "name": "type", + "type": "string", + "doc": "VAT tax type.\n\nSupported values:\n - `\"CPF\"`: for individual tax payers\n - `\"CNPJ\"`: for corporations" } ], + "extra": + { }, + "labels": [] }, + { "name": "Violation", + "locations": + [ { "lineno": 392, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "severity", + "type": "string", + "doc": "Severity of the violation. The violations are shown on the cart and checkout pages. A warning is displayed as yellow, and allows a site visitor to proceed with caution. An error is displayed as red, and doesn't allow a site visitor to proceed with the eCommerce flow.\n\nSupported values:\n+ `\"WARNING\"`\n+ `\"ERROR\"`" }, + { "name": "target", + "type": "ecom-validations.Target", + "doc": "Target location on a checkout or cart page where the violation will be displayed." }, + { "name": "description", + "type": "string", + "doc": "Violation description. Can include rich text. Only HTTP or HTTPS links in the following format are allowed: `Click me`." } ], + "extra": + { }, + "labels": [] }, + { "name": "giftAmount", + "locations": + [ { "lineno": 107, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "amount", + "type": "string", + "doc": "Amount." } ], + "extra": + { }, + "labels": [] }, + { "name": "giftCard", + "locations": + [ { "lineno": 99, + "filename": "validations.js" } ], + "docs": + { "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "_id", + "type": "string", + "doc": "Gift card ID." }, + { "name": "obfuscatedCode", + "type": "string", + "doc": "Gift card obfuscated code." }, + { "name": "appId", + "type": "string", + "doc": "App ID of the gift card provider." }, + { "name": "amount", + "type": "ecom-validations.giftAmount", + "doc": "Gift card value." } ], + "extra": + { }, + "labels": [] } ], + "extra": + { "customLabels": + [ { "id": "maturity-beta" } ] } } \ No newline at end of file diff --git a/media/img1.png b/media/img1.png new file mode 100644 index 0000000000..f56594e27f Binary files /dev/null and b/media/img1.png differ diff --git a/media/img2.png b/media/img2.png new file mode 100644 index 0000000000..eac7feb43b Binary files /dev/null and b/media/img2.png differ diff --git a/media/img3.png b/media/img3.png new file mode 100644 index 0000000000..7fc2256bd0 Binary files /dev/null and b/media/img3.png differ