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
- Products
- 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
- Webhook Events
- Webhook Subscribers
- Wished Items
- Wishlists
- Zones
Update a CMS Section
Updates a CMS Section
curl --request PATCH \
--url http://{defaultHost}/api/v2/platform/cms_sections/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"cms_section": {
"name": "<string>",
"type": "Spree::Cms::Sections::ProductCarousel",
"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": "29",
"type": "cms_section",
"attributes": {
"name": "Super Hero",
"content": {},
"settings": {
"gutters": "No Gutters"
},
"fit": "Screen",
"destination": null,
"type": "Spree::Cms::Sections::HeroImage",
"position": 1,
"linked_resource_type": "Spree::Product",
"created_at": "2022-11-08T19:34:05.290Z",
"updated_at": "2022-11-08T19:34:05.525Z"
},
"relationships": {
"cms_page": {
"data": {
"id": "20",
"type": "cms_page"
}
},
"linked_resource": {
"data": {
"id": "28",
"type": "product"
}
}
}
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
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
Update this section name.
Change the section type.
Spree::Cms::Sections::HeroImage
, Spree::Cms::Sections::FeaturedArticle
, Spree::Cms::Sections::ProductCarousel
, Spree::Cms::Sections::ImageGallery
, Spree::Cms::Sections::SideBySideImages
, Spree::Cms::Sections::RichTextContent
Update the resource type that this section links to.
Spree::Taxon
, Spree::Product
, Spree::CmsPage
Set the ID of the resource that you would like this section to link to.
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
Pass the position that you want this section to appear in. (The list is not zero indexed, so the first item is position: 1
)
This value is used by front end developers for styling the section padding.
Gutters
, No Gutters
Update the text value of the button used in this section.
Update the title for this section.
Use a multipart/form-data
request to upload assets.
Was this page helpful?
curl --request PATCH \
--url http://{defaultHost}/api/v2/platform/cms_sections/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"cms_section": {
"name": "<string>",
"type": "Spree::Cms::Sections::ProductCarousel",
"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": "29",
"type": "cms_section",
"attributes": {
"name": "Super Hero",
"content": {},
"settings": {
"gutters": "No Gutters"
},
"fit": "Screen",
"destination": null,
"type": "Spree::Cms::Sections::HeroImage",
"position": 1,
"linked_resource_type": "Spree::Product",
"created_at": "2022-11-08T19:34:05.290Z",
"updated_at": "2022-11-08T19:34:05.525Z"
},
"relationships": {
"cms_page": {
"data": {
"id": "20",
"type": "cms_page"
}
},
"linked_resource": {
"data": {
"id": "28",
"type": "product"
}
}
}
}
}