• Resolved markh28

    (@markh28)


    I am using the API to upload products with variations. I first make a post to the API with the main product to this endpoint: https://my.site.com/wp-json/wc/v3/products/

    This works fine. Now I am adding the variations (each variation with its own post to the endpoint: https://my.site.com/wp-json/wc/v3/products/MYSKU/variations and am using the following json:

    {
       "regular_price": "26.99",  
       "sku": "sku-1",
       "image": [
          {
            "src": "https://my.site.com/my-image-name.jpg"
          }
        ],
       "attributes": [
          {
             "name": "Color",
              "option": "Blue"
          }
       ]
    }

    and everything works fine except when I visit the product page and change the variation, the image does not change with it (which it should). Also when I edit the product in the dashboard, there is no image shown in the variation.

    I have changed my theme to Twenty-twenty-one and disabled all plugins, and that did not fix it. The problem must be in the API, since the variation image is not getting attached to the variation through the above code.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • @markh28

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.
    
    I can also recommend <a href="https://developer.woocommerce.com/" rel="noopener" target="_blank">the WooCommerce Developer Resources Portal</a> for resources on developing for WooCommerce.
    
    You can also visit the <a href="https://www.facebook.com/groups/advanced.woocommerce/" rel="noopener" target="_blank">WooCommerce Facebook group</a> or the <code>#developers</code> channel of the <a href="https://woocommerce.com/community-slack/" rel="noopener" target="_blank">WooCommerce Community Slack</a>. We're lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Seems we’ve not had additional inputs on this thread. Thus, we encourage you to make use of the above resources.

    I’ll go ahead and mark the thread as resolved but please feel free to create a new thread if you have further questions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Rest API Product Variation Images does not work’ is closed to new replies.