Title: V3 &#8211; Problem with inserting variable product
Last modified: September 1, 2016

---

# V3 – Problem with inserting variable product

 *  [nerijunior](https://wordpress.org/support/users/nerijunior/)
 * (@nerijunior)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/v3-problem-with-inserting-variable-product/)
 * When I insert a variable product the attributes options turns into lowercase 
   inside the variations array but inside the attributes of parent product they 
   still capitalized.
 * Request:
 *     ```
       {
         "product": {
           "title": "Bla bla bla",
           "type": "variable",
           "enable_html_description": true,
           "sku": "V2058",
           "attributes": [
             {
               "name": "Cor",
               "slug": "cor",
               "position": 0,
               "visible": true,
               "variation": true,
               "options": [
                 "Preto",
                 "Branco"
               ]
             }
           ],
           "variations": [
             {
               "regular_price": "264.96",
               "attributes": {
                 "cor": {
                   "name": "Cor",
                   "slug": "cor",
                   "option": "Preto"
                 }
               },
               "dimensions": {
                 "length": "0",
                 "width": "0",
                 "height": "0"
               },
               "weight": "0",
               "sku": 2058,
               "in_stock": false,
               "id": 3535
             },
             {
               "regular_price": "264.96",
               "attributes": {
                 "cor": {
                   "name": "Cor",
                   "slug": "cor",
                   "option": "Branco"
                 }
               },
               "dimensions": {
                 "length": "0",
                 "width": "0",
                 "height": "0"
               },
               "weight": "0",
               "sku": 1958,
               "in_stock": false
             }
           ],
           "catalog_visibility": "visible"
         }
       }
       ```
   
 * Response from woocommerce:
 *     ```
       {
         "product": {
           "title": "Bla bla bla",
           "id": 3534,
           "type": "variable",
           "attributes": [
             {
               "name": "Cor",
               "slug": "cor",
               "position": 0,
               "visible": true,
               "variation": true,
               "options": [
                 "Branco",
                 "Preto"
               ]
             }
           ],
           "variations": [
             {
               "id": 3535,
               "created_at": "2016-07-27T20:50:43Z",
               "updated_at": "2016-08-10T18:39:24Z",
               "downloadable": false,
               "virtual": false,
               "permalink": "https://www.f2iluminacao.com.br/loja/abajur/abajur-vela-metal-e-tecido-preto-arquitetizze-ab1201-1-000/?attribute_pa_cor=preto",
               "sku": "2058",
               "price": "264.96",
               "regular_price": "264.96",
               "sale_price": null,
               "taxable": false,
               "tax_status": "taxable",
               "tax_class": "",
               "managing_stock": false,
               "stock_quantity": "",
               "in_stock": false,
               "backordered": false,
               "purchaseable": true,
               "visible": true,
               "on_sale": false,
               "weight": null,
               "dimensions": {
                 "length": "0",
                 "width": "0",
                 "height": "0",
                 "unit": "cm"
               },
               "shipping_class": "",
               "shipping_class_id": null,
               "image": [
                 {
                   "id": 4750,
                   "created_at": "2016-08-10T17:49:29Z",
                   "updated_at": "2016-08-10T17:49:29Z",
                   "src": "https://www.f2iluminacao.com.br/wp-content/uploads/1673.jpg",
                   "title": "",
                   "alt": "",
                   "position": 0
                 }
               ],
               "attributes": [
                 {
                   "name": "Cor",
                   "slug": "cor",
                   "option": "preto"
                 }
               ],
               "downloads": [],
               "download_limit": 0,
               "download_expiry": 0
             },
             {
               "id": 4776,
               "created_at": "2016-07-27T20:50:43Z",
               "updated_at": "2016-08-10T18:39:24Z",
               "downloadable": false,
               "virtual": false,
               "permalink": "https://www.f2iluminacao.com.br/loja/abajur/abajur-vela-metal-e-tecido-preto-arquitetizze-ab1201-1-000/?attribute_pa_cor=branco",
               "sku": "1958",
               "price": "264.96",
               "regular_price": "264.96",
               "sale_price": null,
               "taxable": false,
               "tax_status": "taxable",
               "tax_class": "",
               "managing_stock": false,
               "stock_quantity": "",
               "in_stock": false,
               "backordered": false,
               "purchaseable": true,
               "visible": true,
               "on_sale": false,
               "weight": null,
               "dimensions": {
                 "length": "0",
                 "width": "0",
                 "height": "0",
                 "unit": "cm"
               },
               "shipping_class": "",
               "shipping_class_id": null,
               "image": [
                 {
                   "id": 1016,
                   "created_at": "2016-07-06T21:59:49Z",
                   "updated_at": "2016-07-06T21:59:49Z",
                   "src": "https://www.f2iluminacao.com.br/wp-content/uploads/17651.jpg",
                   "title": "",
                   "alt": "",
                   "position": 0
                 }
               ],
               "attributes": [
                 {
                   "name": "Cor",
                   "slug": "cor",
                   "option": "branco"
                 }
               ],
               "downloads": [],
               "download_limit": 0,
               "download_expiry": 0
             }
           ],
       }
       ```
   
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

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

 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/v3-problem-with-inserting-variable-product/#post-7653546)
 * That will also be a slug (slugs are lowercase).
 *  Thread Starter [nerijunior](https://wordpress.org/support/users/nerijunior/)
 * (@nerijunior)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/v3-problem-with-inserting-variable-product/#post-7653591)
 * The problem is that the first variations works, the second not and I’m without
   ideas about the cause.
 * If the option inside variable product is a slug ok, but whem I sent it to api
   only the first product is assigned with the ‘cor’ attribute as ‘preto’ the second(
   branco) doesn’t work.
 *  [Caleb Burks](https://wordpress.org/support/users/icaleb/)
 * (@icaleb)
 * Automattic Happiness Engineer
 * [9 years, 10 months ago](https://wordpress.org/support/topic/v3-problem-with-inserting-variable-product/#post-7653649)
 * Doesn’t look like you are passing the attributes correctly for the variation.
   The docs show this:
 *     ```
       "attributes": [
       {
         "id": 6,
         "option": "black"
       },
       {
         "name": "Size",
         "option": "S"
       }
       ]
       ```
   
 * You have:
 *     ```
       "attributes": {
         "cor": {
           "name": "Cor",
           "slug": "cor",
           "option": "Preto"
         }
       },
       ```
   
 * [http://woothemes.github.io/woocommerce-rest-api-docs/#create-a-product](http://woothemes.github.io/woocommerce-rest-api-docs/#create-a-product)
 *  Thread Starter [nerijunior](https://wordpress.org/support/users/nerijunior/)
 * (@nerijunior)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/v3-problem-with-inserting-variable-product/#post-7653788)
 * Caleb Burks – You are saying that if I remove the “slug” from my attributes array
   that works, right?
 *  [Caleb Burks](https://wordpress.org/support/users/icaleb/)
 * (@icaleb)
 * Automattic Happiness Engineer
 * [9 years, 9 months ago](https://wordpress.org/support/topic/v3-problem-with-inserting-variable-product/#post-7653800)
 * There are more differences than just the slug being there.

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

The topic ‘V3 – Problem with inserting variable product’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [variable](https://wordpress.org/support/topic-tag/variable/)

 * 5 replies
 * 3 participants
 * Last reply from: [Caleb Burks](https://wordpress.org/support/users/icaleb/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/v3-problem-with-inserting-variable-product/#post-7653800)
 * Status: not resolved