Join Program

This section is a work in progress, and subject to change.

API access is currently restricted. Interested? Please apply to our early access program.








Enstore API Documentation

The Enstore API lets you write a feature-complete custom Enstore client. Every resource used in Enstore is accessible through the API.

Introduction Back to top

Some examples of what you can do with the API are:

Intended Audience

This document is intended for anyone who wants to understand how to use the Enstore API. Its purpose is to make you familiar with the architecture of the Enstore API. After reading you'll be able to build your own custom solution that can fetch, update and delete resources.

Requirements

The things you need before you can get started:

Transport Protocol

The Enstore API uses the HTTP protocol for default transport and the HTTPS protocol for secure transport.

Endpoint URIs Back to top

URI Syntax

The Enstore API works with uniquely identifiable resources. Every resource is identified by it's universal resource locator (url). The following url is the default base url to identify which store and API version you are using. Resources in the API can be identified in two ways; 1) a single specific resource and 2) a collection of resources.

urldescription
/[store-handle]/api/[api-version]/[resource-name].[resource-format] A resource collection.
/[store-handle]/api/[api-version]/[resource-name]/[resource-uuid].[resource-format] A single resource.

There is a difference between a url with and without a trailing slash. The Enstore API does not support urls with a trailing slash.

Parameters

Most resources take optional GET parameters. These can used to for example filter or sort a resource. Specific parameters are described in the resource documentation.

Methods

HTTP GET is used to retrieve resources, DELETE is used to delete resources and PUT is used for requests that add a new or modify an existing resource.

HTTP method Description Body
GET Retrieve one or more resources
PUT Create or modify a single resource A resource in the requested format
POST Same as PUT Same as PUT
DELETE Delete one or more resources

A resource does not have to implement every HTTP method supported. For example: The settings resource cannot be deleted. Requesting a resource using an unsupported method will result in a 400 error. Consult resource specific documentation to learn which HTTP methods are supported by that resource.

Getting the response Back to top

Response types

All successful requests, except PUT requests, will result in a '200 OK' response. A PUT request will result in a '201 Created' response. The type of unsuccessful responses depends on the type of error.

An error made by the user will return 400 Bad Response, 401 Unauthorized or 404 Not Found. The response body will always contain a detailed description of the error. The response body matches the format supplied with the FORMAT parameter. A user error response could look like:

HTTP/1.1 400 Bad Request
{
    errorCode1: errorMessage,
    errorCode2: errorMessage
}

Note: These errors are meant for debugging purposes. It is advised to not display these errors to your end-users directly.

The Enstore API returns a 500 Internal Server Error response when a request cannot be handled. In most cases this means that the URI is malformed. The body for an Internal Server Error response contains a general error string.

Constants Back to top

Data Types

Name Example Description
integer 1, 1000, -50 Rounded integral number
float 100.00 Floating point value
string "hello", "I am Enstore" String value, maximum 500 characters unless specified otherwise. No newline characters allowed unless it makes sense.
limited string "this-is-a-slug" String limited by length or allowed characters
special string "ef34ac23a3e111dea9736dd313f51ffc", "tags:bike" String with specific format

Data Format

Enstore supports different data formats for text data and binary data (like images). The Enstore API uses UTF-8 encoding for text and prefers UNIX-style LF (U+000A) linebreaks.

JSON

JSON, short for JavaScript Object Notation is a lightweight computer data interchange format. It is a text-based, human-readable format for representing simple data structures and associative arrays (called objects). The JSON format is often used for serialization and transmitting structured data over a network connection. Its main application is in Ajax web application programming, where it serves as an alternative to the XML format.

You can learn more about JSON at the Wikipedia page, or at it's official homepage. There are JSON implementations available in many languages, and you can check syntax with JSON Lint.

Data Type Example Encoding
integer 100
string "I am Enstore"
float 100.00
array [1, 2, 3]
dictionary {"key": "value"}

