---
# System prepended metadata

title: 'Fabric API notes:'

---

# Fabric API notes:
Getting list of items/products

https://awp6xjtoho-dsn.algolia.net/1/indexes/6061f5708d711f0007c01438-sandbox-copilot-search-item/query?x-algolia-agent=Algolia%20for%20JavaScript%20(4.4.0)%3B%20Browser

* Basic attributes to create an item/product include:
    1. SKU
    1. Title
    1. Primary Image
    1. Status

*PS: with attributes there is `GFK SKU` attr*

/api-pim/group-tree -> Associate category
/api-pim/family/list -> family
POST: /api-pim/item -> save item
body:

```json=
{
    "title":"Test01",
    "itemFamily":"60a6a974cc2b760008045b8f", // family/list
    "channel":[12,13],// waht is channels
    "group":["609fc474ecfb7b00080f1dee"], // /group-tree
    "sku":"test-01",
    "description":"<p>test description</p>\n",
    "startDate":"2021-06-02T08:20:18.813Z",
    "endDate":"2099-12-31T00:00:00.000Z",
    "isActive":true,// should ask about this and `state`
    
}

//response
{
"channel":[12,13],
"startDate":"2021-06-02T08:20:18.813Z",
"endDate":"2099-12-31T00:00:00.000Z",
"group":["609fc474ecfb7b00080f1dee"],
"imagesSetOnAttributes":[],
"isDefault":false,
"isActive":true,
"isSoftDeleted":false,
"_id":"60b7408da1d6a30008a4d042",
"title":"Test01",
"itemFamily":"60a6a974cc2b760008045b8f",
"sku":"TEST-01",
"description":"<p>test description</p>\n",
"state":"READY", // what other states do we have for this?
"itemId":1000000033,
"images":[],"videos":[],"files":[],
"attributes":[],"variants":[],"skuInSet":[],
"createdAt":"2021-06-02T08:25:49.483Z",
"updatedAt":"2021-06-02T08:25:49.483Z"
}

```

