API Reference

The Convertopia API operates in accordance with REST principles. Our API follows a structured approach, employing resource-oriented URLs that can be easily anticipated. It readily accepts form-encoded request bodies, ensuring convenient data submission, and responds with JSON-encoded information. Furthermore, the API adheres to standard HTTP response codes, offering a familiar and consistent experience in terms of authentication.

Should you wish to experiment with the Convertopia API without impacting your actual data, a test mode is provided. By employing the appropriate API key for authentication, you can determine whether your requests will operate in live mode or test mode.

It is worth noting that the Convertopia API is tailored to each individual account, accommodating new versions and customizing functionalities accordingly. By logging into your account, you will gain access to documentation specifically designed for your API version. This personalized documentation will be accompanied by your test key and data, ensuring a comprehensive understanding and effective utilization of the API

Live URL https://engine.convertopia.com
Test URL https://staging.engine.convertopia.com

APIs Integrations

An Application Programming Interface (API) is a set of protocols that allows different software applications to communicate with each other. APIs enable Convertopia to connect with other systems, making data exchange and functionality sharing seamless and efficient.

Authentication

The Convertopia API uses API keys to authenticate requests. You can view and manage your API keys in the Convertopia Dashboard.

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas.

Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.

One of the steps involved in this process is to perform Base64 encoding on a specific string: Base64Encoding(ClinetKey:ClientSecert:PublicSiteId)

The assignment of the Client Key, Client Secret, and Public Site ID should be done through the convertopia dashboard.

(e.g., for a cross-origin request), use "Authorization:Base64Encoding(ClinetKey:ClientSecert:PublicSiteId)"

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Product Search Extended

The Product Search endpoint allows you to integrate Convertopia's product search functionality into your website. It provides an extended search capability to retrieve relevant product information based on a given search term

Endpoint:

{baseURL}/product-search/extended

Endpoint Usage:

To use the Product Search endpoint, you need to make a POST request to the specified URL with the required parameters and headers

Sample cURL Request:

curl --location '{baseURL}/product-search/extended' \
--header 'Authorization: Base64Encoding(ClinetKey:ClientSecert:PublicSiteId)
--header 'Content-Type: application/json' \
--data '{ "searchTerm": "bags" }'

Note: Make sure to replace placeholders in the cURL request with actual values before making the API call

cURL Request Parameters:

{baseURL}: The base URL of the Convertopia API.

Request Headers:

Authorization: Basic authentication header containing the API key. Replace Base64Encoding(ClinetKey:ClientSecert:PublicSiteId) with your actual API key.

"searchTerm" (string):The term you want to search for within the merchant store. It can be a keyword, phrase, or any other relevant text that describes the desired information or products.

Content-Type: The content type of the request body. Set this header to application/json.

Response:

The API will respond with a JSON-encoded response containing information about the searched products. This response will include product IDs which are obtained from the merchant store.

[
   65
   96
   195
   538
   693
   797
   1881
   2062
]

Product Search Simple

The Product Search endpoint allows you to integrate Convertopia's product search functionality into your website. It provides a simple search capability to retrieve product information based on a given search term.

Endpoint:

{baseURL}/product-search/simple

Endpoint Usage:

To use the Product Search endpoint , you need to make a POST request to the specified URL with the required parameters and headers.

Sample cURL Request:

curl --location '{baseURL}/product-search/simple' \
--header 'Authorization:Base64Encoding(ClinetKey:ClientSecert:PublicSiteId)
--header 'Content-Type: application/json' \
--data '{ "searchTerm": "bag" }'

Note: Make sure to replace placeholders in the cURL request with actual values before making the API call

cURL Request Parameters:

{baseURL}: The base URL of the Convertopia API.

Request Headers:

Authorization: Basic authentication header containing the plugin API key. Replace Base64Encoding(ClinetKey:ClientSecert:PublicSiteId) with your actual API key.

