Skip to content

Commit d198b25

Browse files
Added docs for filters for products, orders, customers and webhooks
1 parent f42f539 commit d198b25

File tree

6 files changed

+58
-14
lines changed

6 files changed

+58
-14
lines changed

source/includes/v2/_customers.md

+12
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,12 @@ curl https://example.com/wc-api/v2/customers \
316316
}
317317
```
318318

319+
#### Available Filters ####
320+
321+
| Filter | Type | Description |
322+
| ------ | ------ | --------------------------------------------------- |
323+
| `role` | string | Customers by status. eg: `customer` or `subscriber` |
324+
319325
## Update A Customer ##
320326

321327
This API lets you make changes to a customer.
@@ -643,3 +649,9 @@ curl https://example.com/wc-api/v2/customers/count \
643649
"count": 10
644650
}
645651
```
652+
653+
#### Available Filters ####
654+
655+
| Filter | Type | Description |
656+
| ------ | ------ | --------------------------------------------------- |
657+
| `role` | string | Customers by status. eg: `customer` or `subscriber` |

source/includes/v2/_introduction.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Note that the following filters are supported for all endpoints except the `repo
143143
#### Available Filters ####
144144

145145
| Filter | Description |
146-
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
146+
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
147147
| `created_at_min` | given a date, only resources *created after the provided date* will be returned |
148148
| `created_at_max` | given a date, only resources *created before the provided date* will be returned |
149149
| `updated_at_min` | given a date, only resources *updated after the provided date* will be returned |
@@ -154,7 +154,7 @@ Note that the following filters are supported for all endpoints except the `repo
154154
| `orderby_meta_key` | the meta key to order returned resources by when using `orderby=meta_value`. For example, you could order products by price using `GET /products?filter[orderby]=meta_value&filter[orderby_meta_key]=_price` |
155155
| `post_status` | limits resources to only those with the specified post status. Most useful for returning unpublished products, e.g. `GET /products?filter[post_status]=draft` |
156156
| `meta` | resource meta is excluded by default, but it can be included by setting `meta=true`, e.g. `GET /orders?filter[meta]=true`. Protected meta (meta whose key is prefixed with an underscore) is not included in the response |
157-
| pagination | explained below |
157+
| `pagination` | explained below |
158158

159159
Note that Dates should be provided in [RFC3339](http://www.ietf.org/rfc/rfc3339.txt) format in UTC timezone: `YYYY-MM-DDTHH:MM:SSZ`. You may omit the time and timezone if desired.
160160

source/includes/v2/_orders.md

+12
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,12 @@ curl https://example.com/wc-api/v2/orders \
849849
}
850850
```
851851

852+
#### Available Filters ####
853+
854+
| Filter | Type | Description |
855+
| -------- | ------ | ------------------------------------------------- |
856+
| `status` | string | Orders by status. eg: `processing` or `cancelled` |
857+
852858
## Update An Order ##
853859

854860
This API lets you make changes to an order.
@@ -1091,6 +1097,12 @@ curl https://example.com/wc-api/v2/orders/count \
10911097
}
10921098
```
10931099

1100+
#### Available Filters ####
1101+
1102+
| Filter | Type | Description |
1103+
| -------- | ------ | ------------------------------------------------- |
1104+
| `status` | string | Orders by status. eg: `processing` or `cancelled` |
1105+
10941106
## View List Of Order Statuses ##
10951107

10961108
This API lets you retrieve a list of orders statuses available.

source/includes/v2/_products.md

+15
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,14 @@ curl https://example.com/wc-api/v2/products \
10891089
}
10901090
```
10911091

1092+
#### Available Filters ####
1093+
1094+
| Filter | Type | Description |
1095+
| ---------- | ------ | -------------------------------------------- |
1096+
| `type` | string | Products by type. eg: `simple` or `variable` |
1097+
| `category` | string | Products by category. |
1098+
| `sku` | string | Filter a product by SKU. |
1099+
10921100
## Update A Product ##
10931101

10941102
This API lets you make changes to a product.
@@ -1269,6 +1277,13 @@ curl https://example.com/wc-api/v2/products/count \
12691277
}
12701278
```
12711279

1280+
#### Available Filters ####
1281+
1282+
| Filter | Type | Description |
1283+
| ---------- | ------ | -------------------------------------------- |
1284+
| `type` | string | Products by type. eg: `simple` or `variable` |
1285+
| `category` | string | Products by category. |
1286+
12721287
## View List Of Product Reviews ##
12731288

12741289
<div class="api-endpoint">

source/includes/v2/_reports.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
This section lists all API that can be used view reports.
44

5-
## Reports Parameters ##
5+
## Reports Filters ##
66

7-
You can specify the period for which request to retrieve sales or specify a min/max date:
7+
Use the following filters for any type of report to specify the period of sales:
88

9-
| Parameter | Type | Description |
10-
| ------------------ | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11-
| `filter[period]` | string | The supported periods are: `week`, `month`, `last_month`, and `year`. If you use an invalid period, `week` is used. If you don't specify a period, the current day is used |
12-
| `filter[date_min]` | string | Return sales for a specific start date. The date need to be in the `YYYY-MM-AA` format |
13-
| `filter[date_max]` | string | Return sales for a specific end date. The dates need to be in the `YYYY-MM-AA` format. Required to set the `filter[date_min]` too |
9+
| Filter | Type | Description |
10+
| ---------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11+
| `period` | string | The supported periods are: `week`, `month`, `last_month`, and `year`. If you use an invalid period, `week` is used. If you don't specify a period, the current day is used |
12+
| `date_min` | string | Return sales for a specific start date. The date need to be in the `YYYY-MM-AA` format |
13+
| `date_max` | string | Return sales for a specific end date. The dates need to be in the `YYYY-MM-AA` format. Required to set the `filter[date_min]` too |
1414

1515
## View List Of Reports ##
1616

source/includes/v2/_webhooks.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ curl https://example.com/wc-api/v2/webhooks \
192192
}
193193
```
194194

195+
#### Available Filters ####
196+
197+
| Filter | Type | Description |
198+
| -------- | ------ | -------------------------------------------------------------------------------------------- |
199+
| `status` | string | Webhooks by status. The following options are available: `active` or `paused` and `disabled` |
200+
195201
## Update A Webhook ##
196202

197203
This API lets you make changes to a webhook.
@@ -289,12 +295,11 @@ curl https://example.com/wc-api/v2/webhooks/count \
289295
}
290296
```
291297

292-
### Parameters ###
298+
#### Available Filters ####
293299

294-
| Parameter | Type | Description |
295-
| --------- | ------ | ------------------------------------------------------------------ |
296-
| `status` | string | Get a total count of webhooks with the given status |
297-
| `filter` | string | See [Parameters > Filter Parameter](#filter-parameter) documention |
300+
| Filter | Type | Description |
301+
| -------- | ------ | -------------------------------------------------------------------------------------------- |
302+
| `status` | string | Webhooks by status. The following options are available: `active` or `paused` and `disabled` |
298303

299304
## View A Webhooks Delivery ##
300305

0 commit comments

Comments
 (0)