1. Home
  2. Docs
  3. Custom API Examples
  4. Import Woocommerce data to the Google Sheets

Import Woocommerce data to the Google Sheets

WooCommerce is an ecommerce plugin for wordpress used by merchants all around the world.

You can import the WooCommerce data to google sheet via 2 method as mentioned below

  1. [NEW] One click integration via DigiXport
  2. Custom API

To get started quickly you can choose the method – 1.


[NEW] One click integration via DigiXport.


In this article, we’ll be looking at the custom API method.

You can use GET request to import the data from WordPress to google sheets. Also, we’ll go through an example to import orders data in google sheet.

Step 1: Get the API keys of WooCommerce REST API 

  • Log into your WordPress.
  • Go To WooCommerce > Settings > Advanced > REST API
  • Click on Add key.
  • Enter any description, Select the user & then permissions as read access.
  • Click on Generate API Keys.
  • Copy the Consumer key and Consumer secret.

NOTE: You can follow this steps to get the API keys from WooCommerce.

 

Step 2: Setup the API Url and Authorization

  • You can enter the URL as: “{{SITE_URL}}/wp-json/wc/v3/orders”. You can replace the SITE_URL with your own website.
  • Select the authorization as Basic. Enter the username and password as consumer key and consumer secret (which you copied from last step)

customapi_woocommerce

  • Click on Export

 

Step 3 (Optional): Order the columns Or use sort and filter options.

For more information, you can check the WooCommerce REST admin API documentation.

 

Key Points

  • You can use the Sheet cell values to import the data with the dynamic date range. You can fetch the values of the parameters before and after from the google sheet. For Eg: https://www.example.com/wp-json/wc/v2/orders?before=<<Sheet!A1>>&after=<<Sheet!B1>>

Leave a Reply

Your email address will not be published. Required fields are marked *