"searchTerm" (string):The term you want to search for within the merchant store. It can be a keyword, phrase, or any other relevant text that describes the desired information or products.

Content-Type: The content type of the request body. Set this header to application/json.

Response:

The API will respond with a JSON-encoded response containing information about the searched products. The response will include details such as product names, descriptions, prices, and other relevant information, which are obtained from the merchant store.

[
   {
      "id": "string"
      "name": "string"
      "description": "string"
      "sku": "string"
      "catalogId":"string"
      "price": "Integer"
      "isOnline": "Boolean"
      "gender": "string"
      "availability": "Boolean"
      "url":"string",
      "imageUrl":"string",
      "categoryNames": ["strings"],
      "categoryUrls": ["strings"],
      "currency": "string",
      "shortDescription": "string"
      "productId": "string"
      "size": "string"
   },
]

Job Info

The Job Info endpoint allows you to retrieve information about a specific job. This endpoint provides details about the job name, job group ,job details and other relevant information.

Endpoint:

{baseURL}/job/info

Endpoint Usage:

To use the Job Info endpoint, you need to make a GET request to the specified URL with the required parameters and headers.

Sample cURL Request:

curl --location --request GET '{baseURL}engine.convertopia.com/job/info' \
--header 'Authorization:Base64Encoding(ClinetKey:ClientSecert:PublicSiteId)
--header 'Content-Type: application/json' \
--data '{ "searchTerm": "bags" }'

Note: Make sure to replace placeholders in the cURL request with actual values before making the API call

cURL Request Parameters:

{baseURL}: The base URL of the Convertopia API.

Request Headers:

Authorization: Basic authentication header containing the API key. Replace Base64Encoding(ClinetKey:ClientSecert:PublicSiteId) with your actual API key.

"searchTerm" (string):The term you want to search for within the merchant store. It can be a keyword, phrase, or any other relevant text that describes the desired information or products.

Content-Type: The content type of the request body. Set this header to application/json.

Response:

The API will respond with a JSON-encoded response containing information about the specified job. The response will include details such as the job ID, status, progress, and any other relevant information.

[
   {
      "jobName": "string"
      "jobGroup": "string"
      "nextFireTime": "Integer"
      "startedTime": "Integer"
      "siteID": "string"
      "fireURL":"string"
      "jobDetails": ["strings"]
      "isCronJob": "Boolean"
   }
]

Job Trigger

The Job Trigger endpoint allows you to initiate a new job for processing. By triggering a job, you can request Convertopia to perform a specific task or operation based on the provided parameters. This endpoint is used to start a new job in the Convertopia system.

Endpoint:

{baseURL}/job/trigger

Endpoint Usage:

To trigger a job, you need to make a GET request to the specified URL with the required parameters and headers.

Sample cURL Request:

curl --location --request GET 'http://{baseURL}engine.convertopia.com/job/trigger' \
--header 'Authorization:Base64Encoding(ClinetKey:ClientSecert:PublicSiteId)
--header 'Content-Type: application/json' \
--data '{ "searchTerm": "bags" }'

Note: Make sure to replace placeholders in the cURL request with actual values before making the API call

cURL Request Parameters:

{baseURL}: The base URL of the Convertopia API.

Request Headers:

Authorization: Basic authentication header containing the API key. Replace Base64Encoding(ClinetKey:ClientSecert:PublicSiteId) with your actual API key.

"searchTerm" (string):The term you want to search for within the merchant store. It can be a keyword, phrase, or any other relevant text that describes the desired information or products.

Content-Type: The content type of the request body. Set this header to application/json.

Response:

The API will respond with a JSON-encoded response containing information about the triggered job. The response will include details such as the job status.

Job Schedule Trigger

The Job Schedule Trigger endpoint allows you to schedule the execution of a job at a specific time or interval. This endpoint is used to trigger a job based on a predefined schedule. By scheduling a job, you can automate recurring tasks or operations in the Convertopia system.

Endpoint:

{baseURL}/job/trigger/scheduler

