How can I remove a custom attribute from a product via REST? Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How can i set a name or custom attribute for a specific storeview through REST API?The requested Payment Method is not available When creating an orderHow to return a JSON object with a custom REST API in Magento 2?Unable to update custom column value of sales_order via Rest APIGet product custom attribute data Magento 2?How to clear a custom option via REST product updateUnable to create customer using curl commandHow to check if custom product attribute existsHow to get product via attribute value or label?Export custom option via REST interface

Why do we bend a book to keep it straight?

Sci-Fi book where patients in a coma ward all live in a subconscious world linked together

String `!23` is replaced with `docker` in command line

How to react to hostile behavior from a senior developer?

Why aren't air breathing engines used as small first stages

Ring Automorphisms that fix 1.

What would be the ideal power source for a cybernetic eye?

Short Story with Cinderella as a Voo-doo Witch

The logistics of corpse disposal

Book where humans were engineered with genes from animal species to survive hostile planets

What is known about the Ubaid lizard-people figurines?

Using audio cues to encourage good posture

Why are Kinder Surprise Eggs illegal in the USA?

Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?

How do I name drop voicings

How do I keep my slimes from escaping their pens?

Okay to merge included columns on otherwise identical indexes?

Is the Standard Deduction better than Itemized when both are the same amount?

Why light coming from distant stars is not discreet?

At the end of Thor: Ragnarok why don't the Asgardians turn and head for the Bifrost as per their original plan?

Is it true that "carbohydrates are of no use for the basal metabolic need"?

When were vectors invented?

Why is "Consequences inflicted." not a sentence?

What does an IRS interview request entail when called in to verify expenses for a sole proprietor small business?



How can I remove a custom attribute from a product via REST?



Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?How can i set a name or custom attribute for a specific storeview through REST API?The requested Payment Method is not available When creating an orderHow to return a JSON object with a custom REST API in Magento 2?Unable to update custom column value of sales_order via Rest APIGet product custom attribute data Magento 2?How to clear a custom option via REST product updateUnable to create customer using curl commandHow to check if custom product attribute existsHow to get product via attribute value or label?Export custom option via REST interface



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I can add or change a custom attribute of a product, i.e. via



curl -X PUT --header "Content-Type: application/json" 
--header "Accept: application/json"
--header "Authorization: Bearer MYTOKEN" -d '"product":
"id":1,
"attribute_set_id":10,
"name": "Testproduct",
"sku": "test",
"custom_attributes": [

"attribute_code": "test_attribute",
"value": "the value"

]
,
"saveOptions":true' "https://magentohost/rest/default/V1/products/test"


but how can I remove that attribute(-value) again?



Using the admin-backend, I can remove it by setting its value to an empty string, however trying that with the rest api does not change anything. (just as if I leave out the attribute)
I also tried it with '"value": null', but then I get an error "Error occurred during "custom_attributes" processing. Value is not set for attribute code "test_attribute""



I am using Magento 2.1.3 (EE)










share|improve this question






























    3















    I can add or change a custom attribute of a product, i.e. via



    curl -X PUT --header "Content-Type: application/json" 
    --header "Accept: application/json"
    --header "Authorization: Bearer MYTOKEN" -d '"product":
    "id":1,
    "attribute_set_id":10,
    "name": "Testproduct",
    "sku": "test",
    "custom_attributes": [

    "attribute_code": "test_attribute",
    "value": "the value"

    ]
    ,
    "saveOptions":true' "https://magentohost/rest/default/V1/products/test"


    but how can I remove that attribute(-value) again?



    Using the admin-backend, I can remove it by setting its value to an empty string, however trying that with the rest api does not change anything. (just as if I leave out the attribute)
    I also tried it with '"value": null', but then I get an error "Error occurred during "custom_attributes" processing. Value is not set for attribute code "test_attribute""



    I am using Magento 2.1.3 (EE)










    share|improve this question


























      3












      3








      3


      1






      I can add or change a custom attribute of a product, i.e. via



      curl -X PUT --header "Content-Type: application/json" 
      --header "Accept: application/json"
      --header "Authorization: Bearer MYTOKEN" -d '"product":
      "id":1,
      "attribute_set_id":10,
      "name": "Testproduct",
      "sku": "test",
      "custom_attributes": [

      "attribute_code": "test_attribute",
      "value": "the value"

      ]
      ,
      "saveOptions":true' "https://magentohost/rest/default/V1/products/test"


      but how can I remove that attribute(-value) again?



      Using the admin-backend, I can remove it by setting its value to an empty string, however trying that with the rest api does not change anything. (just as if I leave out the attribute)
      I also tried it with '"value": null', but then I get an error "Error occurred during "custom_attributes" processing. Value is not set for attribute code "test_attribute""



      I am using Magento 2.1.3 (EE)










      share|improve this question
















      I can add or change a custom attribute of a product, i.e. via



      curl -X PUT --header "Content-Type: application/json" 
      --header "Accept: application/json"
      --header "Authorization: Bearer MYTOKEN" -d '"product":
      "id":1,
      "attribute_set_id":10,
      "name": "Testproduct",
      "sku": "test",
      "custom_attributes": [

      "attribute_code": "test_attribute",
      "value": "the value"

      ]
      ,
      "saveOptions":true' "https://magentohost/rest/default/V1/products/test"


      but how can I remove that attribute(-value) again?



      Using the admin-backend, I can remove it by setting its value to an empty string, however trying that with the rest api does not change anything. (just as if I leave out the attribute)
      I also tried it with '"value": null', but then I get an error "Error occurred during "custom_attributes" processing. Value is not set for attribute code "test_attribute""



      I am using Magento 2.1.3 (EE)







      magento-2.1 attributes product-attribute rest custom-attributes






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 11 mins ago









      Muhammad Anas

      622320




      622320










      asked Feb 7 '17 at 16:37









      Tim RiemenschneiderTim Riemenschneider

      164




      164




















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f158606%2fhow-can-i-remove-a-custom-attribute-from-a-product-via-rest%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f158606%2fhow-can-i-remove-a-custom-attribute-from-a-product-via-rest%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Magento 2 - Add success message with knockout Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Success / Error message on ajax request$.widget is not a function when loading a homepage after add custom jQuery on custom themeHow can bind jQuery to current document in Magento 2 When template load by ajaxRedirect page using plugin in Magento 2Magento 2 - Update quantity and totals of cart page without page reload?Magento 2: Quote data not loaded on knockout checkoutMagento 2 : I need to change add to cart success message after adding product into cart through pluginMagento 2.2.5 How to add additional products to cart from new checkout step?Magento 2 Add error/success message with knockoutCan't validate Post Code on checkout page

          Fil:Tokke komm.svg

          Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?