About the Wix eCommerce Gift Vouchers Service Plugin

The Wix eCommerce Gift Vouchers Provider Service Plugin allows you to integrate with Wix as a gift card service provider, enabling Wix merchants to utilize your gift card functionalities directly on their sites, providing a seamless experience for their customers.

Important:

The Wix eCommerce Gift Cards service plugin is exposed here as the Wix eCommerce Gift Vouchers service plugin due to npm package limitations. Individual methods will refer to gift cards rather than gift vouchers.

By integrating your service with Wix, you can facilitate key gift card operations such as balance retrieval, redemption, and voiding transactions. These operations are seamlessly integrated into the site's checkout page, enhancing the overall customer experience.

The integration process involves creating an app in the Wix App Market via the Wix Dev Center, and configuring the Gift Vouchers Provider service plugin extension.

Terminology

  • Redeem: Applying a gift card balance to a purchase, including subtracting the applied value from the gift card balance.
  • Void: Reversing a redeem action and returning the applied value to the gift card balance.

Get started

Follow these steps to begin implementing your service plugin:

Step 1| Choose a framework

You can implement this service plugin with the following frameworks:

Step 2| Configure your service plugin

To configure and customize your plugin, you need to provide important information in the service plugin configuration file. You can configure your plugin in the Wix Dev Center. For details, see Gift Vouchers Provider Extension Configuration.

Step 3| Define handler functions

Use giftVouchersProvider.provideHandlers() to define the following handler functions that implement your custom business logic. Make sure you define all required functions.

FunctionRequired
getbalance()Yes
redeem()Yes
_void()Yes

Code examples

Below is an example for implementing the Gift Vouchers Provider service plugin in your code.

CLI: Basic code structure

This is the basic code structure for implementing the Gift Vouchers Provider service plugin with the Wix CLI:

Copy
1

Self-hosted: Basic code structure

This is the basic code structure for implementing a self-hosted Gift Vouchers Provider service plugin:

Copy
1

See also

Was this helpful?
Yes
No

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

Base URI where the endpoints are called. Wix eCommerce appends the endpoint path to the base URI. For example, to call the Get Balance endpoint at https://my-gift-cards.com/v1/balance, the base URI you provide here is https://my-gift-cards.com/.


Was this helpful?
Yes
No