> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetValidationViolations

# Package: validations

# Namespace: ValidationsSPI

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/validations/validations-integration-service-plugin/get-validation-violations.md

## Permission Scopes:
Manage eCommerce - all permissions: SCOPE.DC-ECOM-MEGA.MANAGE-ECOM

## Introduction

This method retrieves validation violations from your app.

Wix calls this method when certain actions are performed on a visitor's cart and checkout. For example, when an item is added to the cart, or when a coupon is added to a checkout.
This method validates a visitor's cart and checkout, and returns any validation violations (using the structure provided by Wix eCommerce). Site visitors can see the validation violations in their cart and checkout pages. If there aren't any validation violations, the method returns an object containing an empty list.

> __Notes:__
> + Do not call the Estimate Cart Totals, Estimate Current Cart Totals or Get Checkout methods from your implementation code for Get Validation Violations. Doing so will result in an error.
> + By default, this method only retrieves validation violations from a visitor's checkout. If you want to also retrieve validation violations from a visitor's cart, set the `validateInCart` parameter to `true` in the Ecom Validations Integration's config file.

---

## REST API

### Schema

```
 Method: getValidationViolations
 Description: This method retrieves validation violations from your app.  Wix calls this method when certain actions are performed on a visitor's cart and checkout. For example, when an item is added to the cart, or when a coupon is added to a checkout. This method validates a visitor's cart and checkout, and returns any validation violations (using the structure provided by Wix eCommerce). Site visitors can see the validation violations in their cart and checkout pages. If there aren't any validation violations, the method returns an object containing an empty list.  > __Notes:__ > + Do not call the Estimate Cart Totals, Estimate Current Cart Totals or Get Checkout methods from your implementation code for Get Validation Violations. Doing so will result in an error. > + By default, this method only retrieves validation violations from a visitor's checkout. If you want to also retrieve validation violations from a visitor's cart, set the `validateInCart` parameter to `true` in the Ecom Validations Integration's config file.
 URL: {DEPLOYMENT-URI}/v1/get-violations
 Method: POST
 Method parameters:
   param name: extendedFields | type: ExtendedFields    
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
   param name: sourceInfo | type: SourceInfo    
        - name: source | type: Source | description: Source of the request.  
             - enum:
             -     OTHER: Context cannot be recognized
             -     CART: Called from Ecom's Cart service
             -     CHECKOUT: Called from Ecom's Checkout service
        - name: purchaseFlowId | type: string | description: Persistent GUID that correlates between the various eCommerce elements: cart, checkout, and order.  | validation: format GUID
   param name: validationInfo | type: ValidationInfo | description: ValidationsData is the main entity of ValidationsSPI, which contains all the data required for validations  
        - name: buyerDetails | type: BuyerDetails | description: Buyer details.  
           - name: email | type: string | description: Buyer's email address.  | validation: format EMAIL
           - name: contactId | type: string | description: Contact GUID if one exists.  | validation: format GUID
        - name: lineItems | type: array<LineItem> | description: Line items. Max: 300 line items  | validation: maxItems 300
           - name: id | type: string | description: Line item GUID.  | validation: format GUID
           - name: quantity | type: integer | description: Item quantity. Min: `0` Max: `100000`  | validation: minimum 0, maximum 100000
           - name: catalogReference | type: CatalogReference | description: Catalog and item reference. Includes GUIDs for the item and the catalog it came from, as well as further optional info.  
              - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to.  | validation: minLength 1, maxLength 36
              - name: appId | type: string | description: GUID of the app providing the catalog.  You can get your app's GUID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).  For items from Wix catalogs, the following values always apply: + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`  | validation: minLength 1
              - name: options | type: object | description: Additional item details in `key:value` pairs.  Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.  For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md) or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration.md), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction.md).  
           - name: productName | type: ProductName | description: Product name. For example, + Stores: `product.name` + Bookings: `service.info.name` + Events: `ticket.name`  
              - name: original | type: string | description: __Required.__ Item name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  Min: 1 character. Max: 200 characters.  | validation: minLength 1, maxLength 200
              - name: translated | type: string | description: Item name translated into the buyer's language.  Min: 1 character. Max: 400 characters. Default: Same as `original`.  | validation: minLength 1, maxLength 400
           - name: price | type: MultiCurrencyPrice | description: Price of the item **after** catalog-defined discount and line item discounts.  
              - name: amount | type: string | description: Amount.  | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
           - name: physicalProperties | type: PhysicalProperties | description: Physical properties of the item. When relevant, contains information such as SKU, item weight, and shippability.  
              - name: weight | type: number | description: Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request.  | validation: format double
              - name: sku | type: string | description: Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku).  | validation: maxLength 40
              - name: shippable | type: boolean | description: Whether this line item is shippable.  
              - name: productDimensions | type: Dimensions | description: Product dimensions (length, width, height of the physical product).  
                 - name: length | type: string | description: Length. Measurement unit is handled at the system level (metric/imperial).  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":6}
                 - name: width | type: string | description: Width. Measurement unit is handled at the system level (metric/imperial).  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":6}
                 - name: height | type: string | description: Height. Measurement unit is handled at the system level (metric/imperial).  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":6}
                 - name: unit | type: DimensionsUnit | description: Unit of measurement for dimensions (length, width, height).  
                         - enum:
                         -     UNKNOWN_DIMENSIONS_UNIT: 
                         -     MM: Millimeters.
                         -     CM: Centimeters.
                         -     M: Meters.
                         -     IN: Inches.
                         -     FT: Feet.
                         -     YD: Yards.
              - name: packageDimensions | type: Dimensions | description: Package dimensions (length, width, height of the shipping package).  
           - name: itemType | type: ItemType | description: Item type.  
              - ONE-OF: 
                 - name: preset | type: ItemTypePreset | description: Preset item type.  
                         - enum: UNRECOGNISED, PHYSICAL, DIGITAL, GIFT_CARD, SERVICE
                 - name: custom | type: string | description: Custom item type. When none of the preset types are suitable, specifies the custom type.  
           - name: subscriptionOptionInfo | type: SubscriptionOptionInfo | description: [Subscription option](https://dev.wix.com/api/rest/wix-stores/subscription-options/introduction) information. A subscription is a product that is sold on a recurring basis.  
              - name: subscriptionSettings | type: SubscriptionSettings | description: Subscription option settings.  
                 - name: frequency | type: SubscriptionFrequency | description: Frequency of recurring payment.  
                         - enum: UNDEFINED, DAY, WEEK, MONTH, YEAR
                 - name: interval | type: integer | description: Interval of recurring payment.  Default: `1`. If SubscriptionFrequency is Day the minimum interval is 7  | validation: minimum 1, maximum 3650, format int32
                 - name: autoRenewal | type: boolean | description: Whether subscription is renewed automatically at the end of each period.  
                 - name: billingCycles | type: integer | description: Number of billing cycles before subscription ends. Ignored if `autoRenewal` is `true`.  | validation: minimum 1, format int32
                 - name: enableCustomerCancellation | type: boolean | description: Whether to allow the customer to cancel the subscription.  
                 - name: freeTrialPeriod | type: FreeTrialPeriod | description: Period until first cycle starts. If applied payNow will be 0 If None => no free trial  
                    - name: frequency | type: SubscriptionFrequency | description: Frequency of period. Values: DAY, WEEK, MONTH, YEAR  
                    - name: interval | type: integer | description: Number of frequency units in the free trial period. For example, frequency `MONTH` with interval `3` means a 3-month free trial.  | validation: minimum 1, maximum 999
                 - name: startDate | type: string | description: Date and time the subscription starts.  The first charge happens when the order is placed. When `freeTrialPeriod` is set, the first charge happens when the free trial ends.  | validation: format date-time
                 - name: billingSettings | type: BillingSettings | description: Billing configuration for recurring charges.  
                    - name: anchorDay | type: integer | description: Day of the month that recurring charges fall on. For example, `15` to charge on the 15th of each month.  Used only when the subscription's `frequency` is `MONTH` and `interval` is `1`.  | validation: minimum 1, maximum 28, format int32
                 - name: cyclePriceOverrides | type: array<CyclePriceOverride> | description: Unit prices for specified billing cycles of the subscription. Cycles that no entry covers are charged the item's `price`.  When `billingCycles` is set, every entry must end on or before the last billing cycle.  | validation: maxItems 1
                    - name: cycleFrom | type: integer | description: __Required.__ First billing cycle the price applies to. The first paid cycle of the subscription is `1`. A free trial period, if any, is cycle `0`.  | validation: minimum 1, maximum 1
                    - name: numberOfCycles | type: integer | description: __Required.__ Number of consecutive billing cycles the price applies to, starting at `cycleFrom`.  | validation: minimum 1, maximum 1, format int32
                    - name: price | type: string | description: __Required.__ Unit price for the cycles this entry covers, in the item's currency. Can be higher than, lower than, or equal to the item's `price`.  | validation: decimalValue {"gte":"0","lte":"1000000000000000","maxScale":4}
              - name: title | type: Title | description: Subscription option title.  
                 - name: original | type: string | description: Subscription option name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  | validation: minLength 1, maxLength 150
                 - name: translated | type: string | description: Subscription option name translated into the buyer's language.  Default: Same as `original`.  | validation: minLength 1, maxLength 150
              - name: description | type: Description | description: Subscription option description.  
                 - name: original | type: string | description: Subscription option description.  | validation: maxLength 500
                 - name: translated | type: string | description: Translated subscription option description.  | validation: maxLength 500
           - name: pricesBreakdown | type: LineItemPricesData | description: Price breakdown for this line item.  
              - name: totalPriceAfterTax | type: MultiCurrencyPrice | description: Total price after discounts and after tax.  
              - name: totalPriceBeforeTax | type: MultiCurrencyPrice | description: Total price after discounts, and before tax.  
              - name: taxDetails | type: ItemTaxFullDetails | description: Tax details.  
                 - name: taxableAmount | type: MultiCurrencyPrice | description: The portion of the total amount of this estimate that was taxable.  
                 - name: totalTax | type: MultiCurrencyPrice | description: Calculated tax, based on `taxable_amount`.  
                 - name: isTaxIncluded | type: boolean | description: Indicates whether the price already includes tax.  
                 - name: taxBreakdown | type: array<TaxBreakdown> | description: A detailed description of all the tax authorities applied on this item.  | validation: minItems 0, maxItems 1000
                    - name: jurisdiction | type: string | description: The name of the jurisdiction to which this tax detail applies. For example, "New York" or "Quebec".  | validation: maxLength 200
                    - name: nonTaxableAmount | type: MultiCurrencyPrice | description: The amount of this line item price that was considered nontaxable. (Decimal value)  
                    - name: rate | type: string | description: The rate at which this tax detail was calculated, e.g 0.1000 signifies 10% tax and 2.0000 signifies 200% tax. (Decimal value)  | validation: decimalValue {"maxScale":6}
                    - name: taxAmount | type: MultiCurrencyPrice | description: The amount of tax estimated for this line item. (Decimal value)  
                    - name: taxableAmount | type: MultiCurrencyPrice | description: The taxable amount of this line item.  
                    - name: taxType | type: string | description: The type of tax that was calculated. Depends on the jurisdiction's tax laws. For example, "Sales Tax", "Income Tax", "Value Added Tax", etc.  | validation: maxLength 200
                    - name: taxName | type: string | description: The name of the tax against which this tax amount was calculated. For example, "NY State Sales Tax", "Quebec GST", etc. This name should be explicit enough to allow the merchant to understand what tax was calculated.  | validation: maxLength 200
                    - name: jurisdictionType | type: JurisdictionType | description: The type of the jurisdiction in which this tax detail applies.  
                             - enum:
                             -     UNDEFINED: Undefined jurisdiction type.
                             -     COUNTRY: Country jurisdiction.
                             -     STATE: State jurisdiction.
                             -     COUNTY: County jurisdiction.
                             -     CITY: City jurisdiction.
                             -     SPECIAL: Special jurisdiction.
              - name: totalDiscount | type: MultiCurrencyPrice | description: Total discount applied for the line item.  
              - name: price | type: MultiCurrencyPrice | description: Catalog price **after** catalog-defined discount and automatic discounts.  
              - name: priceBeforeDiscounts | type: MultiCurrencyPrice | description: Item price **before** automatic discounts, coupons, and global discounts, **after** catalog-defined discount. Defaults to `price` when not provided.  
              - name: lineItemPrice | type: MultiCurrencyPrice | description: Total price **after** catalog-defined discount and automatic discounts, taking line item's quantity into account.  
              - name: fullPrice | type: MultiCurrencyPrice | description: Item price **before** all discounts. Defaults to `price` when not provided.  
        - name: giftCard | type: GiftCard | description: Applied gift card details.  >**Note:** Gift cards are supported through the Wix UI, though the service plugin is not currently available. Learn more about [Wix Gift Cards](https://support.wix.com/en/article/wix-stores-setting-up-wix-gift-cards).  
           - name: obfuscatedCode | type: string | description: Gift card obfuscated code.  
           - name: amount | type: MultiCurrencyPrice | description: Gift card value.  
           - name: appId | type: string | description: App GUID of the gift card provider.  | validation: format GUID
        - name: weightUnit | type: WeightUnit | description: Weight measurement unit. Default: Site's weight unit  
             - enum:
             -     UNSPECIFIED_WEIGHT_UNIT: Weight unit can't be classified due to an error.
             -     KG: Kilograms.
             -     LB: Pounds.
        - name: priceSummary | type: PriceSummary | description: Price summary.  
           - name: subtotal | type: MultiCurrencyPrice | description: Subtotal of all line items, before discounts and before tax.  
           - name: shipping | type: MultiCurrencyPrice | description: Total shipping price, before discounts and before tax.  
           - name: tax | type: MultiCurrencyPrice | description: Total tax.  
           - name: discount | type: MultiCurrencyPrice | description: Total calculated discount value.  
           - name: total | type: MultiCurrencyPrice | description: Total price **after** discounts, gift cards, and tax.  
           - name: additionalFees | type: MultiCurrencyPrice | description: Total additional fees price **before** tax.  
        - name: billingInfo | type: AddressWithContact | description: Billing information.  
           - name: address | type: Address | description: Address.  
              - name: country | type: string | description: Two-letter country code in [ISO-3166 alpha-2](https://www.iso.org/obp/ui/#search/code/) format.  | validation: format COUNTRY
              - name: subdivision | type: string | description: Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://www.iso.org/standard/72483.html) format.  | validation: maxLength 50
              - name: city | type: string | description: City name.  | validation: maxLength 50
              - name: postalCode | type: string | description: Postal or zip code.  | validation: maxLength 50
              - name: streetAddress | type: StreetAddress | description: Street address.  
                 - name: number | type: string | description: Street number.  
                 - name: name | type: string | description: Street name.  
              - name: addressLine | type: string | description: Main address line (usually street name and number).  | validation: maxLength 150
              - name: addressLine2 | type: string | description: Free text providing more detailed address info. Usually contains apt, suite, floor.  | validation: maxLength 100
              - name: geocode | type: AddressLocation | description: Geocode object containing latitude and longitude coordinates.  
                 - name: latitude | type: number | description: Address latitude.  | validation: format double
                 - name: longitude | type: number | description: Address longitude.  | validation: format double
           - name: contactDetails | type: FullAddressContactDetails | description: Contact details.  
              - name: firstName | type: string | description: First name.  | validation: maxLength 100
              - name: lastName | type: string | description: Last name.  | validation: maxLength 100
              - name: phone | type: string | description: Phone number.  | validation: format PHONE
              - name: company | type: string | description: Company name.  | validation: maxLength 1000
              - name: vatId | type: VatId | description: Tax information (for Brazil only). If GUID is provided, `vatId.type` must also be set, `UNSPECIFIED` is not allowed.  
                 - name: id | type: string | description: Customer's tax GUID.  
                 - name: type | type: VatType | description: Tax type.  Supported values: + `CPF`: for individual tax payers + `CNPJ`: for corporations  
                         - enum:
                         -     UNSPECIFIED: 
                         -     CPF: CPF - for individual tax payers.
                         -     CNPJ: CNPJ - for corporations
        - name: shippingAddress | type: AddressWithContact | description: Shipping address and contact details.  
        - name: shippingInfo | type: ShippingInfo | description: Shipping information.  
           - name: selectedCarrierServiceOption | type: SelectedCarrierServiceOption | description: Selected option out of the options allowed for the `region`.  
              - name: code | type: string | description: Unique identifier of selected option. For example, `usps_std_overnight`.  | validation: maxLength 100
              - name: title | type: string | description: Title of the option, such as USPS Standard Overnight Delivery (in the requested locale). For example, "Standard" or "First-Class Package International".  | validation: maxLength 250
              - name: cost | type: SelectedCarrierServiceOptionPrices | description: Shipping costs.  
                 - name: totalPriceAfterTax | type: MultiCurrencyPrice | description: Total shipping price, after discount and after tax.  
                 - name: totalPriceBeforeTax | type: MultiCurrencyPrice | description: Total price of shipping after discounts (when relevant), and before tax.  
                 - name: taxDetails | type: ItemTaxFullDetails | description: Tax details.  
                 - name: totalDiscount | type: MultiCurrencyPrice | description: Shipping discount before tax.  
                 - name: price | type: MultiCurrencyPrice | description: Shipping price before discount and before tax.  
              - name: deliveryAllocations | type: array<DeliveryAllocation> | description: Delivery solution allocations to different delivery carriers and delivery regions  | validation: maxItems 300
                 - name: deliveryCarrier | type: Carrier | description: The delivery option's carrier details, could be multiple if the delivery option is a combination of multiple carriers  
                    - name: appId | type: string | description: The carrier app id  | validation: format GUID
                    - name: code | type: string | description: Unique code that acts as an GUID for a shipping rate. For example, `"usps_std_overnight"`.  | validation: maxLength 250
                 - name: deliveryRegion | type: Region | description: The delivery region that are relevant for this delivery solution.  
                    - name: id | type: string | description: The delivery region id.  | validation: format GUID
                    - name: name | type: string | description: The delivery region name.  | validation: maxLength 100
                 - name: applicableLineItems | type: ApplicableLineItems | description: Populated if the delivery solution is a partially supplied by this carrier.  
                    - name: lineItemIds | type: array<string> | description: Line items that the delivery solution is for.  | validation: maxItems 300, minLength 1, maxLength 100
              - name: partial | type: boolean | description: If the delivery solution is a partial and doesn't apply to all items.  
              - name: deliveryTimeSlot | type: DeliveryTimeSlot | description: Expected delivery time slot.  
                 - name: from | type: string | description: starting time of the delivery time slot  | validation: format date-time
                 - name: to | type: string | description: ending time of the delivery time slot  | validation: format date-time
        - name: customFields | type: CustomFields | description: Custom fields.  
           - name: fields | type: array<CustomField> | description: List of custom fields  | validation: minItems 0, maxItems 50
              - name: value | type: Value | description: Custom field value.  
                 - ONE-OF: 
                    - name: nullValue | type:  | description:   
                    - name: numberValue | type: number | description:   
                    - name: stringValue | type: string | description:   
                    - name: boolValue | type: boolean | description:   
                    - name: structValue | type: object | description:   
                    - name: listValue | type: ListValue | description:   
                       - name: values | type: array<Value> | description:   
              - name: title | type: string | description: Custom field title.  | validation: minLength 1, maxLength 500
              - name: translatedTitle | type: string | description: Translated custom field title.  | validation: minLength 1, maxLength 500
        - name: appliedDiscounts | type: array<AppliedDiscount> | description: Applied discounts.  | validation: maxItems 320
           - ONE-OF: 
              - name: coupon | type: Coupon | description: Coupon details.  
                 - name: id | type: string | description: Coupon GUID.  
                 - name: code | type: string | description: Coupon code.  
                 - name: name | type: string | description: Coupon name.  
                 - name: amount | type: string | description:   | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
              - name: merchantDiscount | type: MerchantDiscount | description: Merchant discount.  
                 - name: amount | type: string | description:   | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
              - name: discountRule | type: DiscountRule | description: Discount rule.  
                 - name: id | type: string | description: Discount rule GUID.  | validation: format GUID
                 - name: name | type: DiscountRuleName | description: Discount rule name.  
                    - name: original | type: string | description: Original discount rule name (in site's default language).  | validation: minLength 1, maxLength 256
                    - name: translated | type: string | description: Translated discount rule name according to buyer language. Defaults to `original` when not provided.  | validation: minLength 1, maxLength 500
                 - name: amount | type: string | description:   | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
           - name: discountType | type: DiscountType | description: Discount type.  
                 - enum:
                 -     GLOBAL: Global discount.
                 -     SPECIFIC_ITEMS: Discount for specific items.
                 -     SHIPPING: Shipping discount.
           - name: lineItemIds | type: array<string> | description: IDs of the line items the discount applies to.  | validation: format GUID
        - name: externalReference | type: ExternalReference | description: References to an external app and resource associated with this checkout. Used for integration and tracking across different platforms.  
           - name: appId | type: string | description: GUID of the app associated with the purchase flow. For example, the Wix Pay Links app GUID.  | validation: format GUID, immutable
           - name: resourceId | type: string | description: Reference to an external resource GUID. Used to link the purchase flow to a specific entity in an external system. For example, a Wix Pay Link GUID.  | validation: minLength 1, maxLength 100, immutable
        - name: sitePaymentMethodTypeId | type: string | description: GUID of the site payment method type the customer selected to pay with. Learn more about the [Site Payment Method Types API](https://dev.wix.com/docs/api-reference/business-management/payments/site-payment-method-types/introduction.md).  Available only when the customer selects a payment method during the purchase flow.  | validation: format GUID
 Return type: GetValidationViolationsResponse
  - name: violations | type: array<Violation> | description: List of validation violations.  
     - name: severity | type: Severity | description: 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.  
         - enum:
         -     WARNING: The user is allowed to move forward in the flow.
         -     ERROR: The user is blocked from moving forward in the flow. For example, if callerContext is CART - moving to checkout is blocked. if callerContext is CHECKOUT, placing an order is blocked.
     - name: target | type: Target | description: Target location on a checkout or cart page where the violation will be displayed.  
        - ONE-OF: 
           - name: other | type: Other | description: General (other) violation.  
              - name: name | type: NameInOther | description: Location on a checkout or a cart page where a general (other) violation will be displayed.  
                     - enum:
                     -     OTHER_DEFAULT: Default location, in case no specific location is specified.
           - name: lineItem | type: LineItem | description: Specific line item violation.  
              - name: name | type: NameInLineItem | description: Location on a checkout or a cart page where the specific line item violation will be displayed.  
                     - enum:
                     -     LINE_ITEM_DEFAULT: Default location, in case no specific location is specified.
              - name: id | type: string | description: GUID of the line item containing the violation.  
     - name: description | type: string | description: Violation description. Can include rich text. Only HTTP or HTTPS links in the following format are allowed: `<a href="https://www.wix.com">Click me</a>`.  | validation: minLength 1, maxLength 1000


```

### Examples

### Get Validation Violations
```curl
curl -X POST https://provider.example.com/v1/get-violations \
-H 'user-agent: Wix' \
-H 'accept-encoding: gzip, deflate' \
-H 'content-type: text/plain; charset=utf-8' \
-d '{
  sourceInfo: {
    source: 'CART',
    purchaseFlowId: 'a22ebad0-11ef-4a4d-a567-691fa7cb264c'
  },
  validationInfo: {
    appliedDiscounts: [
      {
        lineItemIds: [],
        discountType: 'GLOBAL',
        coupon: {
          id: '435409da-d374-4c44-b08b-6c703c546960',
          code: 'couponCode',
          name: 'couponName'
        }
      }
    ],
    billingInfo: {
      address: {
        country: 'USA',
        subdivision: 'US-California',
        city: 'Los Angeles',
        postalCode: '123456'
      },
      contactDetails: {
        firstName: 'John',
        lastName: 'Doe',
        phone: '12345678',
        company: 'Wix',
        vatId: {
          id: 'a35409de-d374-4c4b-bf8b-6c703c5b6960',
          type: 'CPF'
        }
      }
    },
    buyerDetails: {
      contactId: 'f463b4ee-0545-45ac-a273-23bf02d38a07',
      email: 'Johnne@wix.com'
    },
    customFields: {
      fields: [
        {
          name: 'John',
          title: 'Name',
          translatedTitle: '名前'
        }
      ]
    },
    giftCard: {
      id: 'e463b4ee-0145-45ac-a263-23bf02d38a07',
      appId: '215238eb-22a5-4c36-9e7b-e7c08025e04e',
      amount: {
        amount: '2'
      }
    },
    lineItems: [
      {
        catalogReference: {
          appId: '215238eb-22a5-4c36-9e7b-e7c08025e04e',
          catalogItemId: 'e35409da-d374-4c4b-b08b-6c703c5b6960'
        },
        id: '00000000-0000-0000-0000-000000000001',
        itemType: {
          preset: 'PHYSICAL'
        },
        physicalProperties: {
          shippable: true,
          sku: '',
          weight: 11
        },
        price: {
          amount: '1'
        },
        productName: {
          original: 'Cute Silk Worm',
          translated: 'Cute Silk Worm'
        },
        quantity: 4
      },
      {
        catalogReference: {
          appId: '215238eb-22a5-4c36-9e7b-e7c08025e04e',
          catalogItemId: '74bfa1c0-ce2a-49b7-8cd8-a4c0e0b2af6e'
        },
        id: '00000000-0000-0000-0000-000000000002',
        itemType: {
          preset: 'PHYSICAL'
        },
        physicalProperties: {
          shippable: true,
          sku: '',
          weight: '12'
        },
        price: {
          amount: '600'
        },
        productName: {
          original: 'Tea Leaves',
          translated: 'Tea Leaves'
        },
        quantity: 50
      }
    ],
    priceSummary: {
      additionalFees: {
        amount: '0'
      },
      discount: {
        amount: '0'
      },
      shipping: {
        amount: '0.41'
      },
      subtotal: {
        amount: '3.72'
      },
      tax: {
        amount: '0.87'
      },
      total: {
        amount: '5.00'
      }
    },
    shippingAddress: {
      address: {
        country: 'USA',
        subdivision: 'US-California',
        city: 'Los Angeles',
        postalCode: '123456'
      },
      contactDetails: {
        firstName: 'John',
        lastName: 'Doe',
        phone: '12345678',
        company: 'Wix',
        vatId: {
          id: 'a35409de-d374-4c4b-bf8b-6c703c5b6960',
          type: 'CPF'
        }
      }
    },
    shippingInfo: {
      selectedCarrierServiceOption: {
        code: '8d782b64-bda4-93f6-d9c4-e40b497b0ec3'
      },
      weightUnit: 'KG'
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.validations.getValidationViolations(request, metadata)
 Description: This method retrieves validation violations from your app.  Wix calls this method when certain actions are performed on a visitor's cart and checkout. For example, when an item is added to the cart, or when a coupon is added to a checkout. This method validates a visitor's cart and checkout, and returns any validation violations (using the structure provided by Wix eCommerce). Site visitors can see the validation violations in their cart and checkout pages. If there aren't any validation violations, the method returns an object containing an empty list.  > __Notes:__ > + Do not call the Estimate Cart Totals, Estimate Current Cart Totals or Get Checkout methods from your implementation code for Get Validation Violations. Doing so will result in an error. > + By default, this method only retrieves validation violations from a visitor's checkout. If you want to also retrieve validation violations from a visitor's cart, set the `validateInCart` parameter to `true` in the Ecom Validations Integration's config file.
 Method parameters:
   param name: request | type: GetValidationViolationsRequest    
        - name: sourceInfo | type: SourceInfo | description: Information about the source of the request.  
           - name: source | type: Source | description: Source of the request.  
                 - enum:
                 -     OTHER: Context cannot be recognized
                 -     CART: Called from Ecom's Cart service
                 -     CHECKOUT: Called from Ecom's Checkout service
           - name: purchaseFlowId | type: string | description: Persistent GUID that correlates between the various eCommerce elements: cart, checkout, and order.  | validation: format GUID
        - name: validationInfo | type: ValidationInfo | description: Information to validate.  
           - name: buyerDetails | type: BuyerDetails | description: Buyer details.  
              - name: email | type: string | description: Buyer's email address.  | validation: format EMAIL
              - name: contactId | type: string | description: Contact GUID if one exists.  | validation: format GUID
           - name: lineItems | type: array<LineItem> | description: Line items. Max: 300 line items  | validation: maxItems 300
              - name: _id | type: string | description: Line item GUID.  | validation: format GUID
              - name: quantity | type: integer | description: Item quantity. Min: `0` Max: `100000`  | validation: minimum 0, maximum 100000
              - name: catalogReference | type: CatalogReference | description: Catalog and item reference. Includes GUIDs for the item and the catalog it came from, as well as further optional info.  
                 - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to.  | validation: minLength 1, maxLength 36
                 - name: appId | type: string | description: GUID of the app providing the catalog.  You can get your app's GUID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).  For items from Wix catalogs, the following values always apply: + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`  | validation: minLength 1
                 - name: options | type: object | description: Additional item details in `key:value` pairs.  Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.  For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md) or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration.md), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction.md).  
              - name: productName | type: ProductName | description: Product name. For example, + Stores: `product.name` + Bookings: `service.info.name` + Events: `ticket.name`  
                 - name: original | type: string | description: __Required.__ Item name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  Min: 1 character. Max: 200 characters.  | validation: minLength 1, maxLength 200
                 - name: translated | type: string | description: Item name translated into the buyer's language.  Min: 1 character. Max: 400 characters. Default: Same as `original`.  | validation: minLength 1, maxLength 400
              - name: price | type: MultiCurrencyPrice | description: Price of the item **after** catalog-defined discount and line item discounts.  
                 - name: amount | type: string | description: Amount.  | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
              - name: physicalProperties | type: PhysicalProperties | description: Physical properties of the item. When relevant, contains information such as SKU, item weight, and shippability.  
                 - name: weight | type: number | description: Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request.  
                 - name: sku | type: string | description: Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku).  | validation: maxLength 40
                 - name: shippable | type: boolean | description: Whether this line item is shippable.  
                 - name: productDimensions | type: Dimensions | description: Product dimensions (length, width, height of the physical product).  
                    - name: length | type: string | description: Length. Measurement unit is handled at the system level (metric/imperial).  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":6}
                    - name: width | type: string | description: Width. Measurement unit is handled at the system level (metric/imperial).  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":6}
                    - name: height | type: string | description: Height. Measurement unit is handled at the system level (metric/imperial).  | validation: decimalValue {"gte":"0","lte":"999999999","maxScale":6}
                    - name: unit | type: DimensionsUnit | description: Unit of measurement for dimensions (length, width, height).  
                             - enum:
                             -     UNKNOWN_DIMENSIONS_UNIT: 
                             -     MM: Millimeters.
                             -     CM: Centimeters.
                             -     M: Meters.
                             -     IN: Inches.
                             -     FT: Feet.
                             -     YD: Yards.
                 - name: packageDimensions | type: Dimensions | description: Package dimensions (length, width, height of the shipping package).  
              - name: itemType | type: ItemType | description: Item type.  
                 - ONE-OF: 
                    - name: preset | type: ItemTypePreset | description: Preset item type.  
                             - enum: UNRECOGNISED, PHYSICAL, DIGITAL, GIFT_CARD, SERVICE
                    - name: custom | type: string | description: Custom item type. When none of the preset types are suitable, specifies the custom type.  
              - name: subscriptionOptionInfo | type: SubscriptionOptionInfo | description: [Subscription option](https://dev.wix.com/api/rest/wix-stores/subscription-options/introduction) information. A subscription is a product that is sold on a recurring basis.  
                 - name: subscriptionSettings | type: SubscriptionSettings | description: Subscription option settings.  
                    - name: frequency | type: SubscriptionFrequency | description: Frequency of recurring payment.  
                             - enum: UNDEFINED, DAY, WEEK, MONTH, YEAR
                    - name: interval | type: integer | description: Interval of recurring payment.  Default: `1`. If SubscriptionFrequency is Day the minimum interval is 7  | validation: minimum 1, maximum 3650, format int32
                    - name: autoRenewal | type: boolean | description: Whether subscription is renewed automatically at the end of each period.  
                    - name: billingCycles | type: integer | description: Number of billing cycles before subscription ends. Ignored if `autoRenewal` is `true`.  | validation: minimum 1, format int32
                    - name: enableCustomerCancellation | type: boolean | description: Whether to allow the customer to cancel the subscription.  
                    - name: freeTrialPeriod | type: FreeTrialPeriod | description: Period until first cycle starts. If applied payNow will be 0 If None => no free trial  
                       - name: frequency | type: SubscriptionFrequency | description: Frequency of period. Values: DAY, WEEK, MONTH, YEAR  
                       - name: interval | type: integer | description: Number of frequency units in the free trial period. For example, frequency `MONTH` with interval `3` means a 3-month free trial.  | validation: minimum 1, maximum 999
                    - name: startDate | type: Date | description: Date and time the subscription starts.  The first charge happens when the order is placed. When `freeTrialPeriod` is set, the first charge happens when the free trial ends.  
                    - name: billingSettings | type: BillingSettings | description: Billing configuration for recurring charges.  
                       - name: anchorDay | type: integer | description: Day of the month that recurring charges fall on. For example, `15` to charge on the 15th of each month.  Used only when the subscription's `frequency` is `MONTH` and `interval` is `1`.  | validation: minimum 1, maximum 28, format int32
                    - name: cyclePriceOverrides | type: array<CyclePriceOverride> | description: Unit prices for specified billing cycles of the subscription. Cycles that no entry covers are charged the item's `price`.  When `billingCycles` is set, every entry must end on or before the last billing cycle.  | validation: maxItems 1
                       - name: cycleFrom | type: integer | description: __Required.__ First billing cycle the price applies to. The first paid cycle of the subscription is `1`. A free trial period, if any, is cycle `0`.  | validation: minimum 1, maximum 1
                       - name: numberOfCycles | type: integer | description: __Required.__ Number of consecutive billing cycles the price applies to, starting at `cycleFrom`.  | validation: minimum 1, maximum 1, format int32
                       - name: price | type: string | description: __Required.__ Unit price for the cycles this entry covers, in the item's currency. Can be higher than, lower than, or equal to the item's `price`.  | validation: decimalValue {"gte":"0","lte":"1000000000000000","maxScale":4}
                 - name: title | type: Title | description: Subscription option title.  
                    - name: original | type: string | description: Subscription option name in the site's default language as defined in the [request envelope](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions.md#request-envelope).  | validation: minLength 1, maxLength 150
                    - name: translated | type: string | description: Subscription option name translated into the buyer's language.  Default: Same as `original`.  | validation: minLength 1, maxLength 150
                 - name: description | type: Description | description: Subscription option description.  
                    - name: original | type: string | description: Subscription option description.  | validation: maxLength 500
                    - name: translated | type: string | description: Translated subscription option description.  | validation: maxLength 500
              - name: pricesBreakdown | type: LineItemPricesData | description: Price breakdown for this line item.  
                 - name: totalPriceAfterTax | type: MultiCurrencyPrice | description: Total price after discounts and after tax.  
                 - name: totalPriceBeforeTax | type: MultiCurrencyPrice | description: Total price after discounts, and before tax.  
                 - name: taxDetails | type: ItemTaxFullDetails | description: Tax details.  
                    - name: taxableAmount | type: MultiCurrencyPrice | description: The portion of the total amount of this estimate that was taxable.  
                    - name: totalTax | type: MultiCurrencyPrice | description: Calculated tax, based on `taxable_amount`.  
                    - name: isTaxIncluded | type: boolean | description: Indicates whether the price already includes tax.  
                    - name: taxBreakdown | type: array<TaxBreakdown> | description: A detailed description of all the tax authorities applied on this item.  | validation: minItems 0, maxItems 1000
                       - name: jurisdiction | type: string | description: The name of the jurisdiction to which this tax detail applies. For example, "New York" or "Quebec".  | validation: maxLength 200
                       - name: nonTaxableAmount | type: MultiCurrencyPrice | description: The amount of this line item price that was considered nontaxable. (Decimal value)  
                       - name: rate | type: string | description: The rate at which this tax detail was calculated, e.g 0.1000 signifies 10% tax and 2.0000 signifies 200% tax. (Decimal value)  | validation: decimalValue {"maxScale":6}
                       - name: taxAmount | type: MultiCurrencyPrice | description: The amount of tax estimated for this line item. (Decimal value)  
                       - name: taxableAmount | type: MultiCurrencyPrice | description: The taxable amount of this line item.  
                       - name: taxType | type: string | description: The type of tax that was calculated. Depends on the jurisdiction's tax laws. For example, "Sales Tax", "Income Tax", "Value Added Tax", etc.  | validation: maxLength 200
                       - name: taxName | type: string | description: The name of the tax against which this tax amount was calculated. For example, "NY State Sales Tax", "Quebec GST", etc. This name should be explicit enough to allow the merchant to understand what tax was calculated.  | validation: maxLength 200
                       - name: jurisdictionType | type: JurisdictionType | description: The type of the jurisdiction in which this tax detail applies.  
                                 - enum:
                                 -     UNDEFINED: Undefined jurisdiction type.
                                 -     COUNTRY: Country jurisdiction.
                                 -     STATE: State jurisdiction.
                                 -     COUNTY: County jurisdiction.
                                 -     CITY: City jurisdiction.
                                 -     SPECIAL: Special jurisdiction.
                 - name: totalDiscount | type: MultiCurrencyPrice | description: Total discount applied for the line item.  
                 - name: price | type: MultiCurrencyPrice | description: Catalog price **after** catalog-defined discount and automatic discounts.  
                 - name: priceBeforeDiscounts | type: MultiCurrencyPrice | description: Item price **before** automatic discounts, coupons, and global discounts, **after** catalog-defined discount. Defaults to `price` when not provided.  
                 - name: lineItemPrice | type: MultiCurrencyPrice | description: Total price **after** catalog-defined discount and automatic discounts, taking line item's quantity into account.  
                 - name: fullPrice | type: MultiCurrencyPrice | description: Item price **before** all discounts. Defaults to `price` when not provided.  
           - name: giftCard | type: GiftCard | description: Applied gift card details.  >**Note:** Gift cards are supported through the Wix UI, though the service plugin is not currently available. Learn more about [Wix Gift Cards](https://support.wix.com/en/article/wix-stores-setting-up-wix-gift-cards).  
              - name: obfuscatedCode | type: string | description: Gift card obfuscated code.  
              - name: amount | type: MultiCurrencyPrice | description: Gift card value.  
              - name: appId | type: string | description: App GUID of the gift card provider.  | validation: format GUID
           - name: weightUnit | type: WeightUnit | description: Weight measurement unit. Default: Site's weight unit  
                 - enum:
                 -     UNSPECIFIED_WEIGHT_UNIT: Weight unit can't be classified due to an error.
                 -     KG: Kilograms.
                 -     LB: Pounds.
           - name: priceSummary | type: PriceSummary | description: Price summary.  
              - name: subtotal | type: MultiCurrencyPrice | description: Subtotal of all line items, before discounts and before tax.  
              - name: shipping | type: MultiCurrencyPrice | description: Total shipping price, before discounts and before tax.  
              - name: tax | type: MultiCurrencyPrice | description: Total tax.  
              - name: discount | type: MultiCurrencyPrice | description: Total calculated discount value.  
              - name: total | type: MultiCurrencyPrice | description: Total price **after** discounts, gift cards, and tax.  
              - name: additionalFees | type: MultiCurrencyPrice | description: Total additional fees price **before** tax.  
           - name: billingInfo | type: AddressWithContact | description: Billing information.  
              - name: address | type: Address | description: Address.  
                 - name: streetAddress | type: StreetAddress | description: none  
                    - name: name | type: string | description: none  
                    - name: number | type: string | description: none  
                 - name: city | type: string | description: none  
                 - name: subdivision | type: string | description: none  
                 - name: country | type: string | description: none  
                 - name: postalCode | type: string | description: none  
                 - name: addressLine2 | type: string | description: none  
              - name: contactDetails | type: FullAddressContactDetails | description: Contact details.  
                 - name: firstName | type: string | description: First name.  | validation: maxLength 100
                 - name: lastName | type: string | description: Last name.  | validation: maxLength 100
                 - name: phone | type: string | description: Phone number.  | validation: format PHONE
                 - name: company | type: string | description: Company name.  | validation: maxLength 1000
                 - name: vatId | type: VatId | description: Tax information (for Brazil only). If GUID is provided, `vatId.type` must also be set, `UNSPECIFIED` is not allowed.  
                    - name: _id | type: string | description: Customer's tax GUID.  
                    - name: type | type: VatType | description: Tax type.  Supported values: + `CPF`: for individual tax payers + `CNPJ`: for corporations  
                             - enum:
                             -     UNSPECIFIED: 
                             -     CPF: CPF - for individual tax payers.
                             -     CNPJ: CNPJ - for corporations
           - name: shippingAddress | type: AddressWithContact | description: Shipping address and contact details.  
           - name: shippingInfo | type: ShippingInfo | description: Shipping information.  
              - name: selectedCarrierServiceOption | type: SelectedCarrierServiceOption | description: Selected option out of the options allowed for the `region`.  
                 - name: code | type: string | description: Unique identifier of selected option. For example, `usps_std_overnight`.  | validation: maxLength 100
                 - name: title | type: string | description: Title of the option, such as USPS Standard Overnight Delivery (in the requested locale). For example, "Standard" or "First-Class Package International".  | validation: maxLength 250
                 - name: cost | type: SelectedCarrierServiceOptionPrices | description: Shipping costs.  
                    - name: totalPriceAfterTax | type: MultiCurrencyPrice | description: Total shipping price, after discount and after tax.  
                    - name: totalPriceBeforeTax | type: MultiCurrencyPrice | description: Total price of shipping after discounts (when relevant), and before tax.  
                    - name: taxDetails | type: ItemTaxFullDetails | description: Tax details.  
                    - name: totalDiscount | type: MultiCurrencyPrice | description: Shipping discount before tax.  
                    - name: price | type: MultiCurrencyPrice | description: Shipping price before discount and before tax.  
                 - name: deliveryAllocations | type: array<DeliveryAllocation> | description: Delivery solution allocations to different delivery carriers and delivery regions  | validation: maxItems 300
                    - name: deliveryCarrier | type: Carrier | description: The delivery option's carrier details, could be multiple if the delivery option is a combination of multiple carriers  
                       - name: appId | type: string | description: The carrier app id  | validation: format GUID
                       - name: code | type: string | description: Unique code that acts as an GUID for a shipping rate. For example, `"usps_std_overnight"`.  | validation: maxLength 250
                    - name: deliveryRegion | type: Region | description: The delivery region that are relevant for this delivery solution.  
                       - name: _id | type: string | description: The delivery region id.  | validation: format GUID
                       - name: name | type: string | description: The delivery region name.  | validation: maxLength 100
                    - name: applicableLineItems | type: ApplicableLineItems | description: Populated if the delivery solution is a partially supplied by this carrier.  
                       - name: lineItemIds | type: array<string> | description: Line items that the delivery solution is for.  | validation: maxItems 300, minLength 1, maxLength 100
                 - name: partial | type: boolean | description: If the delivery solution is a partial and doesn't apply to all items.  
                 - name: deliveryTimeSlot | type: DeliveryTimeSlot | description: Expected delivery time slot.  
                    - name: from | type: Date | description: starting time of the delivery time slot  
                    - name: to | type: Date | description: ending time of the delivery time slot  
           - name: customFields | type: CustomFields | description: Custom fields.  
              - name: fields | type: array<CustomField> | description: List of custom fields  | validation: minItems 0, maxItems 50
                 - name: value | type: Value | description: Custom field value.  
                    - ONE-OF: 
                       - name: nullValue | type:  | description:   
                       - name: numberValue | type: number | description:   
                       - name: stringValue | type: string | description:   
                       - name: boolValue | type: boolean | description:   
                       - name: structValue | type: object | description:   
                       - name: listValue | type: ListValue | description:   
                          - name: values | type: array<Value> | description:   
                 - name: title | type: string | description: Custom field title.  | validation: minLength 1, maxLength 500
                 - name: translatedTitle | type: string | description: Translated custom field title.  | validation: minLength 1, maxLength 500
           - name: appliedDiscounts | type: array<AppliedDiscount> | description: Applied discounts.  | validation: maxItems 320
              - ONE-OF: 
                 - name: coupon | type: Coupon | description: Coupon details.  
                    - name: _id | type: string | description: Coupon GUID.  
                    - name: code | type: string | description: Coupon code.  
                    - name: name | type: string | description: Coupon name.  
                    - name: amount | type: string | description:   | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
                 - name: merchantDiscount | type: MerchantDiscount | description: Merchant discount.  
                    - name: amount | type: string | description:   | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
                 - name: discountRule | type: DiscountRule | description: Discount rule.  
                    - name: _id | type: string | description: Discount rule GUID.  | validation: format GUID
                    - name: name | type: DiscountRuleName | description: Discount rule name.  
                       - name: original | type: string | description: Original discount rule name (in site's default language).  | validation: minLength 1, maxLength 256
                       - name: translated | type: string | description: Translated discount rule name according to buyer language. Defaults to `original` when not provided.  | validation: minLength 1, maxLength 500
                    - name: amount | type: string | description:   | validation: decimalValue {"gte":"0","lte":"1000000000000000"}
              - name: discountType | type: DiscountType | description: Discount type.  
                     - enum:
                     -     GLOBAL: Global discount.
                     -     SPECIFIC_ITEMS: Discount for specific items.
                     -     SHIPPING: Shipping discount.
              - name: lineItemIds | type: array<string> | description: IDs of the line items the discount applies to.  | validation: format GUID
           - name: externalReference | type: ExternalReference | description: References to an external app and resource associated with this checkout. Used for integration and tracking across different platforms.  
              - name: appId | type: string | description: GUID of the app associated with the purchase flow. For example, the Wix Pay Links app GUID.  | validation: format GUID, immutable
              - name: resourceId | type: string | description: Reference to an external resource GUID. Used to link the purchase flow to a specific entity in an external system. For example, a Wix Pay Link GUID.  | validation: minLength 1, maxLength 100, immutable
           - name: sitePaymentMethodTypeId | type: string | description: GUID of the site payment method type the customer selected to pay with. Learn more about the [Site Payment Method Types API](https://dev.wix.com/docs/api-reference/business-management/payments/site-payment-method-types/introduction.md).  Available only when the customer selects a payment method during the purchase flow.  | validation: format GUID
        - name: extendedFields | type: ExtendedFields | description: Custom field data to validate. [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md) must be configured in the [app dashboard](https://dev.wix.com/dc3/my-apps/) before they can be accessed with API calls.  
           - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
   param name: metadata | type: Context | description: this message is not directly used by any service, it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform. e.g. SPIs, event-handlers, etc.. NOTE: this context object MUST be provided as the last argument in each Velo method signature.  Example: ```typescript export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) { ... } ```  
        - name: requestId | type: string | description: A unique identifier of the request. You may print this GUID to your logs to help with future debugging and easier correlation with Wix's logs.  
        - name: currency | type: string | description: [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.  | validation: format CURRENCY
        - name: identity | type: IdentificationData | description: An object that describes the identity that triggered this request.  
           - ONE-OF: 
              - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site.  | validation: format GUID
              - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site.  | validation: format GUID
              - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.).  | validation: format GUID
              - name: appId | type: string | description: GUID of an app.  | validation: format GUID
        - name: languages | type: array<string> | description: A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`.  
        - name: instanceId | type: string | description: The service provider app's instance GUID.  | validation: format GUID
 Return type: PROMISE<GetValidationViolationsResponse>
  - name: violations | type: array<Violation> | description: List of validation violations.  
     - name: severity | type: Severity | description: 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.  
         - enum:
         -     WARNING: The user is allowed to move forward in the flow.
         -     ERROR: The user is blocked from moving forward in the flow. For example, if callerContext is CART - moving to checkout is blocked. if callerContext is CHECKOUT, placing an order is blocked.
     - name: target | type: Target | description: Target location on a checkout or cart page where the violation will be displayed.  
        - ONE-OF: 
           - name: other | type: Other | description: General (other) violation.  
              - name: name | type: NameInOther | description: Location on a checkout or a cart page where a general (other) violation will be displayed.  
                     - enum:
                     -     OTHER_DEFAULT: Default location, in case no specific location is specified.
           - name: lineItem | type: LineItem | description: Specific line item violation.  
              - name: name | type: NameInLineItem | description: Location on a checkout or a cart page where the specific line item violation will be displayed.  
                     - enum:
                     -     LINE_ITEM_DEFAULT: Default location, in case no specific location is specified.
              - name: _id | type: string | description: GUID of the line item containing the violation.  
     - name: description | type: string | description: Violation description. Can include rich text. Only HTTP or HTTPS links in the following format are allowed: `<a href="https://www.wix.com">Click me</a>`.  | validation: minLength 1, maxLength 1000


```

### Examples

### Example of a `violations` return value
```javascript
import { validations } from '@wix/ecom/service-plugins';

validations.provideHandlers({

  getValidationViolations: async ( payload ) => {
    const {request, metadata} = payload;
        // Use the `request` and `metadata` received from Wix and
        // apply custom logic.
      return {
        // Return your response exactly as documented to integrate with Wix.
        // Return value example:
        violations: [
          {
            description: "You must purchase at least 100 items.",
            severity: "WARNING",
            target: {
              other: {
                name: "OTHER_DEFAULT"
              }
            }
          }
        ]
      }
    }
});

```

### getValidationViolations (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { validations } from '@wix/ecom/service-plugins';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { validations },
  // Include the auth strategy and host as relevant
});


async function getValidationViolations(request,metadata) {
  const response = await myWixClient.validations.getValidationViolations(request,metadata);
};
```

---