Cannot use namespace 'WooCommerceProvider' as a type

I’m trying to use the WooCommerce API to retrieve a list of products for my Ionic APP, and I’ve created a provider for that purpose, which contains the following code:

import { Injectable } from '@angular/core';
import * as WC from 'woocommerce-api';

export class WooCommerceProvider {
  Woocommerce: any;
  WoocommerceV2 : any;
  constructor() {

this.Woocommerce =  WC({
  url: '',
  consumerKey: 'xxxxxxxxxxxxxxxx',
  consumerSecret: 'xxxxxxxxxxxxx',
  wpAPI: true, // Enable the WP REST API integration
  queryStringAuth: true,
  verifySsl: true,
  version: 'wc/v2' // WooCommerce WP REST API version

    return new Promise((resolve, reject) => {

I’ve replaced the consumer key and secret with my own. The following is the page where I try to receive the list of products:

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, AlertController } from 'ionic-angular';
import * as WC from 'woocommerce-api';
import { WooCommerceProvider } from '../providers/woo-commerce/woo-commerce';

 * Generated class for the ShopPage page.
 * See for more info
 * on Ionic pages and navigation.

  selector: 'page-shop',
  templateUrl: 'shop.html',
export class ShopPage {

  produse: any[];
  WooCommerce: any;

  constructor(public navCtrl: NavController, public navParams: NavParams, 
     private alertCtrl: AlertController,private wooProvider: WooCommerceProvider ) {

      this.WooCommerce = wooProvider.WooCommerce;

      this.WooCommerce.getAsync("products").then((searchData) => {
        this.produse = JSON.parse(searchData.body).products;


I get the following error : [ts] Cannot use namespace ‘WooCommerceProvider’ as a type.

Have you tried using ng2woo? That’s the direction I would go – either using someone else’s Angular wrapper, or writing my own.

Thanks for the tip. I did exactly as the Readme said, and I keep getting the following error:

"No route was found matching the URL and request method"

When are you getting the error, and what is its stack trace?

I get the error after I run Ionic Serve and enter the page where I should receive the products from the WooCommerce API. This is the message I get in the debugger: