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.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
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.
~FMSG-MyApiKey~.
Reference: FreeMessages-Txt section
Guide: Defining free standard texts
Step 4: Assembling and sending the data
The transfer is triggered withASSE-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.
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.
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. 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.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 viaMSG-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:
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.Related topics
- Guide: Integrating external content
- Guide: JSON interface
- Guide: Integrating tracking
- Application examples: ASSE