---------------------------
PUT https://sandbox.copilot.fabric.inc/api-pim/item/1000000033
```javascript=
fetch("https://sandbox.copilot.fabric.inc/api-pim/item/1000000033", {
  "headers": {
    "accept": "application/json, text/plain, */*",
    "accept-language": "en-US,en;q=0.9",
    "authorization": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYwYjVmZDQ5OTBhZDcwMDAwOGRkZWMzYiIsInJvbGVzIjpbIkFkbWluIl0sInBlcm1pc3Npb25zIjpbIndyaXRlOmNvbGxlY3Rpb24iLCJ3cml0ZTpyb2xlIiwicmVhZDpyb2xlIiwicmVhZDphdHRyaWJ1dGUtZ3JvdXAiLCJ3cml0ZTpza3VzZXQiLCJ3cml0ZTphdHRyaWJ1dGUtZ3JvdXAiLCJ3cml0ZTp1c2VyIiwid3JpdGU6YXR0cmlidXRlIiwicmVhZDpwZXJtaXNzaW9uIiwicmVhZDpza3VzZXQiLCJyZWFkOmF0dHJpYnV0ZSIsInJlYWQ6Y29sbGVjdGlvbiIsInJlYWQ6dXNlciJdLCJhY2NvdW50IjoiNjA2MWY1NzA4ZDcxMWYwMDA3YzAxNDM4IiwiYWNjb3VudElkIjo1MzA3Nzk3MDQ5LCJ1c2VyVHlwZSI6eyJraW5kIjoiUkVHSVNURVJFRCJ9LCJpYXQiOjE2MjI2MjM3MzMsImV4cCI6MTYyMjYyNTUzM30.QhHoG2LJrTVUzQGaTOnLOModdjYE1yDitohAWx_MQ6pJbR3yRILiuUo_CBmJyHcVTmISAuRkK6SJv_lfPRdBsw",
    "sec-ch-ua": "\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"",
    "sec-ch-ua-mobile": "?0",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "x-site-context": "{\"date\":\"2021-06-02T08:20:01.790Z\",\"channel\":12}"
  },
  "referrer": "https://sandbox.copilot.fabric.inc/pim/items/create",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": "{\"itemFamily\":\"60a6a974cc2b760008045b8f\",\"channel\":[12,13],\"title\":\"Test01\",\"sku\":\"TEST-01\",\"description\":\"<p>test description</p>\\n\",\"startDate\":\"2021-06-02T08:20:18.813Z\",\"endDate\":\"2099-12-31T00:00:00.000Z\",\"isActive\":true,\
 
 "attributes\":[{\"attributeGroupId\":null,\"id\":\"60a663cac65b44000884c736\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a663acc65b44000884c719\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a663cbc65b44000884c737\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a663b1c65b44000884c71d\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a663b3c65b44000884c71f\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a663b7c65b44000884c723\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a663bac65b44000884c725\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a663d7c65b44000884c744\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a663c1c65b44000884c72b\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a663dbc65b44000884c748\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a663dbc65b44000884c749\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a663dcc65b44000884c74a\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a663c7c65b44000884c732\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a663c8c65b44000884c733\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b4739d0e30040009a4f810\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b4742d0e30040009a4f811\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b474440e30040009a4f812\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b4745a0e30040009a4f813\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"609f9e4c31d1ca00084e29de\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b474fd0e30040009a4f814\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b475cc0e30040009a4f815\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b478de574ca50008b1ee1b\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a66510c65b44000884c8d4\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b47c7e64530a000881006b\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b47c6264530a000881006a\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b47c9f64530a000881006c\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b47cb064530a000881006d\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b47cbe64530a000881006e\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b47cce64530a000881006f\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b47a47574ca50008b1ee22\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b47a38574ca50008b1ee21\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b47a28574ca50008b1ee20\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b47a0c574ca50008b1ee1f\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b479fe574ca50008b1ee1e\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b479a8574ca50008b1ee1c\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"609f9eb431d1ca00084e29e1\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b47da664530a0008810070\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b47e0064530a0008810072\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b47e1264530a0008810073\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a69e409d99150008c03d55\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"609f9dfb31d1ca00084e29db\",\"value\":\"test-GFK\"},{\"attributeGroupId\":null,\"id\":\"60b61846e3f8d20007a54d5c\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b61839e3f8d20007a54d5b\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b63e3784bd130008f27f2e\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60b64921ee83510008b0c666\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"609f9e1631d1ca00084e29dc\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"609f9e7731d1ca00084e29df\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"609f9e9e31d1ca00084e29e0\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"609f9e2d31d1ca00084e29dd\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"609a0626a597ac0008656914\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a66544c65b44000884c91a\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a66501c65b44000884c8b7\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a66500c65b44000884c8b6\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a69e589d99150008c03d56\",\"value\":null},{\"attributeGroupId\":null,\"id\":\"60a66501c65b44000884c8b8\",\"value\":null}]}",
  
  
  "method": "PUT",
  "mode": "cors",
  "credentials": "include"
});




// response
```json
{"_id":"60b7408da1d6a30008a4d042","channel":[12,13],"startDate":"2021-06-02T08:20:18.813Z","endDate":"2099-12-31T00:00:00.000Z","group":["609fc474ecfb7b00080f1dee"],
"imagesSetOnAttributes":[],
"isDefault":false,"isActive":true,"isSoftDeleted":false,"title":"Test01","itemFamily":"60a6a974cc2b760008045b8f","sku":"TEST-01","description":"<p>test description</p>\n","state":"READY","itemId":1000000033,

"images":[{"_id":"60b740915f0202000853e89e","order":0,"label":"place.png","source":[{"_id":"60b740915f0202000853e89f","url":"https://greatwall-sandbox-sandbox-image.imgix.net/5307797049/pim/place.png","id":"60b740915f0202000853e89f"}],"id":"60b740915f0202000853e89e"}],


"videos":[],"files":[],

"attributes":[{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c007","id":"60a663cac65b44000884c736"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c008","id":"60a663acc65b44000884c719"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c009","id":"60a663cbc65b44000884c737"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c00a","id":"60a663b1c65b44000884c71d"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c00b","id":"60a663b3c65b44000884c71f"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c00c","id":"60a663b7c65b44000884c723"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c00d","id":"60a663bac65b44000884c725"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c00e","id":"60a663d7c65b44000884c744"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c00f","id":"60a663c1c65b44000884c72b"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c010","id":"60a663dbc65b44000884c748"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c011","id":"60a663dbc65b44000884c749"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c012","id":"60a663dcc65b44000884c74a"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c013","id":"60a663c7c65b44000884c732"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c014","id":"60a663c8c65b44000884c733"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c015","id":"60b4739d0e30040009a4f810"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c016","id":"60b4742d0e30040009a4f811"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c017","id":"60b474440e30040009a4f812"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c018","id":"60b4745a0e30040009a4f813"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c019","id":"609f9e4c31d1ca00084e29de"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c01a","id":"60b474fd0e30040009a4f814"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c01b","id":"60b475cc0e30040009a4f815"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c01c","id":"60b478de574ca50008b1ee1b"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c01d","id":"60a66510c65b44000884c8d4"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c01e","id":"60b47c7e64530a000881006b"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c01f","id":"60b47c6264530a000881006a"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c020","id":"60b47c9f64530a000881006c"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c021","id":"60b47cb064530a000881006d"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c022","id":"60b47cbe64530a000881006e"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c023","id":"60b47cce64530a000881006f"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c024","id":"60b47a47574ca50008b1ee22"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c025","id":"60b47a38574ca50008b1ee21"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c026","id":"60b47a28574ca50008b1ee20"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c027","id":"60b47a0c574ca50008b1ee1f"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c028","id":"60b479fe574ca50008b1ee1e"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c029","id":"60b479a8574ca50008b1ee1c"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c02a","id":"609f9eb431d1ca00084e29e1"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c02b","id":"60b47da664530a0008810070"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c02c","id":"60b47e0064530a0008810072"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c02d","id":"60b47e1264530a0008810073"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c02e","id":"60a69e409d99150008c03d55"},{"attributeGroupId":null,"value":"test-GFK","isDefault":false,"_id":"60b745f6f9fcf20008f7c02f","id":"609f9dfb31d1ca00084e29db"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c030","id":"60b61846e3f8d20007a54d5c"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c031","id":"60b61839e3f8d20007a54d5b"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c032","id":"60b63e3784bd130008f27f2e"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c033","id":"60b64921ee83510008b0c666"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c034","id":"609f9e1631d1ca00084e29dc"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c035","id":"609f9e7731d1ca00084e29df"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c036","id":"609f9e9e31d1ca00084e29e0"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c037","id":"609f9e2d31d1ca00084e29dd"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c038","id":"609a0626a597ac0008656914"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c039","id":"60a66544c65b44000884c91a"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c03a","id":"60a66501c65b44000884c8b7"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c03b","id":"60a66500c65b44000884c8b6"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c03c","id":"60a69e589d99150008c03d56"},{"attributeGroupId":null,"value":"","isDefault":false,"_id":"60b745f6f9fcf20008f7c03d","id":"60a66501c65b44000884c8b8"}],
"variants":[],
"skuInSet":[],
"createdAt":"2021-06-02T08:25:49.483Z","updatedAt":"2021-06-02T08:48:54.351Z","__v":0,"items":[]}
```
```

-----------
https://sandbox.copilot.fabric.inc/api-pim/item/product/enable-disable

{enable: true}