Skip to content

andw99/woocommerce_flutter_api

 
 

Repository files navigation

WooCommerce Flutter API

A comprehensive Flutter package for seamless WooCommerce integration. Easily manage authentication, notifications, cart, and product data with updated dependencies and full documentation.

Dependencies

This package leverages the following dependencies:

Installation

To install the package, run:

flutter pub add woocommerce_flutter_api

Usage

Create the main WooCommerce object to access all the features of the package:

final woocommerce = WooCommerce(
  baseUrl: '<woocommerce-url>', 
  username: '<username>', 
  password: '<password>', 
  useFaker: true,
  isDebug: true, // true by default
  apiPath: '<some-custom-path>',
);

Using Fake Data (useFaker)

The useFaker property is designed for development and testing purposes. When set to true, all API requests will return fake data generated by the faker package. This is especially useful if your WooCommerce backend is still under development—allowing you to build and test your application without relying on live data. Once your backend is ready, simply set useFaker to false to receive real data.

Example of initializing with fake data enabled:

final woocommerce = WooCommerce(
  baseUrl: '<woocommerce-url>', 
  username: '<username>', 
  password: '<password>', 
  useFaker: true,
  isDebug: true, // true by default
  apiPath: '<some-custom-path>',
);

In this mode, every API call (e.g., authentication, notifications, cart, products) will return simulated responses, allowing you to continue development seamlessly until your WooCommerce backend is published.

Authentication

Login and securely store the user ID:

await woocommerce.login('<email>', '<password>');

Notifications

Fetch all notifications for the currently logged in user:

final notifications = await woocommerce.getNotifications();

Cart

Retrieve the cart for the current user:

final cart = await woocommerce.getCart();

WooCommerce API

Fetch a list of products:

final response = await woocommerce.getProducts();

Roadmap

This package is actively being developed, and the following features have been implemented so far:

Implemented Features ✅

  • Authentication (Login & Secure Storage)
  • Fetching Notifications
  • Managing Cart (Retrieve user cart)
  • Fetching Products
  • Order Management (Retrieve, Create, Update, and Delete orders)
  • Product Tags API (Get, Create, Update, Delete product tags)
  • Coupon Management (Retrieve, Create, Update, and Delete coupons)
  • Customer Management (Retrieve, Create, Update, and Delete customers)
  • Order Additional Features (actions, notes, refunds)
  • Product Additional Features (shipping classes, reviews)
  • Reports API
  • Tax rates API
  • Tax classes API
  • Refunds API
  • Webhook API
  • Settings API
  • Setting Options API
  • Payment Gateways API
  • Shipping API (zones, locations, methods)
  • System status API
  • System status tools API
  • Data API

Upcoming Features 🚀

  • Better documentation

Contributing

Contributions are welcome! If you have suggestions, bug fixes, or improvements, please open an issue or submit a pull request. Your contributions will help make this package even better.

About

Woocommerce flutter api integration with external plugin created by [email protected] and published by [email protected].

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 100.0%