Sample Use Cases and Flows

This article presents possible use cases and corresponding sample flows that your app can support. It provides a useful starting point as you plan your app's implementation.

Update a global schema

Suppose you're developing an app that provides promotional campaigns for stores. Your app integrates with Wix Multilingual to allow Wix users to translate promotions for customers. You've already used the createSchema() method to create a GLOBAL schema for all sites. Your schema includes a promotionDetails field that allows stores to provide the fine details of the promotion to the customer. Initially, this field is limited to 256 characters. Due to a recent update in your app, this field now supports up to 1024 characters. You need to update your app's schema to reflect this change:

  1. Call updateSchema() with the promotionDetails field, allowing up to 1024 characters.

  2. Site owners can now provide content for the promotionDetails field with up to 1024 characters in length.

Important:

When updating a schema with a GLOBAL scope, be aware that this change will apply to all sites using this schema. If you need to update a field for only one specific store, consider creating a schema with a SITE scope instead, as explained in the sample flow below.

Create a site schema based on an existing global schema

Suppose you're an app developer providing delivery services for restaurants. Your app integrates with Wix Multilingual to allow Wix users to translate delivery information. You've already used the createSchema() method to create a GLOBAL schema for all sites.

Here's an example schema object:

Copy

Now let's say the restaurant owner wants to disable the option for customers to tip couriers, and requests that you remove the courier_tip field from the schema. Since the schema has a GLOBAL scope, updating it would affect all sites using it. To avoid this, you'll create a site-specific schema based on the existing global one as follows:

  1. Call createSchema() with a SITE scope to create a custom schema for the restaurant's site. Copy all the fields from the existing schema except for the courier_tip field.

  2. After creating the site-specific schema, use the Translation Content API to add your app's default content to the newly created schema. Then, ask the restaurant owner to add their translated content to ensure that the new delivery instructions are available in all supported locales.

To summarize, updating the schema for a specific site removes the courier_tip field only for that site. Other sites using the global schema will still have the option to include tips. This prevents unintended changes for all app users.

Did this help?