When a customer populates their shopping basket within a YUDU digital catalogue, it is possible to submit the contents of their order straight to the shopping basket on your own website, where they can complete the transaction and purchase their order.
In order to integrate a YUDU digital catalogue with your own e-commerce engine, you’ll need to adapt your e-commerce engine’s code so that it can receive and translate the data summarising the shopping basket's contents, and then return some data to us so that we can forward the end-user on to the right URL on your website.
It works like this:
Click To Enlarge - E-commerce Integration Data Journey
The below steps outline exactly what is involved in the set-up of e-commerce integration.
Step 1
After a customer has populated the shopping basket in the digital catalogue and clicked "submit", data will be sent from the digital catalogue to a receiving page on your site, where it will be translated into the format used by your own shopping basket.
Your web team will need to create this page and write the custom code that generates the token and translates the data that is being sent over from the YUDU shopping basket.
We need the URL for this receiving page, so that we know where to send the data.
You will usually receive the data in JSON format. Here is an example of data being sent in JSON:
{
"bookId": 202450,
"currency": "£",
"totalPrice": "43.00",
"postage": "+ P&P",
"orderItems": [{
"productCode": "champagne & sparkling",
"description": "A regular product code overlay - this product code is not matched by a rollover product code.",
"price": "10.00",
"quantity": 1, //optional, can be disabled in Publisher
"quantityPrice": "10.00"
},
{
"productCode": "sweet",
"description": "Antother regular product code overlay - this one also is not matched by a rollover product code.",
"price": "11.00",
"quantity": 3, //optional, can be disabled in Publisher
"quantityPrice": "33.00"
}]
}
Step 2
Once the data has been translated to the correct format, the token that has been generated needs to be sent back to us, along with a result indicating SUCCESS or FAILURE.
Here is an example of the token response:
{
"result": "SUCCESS", //options are "SUCCESS" and "FAILURE"
"token": "myToken"
}
Step 3
The final step is the creation of a receiving page for the customer that displays their populated shopping basket on your website (when given the token). Again, your web team will need to do this, since this is a page on your website where the end user will be sent.
For this step, we require a Redirect URL where the digital catalogue can send the user after receiving the token and the confirmation of SUCCESS.
Summary
In summary, we require two pieces of information:
- The URL of the initial receiving page where the JSON data needs to be sent.
- The redirect URL where the end user should be sent to after clicking the "submit" button.
Note: We’ll include the token you’ve provided in the response as a query string parameter on the end of the redirect URL - which you can use to forward the user to the correct cart on your e-commerce site.
Self-Publishers
If you self-publish your digital catalogues on YUDU Publisher, then you can set-up the above information yourself by going to Settings > eCommerce and scrolling down to the "Submit to E-Commerce engines" sub-section as follows:
Image (above) - the Submit to E-Commerce engines section in YUDU Publisher
OPTIONAL - Passing Additional Information via URL Parameters
If you’d like additional information to be forwarded to your e-commerce engine (for example, a referrer code, or a country code), you can simply append the parameters to the URL of your catalog, using typical URL syntax:
http://yourcataloguelinkhere/folder/index.html?referrer_code=ABC01&country_code=au
Then, in Publisher, modify the custom URL and redirect URL to include this information (custom URL is the URL that the cart will submit the data to, whilst the redirect URL will be the landing page in your e-commerce engine).
The parameters you’re forwarding as above should be set using:
parameter_name=<parameter_name|default_value> (where |default_value is optional).
To take the above example, I could set the custom URL to:
If a referrer code or country code is on the original URL, then it will be passed through, but if they’re not provided, this will resolve to:
http://mycommerceengine.com/addToCart.html?referrer_code=na&country_code=au
The same formatting can be used for the redirect URL. Note that this is flexible – you could customise any part of the redirect or custom URLs using similar formatting. Here’s an example of how to redirect users towards a specific domain e-commerce engine, if you have multiple e-commerce engines in multiple countries:
http://mycommerceengine<domain_name|.co.uk>/addToCart.html
Which would deliver to the .co.uk domain based e-commerce engine if the domain name parameter isn't included in the original catalogue, or another domain otherwise)
If you require further clarification on any of the above, please do not hesitate to speak to your account manager or contact support@yudu.com.