Manually Enabling Justuno AI Product Suggestions & Advanced Reporting - JSON

In this Justuno Support article, we will cover the Product/Order feeds & additional JS needed to enable Justuno AI product suggestions & advanced reporting on eCommerce platforms not supported natively by Justuno

Products and Orders feeds each need to be formatted as

https://wwww.yoursitehere.com/whateveryouwant/products?page=1&limit=50&updatedAt=2006-01-02 15:04:05
https://wwww.yoursitehere.com/whateveryouwant/orders?page=1&limit=50&updatedAt=2006-01-02 15:04:05
  • Pshould start at 1
  • updatedAt value should expect date formatted like above example
  • URL should be accessible via a GET request and should return a JSON response
  • The JSON response broadly should be structured as an array of objects
  • [
    {},
    {},
    {},
    ...
    ]
  • If an empty page is requested, it should return an empty array [ ]

The array for products response should be formatted as follows:

[
{
ID: "", // must be a string REQUIRED
MSRP: 0.00, // must be a float REQUIRED
Price: 0.00, // must be a float REQUIRED
SalePrice: 0.00, // must be a float REQUIRED
Title: "", // must be a string REQUIRED
ImageUrl1: "", // must be a string REQUIRED
ImageUrl2: "", // must be a string OPTIONAL, OMIT IF EMPTY
ImageUrl3: "", // must be a string OPTIONAL, OMIT IF EMPTY
AddToCartURL: "", // must be a string OPTIONAL, OMIT IF EMPTY
URL: "", // must be a string REQUIRED
OptionType1: "", // must be a string OPTIONAL, OMIT IF EMPTY
OptionType2: "", // must be a string OPTIONAL, OMIT IF EMPTY
OptionType3: "", // must be a string OPTIONAL, OMIT IF EMPTY
BrandId: "", // must be a string OPTIONAL, OMIT IF EMPTY
BrandName: "", // must be a string OPTIONAL, OMIT IF EMPTY
BrandDescription: "", // must be a string OPTIONAL, OMIT IF EMPTY
BrandImage: "", // must be a string OPTIONAL, OMIT IF EMPTY
BrandKeywords: "", // must be a string OPTIONAL, OMIT IF EMPTY
Categories: [
{
ID: "", // must be a string REQUIRED
Name: "", // must be a string OPTIONAL, OMIT IF EMPTY
Description: "", // must be a string OPTIONAL, OMIT IF EMPTY
URL: "", // must be a string OPTIONAL, OMIT IF EMPTY
ImageURL: "", // must be a string OPTIONAL, OMIT IF EMPTY
Keyword: "", // must be a string OPTIONAL, OMIT IF EMPTY
}
], // must be array of objects OPTIONAL, OMIT IF EMPTY
Tags [
{
ID: "", // must be a string REQUIRED
Name: "", // must be a string OPTIONAL, OMIT IF EMPTY
}
], // must be array of objects OPTIONAL, OMIT IF EMPTY
CreatedAt: "". // must be a string REQUIRED
UpdatedAt: "". // must be a string REQUIRED
ReviewsCount: 0, // must be an int OPTIONAL, OMIT IF EMPTY
ReviewsRatingSum: 0, // must be an int OPTIONAL, OMIT IF EMPTY
ReviewsRatingAvg: 0.00, // must be a float OPTIONAL, OMIT IF EMPTY
Variants [
{
ID: "", // must be a string REQUIRED
Title: "", // must be a string OPTIONAL, OMIT IF EMPTY
VariantType: "", // must be a string OPTIONAL, OMIT IF EMPTY
SKU: "", // must be a string OPTIONAL, OMIT IF EMPTY
MSRP: 0.00, // must be a float OPTIONAL, OMIT IF EMPTY
Option1: "", // must be a string OPTIONAL, OMIT IF EMPTY
Option2: "", // must be a string OPTIONAL, OMIT IF EMPTY
Option3: "", // must be a string OPTIONAL, OMIT IF EMPTY
SalePrice: 0.00, // must be a float OPTIONAL, OMIT IF EMPTY
InventoryQuantity: 0, // must be an int OPTIONAL, OMIT IF EMPTY
}
] // must be array of objects REQUIRED
}
]
  • There must always be at least one populated object in the Variants array.  If this is a simple product with no variant options, you should duplicate the necessary parent level info into the variant.
  • OptionType1 should contain the heading for the variant Option1.  For example: OptionType1 = Size and Option1 for each variant in that product should contain it's size value.
  • Image Urls should contain full url references to images that are sized at or around 200-300px wide.

