Before using this endpoint please review our Live Indexing Requirements, Use Cases, and Caveats documentation.

Upsert

The upsert operation inserts or replaces the entire contents of a product record in Searchspring.  Use this operation to insert new records, or replace existing records with new data.

Request URL

https://[Site ID]:[Secret Key]@[Site ID].a.searchspring.io/api/index/upsert.json
Site IDThe identifier for your site. It can be found on the My Account page of the Searchspring Management Console.
Secret KeyThe secret key for your live indexing API. Do not share this. Should you need assistance getting this value, please submit a ticket to our Support team using this form.

Request Body

The request body should be a JSON encoded string with the following attributes. Note there is a 3MB limit on the size of the request body. If you wish to upsert more products than will fit in 3MB, you will need to split your products up into multiple batches.

feedIdThe identifier for your data feed. Should you need assistance getting this value, please submit a ticket to our Support team using this form.
recordsAn array of objects representing items in your Searchspring search database that you wish to create/update. See example below.

Example

{
   "feedId": 42,
   "records": [{
      "product_id": "1",
      "name" : "Blue Nike Shirt",
      "price" : 17.99,
      "categories" : ["Clothing", "Shirts"],
      "image" : "http://www.mystore.com/images/blueshirt.jpg",
      "thumbnail" : "http://www.mystore.com/thumbs/blueshirt.jpg",
      "url" : "http://www.mystore.com/blue-shirt.html",
      "in_stock" : true,
      "rating" : 4.5,
      "brand" : "Nike",
      "color" : "Blue",
      "popularity" : 9
   },{
      "product_id": "2",
      "name" : "Red Volcom Shirt",
      "price" : 19.99,
      "categories" : ["Clothing", "Shirts"],
      "image" : "http://www.mystore.com/images/redshirt.jpg",
      "thumbnail" : "http://www.mystore.com/thumbs/redshirt.jpg",
      "url" : "http://www.mystore.com/red-shirt.html",
      "in_stock" : true,
      "rating" : 4.2,
      "brand" : "Volcom",
      "color" : "Red",
      "popularity" : 7
   },{
      "product_id": "3",
      "name" : "Green Adidas Shoes",
      "price" : 49.99,
      "categories" : ["Shoes", "Sale"],
      "image" : "http://www.mystore.com/images/greenshoes.jpg",
      "thumbnail" : "http://www.mystore.com/thumbs/greenshoes.jpg",
      "url" : "http://www.mystore.com/green-shoes.html",
      "in_stock" : false,
      "rating" : 5,
      "brand" : "Adidas",
      "color" : "Green",
      "popularity" : 10
   }]
}



Delete

Deletes products from the Searchspring search database. This uses the same endpoint as the Upsert command, but uses the DELETE HTTP method instead of POST.

Request URL

https://[Site ID]:[Secret Key]@[Site ID].a.searchspring.io/api/index/upsert.json
Site IDThe identifier for your site. It can be found on the My Account page of the Searchspring Management Console.
Secret KeyThe secret key for your live indexing API. Do not share this. Should you need assistance getting this value, please submit a ticket to our Support team using this form.

Request Body

The request body should be a JSON encoded string with the following attributes. Note there is a 3MB limit on the size of the request body. If you wish to delete more products than will fit in 3MB, you will need to split your products up into multiple batches.

feedIdThe identifier for your data feed. Should you need assistance getting this value, please submit a ticket to our Support team using this form.
recordsAn array of IDs of the products in the Searchspring search database that you wish to delete. These must match the values in your Searchspring ID field. You may delete more than one product at a time. See example below.

Example:

{
   "feedId": 42,
   "records": ["1","2","3"]
}