Skip to content

Connect for Commerce Frontend API Server 1.0.0

This schema has to be implemented by any server functioning as the backend of the Frontend API in order for the client module to use it.


Endpoints


GET /findPage

Finds a page based on the given parameters.

Input parameters

Parameter In Type Default Nullable Description
ecom-share-token header string No Provide a token for ShareView
id query string No ID of the page as defined in the mapping.
locale query string No Locale of the desired response.
type query string No Type of the page; either 'product', 'category' or 'content'.
x-referrer header string No Provide url about the iframe parent

Response 200 OK

{
    "previewId": "befda52e-240a-4961-b167-80ea7bab00a8",
    "children": [
        {
            "name": "sup_content",
            "previewId": "57eaaa37-cdec-4c1a-8867-d3b860cec996",
            "children": [
                {
                    "id": "76d255f3-e65f-42ee-96b6-42ea00677b5e",
                    "previewId": "792e9ece-b3cf-49b0-ba96-b8c03a2d4acb",
                    "type": "type",
                    "sectionType": "section_type",
                    "data": {},
                    "children": [
                        {}
                    ],
                    "displayed": true
                }
            ]
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "previewId": {
            "type": "string",
            "example": "befda52e-240a-4961-b167-80ea7bab00a8"
        },
        "children": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "example": "sup_content"
                    },
                    "previewId": {
                        "type": "string",
                        "example": "57eaaa37-cdec-4c1a-8867-d3b860cec996"
                    },
                    "children": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "example": "76d255f3-e65f-42ee-96b6-42ea00677b5e"
                                },
                                "previewId": {
                                    "type": "string",
                                    "example": "792e9ece-b3cf-49b0-ba96-b8c03a2d4acb"
                                },
                                "type": {
                                    "type": "string",
                                    "example": "type"
                                },
                                "sectionType": {
                                    "type": "string",
                                    "example": "section_type"
                                },
                                "data": {
                                    "type": "object"
                                },
                                "children": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                },
                                "displayed": {
                                    "type": "boolean",
                                    "example": true
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

Response headers

Name Description Schema
Access-Control-Expose-Headers Header to expose the `shared-preview` header. string
shared-preview Header indicating shared preview information. string

Other responses


GET /findElement

Finds an element based on the given parameters.

Input parameters

Parameter In Type Default Nullable Description
ecom-share-token header string No Provide a token for ShareView
fsPageId query string No ID of the FirstSpirit page.
locale query string No Locale of the desired response.
x-referrer header string No Provide url about the iframe parent

Response 200 OK

{
    "previewId": "befda52e-240a-4961-b167-80ea7bab00a8",
    "children": [
        {
            "name": "sup_content",
            "previewId": "57eaaa37-cdec-4c1a-8867-d3b860cec996",
            "children": [
                {
                    "id": "76d255f3-e65f-42ee-96b6-42ea00677b5e",
                    "previewId": "792e9ece-b3cf-49b0-ba96-b8c03a2d4acb",
                    "type": "type",
                    "sectionType": "section_type",
                    "data": {},
                    "children": [
                        {}
                    ],
                    "displayed": true
                }
            ]
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "previewId": {
            "type": "string",
            "example": "befda52e-240a-4961-b167-80ea7bab00a8"
        },
        "children": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "example": "sup_content"
                    },
                    "previewId": {
                        "type": "string",
                        "example": "57eaaa37-cdec-4c1a-8867-d3b860cec996"
                    },
                    "children": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "example": "76d255f3-e65f-42ee-96b6-42ea00677b5e"
                                },
                                "previewId": {
                                    "type": "string",
                                    "example": "792e9ece-b3cf-49b0-ba96-b8c03a2d4acb"
                                },
                                "type": {
                                    "type": "string",
                                    "example": "type"
                                },
                                "sectionType": {
                                    "type": "string",
                                    "example": "section_type"
                                },
                                "data": {
                                    "type": "object"
                                },
                                "children": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                },
                                "displayed": {
                                    "type": "boolean",
                                    "example": true
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

Response headers

Name Description Schema
Access-Control-Expose-Headers Header to expose the `shared-preview` header. string
shared-preview Header indicating shared preview information. string

Other responses


GET /fetchNavigation

Fetches the navigation based on the given parameters.

Input parameters

Parameter In Type Default Nullable Description
ecom-share-token header string No Provide a token for ShareView
initialPath query string No Sub-path to search below.
locale query string No Locale of the desired response.
x-referrer header string No Provide url about the iframe parent

Response 200 OK

{
    "idMap": {},
    "seoRouteMap": {},
    "structure": [
        {}
    ],
    "pages": {},
    "meta": {
        "identifier": {
            "tenantId": "792e9ece-b3cf-49b0-ba96-b8c03a2d4acb",
            "navigationId": "792e9ece-b3cf-49b0-ba96-b8c03a2d4acb",
            "languageId": "en_GB"
        }
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "idMap": {
            "type": "object"
        },
        "seoRouteMap": {
            "type": "object"
        },
        "structure": {
            "type": "array",
            "items": {
                "type": "object"
            }
        },
        "pages": {
            "type": "object"
        },
        "meta": {
            "type": "object",
            "properties": {
                "identifier": {
                    "type": "object",
                    "properties": {
                        "tenantId": {
                            "type": "string",
                            "example": "792e9ece-b3cf-49b0-ba96-b8c03a2d4acb"
                        },
                        "navigationId": {
                            "type": "string",
                            "example": "792e9ece-b3cf-49b0-ba96-b8c03a2d4acb"
                        },
                        "languageId": {
                            "type": "string",
                            "example": "en_GB"
                        }
                    }
                }
            }
        }
    }
}

Response headers

Name Description Schema
Access-Control-Expose-Headers Header to expose the `shared-preview` header. string
shared-preview Header indicating shared preview information. string

Other responses


POST /fetchByFilter

Fetches elements based on filter criteria.

Input parameters

Parameter In Type Default Nullable Description
ecom-share-token header string No Provide a token for ShareView
x-referrer header string No Provide url about the iframe parent

Request body

{
    "filters": [
        {
            "operator": "$and",
            "filters": [
                {
                    "field": "page.formData.type.value",
                    "operator": "$eq",
                    "value": "content"
                },
                {
                    "field": "page.formData.id.value",
                    "operator": "$eq",
                    "value": "homepage"
                }
            ]
        }
    ],
    "locale": "de_DE",
    "page": 1,
    "pagesize": 20,
    "sort": [
        {
            "name": "page.formData.title.value",
            "order": "asc"
        }
    ],
    "normalized": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "properties": {
        "filters": {
            "type": "array",
            "description": "Filter queries to be applied",
            "items": {
                "oneOf": [
                    {
                        "$ref": "#/components/schemas/LogicalFilter"
                    },
                    {
                        "$ref": "#/components/schemas/ComparisonFilter"
                    },
                    {
                        "$ref": "#/components/schemas/ArrayFilter"
                    },
                    {
                        "$ref": "#/components/schemas/EvaluationFilter"
                    }
                ]
            }
        },
        "locale": {
            "type": "string",
            "description": "Locale of the desired response",
            "example": "de_DE"
        },
        "page": {
            "type": "integer",
            "description": "Page number for pagination",
            "example": 1
        },
        "pagesize": {
            "type": "integer",
            "description": "Number of items per page",
            "example": 10
        },
        "additionalParams": {
            "type": "object",
            "description": "Additional parameters to be passed to the service",
            "additionalProperties": true
        },
        "remoteProject": {
            "type": "string",
            "description": "ID of the remote project"
        },
        "sort": {
            "type": "array",
            "description": "Sorting parameters",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Name of the field to sort by"
                    },
                    "order": {
                        "type": "string",
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "description": "Sort order"
                    }
                }
            }
        },
        "normalized": {
            "type": "boolean",
            "description": "Whether to return normalized response",
            "example": true
        }
    },
    "example": {
        "filters": [
            {
                "operator": "$and",
                "filters": [
                    {
                        "field": "page.formData.type.value",
                        "operator": "$eq",
                        "value": "content"
                    },
                    {
                        "field": "page.formData.id.value",
                        "operator": "$eq",
                        "value": "homepage"
                    }
                ]
            }
        ],
        "locale": "de_DE",
        "page": 1,
        "pagesize": 20,
        "sort": [
            {
                "name": "page.formData.title.value",
                "order": "asc"
            }
        ],
        "normalized": true
    }
}

