Create Themes

Create a new Theme

End Point

POST https://api.cartup.ai/v1/theme

Headers

Name
Type
Description

Accept*

String

application/json

Content_type*

String

application/json

X-Cartup-Access-Token*

String

$CARTUP_API_KEY

X-Cartup-orgId*

Sring

$CARTUP_ORD_ID

Request Body

Name
Type
Description

themeID*

String

theme ID (Should be unique)

orgID*

String

Your org ID

orgName*

String

You org name

type*

Constant

"Custom"

htmlTemplate*

String

Html template

cssTemplate

String

CSS template

jsTemplate

String

Java Script

displayType*

String

carousel

{
"errMsg":null,
"uid":"852968f0-7c8c-45d7-8ab0-e7287162a67e"
}

Curl Example

curl --request POST 'https://api.cartup.ai/v1/theme'
--header 'Accept: application/json' \  
--header 'Content-Type: application/json' \  
--header 'X-Cartup-Access-Token: $CARTUP_API_KEY'
--header 'X-Cartup-orgId : $CARTUP_ORD_ID'
-d '
{
  "orgId": "8dbc90c4-ad66-48c4-9711-ce3065cfd189",
  "orgName": "freshcouture",
  "type": "Custom",
  "description": null,
  "themeId": "cartup-theme1",
  "htmlTemplate": "<div style=\"display:block;position: relative;\">\n\t<div class=\"widgetDisplayName\"><h2 class=\"recent__title theme\">{{widget_displayName}}</h2></div>\n\t\t<div class=\"product-grid\" id=\"test-widget-wrapper\">\n\t\t\t<div class=\"product-item one-quarter small--one-half\">\n\t\t\t\t<a class=\"product-link\" href=\"{{product_currentPageUrl}}\">\n\t\t\t\t\t<div class=\"product-item__image\">\n\t\t\t\t\t\t<div class=\"product-item__bg\" style=\"background-image:url({{product_imageUrl}});\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"product-information\">\n\t\t\t\t\t\t<span class=\"title\"><h5>{{product_name}}</h5></span>\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>",
  "cssTemplate": null,
  "jsTemplate": "",
  "displayType": "carousel"
}
' \

Request Body

Please refer to field descriptions in the POST Body above.

‌Example

{
  "orgId": "8dbc90c4-ad66-48c4-9711-ce3065cfd189",
  "orgName": "freshcouture",
  "type": "Custom",
  "description": null,
  "themeId": "cartup-theme1",
  "htmlTemplate": "<div style=\"display:block;position: relative;\">\n\t<div class=\"widgetDisplayName\"><h2 class=\"recent__title theme\">{{widget_displayName}}</h2></div>\n\t\t<div class=\"product-grid\" id=\"test-widget-wrapper\">\n\t\t\t<div class=\"product-item one-quarter small--one-half\">\n\t\t\t\t<a class=\"product-link\" href=\"{{product_currentPageUrl}}\">\n\t\t\t\t\t<div class=\"product-item__image\">\n\t\t\t\t\t\t<div class=\"product-item__bg\" style=\"background-image:url({{product_imageUrl}});\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"product-information\">\n\t\t\t\t\t\t<span class=\"title\"><h5>{{product_name}}</h5></span>\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>",
  "cssTemplate": null,
  "jsTemplate": "",
  "displayType": "carousel"
}

Last updated