Title: Syntax for API PUT operations? [Potential Bug]
Last modified: May 10, 2018

---

# Syntax for API PUT operations? [Potential Bug]

 *  Resolved [Flamekebab](https://wordpress.org/support/users/flamekebab/)
 * (@flamekebab)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/)
 * I can get the API to give me information on orders and products (i.e. GET operations)
   but for the life of me I can’t figure out the correct format to send a simple
   stock update command.
 * In the documentation there’s several parameters which aren’t marked as optional(
   e.g. “post_excerpt”) and then there’s various other options but it’s not clear
   how to communicate them to the API.
 * I was hoping it’d be a standard cURL request with something like this appended:
   `-
   d '{"jigoshop_product":{"stock_stock":1}}'`
 * Doing that _does work_. Sort of. It seems to end up breaking the product though.
   Here’s a GET operation on the test product before issuing the PUT command:
 *     ```
       {
       	"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": [],
       		"attachments": [],
       		"categories": [],
       		"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": 1525910400,
       				"date": "2018-05-10"
       			},
       			"to": {
       				"timestamp": 1525910400,
       				"date": "2018-05-10"
       			}
       		}
       	}
       }
       ```
   
 * So let’s issue a PUT command:
 *     ```
       curl --request PUT \
         --url https://fox-box.co.uk/api/v1/products/7354 \
         --header 'authorization: Bearer [CENSORED]' \
         --header 'content-type: application/json' \
         --data '{"jigoshop_product":{
       	"stock_stock":5}
       }'
       ```
   
 * That gave a 200 OK so let’s see what the updated product looks like:
 *     ```
       {
       	"success": true,
       	"data": {
       		"id": 7354,
       		"type": "simple",
       		"name": "",
       		"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": [],
       		"attachments": [],
       		"categories": [],
       		"tags": [],
       		"link": "https:\/\/fox-box.co.uk\/product\/",
       		"cross_sells": [],
       		"up_sells": [],
       		"regular_price": 0,
       		"stock": {
       			"manage": true,
       			"status": 1,
       			"allow_backorders": "no",
       			"stock": 5
       		},
       		"sale": {
       			"enabled": false,
       			"price": "",
       			"from": {
       				"timestamp": 1525910400,
       				"date": "2018-05-10"
       			},
       			"to": {
       				"timestamp": 1525910400,
       				"date": "2018-05-10"
       			}
       		}
       	}
       }
       ```
   
 * That’s… interesting. It’s correctly updated the stock quantity so that’s good.
   Except it’s broken some important things like the product’s link and the product’s
   name.
 * Is it my syntax causing the issue or is that intended behaviour?
 * I can’t find any examples of how to do this, basically. Please add a few to the
   documentation. Please?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsyntax-for-api-put-operations-potential-bug%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Thread Starter [Flamekebab](https://wordpress.org/support/users/flamekebab/)
 * (@flamekebab)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/#post-10287292)
 * Related question: if I update stock this way will it prevent the “-1 units in
   stock” bug?
 * That is to say the stock tracking system seems to get confused when an order 
   is marked as complete if only one unit is in stock. It then lists items as having
   negative units in stock…
 *  [Jigoshop Support – Marcin](https://wordpress.org/support/users/azrielnefezen/)
 * (@azrielnefezen)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/#post-10293873)
 * Hi Flamekebab,
    You might be right with the bug in the PUT operations – I’ve 
   sent this to our Core Development department for further investigation.
 * With the stock quantities – which version of Jigoshop are you using? I believe
   it was fixed a while ago, but if the issue still persists we’d like to know.
 *  Thread Starter [Flamekebab](https://wordpress.org/support/users/flamekebab/)
 * (@flamekebab)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/#post-10293957)
 * I’m using the latest version, 2.1.12 at the time of writing. Interestingly the
   Jigoshop system information page doesn’t list a database version number. The 
   field is just blank.
 * I thought I’d gone through and refreshed every in stock item to ensure that the
   entries were up to date (after the change to how Jigoshop detects whether an 
   item is visible or not). Perhaps the items were still subject to that but it’s
   hard to say – my catalogue is too big for me to remember.
 * With regards to PUT operations a friend of mine asked why PATCH isn’t an option
   instead of PUT. After all – I only want to amend a single value, not change the
   entire product.
 *  Thread Starter [Flamekebab](https://wordpress.org/support/users/flamekebab/)
 * (@flamekebab)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/#post-10333878)
 * It’s now been well over two weeks and I still have boxes of stock sitting on 
   my living room floor because I can’t store them with the existing stock.
 * I used to have a fairly simple SQL query I could run to update stock quantities(
   bearing in mind that I have to modify hundreds of records). Since moving to Jigoshop
   2.x that’s not been an option. I was hoping that by using the API things could
   be done properly and avoid issues that an SQL workaround might cause (such as
   stock visibility problems).
 * Could I please have an answer on the _correct_ way to use the API to update a
   product’s quantities?
 *  [Jigoshop Support – Marcin](https://wordpress.org/support/users/azrielnefezen/)
 * (@azrielnefezen)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/#post-10335129)
 * You’re using the correct syntax. There was a bug in the API which prevented the
   product from properly updating, thus breaking the link, name and description.
 * That said – there are 3 mandatory fields in the API PUT command on the documentation
   page you linked, so until then you would need to send a request with all 3 of
   them.
 * This bug will be fixed in the next release, sorry for the inconvenience.
    -  This reply was modified 7 years, 10 months ago by [Jigoshop Support - Marcin](https://wordpress.org/support/users/azrielnefezen/).
 *  Thread Starter [Flamekebab](https://wordpress.org/support/users/flamekebab/)
 * (@flamekebab)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/#post-10335153)
 * In that case I’m glad I could help with the bug-stomping effort!
 * Would it make more sense to use a PATCH command rather than a PUT one though?
 *  [Jigoshop Support – Marcin](https://wordpress.org/support/users/azrielnefezen/)
 * (@azrielnefezen)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/#post-10335169)
 * Well, honestly, implementing another command into the API would make sense in
   the future. Right now it’s not that high on the priority list.
 *  Thread Starter [Flamekebab](https://wordpress.org/support/users/flamekebab/)
 * (@flamekebab)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/#post-10335186)
 * Fair enough, as long as it lets me update stock values from a list of product
   IDs I’ll be happy!
 *  [Jigoshop Support – Marcin](https://wordpress.org/support/users/azrielnefezen/)
 * (@azrielnefezen)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/#post-10365531)
 * The issue has been fixed in the latest release, please refer to [https://www.jigoshop.com/rest-api-docs/index.html](https://www.jigoshop.com/rest-api-docs/index.html)
   in order to check what’s changed in the API.
 *  Thread Starter [Flamekebab](https://wordpress.org/support/users/flamekebab/)
 * (@flamekebab)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/#post-10365841)
 * 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!
 *  Thread Starter [Flamekebab](https://wordpress.org/support/users/flamekebab/)
 * (@flamekebab)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/#post-10366431)
 * Another odd one – it seems like if one doesn’t supply a user agent the API just
   provides “200 OK” and does nothing. As in any given request won’t throw an error
   but also won’t do anything.
 *  Thread Starter [Flamekebab](https://wordpress.org/support/users/flamekebab/)
 * (@flamekebab)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/#post-10369401)
 * Follow up on the user-agent thing – there’s an extension I have for blocking 
   various crawlers. It was blocking python-requests. Nothing to do with Jigoshop
   🙂

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Syntax for API PUT operations? [Potential Bug]’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/jigoshop-ecommerce_222121.svg)
 * [Jigoshop eCommerce](https://wordpress.org/plugins/jigoshop-ecommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jigoshop-ecommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jigoshop-ecommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/jigoshop-ecommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jigoshop-ecommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jigoshop-ecommerce/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [potential bug?](https://wordpress.org/support/topic-tag/potential-bug/)

 * 12 replies
 * 2 participants
 * Last reply from: [Flamekebab](https://wordpress.org/support/users/flamekebab/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/syntax-for-api-put-operations-potential-bug/#post-10369401)
 * Status: resolved