Response 200 OK

Schema of the response body
{
    "oneOf": [
        {
            "$ref": "#/components/schemas/NormalizedFetchResponse"
        },
        {
            "$ref": "#/components/schemas/DenormalizedFetchResponse"
        }
    ]
}

Response headers

Name Description Schema
Access-Control-Expose-Headers Header to expose the `shared-preview` header. string
shared-preview Header indicating shared preview information. string

Response 400 Bad Request

{
    "error": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "error": {
            "type": "string"
        }
    }
}

Response 401 Unauthorized

Response 404 Not Found

Response 500 Internal Server Error


GET /isPreview

Determines whether the requester is in preview mode.

Input parameters

Parameter In Type Default Nullable Description
ecom-share-token header string No Provide a token for ShareView
x-referrer header string No Provide url about the iframe parent

Response 200 OK

{
    "isPreview": true,
    "isShareSession": false
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "isPreview": {
            "type": "boolean",
            "example": true
        },
        "isShareSession": {
            "type": "boolean",
            "example": false
        }
    }
}

Response headers

Name Description Schema
Access-Control-Expose-Headers Header to expose the `shared-preview` header. string
shared-preview Header indicating shared preview information. string

Other responses


GET /fetchProjectProperties

Fetches the project properties from CaaS.

Input parameters

