Supported methods
List of all supported methods.| Command | Endpoints | GET | POST | PUT | DELETE |
|---|---|---|---|---|---|
| Create session | session/create | ||||
| Create link to a template page. | session/prepareRedirect |
Methods for session handling
These methods take care of session handling between API and storefront: First, new session IDs are generated as the technical basis for all further API calls. If needed, complete redirect links to template pages (e.g. checkout) are built up, including handover of the current session. Optional parameters can be used to specifically control target pages (e.g. a specific checkout step or highlights), while the actual session ID is securely embedded in the link.POST session/create
The following call creates a session ID.More info: Storefront API Basics
Example response
POST session/prepareRedirect
The following call generates a complete link to a template page (e.g. “checkout.htm”) and carries the current session over into the storefront. Optionally, additional parameters can be passed that the target template reads (e.g. to directly open a specific checkout step). Using this method makes sense if your shop is set up in a mixed way, i.e. if some parts have been created with the WEBSALE template theme and other parts with the Storefront API. The endpoint ensures that both parts use the same session. Example request that creates a complete link to the template pagecheckout and takes the current session along
Parameter overview
| Parameter | Type | Description |
|---|---|---|
x-session | string | Required field ID of the current session. More information: Storefront API Basics |
viewIdentifier | string | Required field The ID configured in storefrontApi.redirects. More about this: storefrontApi - Storefront API |
parameters | object | Optional values that are passed to the target page and are available there, for example, via $wsViews.storefrontApiLinkParameters. Example: { "viewIdentifier": "checkout", "params": { "step": "address", "highlight": "shipping" } } |
Example response
Error codes
| Code | Description |
|---|---|
redirectNotFound | No configuration entry found for the specified viewIdentifier. |
redisServicePoolInaccessible | Internal problem. Please contact WEBSALE support. |
redisServiceNotFound | Internal problem. Please contact WEBSALE support. |
