WooCommerce

Steps to Verify Woocommerce in Android App

Author By Chandan Kumar
August 5, 2017
8 min read
Share:
Steps to Verify Woocommerce in Android App

The most important thing that we are going to share with you guys today, that is how to verify woocommerce in the android app. Let’s check out the steps for Woocommerce authentication in the Android app.

Verify Woocommerce in Android App

WooCommerce Settings

  • Login to a WordPress site, and the menu will be displayed at the left side of the page from there select WooCommerce and select Settings menu under WooCommerce menu.
  • Setting options will appear in the content window select the API tab. Select settings under the API section. Check the Enable REST API checkbox to allow rest API access.
  • Select the Keys/Apps tab under the API section to add a key for the user and click the Add key button, add a description for the key and select user for which key will be generated. Always select Permission as Read/Write to have access to REST API for GET and POST methods.
  • Add key by providing details. And click on the Generate API Key button Consumer key and consumer secret keys will be generated

Android Setting

  • Add scribe library to android project in app/libs folder.
    Add the consumer key and consumer secret key in Strings.xml file
  • Create an oAuth service by providing consumer key and consumer secret key to request oAuth token for authorization.
  • Create an oAuth request with request method:

? For GET method:


? For POST method:


final Object being the JSONOBJECT with all required parameter values to post to API.

  • Send scribe signed requests based on the async http client method to construct a signed request for oAuth service. And send the request to server.

Get Products From Woocommerce Store:

  • Call the products API and pass category IDs in the URL, it will list all products of a category. It might be possible that a category has subcategories in it, in that case, pass all subcategories with the URL and all products for all subcategories mentioned in the URL will be listed
  • In product response each product will have a categories array, will list categories under which the product lies, get the category name or category ID and filter products on subcategory IDs. Suppose Category 1 has three subcategories then pass all three subcategory IDs in products API.

http://your_wordpress_site/wordpress/wp-json/wc/v2/products/?category=26,27,28
Product response will have categories array:

[php]
“categories”: [
{
“id”: 26,
“name”: “Subcategory”,
“slug”: “subcategory”
}
],
[/php]

While displaying subcategory with its products, filter this list based on current subcategory we are displaying.

Chandan Kumar

Chandan Kumar

Related Articles

Continue reading with these hand-picked articles on similar topics.

Customize WooCommerce Emails in Minutes: The Complete Guide 2025
WooCommerce
Customize WooCommerce Emails in Minutes: The Complete Guide 2025
WooCommerce stores offer multiple benefits, including sending automatic emails to customers concerning their orders. Automated emails help in building trust and improving communication. You easily get basic WooCommerce emails by default in CMSs. But you can customize WooCommerce emails to get added advantages. Customizing WooCommerce emails is possible for all WordPress and WooCommerce users. Check […]
Chandan Kumar January 22, 2025
Handy WooCommerce Shortcode Guide for Simplified and Customized eCommerce Store
WooCommerce
Handy WooCommerce Shortcode Guide for Simplified and Customized eCommerce Store
Unlock the power of WooCommerce shortcodes to enhance your store's functionality. Learn to customize pages, display products, and simplify user experience!
Chandan Kumar January 17, 2025
How to Integrate Google Merchant Center with WooCommerce
WooCommerce
How to Integrate Google Merchant Center with WooCommerce
Google Merchant Center, a.k.a. GMC or Google Shopping, is a free-to-use digital platform where online retailers can upload and display their physical products and services on Google. It enables targeted shoppers on Google to discover, explore, and buy at their convenience. The GMC works as a bridge between the Google search engine and your online […]
Chandan Kumar December 9, 2024