cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a new size?

SOLVED

How can I create a new size?

I need to create new sizes via API
Example:
XXS
XXXL

 

How can I do it?

Thank you very much.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How can I create a new size?

@luciano_siqueir I hope you need to create product attributes options via API. If yes we have a OOTB API to create option.

You can refer this API

 

Note: Make sure size attribute is already created.

 

Example:

API URL: http://{{site_url}}/index.php/rest/V1/products/attributes/{attribute_code}/options

METHOD: POST

BODY:

 

{
  "option": {
    "label": "XXS",
    "value": "XXS",
    "sort_order": 0,
    "is_default": true,
    "store_labels": [
      {
        "store_id": 0,
        "label": "XXS"
      }
    ]
  }
}

 

Thanks

Sathish

 

View solution in original post

6 REPLIES 6

Re: How can I create a new size?

Hi @luciano_siqueir 

 

So you want to create a new size attribute of new configurable product using REST Api ?

 

If you are talking about new configurable products with new size then i would suggest you to refer below link :

 

https://devdocs.magento.com/guides/v2.3/rest/tutorials/configurable-product/create-configurable-prod... 

 

https://magento.stackexchange.com/questions/156374/how-do-i-create-a-configurable-product-using-the-... 

 

It will helps you for the same.

 

Hope it helps !

 

 

if issue solved,Click Kudos & Accept as Solution

Re: How can I create a new size?

@luciano_siqueir I hope you need to create product attributes options via API. If yes we have a OOTB API to create option.

You can refer this API

 

Note: Make sure size attribute is already created.

 

Example:

API URL: http://{{site_url}}/index.php/rest/V1/products/attributes/{attribute_code}/options

METHOD: POST

BODY:

 

{
  "option": {
    "label": "XXS",
    "value": "XXS",
    "sort_order": 0,
    "is_default": true,
    "store_labels": [
      {
        "store_id": 0,
        "label": "XXS"
      }
    ]
  }
}

 

Thanks

Sathish

 

Re: How can I create a new size?

Hi Sathish,

 

Thank you very much!!

Worked perfectly.

 

Tks

Luciano

 

Re: How can I create a new size?

Hi Sathish.

 

Could you help me again?

 

New questions:

1- How can I do if I need to change the description of a Size, make a PUT. Have any options?


2- If I have a website with 2 languages, how can I insert the description of Size in different languages.
Would it be in "store_id": 0?

 

 

Thank you.

Luciano

Re: How can I create a new size?

@luciano_siqueir My answer resolved your queries Click Kudos & Accept as Solution

Re: How can I create a new size?

Hi @Sathish_S 

 

 

Could you help me again?

 

New questions:

1- How can I do if I need to change the description of a Size, make a PUT. Have any options?


2- If I have a website with 2 languages, how can I insert the description of Size in different languages.
Would it be in "store_id": 0?

 

 

Thank you.

Luciano