Parameter In Type Default Nullable Description
ecom-share-token header string No Provide a token for ShareView
locale query string No Locale of the desired response.
x-referrer header string No Provide url about the iframe parent

Response 200 OK

{
    "type": "ProjectProperties",
    "data": {
        "ps_logo": {
            "type": "Image",
            "id": "74fe3e66-0408-4aa8-8bd1-6f7ea3e2858f",
            "previewId": "74fe3e66-0408-4aa8-8bd1-6f7ea3e2858f.de_DE",
            "meta": {},
            "description": null,
            "resolutions": {
                "16x4_L": {
                    "fileSize": 4004,
                    "extension": "png",
                    "mimeType": "image/png",
                    "width": 480,
                    "height": 480,
                    "url": "https://example.org/image.16x4_L.de_DE"
                }
            }
        },
        "ps_logo_small": {
            "type": "Image",
            "id": "8d11b307-2a4e-4c8c-8cbb-d79afcc00af1",
            "previewId": "8d11b307-2a4e-4c8c-8cbb-d79afcc00af1.de_DE",
            "meta": {},
            "description": null,
            "resolutions": {
                "16x4_L": {
                    "fileSize": 3991,
                    "extension": "png",
                    "mimeType": "image/png",
                    "width": 480,
                    "height": 480,
                    "url": "https://example.org/image.16x4_L.de_DE"
                }
            }
        },
        "ps_logo_text": "Connect for Commerce",
        "ps_theme_primary": "#D5DD03",
        "ps_theme_secondary": "#999999"
    },
    "layout": "project_settings",
    "meta": {},
    "name": "ProjectProperties",
    "previewId": "1775ac7c-39e0-49fd-8285-5e7ac76fd717.de_DE",
    "id": "1775ac7c-39e0-49fd-8285-5e7ac76fd717",
    "masterLocale": {
        "identifier": "EN",
        "country": "GB",
        "language": "en"
    }
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "type": {
            "type": "string",
            "example": "ProjectProperties"
        },
        "data": {
            "type": "object",
            "properties": {
                "ps_logo": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string",
                            "example": "Image"
                        },
                        "id": {
                            "type": "string"
                        },
                        "previewId": {
                            "type": "string"
                        },
                        "meta": {
                            "type": "object"
                        },
                        "description": {
                            "type": "string",
                            "nullable": true
                        },
                        "resolutions": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "object",
                                "properties": {
                                    "fileSize": {
                                        "type": "integer"
                                    },
                                    "extension": {
                                        "type": "string"
                                    },
                                    "mimeType": {
                                        "type": "string"
                                    },
                                    "width": {
                                        "type": "integer"
                                    },
                                    "height": {
                                        "type": "integer"
                                    },
                                    "url": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "ps_logo_small": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string",
                            "example": "Image"
                        },
                        "id": {
                            "type": "string"
                        },
                        "previewId": {
                            "type": "string"
                        },
                        "meta": {
                            "type": "object"
                        },
                        "description": {
                            "type": "string",
                            "nullable": true
                        },
                        "resolutions": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "object",
                                "properties": {
                                    "fileSize": {
                                        "type": "integer"
                                    },
                                    "extension": {
                                        "type": "string"
                                    },
                                    "mimeType": {
                                        "type": "string"
                                    },
                                    "width": {
                                        "type": "integer"
                                    },
                                    "height": {
                                        "type": "integer"
                                    },
                                    "url": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "ps_logo_text": {
                    "type": "string"
                },
                "ps_theme_primary": {
                    "type": "string"
                },
                "ps_theme_secondary": {
                    "type": "string"
                }
            },
            "example": {
                "ps_logo": {
                    "type": "Image",
                    "id": "74fe3e66-0408-4aa8-8bd1-6f7ea3e2858f",
                    "previewId": "74fe3e66-0408-4aa8-8bd1-6f7ea3e2858f.de_DE",
                    "meta": {},
                    "description": null,
                    "resolutions": {
                        "16x4_L": {
                            "fileSize": 4004,
                            "extension": "png",
                            "mimeType": "image/png",
                            "width": 480,
                            "height": 480,
                            "url": "https://example.org/image.16x4_L.de_DE"
                        }
                    }
                },
                "ps_logo_small": {
                    "type": "Image",
                    "id": "8d11b307-2a4e-4c8c-8cbb-d79afcc00af1",
                    "previewId": "8d11b307-2a4e-4c8c-8cbb-d79afcc00af1.de_DE",
                    "meta": {},
                    "description": null,
                    "resolutions": {
                        "16x4_L": {
                            "fileSize": 3991,
                            "extension": "png",
                            "mimeType": "image/png",
                            "width": 480,
                            "height": 480,
                            "url": "https://example.org/image.16x4_L.de_DE"
                        }
                    }
                },
                "ps_logo_text": "Connect for Commerce",
                "ps_theme_primary": "#D5DD03",
                "ps_theme_secondary": "#999999"
            }
        },
        "layout": {
            "type": "string",
            "example": "project_settings"
        },
        "meta": {
            "type": "object",
            "example": {}
        },
        "name": {
            "type": "string",
            "example": "ProjectProperties"
        },
        "previewId": {
            "type": "string",
            "example": "1775ac7c-39e0-49fd-8285-5e7ac76fd717.de_DE"
        },
        "id": {
            "type": "string",
            "example": "1775ac7c-39e0-49fd-8285-5e7ac76fd717"
        },
        "masterLocale": {
            "type": "object",
            "properties": {
                "identifier": {
                    "type": "string",
                    "example": "EN"
                },
                "country": {
                    "type": "string",
                    "example": "GB"
                },
                "language": {
                    "type": "string",
                    "example": "en"
                }
            }
        }
    },
    "example": {
        "type": "ProjectProperties",
        "data": {
            "ps_logo": {
                "type": "Image",
                "id": "74fe3e66-0408-4aa8-8bd1-6f7ea3e2858f",
                "previewId": "74fe3e66-0408-4aa8-8bd1-6f7ea3e2858f.de_DE",
                "meta": {},
                "description": null,
                "resolutions": {
                    "16x4_L": {
                        "fileSize": 4004,
                        "extension": "png",
                        "mimeType": "image/png",
                        "width": 480,
                        "height": 480,
                        "url": "https://example.org/image.16x4_L.de_DE"
                    }
                }
            },
            "ps_logo_small": {
                "type": "Image",
                "id": "8d11b307-2a4e-4c8c-8cbb-d79afcc00af1",
                "previewId": "8d11b307-2a4e-4c8c-8cbb-d79afcc00af1.de_DE",
                "meta": {},
                "description": null,
                "resolutions": {
                    "16x4_L": {
                        "fileSize": 3991,
                        "extension": "png",
                        "mimeType": "image/png",
                        "width": 480,
                        "height": 480,
                        "url": "https://example.org/image.16x4_L.de_DE"
                    }
                }
            },
            "ps_logo_text": "Connect for Commerce",
            "ps_theme_primary": "#D5DD03",
            "ps_theme_secondary": "#999999"
        },
        "layout": "project_settings",
        "meta": {},
        "name": "ProjectProperties",
        "previewId": "1775ac7c-39e0-49fd-8285-5e7ac76fd717.de_DE",
        "id": "1775ac7c-39e0-49fd-8285-5e7ac76fd717",
        "masterLocale": {
            "identifier": "EN",
            "country": "GB",
            "language": "en"
        }
    }
}

Response headers

Name Description Schema
Access-Control-Expose-Headers Header to expose the `shared-preview` header. string
shared-preview Header indicating shared preview information. string

Other responses


GET /getAvailableLocales

Gets the available locales in the configured FirstSpirit project.

Input parameters

Parameter In Type Default Nullable Description
ecom-share-token header string No Provide a token for ShareView
x-referrer header string No Provide url about the iframe parent

Response 200 OK

[
    "en_GB",
    "de_DE"
]
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "array",
    "items": {
        "type": "string"
    },
    "example": [
        "en_GB",
        "de_DE"
    ]
}

Response headers

Name Description Schema
Access-Control-Expose-Headers Header to expose the `shared-preview` header. string
shared-preview Header indicating shared preview information. string

Other responses


Schemas

ArrayFilter

Name Type
field string
operator string
value Array<>

BaseItem

Name Type
id string
previewId string
type string

ComparisonFilter

Type:

DenormalizedFetchResponse

Type:

EvaluationFilter

Name Type
field string
operator string
value string

FetchResponseBase

Name Type
page integer
pagesize integer
size integer
totalPages integer

LogicalFilter

Type:

NormalizedFetchResponse

Type:


Last update: June 3, 2024