Endpoint Usage:

To schedule the execution of a job, you need to make a GET request to the specified URL with the required parameters and headers.

Sample cURL Request:

curl --location 'http://{baseURL}/job/trigger/scheduler?jobId=importProductFeed&jobGroup=Product' \
--header 'Authorization:Base64Encoding(ClinetKey:ClientSecert:PublicSiteId)

Note: Make sure to replace placeholders in the cURL request with actual values before making the API call

cURL Request Parameters:

{baseURL}: The base URL of the Convertopia API.

Query Parameters:

jobID:

The identifier of the job you want to schedule. Replace importProductFeed with the actual job ID.

jobGroup:

The group to which the job belongs. Replace product with the appropriate job group.

Request Headers:

Authorization: Basic authentication header containing the plugin API key. Replace Base64Encoding(ClinetKey:ClientSecert:PublicSiteId) with your actual API key.

Content-Type: The content type of the request body. Set this header to application/json.

Response:

The API will respond with a JSON-encoded response containing information about the triggered job. The response will include details such as the job status.

Autocomplete

There are two types of autocomplete functionality available: API-based and CDN-based.

API's

The Autocomplete Login API endpoint allows you to retrieve autocomplete suggestions for a search term. This endpoint is used to provide users with real-time suggestions as they type in a search box. It requires a valid access token for authentication.

One of the steps involved in this process is to perform Base64 encoding on a specific string: Base64Encoding(ClinetKey:PublicSiteId)

The assignment of the Client Key and Public Site ID should be done through the dashboard.

Endpoint:

product-search/autocomplete/{accessToken}

Endpoint Usage:

To retrieve autocomplete suggestions, you need to make a GET request to the specified URL with the required parameters and headers.

Sample cURL Request:

curl --location 'http://{baseURL}/product-search/autocomplete/QWNjZXNzIHRva2Vu' \
--header 'Content-Type: application/json' \
--data '{"searchTerm": "bag"}',
"{baseURL}": "https://google.com"

Note: Make sure to replace placeholders in the cURL request with actual values before making the API call

cURL Request Parameters:

{baseURL}: The base URL of the Convertopia engine.

{accessToken}: The access token obtained after successful login. ReplaceQWNjZXNzIHRva2Vuwith the actual accesstoken.

"searchTerm" (string):The term you want to search for within the merchant store. It can be a keyword, phrase, or any other relevant text that describes the desired information or products.

Request Headers:

Content-Type: The content type of the request body. Set this header to application/json.

Response:

The API will respond with a JSON-encoded response containing the tempalte and redirection.
If redirect URL is configured in the Convertopia dashboard, it will return "redirection true" along with the specified URL instead of the template.

{
    "template": "URL" ,
    "redirection": true
}

If a redirect URL is not specified in the Convertopia dashboard, it will return "redirect false" along with the provided template.

{
    "template": "html string" ,
    "redirection": false
}

CDN's

Autocomplete can be implemented using a CDN for JSON.
This documentation provides information on how to utilize these CDN services for Autocomplete functionality.

JS | http://cdn.convertopia.com/static/js/{siteID}/convertopia.js

Image | http://cdn.convertopia.com/static/image/{siteID}/{imageName}

To access the CDN services, you can obtain the necessary details from the Convertopia dashboard.

Requirements:

Access to the Convertopia dashboard

Steps to Implement Autocomplete


1. Log in to the Convertopia dashboard.

2. Navigate to the Autocomplete > Installation Instructions .

3. Identify the selectorID from the merchant's code that corresponds to the search field where you need to implement autocomplete functionality.
Please provide the specific selectorID for the search field in convertopia dashboard .

4. Locate the result container ID from the merchant's code that corresponds to the section displaying the autocomplete search results.
Additionally, provide the color used to highlight the best match within the search results.


Analytics Tracking