The array for orders response should be formatted as follows:

[
{
ID: "", // must be a string REQUIRED
OrderNumber: "", // must be a string REQUIRED
CustomerID: "", // must be a string REQUIRED
Email: "", // must be a string OPTIONAL, OMIT IF EMPTY
CreatedAt: "", // must be a string REQUIRED
UpdatedAt: "", // must be a string REQUIRED
TotalPrice: 0.00, // must be a float OPTIONAL, OMIT IF EMPTY
SubtotalPrice: 0.00, // must be a float OPTIONAL, OMIT IF EMPTY
ShippingPrice: 0.00, // must be a float OPTIONAL, OMIT IF EMPTY
TotalTax: 0.00, // must be a float OPTIONAL, OMIT IF EMPTY
TotalDiscounts: 0.00, // must be a float OPTIONAL, OMIT IF EMPTY
TotalItems: 0, // must be an int OPTIONAL, OMIT IF EMPTY
Currency: "", // must be a string OPTIONAL, OMIT IF EMPTY
Status: "", // must be a string OPTIONAL, OMIT IF EMPTY
IP: "", // must be a string OPTIONAL, OMIT IF EMPTY
CountryCode: "", // must be a string OPTIONAL, OMIT IF EMPTY
LineItems [
{
ProductID: "", // must be a string REQUIRED
OrderID: "", // must be a string REQUIRED
VariantID: "", // must be a string OPTIONAL, OMIT IF EMPTY
Price: 0.00, // must be a float OPTIONAL, OMIT IF EMPTY
TotalDiscount: 0.00, // must be a float OPTIONAL, OMIT IF EMPTY
}
], // must be array of objects REQUIRED
Customer {
ID: "", // must be a string REQUIRED
email: "", // must be a string OPTIONAL, OMIT IF EMPTY
CreatedAt: "", // must be a string REQUIRED
UpdatedAt: "", // must be a string REQUIRED
FirstName: "", // must be a string OPTIONAL, OMIT IF EMPTY
LastName: "", // must be a string OPTIONAL, OMIT IF EMPTY
OrdersCount: 0, // must be an int OPTIONAL, OMIT IF EMPTY
TotalSpend: 0.00, // must be a float OPTIONAL, OMIT IF EMPTY
Tags: "", // must be a string OPTIONAL, OMIT IF EMPTY
Currency: "", // must be a string OPTIONAL, OMIT IF EMPTY
address1: "", // must be a string OPTIONAL, OMIT IF EMPTY
address2: "", // must be a string OPTIONAL, OMIT IF EMPTY
City: "", // must be a string OPTIONAL, OMIT IF EMPTY
Zip: "", // must be a string OPTIONAL, OMIT IF EMPTY
ProvinceCode: "", // must be a string OPTIONAL, OMIT IF EMPTY
CountryCode: "", // must be a string OPTIONAL, OMIT IF EMPTY
}, // REQUIRED
}
]

Additional Javascript snippets necessary:

<script>
window.juapp=window.juapp||function(){(window.juapp.q=window.juapp.q||[]).push(arguments)}

juapp('local','pageType','{homepage/category/product/cart/checkout/thankyou/....}');
juapp('local','prodId','{product ID of product being viewed}');
juapp('local','custId','{logged in customer ID}');
</script>

You should try to include the three juapp function calls whenever possible per page load on your site if you have values to assign them as.

 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us