Because JSON only supports primitive data types by default, Enstore handles more advanced data types by expressing them in simple data types.

Data Type Example Encoding Notes
decimal "100.33" Precise number expressed in string
datetime 1253230487 Standard UTC UNIX timestamp expressed as integer, precision up to seconds

JSONP

JSONP (or padded-JSON) is a format that makes it possible to use it through ajax directly in a web browser, even if the request is cross domain. The only difference in formatting is that the data is wrapped in a callback function for security. By default this is callback, but it can be set by setting the GET callback variable in a request. For example: GET /[store-handle]/api/v2/products.jsonp?callback=customFunction.

Images

Enstore supports the most popular image formats on the web. Image formats are detected based on their extension. All extensions will be converted to lower case.

Extension Mime Type Notes
jpg image/jpeg jpeg is also supported, but will be converted to jpg
gif image/gif
png image/png
pdf application/pdf Beware that not all browsers can display inline pdf images

Settings Resource Back to top

URL Endpoints

Endpoint Supported Metods
/[store-handle]/api/v2/settings.json GET, PUT

Data Structure

Settings can contain specific application settings under the key applications

Name Path Type Description Example
type uuid string (readonly) Resource type. "settings"
handle handle string (readonly) Store handle. mystore
name address string Store name. "My Great Store"
email email string Contact email. "owner@store.com"
currency currency string Currency code. "USD", "EUR", "GBP"
weightUnit weightUnit string Unit weights are expressed in. "KG", "LBS"
shippingDefaultWeight shippingDefaultWeight string Fallback weight for products without weight. "1.00"
displayPriceIncludingTax displayPriceIncludingTax bool Wether the displayPrice properties on products should include tax or not. true, false
address address string Store address.
street1 address.street1 string Street address. "123, Broadway"
street2 address.street2 string Street address line 2. "Apt 4 Building 8"
city address.city string City name. "New York"
zipCode address.zipCode string Zip/Postal code. "90210"
stateCode address.stateCode string State/Province code. "NY"
stateName address.stateName string (readonly) State/Province name. "New York"
countryCode address.countryCode string Country code. "US"
countryName address.countryName string (readonly) Country name. "United States"
applications applications dictionary with dictionaries Collections of settings for specific application settings that need to persist settings data. Keys are application identifiers. "com.sofa.enstore-admin", "com.sofa.enstore-webstore"

Products Resource Back to top

URL Endpoints

Endpoint Supported Metods Description
/[store-handle]/api/v2/sales/products.json GET Collection of products.
/[store-handle]/api/v2/sales/products/[product-uuid or product-slug].json GET, PUT, DELETE A single product.
/[store-handle]/api/v2/sales/products/count.json GET Total result counter for a query. Returns as integer.

URL Parameters

Parameter Type Example Description
size integer /[store-handle]/api/v2/webstore/products.json?size=40 Results per page. Limited to 20, 40 or 80. Default is 40.
page integer /[store-handle]/api/v2/webstore/products.json?page=5 Result page for query. Starts at and defaults to 0.
tags string /[store-handle]/api/v2/webstore/products.json?tags=men,bikes Filter by tags. Multiple tags allowed.
query string /[store-handle]/api/v2/webstore/products.json?query=test Fulltext search by query.
since timestamp /[store-handle]/api/v2/webstore/products.json?since=1253783215 Results newer then revision.
sort string /[store-handle]/api/v2/webstore/products.json?sort=sku Sort order for results, can be "sku", "name", "price", "value". Default is "name".

Although you can only page through the results by at most 80 items at a time, you can get the total count of items for the given query by sending the exact same GET parameters to /[store-handle]/api/v2/webstore/products/count.json. For example /[store-handle]/api/v2/webstore/products/count.json will return the total count for all products, and /[store-handle]/api/v2/webstore/products/count.json?tags=bike will return the count for all products with tag bike. Counting does not work in combination with revision and query parameters.