Analytics tracking is the process of collecting, measuring, and analyzing data about how users interact with a website or application. This data provides insights into user behavior, helping businesses understand how visitors navigate through their platform, which pages are most popular, the time spent on each page, and the actions users take. you can enhance user experience, improve conversion rates, and drive overall growth. Whether you're running a website or an application like Convertopia, integrating robust analytics tracking is essential for sustained success and continuous improvement.

Implementation

How to set up:

Go to the Dashboard => configuration => AJAX Installation

To ensure seamless installation, simply copy the provided code/script and paste it at the bottom of your template, just before the closing tag.

Global Tracking:

Implement global tracking by inserting the code snippet at the top of every page of your site as given below

This ensures that tracking is activated across all pages, providing comprehensive insights into user interactions and behavior.

For the "public_site_id," utilize the Convertopia Store-ID already available in our extension. As for the "session_id," generate a unique ID for each merchant site session. Ensure consistency so that each session has only one ID. If the customer is logged in, pass their login or email address for identification.

Page View Tracking

Implement page view tracking on all site pages, ensuring that global tracking events fire beforehand.

If the customer is registered, their login or email ID is passed; otherwise, 'guest' is passed. Various page types are listed below.

Page Type Value:

Page Types Description
ACCOUNT_LOGIN When the customer is on the login page of their account
ACCOUNT_SIGNUP When the customer is on the signup page to create an account
ACCOUNT_DASHBORD When the customer is on their dashboard after logging in
CART When customer is on the cart page
CHECKOUT_BEGIN When the customer start's checkout
CHECKOUT_SHIPPING When customer is on the checkout shipping page
CHECKOUT_PAYMENT When the customer is on the checkout payment page
CHECKOUT_REVIEW When the customer is on the checkout review page and is ready to place the order
CLP When the customer is on a category landing page
HOME When the customer is on the homepage
PLP When customer is on a product listing page
PDP When customer is on a product details page
ORDER_CONFIRMATION When the customer is on the order confirmation page
OTHER When the page isn't specified, we can utilize it

Add To Cart:

Ensure that the global event fires first, then fire the event below when the customer adds a product to their cart

If the customer is registered, pass their login or email ID; otherwise, pass 'guest'.

Cart View:

Ensure that the global event fires first, then fire the event below when the customer views their cart

If the customer is registered, pass their login or email ID; otherwise, pass 'guest'.

Checkout Event:

Ensure that the global event fires first, then fire the event below when the customer starts their checkout

If the customer is registered, pass their login or email ID; otherwise, pass 'guest'.

Checkout Shipping:

Ensure the global event fires first, then trigger the event below when the customer completes their shipping address

If the customer is registered, pass their customer ID; if they enter their email address, pass the hashed version; otherwise, pass 'guest'.

Checkout Payment:

Ensure the global event fires first, then trigger the event below when the customer completes their payment

If the customer is a registered customer, pass their customer ID; otherwise, pass 'guest'.

Order Confirmation Event:

Ensure the global event fires first, then trigger the event below at the time of the order confirmation page

If the customer is a registered customer, their login or email ID is passed; otherwise, 'guest' is passed.

Testing:

Inside the browser console, when you enter `window.convertopia`, it should display all fired events on the page.

Errors

Conventional HTTP response codes are employed by Convertopia to convey the outcome of an API request, whether it was successful or unsuccessful. Typically, response codes in the 2xx range signify a successful operation. Response codes in the 4xx range indicate an error that occurred due to inadequate information provided, such as a missing required parameter or a failed transaction. On the other hand, response codes in the 5xx range indicate an error related to Convertopia's servers, although such occurrences are infrequent.
Some 4xx errors that could be handled programmatically (e.g., a card is declined) include an error code that briefly explains the error reported.

HTTP status code summary
200-OK Everything worked as expected.
400-Bad Request The request sent to the server is invalid or corrupted.
401-Unauthorized No valid API key provided.
404-Not Found The requested resource doesn't exist.
501-Server Errors The server does not support the functionality required to fulfill the request.