Extension Config


To configure and customize your service plugin, you need to provide important details in the plugin.json configuration file.

Note

If you created your service plugin extension with the CLI, required fields are automatically populated for you.

Configuration Params
deploymentUristring

Required. Base URI where the endpoints are called. Wix appends the endpoint path to the base URI. For example, to call the Get Validation Violations endpoint at https://my-validations.com/v1/get-violations, the base URI you provide here is https://my-validations.com.


validateInCartboolean

Whether to validate the cart page in addition to the checkout page. Default: false

Did this help?

getValidationViolations( )


Important: This is a handler function. Implement it only as part of the service plugin.


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 Declaration
Copy
Method Parameters
payloadGetValidationViolationsEnvelope
Returns
Return Type:GetValidationViolationsResponse | Promise<GetValidationViolationsResponse>
Did this help?