API & Manual Integration

Learn how to add TrustSpot code manually to your website for use with the API or custom integrations.

Beth avatar
Written by Beth
Updated over a week ago

Overview

At TrustSpot there are 2 different types of reviews that we help customers collect & display on their site: 

  • Company Reviews are about your brand, the customer's experience, shipping, and more generalized language to speak about your company as a whole.

  • Product Reviews are about the customer reviewing a specific product after purchase.

Types of APIs

Our API documentation is split into 2 components: 

  1. GET:

    1. Pull review content onto your site for use on your site any way you see fit. Some examples include custom review displays, search results, and data analytics.

  2. POST:

    1. Send the customer's information to TrustSpot to later trigger a review request to be sent to them (based on your automatic email settings). 

To utilize TrustSpot's API, you will need to know your:

  • Merchant ID

  • API Key

  • API Secret Key

All of which are available within your TrustSpot account. CIick your company name in the top right corner and select Account Settings

Product Review API Integration

If you have a custom eCommerce website and would like to start collecting reviews for the products you sell, this article describes the necessary steps to take. 

Step 1:  Implement Product Review POST API

Once an order is completed on your store, you will need to call our POST API and push the order information. Typically this information includes the customer's name & email, along with the product they purchased. 

We recommend sending orders to our system once an order is "Shipped" from your company. 

The next few steps will outline how to show Product Reviews on your website. 

Step 2: Add TrustSpot Javscript to Site

Now that your store is successfully connected to TrustSpot, the next step is to add the JS script to your site. This is required so that our content can load on your store. 

Copy & Paste the below code below the HEAD on your website:

<script>trustspot_key='YYYY';</script>
<script async src="https://trustspot.io/assets/js/trustspot_product_reviews.js"></script>
  • Replace XXXX with your TrustSpot Merchant ID, found in your Account Settings

  • Replace the YYYY with your TrustSpot API Key, found in your Account Settings

Step 3: Add the Reviews Widget

This adds the review widget to your product page template to show off all of your review, photo, and Q&A content.

<div class="trustspot trustspot-main-widget"
data-product-sku="{ product.sku }"
data-name="{ product.name }">
</div>
  • You will need to replace the sample values above with your own data. For example, you would replace { product.sku } with the real SKU on the product page. 

To customize all of the colors and fonts associated with the Widget, you will need to go to:   Product Reviews >Review Display Widget>Design. 

Step 4: Add the Product Inline Stars

The Inline Product Stars are often placed at the top of the product page, below the title or the price. When a visitor clicks on this link, it will push them down the page automatically to show the Reviews Widget. 

<div class="trustspot-inline-product" data-product-sku="{ product.sku }"></div> 

To customize the size of the product inline stars or to show a different display style, you will need to go to:   Product Reviews >Review Display Widget>Product Stars.

Step 5: Add the Category Inline Stars

The Category Inline Stars are Optional, but they are often used to show the number of reviews a product has if a customer is looking at a category page. For example: If you have a category called "Shirts" that contains 10 types of Shirts, this star rating will show the # of reviews below each product listing on the category page. 

<div class="trustspot-inline-category" data-product-sku="{ product.sku }"></div> 

To customize the size of the category inline stars or to show a different display style, you will need to go to:   Product Reviews >Review Display Widget>Category Stars.

Pricing Plans

API Access for both Company and Product Reviews begins on the Enterprise Plan. 

Request API Access

If you'd like to start using our API, please contact our support team via Live Chat (bottom right of the site) or by emailing us at: support@trustspot.io.

If you have any questions on this article or the API in general, please reach out to our support team.

Did this answer your question?