Asset APIs

If your app must edit codes of Online Store 1.0 themes, you can use theme asset APIs to merge your app ability into the target theme. You can use asset REST Admin APIs to query, add, update, or delete theme-related resources.

note

Using this integration method leads to a custom theme, which will not be upgraded along with the official version. Therefore, it is highly recommended that:

  • you provide the updated codes and detailed specifications about how these theme assets are updated.
  • pay attention to whether the themes you used for integrating your apps have new versions. Refer to Online Store 2.1 theme to get information about theme versions. When the theme you used updates, ensure that your apps are compatible with the new version.

We do not recommend you to use asset APIs, so consider the following methods:

  • If you need to inject inline content into Online Store 2.0 or above themes, use theme app extensions as an alternative. Refer to Alternatives for common asset API use cases for detailed instructions on alternative methods.
  • If you only need to modify the component and style of the theme, you can instruct merchants to use the following methods to edit their themes:
    • Customize Handlebar sections or blocks in the SHOPLINE Admin by following the steps:
      1. Go to Online Store > Design.
      2. Click Design.
      3. Click Add component and select Custom HTML.
    • Customize CSS settings.

Alternatives for common asset API use cases

The following table presents recommended alternatives to common asset API use cases.

Use caseAlternatives
Load custom JavaScript to provide additional functionality for your apps.Consider one of the following methods:
1.App embed blocks
2.App blocks
Customize your app style by loading custom CSS, such as custom colors or fonts.
Add custom metafields to stores, such as meta descriptions, keywords, or social media tags.App Embed Blocks
Implement custom pop-up windows, such as registration forms or promotional offers.
Customize the search results page, for instance, by adding custom search results.App blocks
Add custom product reviews, such as customer ratings or customer feedback.
Customize the product detail pages by adding additional product information.
Customize the cart page by adding custom cart information.
Customize the contact page, for example by adding a custom contact form or custom contact information.
Comment out page details (such as block titles) to hide elements or inject alternative values.Use app embed blocks, you can add content or load scripts to achieve similar functionality.
Edit CSS classes or add attributes to existing theme elements.Consider one of the following methods:
1.Use app embed blocks and load scripts to target specific elements on a page.
2.Use app embed blocks and custom CSS settings of existing components.
3.Use app embed blocks or theme app blocks to provide alternative elements instead of modifying theme blocks.
Table 1. Alternatives for common asset API use cases

Refer to the following for how to use alternatives for common asset API use cases:

Was this article helpful to you?

Error loading component.

Error loading component.