Extend an Existing Object with Custom Fields

This article shows you how to add custom fields to a Wix API object using data extension schemas and the Data Extension Schema API.

Step 1 | Identify the API object FQDN

First, determine the FQDN of the supported Wix API object you want to extend.

The examples in this article use the eCommerce Order object FQDN:

Copy

Step 2 | Check for an existing data extension schema

Call List Data Extension Schemas to check if a data extension schema already exists for the FQDN, and whether the _user_fields namespace is present. The _user_fields namespace is reserved for site-specific custom fields. If it exists, collect the data extension schema ID and its existing data for the next step.

Copy

Step 3 | Create or update the user-defined schema

Based on whether a site-specific _user_fields schema exists, you'll either create a new one or update the existing one.

Step 4 | Set and display custom fields

Once you've added a custom field to an object, call the relevant method for the target API object to set the values of your custom fields. For example, when calling Create Order, include your custom field values in the method parameters:

Copy

As a result, the custom fields will be available in the extendedFields property of the API object. To access, call the relevant method for the target API object to get the values of your custom fields.

For example, when calling Get Order, the custom fields will appear as:

Copy

See also

Did this help?