Embed the viewer on a product page
Read an article, paste the viewer snippet into your product template and show the 3D viewer and AR on your shop.
You end up with the 3D viewer and AR on your product page, keyed on the article number you already use. The snippet is safe to add to every product page, because the viewer stays hidden until the model is delivered.
Read the article
GET/api/v1/assets/{article}assets:readcurl -sS https://platform.charpstar.co/api/v1/assets/CH-1001 \
-H "Authorization: Bearer $CHARPSTAR_API_KEY"statusisreceived,in_production,in_review,approvedordelivered. Links arenulluntil the product isdelivered.embedisnulluntil then. Once the article is delivered,embed.dataClientis yourdata-clientvalue andembed.snippetholds the snippet for this article.
Paste the snippet into the product template
<script src="https://js.charpstar.net/V2/charpstAR-Base.js" data-client="YourCompany" defer></script>
<charpstar-viewer data-articleid="CH-1001"></charpstar-viewer>data-clientis your company's delivery name, the same on every page of your shop.data-articleidis the article number, exactly as you sent it inarticleId.- Until a product is delivered, the tag shows nothing: no empty box, no error. Once it is delivered, the viewer shows up by itself, with a button to see it in AR.
Use the Shopify version
In your theme editor, add a Custom Liquid block to the product template:
{%- assign cs_article = product.selected_or_first_available_variant.sku -%}
{%- if cs_article != blank -%}
<script src="https://js.charpstar.net/V2/charpstAR-Base.js" data-client="YourCompany" defer></script>
<charpstar-viewer data-articleid="{{ cs_article | escape }}" style="display:block;width:100%;height:480px"></charpstar-viewer>
{%- endif -%}This works when your SKU is the same article number you send us.