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
- [NEW] One click integration via DigiXport
- 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)
- Click on Export
Step 3 (Optional): Order the columns Or use sort and filter options.
- You can now use the sort, order and filter options to filter the columns as per your needs.
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>>