Skip to content

Commit 899fb48

Browse files
committed
fix: ISSUE-1: Enforce sending the 'status' parameter as a
comma-separated list of values.
1 parent 906bbe0 commit 899fb48

File tree

4 files changed

+197
-194
lines changed

4 files changed

+197
-194
lines changed

README.md

Lines changed: 154 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,155 @@
1-
# WooCommerce Java REST API Client
2-
3-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4-
[![Java Version](https://img.shields.io/badge/Java-8%2B-blue)](https://www.java.com)
5-
6-
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. 🚀
7-
8-
This API client provides a type-safe Java interface for WooCommerce REST API v3, enabling seamless management of:
9-
- WooCommerce products and inventory
10-
- Customer data and orders
11-
- E-commerce operations via REST API
12-
13-
## ✨ Why Choose This Client?
14-
15-
- 💡 **Type-Safe Java API** - fully typed interfaces for WooCommerce REST endpoints
16-
- 🛡️ **Basic Authentication** - secure WooCommerce API access
17-
- 📚 **Clear Documentation** - comprehensive examples for Java integration
18-
- 🚀 **Wide Java Support** - compatible with Java 8 and newer
19-
-**OpenAPI Generated** - based on our [OpenAPI specification](https://github.com/wtx-labs/woocommerce-api-openapi-specification) developed from official WooCommerce documentation
20-
21-
## 🎯 Currently Implemented Features
22-
23-
- ✅ Products API
24-
- List/search WooCommerce products
25-
- Create/Read/Update/Delete products
26-
- Filter products by status, date, stock status
27-
- Manage product inventory
28-
- ✅ Customers API
29-
- List/search WooCommerce customers
30-
- Create/Read/Update/Delete customers
31-
- Search and filter customer data
32-
- Manage customer accounts
33-
- ✅ Orders API
34-
- List/search WooCommerce orders
35-
- Create/Read/Update/Delete orders
36-
- Filter orders by status and date
37-
- Process order management
38-
39-
## 🚨 Project Status
40-
41-
> ⚠️ **Note: This is an early development version!**
42-
>
43-
> We are actively implementing more WooCommerce API features.
44-
> Contributions and feedback are welcome on GitHub!
45-
46-
## 📦 Version Information
47-
48-
- **Current Version**: `0.1.5-alpha-20250412`
49-
- **Supported WooCommerce API Version**: `v3`
50-
- **Java Compatibility**: Java 8+
51-
52-
53-
54-
## 🔓 License
55-
56-
**MIT License**
57-
58-
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.
59-
60-
The only requirement is to preserve the original author attribution in the source code and documentation.
61-
62-
## 🚀 Quick Start Guide
63-
64-
### 1️⃣ Installation
65-
66-
Clone and build the library from source:
67-
68-
```sh
69-
git clone https://github.com/wtx-labs/woocommerce-api-client-java.git
70-
cd woocommerce-api-client-java
71-
mvn clean install
72-
```
73-
74-
Then add the locally built artifact to your project:
75-
76-
```xml
77-
<dependency>
78-
<groupId>wtx.woocommerce</groupId>
79-
<artifactId>woocommerce-api-client</artifactId>
80-
<version>0.1.5-alpha-20250412</version>
81-
</dependency>
82-
```
83-
84-
### 2️⃣ Java Integration Example
85-
86-
Here's how to fetch WooCommerce customer data using the client:
87-
88-
```java
89-
package wtx.woocommerce;
90-
91-
import java.util.List;
92-
93-
import wtx.woocommerce.api.client.CustomersApi;
94-
import wtx.woocommerce.api.client.invoker.ApiException;
95-
import wtx.woocommerce.api.client.model.Customer;
96-
97-
public class WooCommerceApiClientUsageDemo {
98-
99-
// TODO: Set your WooCommerce API base path!
100-
private static final String API_BASE_PATH = "https://your-woocommerce-shop.com/wp-json/wc/v3";
101-
private static final String API_USERNAME = "TODO_SET_API_USERNAME";
102-
private static final String API_PASSWORD = "TODO_SET_API_PASSWORD";
103-
104-
public static void main(String[] args) {
105-
106-
System.out.println(">>> Start running the WooCommerceApiClientUsageDemo...");
107-
108-
// Use WooCommerceApiClient(true) if you need to log API communication messages.
109-
WooCommerceApiClient apiClient = new WooCommerceApiClient();
110-
111-
apiClient.setBasePath(API_BASE_PATH);
112-
apiClient.setUsername(API_USERNAME);
113-
apiClient.setPassword(API_PASSWORD);
114-
115-
CustomersApi customersApi = new CustomersApi(apiClient);
116-
117-
try {
118-
119-
List<Customer> customers = customersApi.listAllCustomers(
120-
null, null, null, null, null, null, null, null, null, null, null
121-
);
122-
123-
// Example list of customer's emails:
124-
customers.forEach(customer -> System.out.println("Customer: " + customer.getEmail()));
125-
126-
} catch (ApiException e) {
127-
System.err.println("Error occurred during API call: " + e);
128-
}
129-
130-
System.out.println("<<< The WooCommerceApiClientUsageDemo has been finished.");
131-
132-
}
133-
134-
}
135-
```
136-
137-
## 🔗 Get Involved
138-
139-
- ✨ Check our [GitHub Issues](https://github.com/wtx-labs/woocommerce-api-client-java/issues) for latest updates
140-
- 💡 Have suggestions? Open an Issue or contribute to the project
141-
- 🌟 Star this repository if you find it helpful!
142-
143-
## 📊 Project Statistics
144-
145-
- ⭐ 2 GitHub stars
146-
- 🔄 Regular updates and improvements
147-
- 👥 Open for community contributions
148-
149-
## 🔍 Keywords
150-
151-
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
152-
153-
🚀 Happy coding! 😊
154-
1+
# WooCommerce Java REST API Client
2+
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4+
[![Java Version](https://img.shields.io/badge/Java-8%2B-blue)](https://www.java.com)
5+
6+
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. 🚀
7+
8+
This API client provides a type-safe Java interface for WooCommerce REST API v3, enabling seamless management of:
9+
- WooCommerce products and inventory
10+
- Customer data and orders
11+
- E-commerce operations via REST API
12+
13+
## ✨ Why Choose This Client?
14+
15+
- 💡 **Type-Safe Java API** - fully typed interfaces for WooCommerce REST endpoints
16+
- 🛡️ **Basic Authentication** - secure WooCommerce API access
17+
- 📚 **Clear Documentation** - comprehensive examples for Java integration
18+
- 🚀 **Wide Java Support** - compatible with Java 8 and newer
19+
-**OpenAPI Generated** - based on our [OpenAPI specification](https://github.com/wtx-labs/woocommerce-api-openapi-specification) developed from official WooCommerce documentation
20+
21+
## 🎯 Currently Implemented Features
22+
23+
- ✅ Products API
24+
- List/search WooCommerce products
25+
- Create/Read/Update/Delete products
26+
- Filter products by status, date, stock status
27+
- Manage product inventory
28+
- ✅ Customers API
29+
- List/search WooCommerce customers
30+
- Create/Read/Update/Delete customers
31+
- Search and filter customer data
32+
- Manage customer accounts
33+
- ✅ Orders API
34+
- List/search WooCommerce orders
35+
- Create/Read/Update/Delete orders
36+
- Filter orders by status and date
37+
- Process order management
38+
39+
## 🚨 Project Status
40+
41+
> ⚠️ **Note: This is an early development version!**
42+
>
43+
> We are actively implementing more WooCommerce API features.
44+
> Contributions and feedback are welcome on GitHub!
45+
46+
## 📦 Version Information
47+
48+
- **Current Version**: `0.1.5-alpha-20250412`
49+
- **Supported WooCommerce API Version**: `v3`
50+
- **Java Compatibility**: Java 8+
51+
52+
53+
54+
## 🔓 License
55+
56+
**MIT License**
57+
58+
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.
59+
60+
The only requirement is to preserve the original author attribution in the source code and documentation.
61+
62+
## 🚀 Quick Start Guide
63+
64+
### 1️⃣ Installation
65+
66+
Clone and build the library from source:
67+
68+
```sh
69+
git clone https://github.com/wtx-labs/woocommerce-api-client-java.git
70+
cd woocommerce-api-client-java
71+
mvn clean install
72+
```
73+
74+
Then add the locally built artifact to your project:
75+
76+
```xml
77+
<dependency>
78+
<groupId>wtx.woocommerce</groupId>
79+
<artifactId>woocommerce-api-client</artifactId>
80+
<version>0.1.5-alpha-20250412</version>
81+
</dependency>
82+
```
83+
84+
### 2️⃣ Java Integration Example
85+
86+
Here's how to fetch WooCommerce customer data using the client:
87+
88+
```java
89+
package wtx.woocommerce;
90+
91+
import java.util.List;
92+
93+
import wtx.woocommerce.api.client.CustomersApi;
94+
import wtx.woocommerce.api.client.invoker.ApiException;
95+
import wtx.woocommerce.api.client.model.Customer;
96+
97+
public class WooCommerceApiClientUsageDemo {
98+
99+
// TODO: Set your WooCommerce API base path!
100+
private static final String API_BASE_PATH = "https://your-woocommerce-shop.com/wp-json/wc/v3";
101+
private static final String API_USERNAME = "TODO_SET_API_USERNAME";
102+
private static final String API_PASSWORD = "TODO_SET_API_PASSWORD";
103+
104+
public static void main(String[] args) {
105+
106+
System.out.println(">>> Start running the WooCommerceApiClientUsageDemo...");
107+
108+
// Use WooCommerceApiClient(true) if you need to log API communication messages.
109+
WooCommerceApiClient apiClient = new WooCommerceApiClient();
110+
111+
apiClient.setBasePath(API_BASE_PATH);
112+
apiClient.setUsername(API_USERNAME);
113+
apiClient.setPassword(API_PASSWORD);
114+
115+
CustomersApi customersApi = new CustomersApi(apiClient);
116+
117+
try {
118+
119+
List<Customer> customers = customersApi.listAllCustomers(
120+
null, null, null, null, null, null, null, null, null, null, null
121+
);
122+
123+
// Example list of customer's emails:
124+
customers.forEach(customer -> System.out.println("Customer: " + customer.getEmail()));
125+
126+
} catch (ApiException e) {
127+
System.err.println("Error occurred during API call: " + e);
128+
}
129+
130+
System.out.println("<<< The WooCommerceApiClientUsageDemo has been finished.");
131+
132+
}
133+
134+
}
135+
```
136+
137+
## 🔗 Get Involved
138+
139+
- ✨ Check our [GitHub Issues](https://github.com/wtx-labs/woocommerce-api-client-java/issues) for latest updates
140+
- 💡 Have suggestions? Open an Issue or contribute to the project
141+
- 🌟 Star this repository if you find it helpful!
142+
143+
## 📊 Project Statistics
144+
145+
- ⭐ 2 GitHub stars
146+
- 🔄 Regular updates and improvements
147+
- 👥 Open for community contributions
148+
149+
## 🔍 Keywords
150+
151+
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
152+
153+
🚀 Happy coding! 😊
154+
155155
**Your WTX Labs Team** 🚀

src/main/java/wtx/woocommerce/api/client/OrdersApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ public okhttp3.Call listAllOrdersCall(Integer page, Integer perPage, String afte
423423
}
424424

425425
if (status != null) {
426-
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "status", status));
426+
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "status", status));
427427
}
428428

429429
if (order != null) {

src/main/java/wtx/woocommerce/api/client/ProductsApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ public okhttp3.Call listAllProductsCall(String sku, String attribute, Integer pe
434434
}
435435

436436
if (status != null) {
437-
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "status", status));
437+
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "status", status));
438438
}
439439

440440
if (stockStatus != null) {

0 commit comments

Comments
 (0)