Data Structure

Products describe items in your webstore including names, pricing description etc.

Name Path Type Description Example
date date timestamp (readonly) Date created. 1253783215
sku sku limited string Stock keeping unit. Should be unique across products, including variations. "IPOD40", "SHIRT-SMALL-RED"
name name string Product name. "iPod 40GB", "Pretty T-Shirt"
slug slug string (readonly) Product slug. Generated from product name. Lowercase url friendly characters only. Unique across all products. "ipod-40gb", "pretty-t-shirt"
brand brand string Product brand name. "Apple", "Gucci"
description description string Product description. "This product is beautiful."
tags tags array with strings Tags for this product. Values are limited lowercase strings with url friendly characters. "men", "bike", "discounted"
price price decimal Product price per unit. "20.00"
displayPrice displayPrice decimal (readonly) Product price for display purposes. Generated based on the price and store settings. Can be including or excluding tax. "20.00"
tax tax decimal (readonly) Calculated tax for this product. "3.00"
total total decimal (readonly) Calculated total for this product (price + tax). "20.00"
value value decimal The products stock value. This is not the actual stock value, but a custom average used for bookkeeping or margin calculations. "18.00"
unit unit string Unit the quantity is expressed in. "Pieces", "Boxes", "Bottles"
weight weight decimal Product weight. "5.00"
weightUnit weightUnit enum Unit the weight is expressed in. For all weight units see constants. "KG", "LBS"
currency currency enum Currency the price is expressed in. For all weight units see constants. "USD", "EUR", "GBP"
hasStock hasStock bool Whether the product has physical stock. true, false
needsSerial needsSerial bool Whether the product needs a serial number. true, false
isTaxable isTaxable bool Whether this product is taxable. true, false
taxes taxes list with tax resources Taxes that are applicable to this product.
images images list with dictionaries Images for this product.
order images.[index].order integer Order index for this image. Used to define order of product images. Should be unique across product images. 1, 2, 3, 4
description images.[index].description string Image description. "Beautiful sweater"
url images.[index].url string Image location. Can be a full url, image uuid with format to look up in the images resource. "http://www.apple.com/media/product1.jpg", "1c32c848e64741849e2049090e1c7688.jpg"
variations variations dictionary with dictionaries Variation options. Keys are limited strings that contain the [variation-id]. "color", "size", "material"
name [variation-id].name string Variation name. "Color", "Size", "Material"
options [variation-id].options dictionary with dictionaries Keys are limited strings that contain the [option-id]. "red", "large", "wood"
[option-id] [variation-id].options.[option-id] string Option name. "Green", "Yellow", "Large", "Wood"
variation variation dictionary with strings This products variations and options combination. Keys are limited strings that contain the [variation-id]. "color", "size", "material"
[variation-id] variation.[variation-id] string The [option-id] for this [variation-id]. Only needed if this is a variation product (variationMaster not null). The [variation-id] and [option-id] should be available for this variation master. "red", "large", "wood"
variationMaster variationMaster uuid This variations' master product uuid. Defines whether this is a master or variation product, if empty it's a master product. "06429e75a8ea11de82c09314b8ee4e5a"

Product Variations Resource Back to top

URL Endpoints

Endpoint Supported Metods
/[store-handle]/api/v2/webstore/products/[product-uuid]/variations.json GET
/[store-handle]/api/v2/webstore/products/[product-uuid]/variations/[variation-uuid].json GET, PUT, DELETE

Data Structure

Data structure of variation products is identical to regular products.

Orders Resource Back to top

URL Endpoints

Endpoint Supported Metods Description
/[store-handle]/api/v2/sales/orders.json GET Collection of orders.
/[store-handle]/api/v2/sales/orders/[order-uuid].json GET, PUT, DELETE A single customer. Does not take parameters.
/[store-handle]/api/v2/sales/orders/count.json GET Total result counter for a query. Returns as integer.

URL Parameters

