This tutorial shows you how to add custom fields to a Wix API object for a specific site using the Data Extension Schema API to access and manage the site's _user_fields namespace. Unlike schema plugins that affect all your app's users, this approach creates a field that only affects the specified site.
For example, if you're building a product management app used by many different stores, and one specific wine store wants to add an "Alcohol by Volume (ABV)" field to their orders. Other stores using your app (like clothing stores or electronics shops) won't see this field. This is perfect for site-specific customizations that don't apply globally.
As your app grows and serves diverse businesses, you may find that one-size-fits-all fields don't work for every client. When users request custom fields for their specific business needs, site-specific fields allow you to offer personalized functionality without cluttering the interface for users who don't need those features, or when different industries require different data structures.
Note: This tutorial focuses on site-specific fields. For global schema plugins that affect all users, see About Schema Plugin Extensions and Extend an Existing Object.
This tutorial demonstrates how to:
First, determine the FQDN of the Wix API object you want to extend for the specific site.
FQDNs are available in most event payloads. Events that return FQDNs will have the entityFqdn field documented in their event reference, and the FQDN is returned as entityFqdn in the event data.
Common FQDNs include:
wix.ecom.*.orderwix.ecom.*.checkoutwix.bookings.*.serviceCall List Data Extension Schemas to check if a site-specific schema already exists for the specific FQDN on the site by and for a _user_fields namespace. The _user_fields namespace is a special namespace reserved for site-specific custom fields.
If the _user_fields namespace exists, collect the data extension schema ID and its existing data for the next step.
Based on whether a site-specific _user_fields schema exists, you'll either create a new one or update the existing one.
If no _user_fields namespace schema exists for the site, call Create Data Extension Schema to create one, and include your custom field. This example creates a field called alcoholByVolume for tracking wine ABV:
If a _user_fields namespace schema already exists for the site, call Update Data Extension Schema to update it with your new field. This example adds the alcoholByVolume field to an existing schema that already has other fields:
Once you've added a site-specific field to the site's schema, you should call the relevant GET call for the target API object, in this case, Get Order, every time a visitor navigates to your UI to collect and display the user fields.
The custom fields will be available in the extendedFields property of the API object. For example, when querying an eCommerce order, the custom fields will appear as: