• Home
  • >
  • Woocommerce
  • >
  • How do you use REST API to sync data from your website with other stores?

How do you use REST API to sync data from your website with other stores?

When you use Woocommerce, you are using a free ecommerce plugin that enables you to sell anything and everything from your online store seamlessly and beautifully. This plugin can be integrated with WordPress and help you build online stores that help both store owners and developers.

At Digital Aptech, we have introduced REST API sync, which allows WooCommerce data to be created, read, updated and deleted using requests in the JSON format. We have synced REST API in the Woocommerce store to other platforms like Revel, Quickbooks, etc.

Here’s how:

When you are using REST API, you need to check whether you are using:

  • WooCommerce 2.6+
  • WordPress 4.4+
  • Pretty permalinks in Settings > Permalinks so that the custom endpoints are supported. Default permalinks will not work.
  • It is important to know the response format. The default response format is JSON. Requests with a message-body use plain JSON to set or update resource attributes. Successful requests will return a 200 OK HTTP status.
  • To use this REST API, it is mandatory to have Woocommerce API keys generated for your website.
  • This can be done from the admin. Generating API keys in the WordPress admin interface

Step 1:

To create or manage keys for a WordPress user, go to WooCommerce > Settings > API to enable the REST API option.

Step 2:

Click the “Add Key” button. In the next screen, add a description and select the WordPress user you would like to generate the key for. Use of the REST API with the generated keys will conform to that user’s WordPress roles and capabilities.

Choose the level of access for this REST API key, which can be Read access, Write access or Read/Write access. Then click the “Generate API Key” button and WooCommerce will generate REST API keys for the selected user.

Step 3:

Now that keys have been generated, you can see two new keys, a QRCode, and a Revoke API Key button. These two keys are your Consumer Key and Consumer Secret.

You then have the woocommerce object to call the API methods. For this, you may use HTTP Basic Auth by providing the REST API Consumer Key as the username and the REST API Consumer Secret as the password.

Here is the sample code by how can use the Rest API:

November 16 , 2016

Digital Aptech

This entry was posted in Woocommerce

Why Hire Us?

  • Awarded with "Fastest growing Indian company excellence award" at 8th International Achievers Conference at Bangkok, Thailand.
  • Featured as the "Company of the Month" in December 2016 in India's premier IT magazine, Silicon India having significant circulation in US and in India.
  • Featured among the "20 most promising Digital Marketing Solution Providers in India in 2016" in the prestigious entrepreneur magazine in India
  • ISO 9001:2008 Certified & RAR+ Recommended Company
  • Around 200+ In-house Employee and 800+ Years Of Collective Experience
  • 1500+ Digital Projects Delivered
  • Savings of up to 50% on your project cost
  • Assured monthly work production of 160 hours Guaranteed
  • Total Project Management Control
  • 9000 sq. ft. State-of-the-art Facilities & Infrastructure
  • Work with Your OWN remote team
  • 24x7 Availability when required
  • We Sign NDA for Confidentiality, All Rights Are Owned By You
  • Profitable Since Inception. US$ 2Million turnover

Projects VS DRM!

This is a Detailed Breakdown of the Advantages that the Dedicated Resource Model vis-à-vis the Conservative Project Model. Read More...

Quick Contact

Keep in touch at

Ourlocations

We are here to help you and would love to hear from you, so please feel free to contact us.


US Office

Visit Us

193 Twilight Terrace Bailey,
CO 80421
(Greater Denver Area)

Tel: +1-650 481 6031


UK Office

Visit Us

Box 4343,Office 6 Slington House,
Rankine Road, BASINGSTOKE,
RG24 8PH, United Kingdom

Tel: +44 20 79932099


India Development Office

Visit Us

EN-34 (9th Floor),
Block-EN, Sector - V,
Salt Lake City, Kolkata - 700091, West Bengal, India

Tel: +91 33 69000863 / 69


Australia Office

Visit Us

25, Ashbury Grove,
Hillside
Australia – 3037

Tel: +61 433 134 786