Parameter Type Example Description
size integer /[store-handle]/api/v2/webstore/orders.json?size=40 Results per page. Limited to 20, 40 or 80. Default is 40.
page integer /[store-handle]/api/v2/webstore/orders.json?page=5 Result page for query. Starts at and defaults to 0.
startDate timestamp /[store-handle]/api/v2/webstore/orders.json?startDate=1265627628 Orders since this date (utc timestamp).
endDate timestamp /[store-handle]/api/v2/webstore/orders.json?endDate=1265627628 Orders until this date (utc timestamp).
query string /[store-handle]/api/v2/webstore/orders.json?query=test Fulltext search by query.
since timestamp /[store-handle]/api/v2/webstore/orders.json?since=1253783215 Results newer then revision.

Data Structure

Orders are documents that connect ordered goods to customers.

Name Path Type Description Example
date date timestamp (readonly) Date created. 1253783215
number number string Order number. "2010-374"
reference reference string Order reference for customer. "lpsvp9"
status status enum Order status. Can be "pending", "invoiced", "shipped" and "returned". "pending"
customer customer dictionary
For customer properties see the customer resource documentation.
lines lines list with dictionaries
type lines.[index].type string (readonly) Resource type. "orderline"
uuid lines.[index].uuid uuid Resource identifier. Must be a valid hex representation. "06429e75a8ea11de80c09314b8ee4e52"
productUUID lines.[index].productUUID uuid UUID of the product this line is based on. "06429e75a8ea11de80c09314b8ee4e52"
quantity lines.[index].quantity decimal Quantity of products on line. Expressed in product units. "4", "1", "2.5"
totalWeight lines.[index].totalWeight decimal (readonly) Total weight for products. "1.0", "4.2"
tax lines.[index].tax decimal (readonly) Total tax for order line. "22.0", "0.00"
subtotal lines.[index].subtotal decimal (readonly) Total price for products without tax. "70.00", "20.00"
total lines.[index].total decimal (readonly) Total price for products. "100.0", "33.0"
taxes lines.[index].taxes list with dictionaries Applied taxes to this order line.
name lines.[index].taxes.[index].name string Tax name. "GST", "BTW Hoog"
group lines.[index].taxes.[index].group string Tax group. "STATE", "COUNTY", "CITY"
taxtype lines.[index].taxes.[index].taxtype string Tax type. "SALES", "USE"
rate lines.[index].taxes.[index].rate decimal Tax rate. "7.00", "19.0", "1.5"
total lines.[index].taxes.[index].total decimal (readonly) Tax total for tax on this orderline. "7.00", "19.0", "1.5"
All other attributes are equal to the product resource.
payments payments list with dictionaries
type payments.[index].type string (readonly) Resource type. "payment"
uuid payments.[index].uuid uuid Resource identifier. Must be a valid hex representation. "06429e75a8ea11de80c09314b8ee4e52"
date payments.[index].date timestamp (readonly) Date created. 1253783215
status payments.[index].status enum Payment status. Options are "pending", "failed", "processed". "processing"
total payments.[index].total decimal Payment total. "250.00"
method payments.[index].method enum Payment method. Options are "cash", "debitcard", "creditcard", "check", "transfer". "debitcard"
name payments.[index].name string Payment method name. "ACH Direct Online"
gateway payments.[index].gateway string Optional used gateway. "ach_direct"
currency payments.[index].currency string Used payment currency. "EUR", "USD"
reference payments.[index].reference string Returned payment reference from gateway/processor. "07B03856-31F8-4231-B499-7FA197D3ABBF"
paymentMethodUUID payments.[index].paymentMethodUUID string Optional uuid from payment method this payment was based on. "06429e75a8ea11de80c09314b8ee4e52"
error payments.[index].error string Optional error if payment processing failed. "Card limit reached."
data payments.[index].data dictionary Optional extra returned data from the gateway.
testing payments.[index].testing boolean Whether the gateway processed this payment in testing mode. true, false
shipmentsSubTotal shipmentsSubTotal decimal (readonly) Subtotal for all shipments. "25.00"
productsSubTotal shipmentsSubTotal decimal (readonly) Subtotal for all products. "25.00"
subtotal subtotal decimal (readonly) Subtotal for order. "525.00"
shipmentsTax shipmentsTax decimal (readonly) Tax for all shipments. "25.00"
productsTax productsTax decimal (readonly) Tax for all products. "25.00"
tax tax decimal (readonly) Tax for order. "30.00"
taxes taxes dictionary (readonly) Taxes used on order.
name lines.[index].taxes.[index].name string Tax name. "GST", "BTW Hoog"
group lines.[index].taxes.[index].group string Tax group. "STATE", "COUNTY", "CITY"
taxtype lines.[index].taxes.[index].taxtype string Tax type. "SALES", "USE"
rate lines.[index].taxes.[index].rate decimal Tax rate. "7.00", "19.0", "1.5"
total lines.[index].taxes.[index].total decimal (readonly) Tax total for tax on this orderline. "7.00", "19.0", "1.5"
shipmentsTotal shipmentsTotal decimal (readonly) Total for all shipments. "25.00"
productsTotal productsTotal decimal (readonly) Total for all products. "25.00"
total total decimal (readonly) Total for order. "550.00"
balance balance decimal (readonly) Balance for this order (total - total of all payments). "0.00", "100.00"
isPaid isPaid boolean (readonly) Wether this order is fully paid. "0.00", "100.00"

