HomeGuidesRecipesDocumentationChangelog
Log InDiscussions
Discussions

Product Import API - Example JSON

Our Product Import API originally only supported JSON files to be uploaded during the POST request. You can now POST a JSON payload directly to the API without attaching a file. This example should help in both cases.

If you are associating an imported item with an asset in Threekit, you will have to specify the type. The following asset types are available: scene, model, material, texture, stage, item, composite, attribute, upload, vector, font, vfb, video, lut, folder

🚧

JSON vs File Approach

Please be aware that the Product Import API now supports JSON payloads in the body as well as uploading files as previously supported. Each approach has a dedicated page in the Server Side APIs category.

Create Item

You can find our Asset Import API here.

[
  {
    "product": {
      "name": "Soprano Sofa",
      "description": "Moderation is the quintessence of elegance; etc...",
      "tags": ["Bed", "Corner"],
      "keywords": ["Soprano"],
      "metadata": [
        {
          "name": "Brand",
          "type": "String",
          "defaultValue": "Testing"
        },
        {
          "name": "SKU",
          "type": "String",
          "defaultValue": "3NSZPL-1,5NWP"
        },
        {
          "name": "Threehub Category",
          "type": "String",
          "defaultValue": "Furniture"
        },
        {
          "name": "Product Family",
          "type": "String",
          "defaultValue": "Another test"
        },
        {
          "name": "Collection",
          "type": "String",
          "defaultValue": "Soprano"
        },
        {
          "name": "Availability",
          "type": "String",
          "defaultValue": "Europe, Russia,Georgia"
        },
        {
          "name": "URL",
          "type": "String",
          "defaultValue": "https://threehome.threekit.com/lounge-chair/"
        },
        {
          "name": "Height (cm)",
          "type": "Number",
          "defaultValue": 120
        },
        {
          "name": "Width (cm)",
          "type": "Number",
          "defaultValue": 327
        }
      ],
		"asset": {
			"assetId": "2a792534-844c-45bc-b61b-cdd211273d24", // ID of associated asset,
			"configuration": {},
			"type": "model"
		}
    }
  }
]

Update Item

To update an item, you will also need to provide a query object in the file. For example:

[
    {
        "query": {
            "id": "081fc8e1-d76f-4dd4-ad78-7e9310a0725c" // ID of item
        },
        "product": {
            "name": "Soprano2",
            "asset": {
                "assetId": "2a792534-844c-45bc-b61b-cdd211273d24", // ID of associated asset
                "configuration": {},
                "type": "model"
            }
        }
    }
]