Excellent stuff. That seems to be working.
There’s a related issue that might be a symptom of another problem – when issuing a PUT command to update the stock the returned data lists all the categories the shop supports.
For example:
Product “API_test” appears in the category “Fox Box”
A GET command on it lists the following:
{
"success": true,
"data": {
"id": 7354,
"type": "simple",
"name": "API_test",
"description": "",
"sku": "",
"brand": "",
"gtin": "",
"mpn": "",
"featured": false,
"visibility": 3,
"is_taxable": true,
"tax_classes": [],
"size": {
"weight": "0",
"width": "0",
"height": "0",
"length": "0"
},
"attributes": [],
"attribute_order": null,
"attachments": [],
"categories": [
{
"id": 70,
"name": "Fox Box",
"slug": "fox-box",
"link": "https:\/\/fox-box.co.uk\/product-category\/fox-box\/"
}
],
"tags": [],
"link": "https:\/\/fox-box.co.uk\/product\/api_test\/",
"cross_sells": [],
"up_sells": [],
"regular_price": 0,
"stock": {
"manage": true,
"status": 1,
"allow_backorders": "no",
"stock": 1
},
"sale": {
"enabled": false,
"price": "",
"from": {
"timestamp": 1528156800,
"date": "2018-06-05"
},
"to": {
"timestamp": 1528156800,
"date": "2018-06-05"
}
}
}
}
If I then issue a PUT command to update the stock:
{"jigoshop_product":{"stock_stock":3}
}
The returned value is:
{
"success": true,
"data": {
"id": 7354,
"type": "simple",
"name": "API_test",
"description": "",
"sku": "",
"brand": "",
"gtin": "",
"mpn": "",
"featured": false,
"visibility": 3,
"is_taxable": true,
"tax_classes": [],
"size": {
"weight": "0",
"width": "0",
"height": "0",
"length": "0"
},
"attributes": [],
"attribute_order": null,
"attachments": [],
"categories": [
{
"id": 35,
"name": "Big Gunz",
"slug": "orc-big-gunz",
"link": "https:\/\/fox-box.co.uk\/product-category\/orc-big-gunz\/"
},
{
"id": 106,
"name": "Clergy",
"slug": "clergy",
"link": "https:\/\/fox-box.co.uk\/product-category\/clergy\/"
},
{
"id": 105,
"name": "Crusaders",
"slug": "crusaders",
"link": "https:\/\/fox-box.co.uk\/product-category\/crusaders\/"
},
{
"id": 107,
"name": "Familiars",
"slug": "familiars",
"link": "https:\/\/fox-box.co.uk\/product-category\/familiars\/"
},
{
"id": 70,
"name": "Fox Box",
"slug": "fox-box",
"link": "https:\/\/fox-box.co.uk\/product-category\/fox-box\/"
},
{
"id": 37,
"name": "Greenskin Accessories",
"slug": "greenskin-accessories",
"link": "https:\/\/fox-box.co.uk\/product-category\/greenskin-accessories\/"
},
{
"id": 21,
"name": "Greenskin Arms",
"slug": "orc-arms",
"link": "https:\/\/fox-box.co.uk\/product-category\/orc-arms\/"
},
{
"id": 4,
"name": "Greenskin Heads",
"slug": "orc-heads",
"link": "https:\/\/fox-box.co.uk\/product-category\/orc-heads\/"
},
{
"id": 22,
"name": "Greenskin Left Arms",
"slug": "orc-left-arms",
"link": "https:\/\/fox-box.co.uk\/product-category\/orc-left-arms\/"
},
{
"id": 19,
"name": "Greenskin Legs",
"slug": "orc-legs",
"link": "https:\/\/fox-box.co.uk\/product-category\/orc-legs\/"
},
{
"id": 23,
"name": "Greenskin Right Arms",
"slug": "orc-right-arms",
"link": "https:\/\/fox-box.co.uk\/product-category\/orc-right-arms\/"
},
{
"id": 18,
"name": "Greenskin Torsos",
"slug": "orc-torsos",
"link": "https:\/\/fox-box.co.uk\/product-category\/orc-torsos\/"
},
{
"id": 53,
"name": "Greenskin Vehicles",
"slug": "greenskin-vehicles",
"link": "https:\/\/fox-box.co.uk\/product-category\/greenskin-vehicles\/"
},
{
"id": 5,
"name": "Greenskins",
"slug": "orcs",
"link": "https:\/\/fox-box.co.uk\/product-category\/orcs\/"
},
{
"id": 39,
"name": "Grots & Goblins",
"slug": "grots",
"link": "https:\/\/fox-box.co.uk\/product-category\/grots\/"
},
{
"id": 33,
"name": "Gunz",
"slug": "gunz",
"link": "https:\/\/fox-box.co.uk\/product-category\/gunz\/"
},
{
"id": 34,
"name": "H2H",
"slug": "orc-h2h",
"link": "https:\/\/fox-box.co.uk\/product-category\/orc-h2h\/"
},
{
"id": 91,
"name": "Kitbasherz' Korner",
"slug": "kitbashing",
"link": "https:\/\/fox-box.co.uk\/product-category\/kitbashing\/"
},
{
"id": 62,
"name": "Kromlech",
"slug": "kromlech",
"link": "https:\/\/fox-box.co.uk\/product-category\/kromlech\/"
},
{
"id": 89,
"name": "LavaTurbine",
"slug": "lavaturbine",
"link": "https:\/\/fox-box.co.uk\/product-category\/lavaturbine\/"
},
{
"id": 79,
"name": "Opposing Forces",
"slug": "op-for",
"link": "https:\/\/fox-box.co.uk\/product-category\/op-for\/"
},
{
"id": 104,
"name": "Sororitas Arcanum",
"slug": "sororitas-arcanum",
"link": "https:\/\/fox-box.co.uk\/product-category\/sororitas-arcanum\/"
},
{
"id": 87,
"name": "Terrain",
"slug": "terrain",
"link": "https:\/\/fox-box.co.uk\/product-category\/terrain\/"
},
{
"id": 54,
"name": "Vehicle Accessories",
"slug": "vehicle-accessories",
"link": "https:\/\/fox-box.co.uk\/product-category\/vehicle-accessories\/"
},
{
"id": 38,
"name": "Vehicle Crew",
"slug": "vehicle-crew",
"link": "https:\/\/fox-box.co.uk\/product-category\/vehicle-crew\/"
},
{
"id": 36,
"name": "Vehicle Parts",
"slug": "vehicle-parts",
"link": "https:\/\/fox-box.co.uk\/product-category\/vehicle-parts\/"
},
{
"id": 32,
"name": "Weapons",
"slug": "orc-weapons",
"link": "https:\/\/fox-box.co.uk\/product-category\/orc-weapons\/"
}
],
"tags": [
{
"id": 90,
"name": "acrylic",
"slug": "acrylic",
"link": "https:\/\/fox-box.co.uk\/product-tag\/acrylic\/"
},
{
"id": 43,
"name": "Basicks",
"slug": "basicks",
"link": "https:\/\/fox-box.co.uk\/product-tag\/basicks\/"
},
{
"id": 57,
"name": "bike",
"slug": "bike",
"link": "https:\/\/fox-box.co.uk\/product-tag\/bike\/"
},
{
"id": 42,
"name": "bionic",
"slug": "bionic",
"link": "https:\/\/fox-box.co.uk\/product-tag\/bionic\/"
},
{
"id": 41,
"name": "bionik",
"slug": "bionik",
"link": "https:\/\/fox-box.co.uk\/product-tag\/bionik\/"
},
{
"id": 109,
"name": "Blackthumb",
"slug": "blackthumb",
"link": "https:\/\/fox-box.co.uk\/product-tag\/blackthumb\/"
},
{
"id": 108,
"name": "Familiars",
"slug": "familiars",
"link": "https:\/\/fox-box.co.uk\/product-tag\/familiars\/"
},
{
"id": 86,
"name": "Fox Box",
"slug": "fox-box",
"link": "https:\/\/fox-box.co.uk\/product-tag\/fox-box\/"
},
{
"id": 110,
"name": "full kit",
"slug": "full-kit",
"link": "https:\/\/fox-box.co.uk\/product-tag\/full-kit\/"
},
{
"id": 111,
"name": "full sculpt",
"slug": "full-sculpt",
"link": "https:\/\/fox-box.co.uk\/product-tag\/full-sculpt\/"
},
{
"id": 24,
"name": "gloves",
"slug": "gloves",
"link": "https:\/\/fox-box.co.uk\/product-tag\/gloves\/"
},
{
"id": 60,
"name": "glyph",
"slug": "glyph",
"link": "https:\/\/fox-box.co.uk\/product-tag\/glyph\/"
},
{
"id": 49,
"name": "Goblin",
"slug": "goblin",
"link": "https:\/\/fox-box.co.uk\/product-tag\/goblin\/"
},
{
"id": 51,
"name": "Gretchin",
"slug": "gretchin",
"link": "https:\/\/fox-box.co.uk\/product-tag\/gretchin\/"
},
{
"id": 50,
"name": "Grot",
"slug": "grot",
"link": "https:\/\/fox-box.co.uk\/product-tag\/grot\/"
},
{
"id": 59,
"name": "gubbinz",
"slug": "gubbinz",
"link": "https:\/\/fox-box.co.uk\/product-tag\/gubbinz\/"
},
{
"id": 46,
"name": "GW",
"slug": "gw",
"link": "https:\/\/fox-box.co.uk\/product-tag\/gw\/"
},
{
"id": 29,
"name": "Hard Plastic",
"slug": "hard-plastic",
"link": "https:\/\/fox-box.co.uk\/product-tag\/hard-plastic\/"
},
{
"id": 47,
"name": "headwear",
"slug": "headwear",
"link": "https:\/\/fox-box.co.uk\/product-tag\/headwear\/"
},
{
"id": 25,
"name": "helmet",
"slug": "helmet",
"link": "https:\/\/fox-box.co.uk\/product-tag\/helmet\/"
},
{
"id": 103,
"name": "hobby accessories",
"slug": "hobby-accessories",
"link": "https:\/\/fox-box.co.uk\/product-tag\/hobby-accessories\/"
},
{
"id": 84,
"name": "Kromlech",
"slug": "kromlech",
"link": "https:\/\/fox-box.co.uk\/product-tag\/kromlech\/"
},
{
"id": 102,
"name": "LavaTurbine",
"slug": "lavaturbine",
"link": "https:\/\/fox-box.co.uk\/product-tag\/lavaturbine\/"
},
{
"id": 74,
"name": "Mek'z Speshul",
"slug": "mekz-speshul",
"link": "https:\/\/fox-box.co.uk\/product-tag\/mekz-speshul\/"
},
{
"id": 48,
"name": "Metal",
"slug": "metal",
"link": "https:\/\/fox-box.co.uk\/product-tag\/metal\/"
},
{
"id": 44,
"name": "Orc",
"slug": "orc",
"link": "https:\/\/fox-box.co.uk\/product-tag\/orc\/"
},
{
"id": 72,
"name": "Orc Boyz",
"slug": "orc-boyz",
"link": "https:\/\/fox-box.co.uk\/product-tag\/orc-boyz\/"
},
{
"id": 69,
"name": "Ork Battlewagon",
"slug": "ork-battlewagon",
"link": "https:\/\/fox-box.co.uk\/product-tag\/ork-battlewagon\/"
},
{
"id": 78,
"name": "Ork Bommer",
"slug": "ork-bommer",
"link": "https:\/\/fox-box.co.uk\/product-tag\/ork-bommer\/"
},
{
"id": 27,
"name": "Ork Boyz",
"slug": "ork-boyz",
"link": "https:\/\/fox-box.co.uk\/product-tag\/ork-boyz\/"
},
{
"id": 67,
"name": "Ork Gretchin",
"slug": "ork-gretchin",
"link": "https:\/\/fox-box.co.uk\/product-tag\/ork-gretchin\/"
},
{
"id": 64,
"name": "Ork Lootas & Burnas",
"slug": "ork-lootas-burnas",
"link": "https:\/\/fox-box.co.uk\/product-tag\/ork-lootas-burnas\/"
},
{
"id": 40,
"name": "Ork Nobz",
"slug": "ork-nobz",
"link": "https:\/\/fox-box.co.uk\/product-tag\/ork-nobz\/"
},
{
"id": 68,
"name": "Ork Stormboyz",
"slug": "ork-stormboyz",
"link": "https:\/\/fox-box.co.uk\/product-tag\/ork-stormboyz\/"
},
{
"id": 58,
"name": "Ork Trukk",
"slug": "ork-trukk",
"link": "https:\/\/fox-box.co.uk\/product-tag\/ork-trukk\/"
},
{
"id": 55,
"name": "Ork Warbikers",
"slug": "ork-warbikers",
"link": "https:\/\/fox-box.co.uk\/product-tag\/ork-warbikers\/"
},
{
"id": 63,
"name": "OW2",
"slug": "ow2",
"link": "https:\/\/fox-box.co.uk\/product-tag\/ow2\/"
},
{
"id": 31,
"name": "Resin",
"slug": "resin",
"link": "https:\/\/fox-box.co.uk\/product-tag\/resin\/"
},
{
"id": 80,
"name": "Sororitas Arcanum",
"slug": "sororitas-arcanum",
"link": "https:\/\/fox-box.co.uk\/product-tag\/sororitas-arcanum\/"
},
{
"id": 92,
"name": "Special!",
"slug": "special",
"link": "https:\/\/fox-box.co.uk\/product-tag\/special\/"
},
{
"id": 66,
"name": "Terrain",
"slug": "terrain",
"link": "https:\/\/fox-box.co.uk\/product-tag\/terrain\/"
},
{
"id": 56,
"name": "vehicle",
"slug": "vehicle",
"link": "https:\/\/fox-box.co.uk\/product-tag\/vehicle\/"
}
],
"link": "https:\/\/fox-box.co.uk\/product\/api_test\/",
"cross_sells": [],
"up_sells": [],
"regular_price": 0,
"stock": {
"manage": true,
"status": 1,
"allow_backorders": "no",
"stock": 3
},
"sale": {
"enabled": false,
"price": "",
"from": {
"timestamp": 1528156800,
"date": "2018-06-05"
},
"to": {
"timestamp": 1528156800,
"date": "2018-06-05"
}
}
}
}
Has it actually enabled all the categories? Let’s issue the same GET command again:
{
"success": true,
"data": {
"id": 7354,
"type": "simple",
"name": "API_test",
"description": "",
"sku": "",
"brand": "",
"gtin": "",
"mpn": "",
"featured": false,
"visibility": 3,
"is_taxable": true,
"tax_classes": [],
"size": {
"weight": "0",
"width": "0",
"height": "0",
"length": "0"
},
"attributes": [],
"attribute_order": null,
"attachments": [],
"categories": [
{
"id": 70,
"name": "Fox Box",
"slug": "fox-box",
"link": "https:\/\/fox-box.co.uk\/product-category\/fox-box\/"
}
],
"tags": [],
"link": "https:\/\/fox-box.co.uk\/product\/api_test\/",
"cross_sells": [],
"up_sells": [],
"regular_price": 0,
"stock": {
"manage": true,
"status": 1,
"allow_backorders": "no",
"stock": 1
},
"sale": {
"enabled": false,
"price": "",
"from": {
"timestamp": 1528156800,
"date": "2018-06-05"
},
"to": {
"timestamp": 1528156800,
"date": "2018-06-05"
}
}
}
}
Nope. Weird.
Not exactly a high priority but something that might be worth a quick look. Thanks for fixing the functionality that matters though!