CMS Sections
Create a CMS Section
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
CMS Sections
Create a CMS Section
Creates a CMS Section
POST
/
api
/
v2
/
platform
/
cms_sections
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
application/json
Response
201
application/vnd.api+json
Record created
The response is of type object
.
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"
}
}
}
}
}