Customers Resource Back to top

URL Endpoints

Endpoint Supported Metods Description
/[store-handle]/api/v2/sales/customers.json GET Collection of customers.
/[store-handle]/api/v2/sales/customers/[customer-uuid].json GET, PUT, DELETE A single customer. Does not take parameters.
/[store-handle]/api/v2/sales/customers/count.json GET Total result counter for a query. Returns as integer.
/[store-handle]/api/v2/sales/customers/[customer-uuid]/orders.json GET List of orders by customer. Works as orders resource.

URL Parameters

Parameter Type Example Description
size integer /[store-handle]/api/v2/webstore/products.json?size=40 Results per page. Limited to 20, 40 or 80. Default is 40.
page integer /[store-handle]/api/v2/webstore/products.json?page=5 Result page for query. Starts at and defaults to 0.
tags string /[store-handle]/api/v2/webstore/products.json?tags=men,bikes Filter by tags. Multiple tags allowed.
query string /[store-handle]/api/v2/webstore/products.json?query=test Fulltext search by query.
since timestamp /[store-handle]/api/v2/webstore/products.json?since=1253783215 Results newer then revision.

Although you can only page through the results by at most 80 items at a time, you can get the total count of items for the given query by sending the exact same GET parameters to /[store-handle]/api/v2/webstore/customers/count.json. For example /[store-handle]/api/v2/webstore/customers/count.json will return the total count for all customers, and /[store-handle]/api/v2/webstore/customers/count.json?tags=wholesale will return the count for all products with tag wholesale. Counting does not work in combination with revision and query parameters.

Data Structure

Customers are contact records that hold name, address and shipping information. They can be organized with tags. Orders hold immutable copies of customer records. They can only be sorted on lastName.

