E-commerce is eating the retail world, and mobile app is playing an important role.
If you own an e-commerce website, you should consider having an app for your business,
because people tend to use mobile apps more ofthen than mobile web browser,
and if you are running your e-commerce site with Wordpress WooCommerce, there is a good news for you.
With WooCommerce API, you are good to go with the existing backend for your new mobile app.
I am not going into detail how to enable REST API for your WooCommerce site.
Let's just dive into developing the mobile app with it.
Here are the API docs to start with.
WooCommerce API provides
/token endpoints for sign up and login purpose.
However, do take note that the base url is different for
/token in this case.
To generate a token and hence login a user, you need to use
Whereas for the rest of the API, use
/wp-json/wc/v2/ as base url instead.
However, there are a pitfall in the authentication/customers module, which is reset a user password.
To reset a password, WooCommerce did not provide an endpoint for that,
but considering the amount of time saved for the rest of the available APIs, this is some what tolerable.
Not to mention there are ways around it.
This endpoint is pretty much perfect for showing list of products for viewing, with pagination options and lots of other metadata like available stocks, prices etc.
You can also build product reviews screens with the
Product reviews module. Pretty neat.
Perhaps the most important feature of all e-commerce apps.
WooCommerce doesn't provide cart module. This is left for developer to implement own cart and checkout system.
However, it is not hard to build one. I will cover this part in future blog topic.
Customers place orders and with this module, you are good to go to show the purchase history, order status and etc.
You can also view purchased item and their respective prices with a bit of twist.
Well this could be a bit tricky because in order to have good user experience, it is advisable to go with native implementation of payment gateway(because you are just one step away from making a sale!).
So you want to be extra careful here. Luckily for most payment gateway provider(that I've used so far), mobile support is available and somewhat considered good for certain provider.
Overall it is time saving to use WooCommerce API considering that most APIs are ready to be consumed for mobile app. Products, reviews, customers and orders modules are well taken care of.
Developer just need to integrate with payment gateway and implement a shopping cart & check-out module for a complete e-commerce app.
So with the time saved, it means more time for better UI/UX, or simply reduction in development cost.