A lightweight Java client library for WooCommerce REST API integration. Built for Java developers who need to integrate their applications with WooCommerce e-commerce platform. π
This API client provides a type-safe Java interface for WooCommerce REST API v3, enabling seamless management of:
- WooCommerce products and inventory
- Customer data and orders
- E-commerce operations via REST API
- π‘ Type-Safe Java API - fully typed interfaces for WooCommerce REST endpoints
- π‘οΈ Basic authentication - secure WooCommerce API acce 8000 ss
- π Clear documentation - comprehensive examples for Java integration
- π Wide Java support - compatible with Java 8 and newer
- β‘ OpenAPI Generated - based on our OpenAPI specification developed from official WooCommerce documentation
- β
Customers API
- List all customers
- Create a new customer
- Get a specific customer
- Update a customer
- Delete a customer
- β
Products API
- List all products
- Create a new product
- Get a specific product
- Update a product
- Delete a product
- β
Product Variations API
- List all variations of a product
- Create a new product variation
- Get a specific product variation
- Update a product variation
- Delete a product variation
- β
Product Categories API
- List all product categories
- Create a new product category
- Get a specific product category
- Update a product category
- Delete a product category
- β
Orders API
- List all orders
- Create a new order
- Get a specific order
- Update an order
- Delete an order
- β
Reports
- Retrieve and view orders totals report
- Retrieve and view sales report
β οΈ Note: This is an early development version!We are actively implementing more WooCommerce API features. Contributions and feedback are welcome on GitHub!
- Current version:
0.9.6
- Supported WooCommerce API version:
v3
- Java compatibility: Java 8+
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files, to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software.
The only requirement is to preserve the original author attribution in the source code and documentation.
You can add the library to your project by including the dependency from Maven Central:
<!-- https://mvnrepository.com/artifact/pl.wtx.woocommerce/woocommerce-api-client -->
<dependency>
<groupId>pl.wtx.woocommerce</groupId>
<artifactId>woocommerce-api-client</artifactId>
<version>0.9.6</version>
</dependency>
Alternatively, clone and build the library from source:
git clone https://github.com/wtx-labs/woocommerce-api-client-java.git
cd woocommerce-api-client-java
mvn clean install
Then add the locally built artifact to your project:
<dependency>
<groupId>pl.wtx.woocommerce</groupId>
<artifactId>woocommerce-api-client</artifactId>
<version>0.9.6</version>
</dependency>
Here's how to fetch WooCommerce customer data using the client:
package pl.wtx.woocommerce;
import java.util.List;
import pl.wtx.woocommerce.api.client.CustomersApi;
import pl.wtx.woocommerce.api.client.invoker.ApiException;
import pl.wtx.woocommerce.api.client.model.Customer;
public class WooCommerceApiClientUsageDemo {
// TODO: Set your WooCommerce API base path!
private static final String API_BASE_PATH = "https://your-woocommerce-shop.com/wp-json/wc/v3";
private static final String API_USERNAME = "TODO_SET_API_USERNAME";
private static final String API_PASSWORD = "TODO_SET_API_PASSWORD";
public static void main(String[] args) {
System.out.println(">>> Start running the WooCommerceApiClientUsageDemo...");
// Use WooCommerceApiClient(true) if you need to log API communication messages.
WooCommerceApiClient apiClient = new WooCommerceApiClient();
apiClient.setBasePath(API_BASE_PATH);
apiClient.setUsername(API_USERNAME);
apiClient.setPassword(API_PASSWORD);
CustomersApi customersApi = new CustomersApi(apiClient);
try {
List<Customer> customers = customersApi.listAllCustomers(
null, null, null, null, null, null, null, null, null, null, null
);
// Example list of customer's emails:
customers.forEach(customer -> System.out.println("Customer: " + customer.getEmail()));
} catch (ApiException e) {
System.err.println("Error occurred during API call: " + e);
}
System.out.println("<<< The WooCommerceApiClientUsageDemo has been finished.");
}
}
- β¨ Check our GitHub Issues for latest updates
- π‘ Have suggestions? Open an Issue or contribute to the project
- π Star this repository if you find it helpful!
- β 5 GitHub stars
- π Regular updates and improvements
- π₯ Open for community contributions
woocommerce java client, woocommerce rest api java, java woocommerce integration, woocommerce api v3 java, e-commerce java integration, woocommerce java library, java rest api client woocommerce, woocommerce api client library for java
π Happy coding! π
Your WTX Labs Team π