Name Path Type Description Example
date date timestamp (readonly) Date created. 1253783215
tags tags array with strings Tags for this customer. Values are limited lowercase strings with url friendly characters. "wholesale", "local"
firstName firstName string First name. "John", "Mary"
middleName middleName string Middle name. "van"
lastName lastName string Last name. "Ryan", "Poppins"
companyName companyName string Company name. "Sofa"
taxNumber taxNumber string Tax number. "NL123456789"
email email string Email address. "my@email.com"
workPhone workPhone string Work phone number. "1 800 12345"
homePhone homePhone string Home phone number. "1 800 12345"
mobilePhone mobilePhone string Mobile phone number. "1 800 12345"
street1 street1 string Street address "123, Broadway"
street2 street2 string Street address line 2 "Apt 4 Building 8"
city city string City name "New York"
zipCode zipCode string Zip/Postal Code "90210"
stateCode stateCode string State/Province Code "NY"
stateName stateName string (readonly) State/Province Name. Generated from state code. "New York"
countryCode countryCode string Country Code "US"
countryName countryName string (readlonly) Country Name. Generated from country code. "United States"
shippingFirstName shippingFirstName string First name for shipping address. "John", "Mary"
shippingMiddleName shippingMiddleName string Middle name. "van"
shippingLastName shippingLastName string Last name. "Ryan", "Poppins"
shippingCompanyName shippingCompanyName string Company name. "Sofa"
shippingStreet1 shippingStreet1 string Street address "123, Broadway"
shippingStreet2 shippingStreet2 string Street address line 2 "Apt 4 Building 8"
shippingCity shippingCity string City name "New York"
shippingZipCode shippingZipCode string Zip/Postal Code "90210"
shippingStateCode shippingStateCode string State/Province Code "NY"
shippingStateName shippingStateName string (readonly) State/Province Name. Generated from state code. "New York"
shippingCountryCode shippingCountryCode string Country Code "US"
shippingCountryName shippingCountryName string (readonly) Country Name. Generated from country code. "United States"

Payment Methods Resource Back to top

URL Endpoints

Endpoint Supported Methods
/[store-handle]/api/v2/sales/paymentmethods.json GET
/[store-handle]/api/v2/sales/paymentmethods/[paymentmethod-uuid].[format] GET, PUT, DELETE

Data Structure

Name Path Type Description Example
name name string Payment method name. "Pick up in Store", "Paypal", "ACH Direct", "Bank Transfer"
method method enum Payment method. Values can be "cash", "debitcard", "creditcard", "check", "transfer". "cash", "debitcard"
gateway gateway enum Merchant code. Used for online processing. Values can be "paypal_express", "paypal_direct", "ach_direct", "authorize" or empty. "paypal_express", "paypal_direct"
testing testing bool Testing modus. For online processing this means it uses the test servers. true, false
login login string Login name for processing service. "mystore"
password password string (masked) Password for processing service. Is masked using * characters. "*****"
signature signature string Optional signature for processing service. "Sjd78HSd7"
instructions instructions string Optional instructions for this payment method. "Transfer money to account number x."

Shipping Methods Resource Back to top

URL Endpoints

Endpoint Supported Methods
/[store-handle]/api/v2/sales/shippingmethods.json GET
/[store-handle]/api/v2/sales/shippingmethods/[paymentmethod-uuid].[format] GET, PUT, DELETE

Data Structure

Name Path Type Description Example
name name string Shipping method name. "USPS Ground Shipping"
carrierCode carrierCode enum Shipping carrier code. Values can be "fedex", "ups", "usps", "weight" or "price". "fedex", "ups", "usps", "weight"
carrierName carrierName string Optional shipping carrier name. "FedEx", "USPS", "UPS"
serviceCode serviceCode string Shipping service code. "GROUND", "EXPRESS"
serviceName serviceName string Shipping service name "Express Saver", "Weight Based"
login login string Login name for processing service. "mystore"
password password string (masked) Password for processing service. Is masked using * characters. "*****"
signature signature string Optional signature for processing service. "Sjd78HSd7"
originCountryCode originCountryCode enum Origin country code for this shipping method. Takes two character iso country codes. "US", "NL", "DE"
destinationCountryCodes destinationCountryCodes list with strings Destination country codes this shipping method is valid for. Takes two character iso country codes. "US", "NL", "DE"
isTaxable isTaxable bool Wether this shipping method is taxable or not. true, false
priceRanges priceRanges dictionary with dictionaries Prices for shipping method. Also see price ranges explanation below.
amount amount decimal Amount of weight or price from which the according price applies. Also see price ranges explanation below.
price price decimal Price for amount level.

