v1

latestOpenAPI 3.0.22026-08-0426137631.3 KB
Product / Content APIs

Product / Content Upload API

Bulk API to insert Product records. This API endpoint accepts POST requests with JSON data containing a list of Product / Content records wrapped in a dictionary:

POST /v1/products

{"data": [product_1, product_2, product_3]}

Each product is uniquely identified by its product_id. If a record with the same product_id already exists in the dataset, the existing one will be replaced by the insertion (no partial update is allowed at this time). We recommend limiting your calls to around 100 records at a time to avoid memory issues or timeout risks.

Schema validation

This API validates the inserted records against the API schema; any schema error will cause the whole request to fail (status_code=422), and none of the records will be inserted. You should check the response.errors field to see if there are any errors. For example, the response below means there are no errors (status_code=200):

{
  "message": "success",
  "data": {
    "task_id": "{task_id}"
  }
}

A common source of errors when uploading Product records is that the custom attributes' data types are not consistent with the data types of the existing records. In such cases, you can check the individual error message in the data array. For example, if there is an error regarding the second record you tried to insert, the response might look like:

{
  "errors": true, // there are errors. please check!
  "data": [
    "data.0.custom_attributes.designer is invalid. Its data type is not consistent with other records",
    "data.0.product_id is invalid. The attribute expected to be of type 'string', but 'array' is given.",
    "data.0.created_at is invalid. The attribute should match 'date-time' format."
  ]
}

Internationalization (I18N)

Miso has the built-in support for majority of Western European languages, including English, French, German, Spanish, Italian, Dutch, Russian, and Ukrainian, as well as, major Asian languages, including Mandarin (both Simplified and Traditional), Japanese, and Korean.

In Dojo, you can choose the Primary Language for your product catalog (default is English). However, you can also have more than one language in your product catalog that is beyond your primary languages using the i18n_$LN fields (replace $LN with the two-letter language code of your choice), and let Miso apply the language-specific preprocessing for you, such as tokenization, stemming, elision removal, folding, decompounding, and traditional to simplified Chinese conversion.

For example, you may have a product called "Arizona, Green Tea with Ginseng & Honey" in your catalog, and you also sell it in your Spanish, French, and Chinese sites, and want your customers to be able to search for this product in their native languages.

In this case, your product records will like the following sample record, where English is the primary language of the record, and i18n_es, i18n_fr, i18n_zh fields contain product details in their corresponding languages.

{
    "product_id": "arizona-ginseng-honey",
    // the primary language is English
    "title": "Arizona, Green Tea with Ginseng & Honey",
    // ... other product details in English
    "i18n_es": {
       "title": "AriZona, Té verde con ginseng y miel"
        // ... other product details in Spanish
    },
    "i18n_fr": {
       "title": "AriZona - Thé Vert Aromatisé au Miel"
        // ... other product details in French
    },
    "i18n_zh": {
       "title": "美國ARIZONA亞歷桑納 - 蜂蜜人蔘綠茶"
        // ... other product details in Chinese
    }
 }

In this way, your customer can find this product with any of the following search queries without additional configuration:

  • arizona green tea
  • arizona te verde
  • arizona the vert
  • arizona 綠茶

The similar concept applies to Autocomplete as well. You can specify a language parameter in the requests to Autocomplete API, and the autocomplete results for the specific language will be returned.

post/v1/products

Request body

Example request

{
  "data": [
    {
      "product_id": "123ABC-S-Black",
      "product_group_id": "123ABC",
      "parent_id": "Nike_Shop_123",
      "type": "clothes",
      "title": "Japanese Shiba Inu Dog Eating Miso Soup T-Shirt",
      "description": "This cute Shiba inu dog eating Miso soup is perfect for those who love Japanese culture.",
      "short_description": "Cute Shiba Inu Dog Eating Miso Soup T-Shirt",
      "language": "en",
      "categories": [
        [
          "Clothing, Shoes & Jewelry",
          "Women",
          "T-Shirts"
        ],
        [
          "Novelty",
          "Tops & Tees",
          "T-Shirts"
        ]
      ],
      "tags": [
        "cute",
        "anime",
        "dogs",
        "t-shirt"
      ],
      "url": "https://example.com/miso-tshirt-123ABC",
      "cover_image": "https://example.com/miso-tshirt-123ABC.jpg",
      "original_price": 20,
      "sale_price": 15,
      "margin": 15,
      "size": "S",
      "color": "Black",
      "material": "Cotton",
      "brand": "Miso Corp.",
      "authors": [
        "Andy Hsieh"
      ],
      "publishers": [
        "O'Reilly Media"
      ],
      "collections": [
        "Anime T-Shirt Collection",
        "Superhero T-Shirt Collection"
      ],
      "location": [
        {
          "lat": 40.74844,
          "lon": -73.985664
        }
      ],
      "rating": 5,
      "custom_attributes": {
        "cast": [
          "Robin Williams",
          "Jonathan Hyde"
        ],
        "director": "Joe Johnston",
        "genres": [
          "Adventure",
          "Fantasy",
          "Family"
        ],
        "popularity": 7.439,
        "adult": false
      }
    }
  ]
}

Response

Successful Response

messagestring required

Human-readable message

Example response

{
  "message": "success"
}