Storefront API
- Authentication
- Account
- Account / Address
- Account / Credit Cards
- Account / Orders
- Order Status
- Cart
- Cart / Line Items
- Cart / Other
- Cart / Coupons
- Checkout
- Checkout / State
- Checkout / Shipments
- Checkout / Payments
- Checkout / Store Credit
- Stripe
- Products
- Vendors
- Stores
- Taxons
- Countries
- CMS Pages
- Menus
- Wishlists
- Wishlists / Wished Items
- Digital Downloads
Platform API
- Authentication
- Addresses
- Adjustments
- Classifications
- CMS Pages
- CMS Sections
- Countries
- Data Feeds
- Digital Links
- Digital Assets
- Line Items
- Menu Items
- Menus
- Option Types
- Option Values
- Orders
- Payment Methods
- Payments
- Products
- Promotion Actions
- Promotion Categories
- Promotion Rules
- Promotions
- Roles
- Shipments
- Shipping Categories
- Shipping Methods
- States
- Stock Items
- Stock Locations
- Store Credit Categories
- Store Credit Types
- Store Credits
- Tax Categories
- Tax Rates
- Taxonomies
- Taxons
- Users
- Variants
- Vendors
- Webhook Events
- Webhook Subscribers
- Wished Items
- Wishlists
- Zones
Create a CMS Section
Creates a CMS Section
curl --request POST \
--url http://{defaultHost}/api/v2/platform/cms_sections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"cms_section": {
"name": "<string>",
"cms_page_id": "<string>",
"type": "Spree::Cms::Sections::HeroImage",
"linked_resource_type": "Spree::Taxon",
"linked_resource_id": "1",
"fit": "Screen",
"position": 2,
"gutters": "No Gutters",
"button_text": "Click Here",
"title": "Shop Today"
}
}'
{
"data": {
"id": "13",
"type": "cms_section",
"attributes": {
"name": "Hic iste cupiditate corrupti esse minima.",
"content": {},
"settings": {
"gutters": "No Gutters"
},
"fit": "Screen",
"destination": null,
"type": "Spree::Cms::Sections::HeroImage",
"position": 3,
"linked_resource_type": "Spree::Product",
"created_at": "2022-11-08T19:34:04.185Z",
"updated_at": "2022-11-08T19:34:04.185Z"
},
"relationships": {
"cms_page": {
"data": {
"id": "15",
"type": "cms_page"
}
},
"linked_resource": {
"data": {
"id": "23",
"type": "product"
}
}
}
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Query Parameters
Select which associated resources you would like to fetch, see: <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>
Body
Give this section a name.
Set the cms_page
ID that this section belongs to.
Set the section type.
Spree::Cms::Sections::HeroImage
"Spree::Cms::Sections::HeroImage"
Set the resource type that this section links to.
Spree::Taxon
, Spree::Product
, Spree::CmsPage
"Spree::Taxon"
Set the ID of the resource that you would like this section to link to.
"1"
This value is used by front end developers to set CSS classes for content that fits the screen edge-to-edge, or stays within the boundaries of the central container.
Screen
, Container
"Screen"
Pass the position that you want this section to appear in. (The list is not zero indexed, so the first item is position: 1
)
2
This value is used by front end developers for styling the section padding.
Gutters
, No Gutters
"No Gutters"
Set the text value of the button used in this section.
"Click Here"
Create a title for the Hero Section.
"Shop Today"
Use a multipart/form-data
request to upload assets.
Give this section a name.
Set the cms_page
ID that this section belongs to.
Set the section type.
Spree::Cms::Sections::HeroImage
"Spree::Cms::Sections::HeroImage"
Set the resource type that this section links to.
Spree::Taxon
, Spree::Product
, Spree::CmsPage
"Spree::Taxon"
Set the ID of the resource that you would like this section to link to.
"1"
This value is used by front end developers to set CSS classes for content that fits the screen edge-to-edge, or stays within the boundaries of the central container.
Screen
, Container
"Screen"
Pass the position that you want this section to appear in. (The list is not zero indexed, so the first item is position: 1
)
2
This value is used by front end developers for styling the section padding.
Gutters
, No Gutters
"No Gutters"
Set the text value of the button used in this section.
"Click Here"
Create a title for the Hero Section.
"Shop Today"
Use a multipart/form-data
request to upload assets.
Give this section a name.
Set the cms_page
ID that this section belongs to.
Set the section type.
Spree::Cms::Sections::ProductCarousel
"Spree::Cms::Sections::ProductCarousel"
Pass the position that you want this section to appear in. (The list is not zero indexed, so the first item is position: 1
)
2
Set the ID of the Taxon that you would like displayed as a Product Carousel.
"1"
Give this section a name.
Set the cms_page
ID that this section belongs to.
Set the section type.
Spree::Cms::Sections::SideBySideImages
"Spree::Cms::Sections::SideBySideImages"
Pass the position that you want this section to appear in. (The list is not zero indexed, so the first item is position: 1
)
2
Set the resource type that image one links to.
Spree::Taxon
, Spree::Product
"Spree::Taxon"
Set the resource type that image two links to.
Spree::Taxon
, Spree::Product
"Spree::Taxon"
Set the slug or path that image two links to.
"men/shirts"
Set the slug or path that image two links to.
"white-shirt"
Set the title used in image one.
"Shop Men's Shirts"
Set the title used in image two.
"Buy This Men's Shirt"
This value is used by front end developers to set CSS classes for content that fits the screen edge-to-edge, or stays within the boundaries of the central container.
Screen
, Container
"Screen"
Set the subtitle used in image one.
"Save 50% today"
Set the subtitle used in image two.
"Save 50% today"
This value is used by front end developers for styling the section padding.
Gutters
, No Gutters
"No Gutters"
Use a multipart/form-data
request to upload assets.
Use a multipart/form-data
request to upload assets.
Give this section a name.
Set the cms_page
ID that this section belongs to.
Set the section type.
Spree::Cms::Sections::FeaturedArticle
"Spree::Cms::Sections::FeaturedArticle"
Pass the position that you want this section to appear in. (The list is not zero indexed, so the first item is position: 1
)
2
Set the resource type that this section links to.
Spree::Taxon
, Spree::Product
, Spree::CmsPage
"Spree::Taxon"
Set the ID of the resource that you would like this section to link to.
"1"
This value is used by front end developers to set CSS classes for content that fits the screen edge-to-edge, or stays within the boundaries of the central container.
Screen
, Container
"Screen"
This value is used by front end developers for styling the section padding.
Gutters
, No Gutters
"No Gutters"
Set the text value of the button used in this section.
"Click Here"
Create a title for the Section.
"Shop Today"
Create a subtitle for the Section.
"Save Big!"
Set the content, here, this can be rich text editor content.
"Lots of text and content goes here."
Give this section a name.
Set the cms_page
ID that this section belongs to.
Set the section type.
Spree::Cms::Sections::ImageGallery
"Spree::Cms::Sections::ImageGallery"
Pass the position that you want this section to appear in. (The list is not zero indexed, so the first item is position: 1
)
2
Set the resource type that image one links to.
Spree::Taxon
, Spree::Product
"Spree::Taxon"
Set the resource type that image two links to.
Spree::Taxon
, Spree::Product
"Spree::Taxon"
Set the resource type that image three links to.
Spree::Taxon
, Spree::Product
"Spree::Taxon"
Set the slug or path that image two links to.
"men/shirts"
Set the slug or path that image two links to.
"white-shirt"
Set the slug or path that image three links to.
"red-shirt"
Set the title used in image one.
"Shop Men's Shirts"
Set the title used in image two.
"Buy This Men's Shirt"
Set the title used in image three.
"Buy This Women's Skirt"
This value is used by front end developers to set CSS classes for content that fits the screen edge-to-edge, or stays within the boundaries of the central container.
Screen
, Container
"Screen"
This value is used by front end developers for styling the order the images appear.
Default
, Reversed
"Default"
This value is used by front end developers for showing and hiding the label on the images.
Show
, Hide
"Show"
Use a multipart/form-data
request to upload assets.
Use a multipart/form-data
request to upload assets.
Use a multipart/form-data
request to upload assets.
Give this section a name.
Set the cms_page
ID that this section belongs to.
Set the section type.
Spree::Cms::Sections::RichTextContent
"Spree::Cms::Sections::RichTextContent"
Pass the position that you want this section to appear in. (The list is not zero indexed, so the first item is position: 1
)
2
This value is used by front end developers to set CSS classes for content that fits the screen edge-to-edge, or stays within the boundaries of the central container.
Screen
, Container
"Screen"
Set the content, here, this can be rich text editor content.
"Lots of text and content goes here."
Was this page helpful?
curl --request POST \
--url http://{defaultHost}/api/v2/platform/cms_sections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"cms_section": {
"name": "<string>",
"cms_page_id": "<string>",
"type": "Spree::Cms::Sections::HeroImage",
"linked_resource_type": "Spree::Taxon",
"linked_resource_id": "1",
"fit": "Screen",
"position": 2,
"gutters": "No Gutters",
"button_text": "Click Here",
"title": "Shop Today"
}
}'
{
"data": {
"id": "13",
"type": "cms_section",
"attributes": {
"name": "Hic iste cupiditate corrupti esse minima.",
"content": {},
"settings": {
"gutters": "No Gutters"
},
"fit": "Screen",
"destination": null,
"type": "Spree::Cms::Sections::HeroImage",
"position": 3,
"linked_resource_type": "Spree::Product",
"created_at": "2022-11-08T19:34:04.185Z",
"updated_at": "2022-11-08T19:34:04.185Z"
},
"relationships": {
"cms_page": {
"data": {
"id": "15",
"type": "cms_page"
}
},
"linked_resource": {
"data": {
"id": "23",
"type": "product"
}
}
}
}
}