REST API – Page 5

WooCommerce REST API: Create Product with Images

I am starting to have more and more tutorials about REST API on my blog which is for sure because I am doing some work with my crossposting plugin.

Today is another one where I am going to share with you a simple code example how you can add Product image and Product gallery images when creating a product with REST API.

Just in case I mean these things:

WooCommerce product image and gallery images
You can find this if you go and edit any WooCommerce product.

WooCommerce REST API: Create Products with Attributes

Before all I also recommend you to check my basic WooCommerce REST API tutorial, where we just created and updated some simple products.

Right now I am going to show you two more specific examples. Two – because there are two types of attributes in WooCommerce – custom attributes and the ones that created in Products > Attributes menu (those are technically taxonomies).

Create and Update Products with WooCommerce API

Recently I was publishing and updating the tutorials about WordPress REST API, how to create a post, how to add a featured image and so on. But did you know that WooCommerce has its own API which is build on the base of a regular WordPress REST API but allows to do much more things and also simplifies the work with the other ones.

In this tutorial we are going to dive into actual examples of working with WooCommerce API, I will show examples of creating and updating products, and also we will try to search them by SKU and delete them.

One more thing – I am a big fan of using WordPress HTTP functions like wp_remote_get() and wp_remote_request(), so we are going to use them below. So no additional steps are needed like installation of a PHP library or anything else.