Skip to main content
With the test mode endpoints of the Storefront API, you can control the shop’s test mode from your own storefront. You can query the current state, activate test mode with the test mode password and toggle the switches for debugging, simulated payment failures and the WEBSALE Search test API. You can also deactivate test mode again. Test mode applies to the session passed in the x-session header. All endpoints therefore require a valid session.

Supported methods

List of all supported methods.

Basic concept

Mapping to shop actions

Internally, the writing endpoints execute the same shop actions as the forms in the template. The error codes therefore come from these actions. You maintain their error texts in the configuration under actions - Test mode.

Response on success

On success, all four endpoints respond with status 200 and the current state of test mode. The structure corresponds to the $wsTestMode module.

searchTestApi switch

The searchTestApi switch does not change the shop itself. It is merely a signal to your storefront. Based on its value, the storefront decides whether to address the test API or the production API of WEBSALE Search.
The shop does not call WEBSALE Search itself. Instead, it only stores the switch in the session and passes it on in the response so that your storefront can react to it. You implement the switch to the test API in your storefront.

General responses


Methods for test mode

GET testMode/status

The following call returns the current state of test mode for the session.

Parameter overview

Header parameters

Example response

POST testMode/activate

With the following call, you activate test mode for the session. Optionally, you can switch on extended debugging, the simulation of failed payments and the signal for the WEBSALE Search test API. The call defines the initial state of test mode. Switches that you do not send are then off. If test mode is already active for the session, switches that are not sent keep their previous value.

Example request

Parameter overview

Header parameters

Body parameters

Example response

Error codes

The lockout applies to the IP address, not to the session. A new session therefore does not lift it. During the lockout, the shop also rejects a correct password with tooManyAttempts.

POST testMode/deactivate

The following call deactivates test mode for the session. The shop resets the values active, debug, makePaymentFail and searchTestApi to false. A request body is not required.

Parameter overview

Header parameters

Example response

POST testMode/update

The following call changes the debug, makePaymentFail and searchTestApi switches without leaving test mode. The prerequisite is that test mode was previously activated with the password for the respective session. The call only changes the switches that you send in the request. Switches that are not specified keep their previous value. All switches are therefore optional.

Example request

This request switches debug off and leaves makePaymentFail and searchTestApi unchanged.

Parameter overview

Header parameters

Body parameters

With testMode/update, only the switches you send are changed. To switch a switch off, explicitly send it with the value false. Omitting it means “do not change”. This way, existing integrations continue to work unchanged even if further switches are added later.
This does not apply to the form on the shop’s test mode page. The TestModeChange action used there always sets all switches when saving. The reason is that the browser does not send an unchecked checkbox at all. A switch that is not checked in the form is therefore off after saving.

Example response

The response shows the state after the example request. Only debug has changed.

Error codes


Transition to the checkout

If you redirect from the storefront to a checkout of the template theme via session/prepareRedirect, test mode is retained because the shop takes over the session. The following applies to the rest of the process:
  • Orders receive the verification status “Test”. You can recognize them in the order overview in the admin interface and filter by the verificationStatus field via the Admin Interface API.
  • If makePaymentFail is switched on, payments also fail in the checkout.
The link from session/prepareRedirect is valid for 30 seconds. If it is called later, the shop creates a new, empty session. Test mode is no longer active in this session, and orders are executed as regular orders.