Price Ranges

Custom shipping methods can be weight-based or price-based, determined by the carrierCodes "weight" or "price". If it's set to either one of these, Enstore will look up the shipping price for a product line by either the weight or price.

URL Endpoints

Endpoint Supported Metods
/[store-handle]/api/v2/webstore/menus.json GET
/[store-handle]/api/v2/webstore/menus/[menu-uuid or menu-name].json GET, PUT, DELETE

Data Structure

The menus in the menu resource are named collections of structured menus. They can go multiple levels deep, but please note that some of the templates only render the menus up to two levels of depth. The correct urls for the menu items will be generated when rendering the template, for example the url "tags:man,bikes" could become /store-name/shop/browse/man,bikes/1.

Name Path Type Description Example
name name limited string Menu name. By default templates expect "navigation" and "product" menu to be available. "navigation", "product", "footer"
menu menu array with dictionaries
title menu.0.title string Name as it would appear on the site. "License Agreement", "Apple Website", "Bikes for Men"
target menu.0.target special string Location the menu should point to. The targets can be of types page:[page resource url], url:[link], tags:[list of tags separated by comma]. If using tags or pages, make sure they exist. "page:agreement", "url:http://www.apple.com", "tags:man,bikes"
submenus menu.0.submenus array with dictionaries List with more menu resources.

Templates Resource Back to top

URL Endpoints

Endpoint Supported Metods
/[store-handle]/api/v2/webstore/templates.json GET
/[store-handle]/api/v2/webstore/templates/[template-uuid].json GET, PUT, DELETE

Data Structure

Template resources hold information about their pages and assets and the author. Templates are used for the visual representation of your webstore.

Name Path Type Description Example
name name string Template name. "Raconteurs", "Bishop"
author author string Template author. "Vincent van Gogh"
description description string Template description. Most likely a description of what this template is capable of. "Lorem ipsum dolor sit amet."
contextVersion contextVersion integer Context version for template to use. 1
assets assets array with dictionaries (readonly) Generated from the assets for this resource.
pages pages array with strings (readonly) Generated from the pages for this resource.

Template Assets Resource Back to top

URL Endpoints

Endpoint Supported Metods
/[store-handle]/api/v2/webstore/templates/[template-uuid]/assets/[asset-uuid].[format] GET, PUT, DELETE

Data Structure

Templates assets can be sent the raw file data of the asset. Supported asset formats are: png, jpg, gif, css, js, htc. Format is detected based on file extension.

Template Pages Resource Back to top

URL Endpoints

Endpoint Supported Metods
/[store-handle]/api/v2/webstore/templates/[template-uuid]/pages/[page-name].html GET, PUT, DELETE

Data Structure

Templates pages can be sent the raw template data. The base format is html with template logic. For more information about template capabilities see the custom template documentation.

Pages Resource Back to top

URL Endpoints

Endpoint Supported Metods
/[store-handle]/api/v2/webstore/pages.json GET
/[store-handle]/api/v2/webstore/pages/[page-uuid or page-handle].json GET, PUT, DELETE

Data Structure

If the url /store-name/shop/page/agreement would be requested, a page would be looked up by the handle agreement and rendered using the template defined by the page property, passing the content dictionary to the template context.

Name Path Type Description Example
handle handle limited string Reference to be used in the url. Accepts url friendly characters (a-z0-9-_). Needs to be unique amongst all pages. "agreement", "about-us", "welcome"
templatePage templatePage string Page file name in the current template. "page.html", "welcome.html"
content content dictionary with strings The pages will be rendered using this content. It can contain any key you wish. Default pages expect at least a value with key "main". See the page context for more info.
main content.main string Text content for the page. Can be either HTML, Plain Text or Textile data. "Lorem ipsum dolor sit amet."