Skip to main content
Besides content that comes into the shop from outside, there is the reverse route and a special case in between. This page covers both directions and the format in which numbers should cross the system boundary.

Sending data: ASSE

Asynchronous Server-Side Events, ASSE for short, transmits any data from the shop via HTTPS to third-party systems. The format is free; JSON and XML are common. Typical uses are order data, newsletter sign-ups and tracking events. The key word is asynchronous: The data goes from the shop server to the recipient, not via the visitor’s browser. Page rendering does not wait for the response. If the remote system does not respond at all, the visitor notices nothing.
Transmission errors are visible neither in the shop nor in the online service area, precisely because the transfer runs asynchronously. If all delivery attempts fail, the data ends up in an error directory, and WEBSALE system monitoring contacts your shop administrator.

Step 1: Activation

ASSE must be activated, either globally or per subshop. Contact your WEBSALE contact person.

Step 2: Configuring the transfer

Each transfer gets its own <+Entry> in the <ASSE> section of shop.config.
The value for ContentType is determined by the recipient. Enter exactly what its documentation requires.

When a delivery counts as successful

Without further specification, any response counts as success. Using <DefinitionOfOK>, you define what really counts. Multiple conditions are combined with AND, so all of them must be met.
If the condition is met, the delivery is considered complete and no further attempts follow.

Additional entries in the HTTP header

Reference: ASSE section

Step 3: Storing credentials securely

If a key or password belongs in the data, do not write it into the template. Stored in the <FreeMessages-Txt> section, it does not appear in plain text in the editing templates on the server.
In the template, you retrieve the value via the corresponding tag, here ~FMSG-MyApiKey~. Reference: FreeMessages-Txt section Guide: Defining free standard texts

Step 4: Assembling and sending the data

The transfer is triggered with ASSE-Fire(). The tag takes two arguments: the identifier from the configuration and the data to be sent. The following example assembles the order data on the order confirmation page and sends it.
Within a tag argument, other tags are written with dollar signs, not with tildes. So $FMSG-MyApiKey$ belongs in the data structure; ~FMSG-MyApiKey~ would not be replaced there.
The counter in the loop inserts the comma between the entries, but not before the first one. The result is:
Instead of assembling the data with DC-FPX_append, it can also be generated via the JSON interface. For nested data, that is the clearer route.

Detecting errors when triggering

Configuration errors when generating the event are reported by a dedicated tag. During setup, place it below the code that triggers the transfer.
To check the data sent, services that provide an address for receiving and display what was received are useful, for example webhook.site. You can check the response of the real remote system with a tool such as reqbin.com.
Reference: ASSE-Fire() · ASSE-LastErrorCode · Freely usable DesignControl tags DC-FPX · DC-FPX_set() · DC-FPX_append Application examples: ASSE

Fetching product data: RPDE

RPDE stands for RemoteProductDataEnrichment. With it, the shop queries technical product data fields from a third-party system during page rendering and uses them immediately. Existing fields can be enriched or overwritten. The data is not stored at WEBSALE but comes via a secured server-to-server connection. Typical cases are daily prices or values that only result from the customer’s input.
RPDE is subject to strict limits:
  • Exactly one query is possible per displayed page, including on search result lists.
  • The product must be fully resolved, so all dependent variants must be selected.
  • For set products, the function is only available for the parent product, and this must be marked accordingly in the product data.
  • RPDE cannot be used together with the cookie basket or the order generator.
  • The function cannot be guaranteed alongside other external service providers such as W2P.
You assemble the data passed to the third-party system freely in the template. The response is expected in JSON format and is read via the JSON interface.

Example: Labelprint24

Labelprint24 prints custom-sized packaging. The customer enters length, width and height, the shop sends these values together with the product’s basic data, and Labelprint24 checks whether it can be manufactured that way and returns the price and weight. Both end up in the product data. A contract with Labelprint24 is required, and the connection must be set up by WEBSALE.

Step 1: Marking product data

The relevant products are marked in the product data. The details are in the interface documentation “Produkte PRO”.

Step 2: Adding an error message

Step 3: Assigning the template

Step 4: Creating the transfer template

Create the template under the assigned name in your template directory.
Labelprint24 determines which information the template must contain. Coordinate the content with them before you test.

Step 5: Input fields on the product detail view

Reloading via AJAX when leaving the field is recommended, as in the example via onBlur. Otherwise, the customer only finds out after submitting whether their dimensions can be manufactured.
Length, width and height cannot be prefilled, and the shop does not check them on the server side. The check is performed solely by the third-party system.

Step 6: Display in the basket

Troubleshooting

For testing purposes, output messages from the interface via MSG-InternalErrorMessage. Two further tags let you look at the data actually sent and received. Reference: MSG-InternalErrorMessage · PR-RPDE · PR-RPDE_OK · PR-RPDE_Data · BASKET-PR-RPDE_Data · WS-RPDE_DebugInfo_RequestData · WS-RPDE_DebugInfo_ResponseData Reference: WS-RPDE_Labelprint_token · PR-RPDE_Labelprint_width · PR-RPDE_Labelprint_length · PR-RPDE_Labelprint_height

Passing prices in machine-readable form

Prices shown in the shop are formatted for humans: with thousands separators, decimal commas and currency symbols. A third-party system cannot do anything with that. For the transfer, there is therefore a technical counterpart for all amounts and quantities. Without additional arguments, these tags are output without a thousands separator, with a period as the decimal separator and with two decimal places.

Adjusting the format

All tags take up to three comma-separated arguments: For a value of 12.99, the result is:
A comma as a decimal separator must be written as \,. Unescaped, it separates the arguments from each other, and the shop reads it as an empty first argument.
An empty position means “keep the default”. (,0,100) therefore leaves the decimal separator unchanged, sets zero decimal places and multiplies by 100. This is the usual form for systems that expect amounts in cents.
Guide: Displaying the basket
  • Guide: Integrating external content
  • Guide: JSON interface
  • Guide: Integrating tracking
  • Application examples: ASSE