Skip to content

[Enhancement]: Add /wc-analytics/reports APIs to the document #248

Description

@ianlin

Part of the task: pfKYZu-2C-p2

In addition to the WC REST API with the namespace /wc/v3, we've also introduced a set of APIs for WooCommerce Analytics under the namespace /wc-analytics. To improve the visibility of these APIs and avoid confusion with the legacy reports API /wc/v3/reports (used for the deprecated legacy reports), we will add the /wc-analytics/reports API to the REST API documentation. We will also clearly explain the difference between the legacy reports API and the WC Analytics API.

A shared branch feature/add-wc-analytics-reports-api-doc has been created and this will serve as a feature branch, meaning all subsequent PRs should be merged into this branch first, allowing us to release all the APIs document together.

The APIs we will be adding are as follows:

### Analytics > Products
- [x] GET [/wc-analytics/reports/products](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Products/Controller.php#L30) - #249
- [x] GET [/wc-analytics/reports/products/stats](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Products/Stats/Controller.php#L30) - #249
### Analytics > Revenue
- [x] GET [/wc-analytics/reports/revenue/stats](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Revenue/Stats/Controller.php#L37) - #250
### Analytics > Orders
- [x] GET [/wc-analytics/reports/orders](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Orders/Controller.php#L28) - #250
- [x] GET [/wc-analytics/reports/orders/stats](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Orders/Stats/Controller.php#L27) - #250
### Analytics > Variations
- [ ] GET [/wc-analytics/reports/variations](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Variations/Controller.php#L33)
- [ ] GET [/wc-analytics/reports/variations/stats](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Variations/Stats/Controller.php#L30)
### Analytics > Categories
- [ ] GET [/wc-analytics/reports/categories](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Categories/Controller.php#L28)
### Analytics > Coupons
- [ ] GET [/wc-analytics/reports/coupons](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Coupons/Controller.php#L30)
- [ ] GET [/wc-analytics/reports/coupons/stats](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Coupons/Stats/Controller.php#L30)
### Analytics > Taxes
- [ ] GET [/wc-analytics/reports/taxes](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Taxes/Controller.php#L35)
- [ ] GET [/wc-analytics/reports/taxes/stats](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Taxes/Stats/Controller.php#L29)
### Analytics > Downloads
- [ ] GET [/wc-analytics/reports/downloads](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Downloads/Controller.php#L28)
- [ ] GET [/wc-analytics/reports/downloads/stats](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Downloads/Stats/Controller.php#L29)
- [ ] GET [/wc-analytics/reports/downloads/files](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Downloads/Files/Controller.php#L32)
### Analytics > Stock
- [ ] GET [/wc-analytics/reports/stock](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Stock/Controller.php#L30)
- [ ] GET [/wc-analytics/reports/stock/stats](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Stock/Stats/Controller.php#L32)
### Performance Indicators
- [ ] GET [/wc-analytics/reports/performance-indicators](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/PerformanceIndicators/Controller.php#L30)
- [ ] GET [/wc-analytics/reports/performance-indicators/allowed](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/PerformanceIndicators/Controller.php#L88-L92)
### Export
- [ ] PUT [/wc-analytics/reports/(?P<type>[a-z]+)/export](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Export/Controller.php#L36-L40)
- [ ] GET [/wc-analytics/reports/(?P<type>[a-z]+)/export/(?P<export_id>[a-z0-9]+)/status](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Export/Controller.php#L50-L54)
### Import
- [ ] PUT [/wc-analytics/reports/import](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Import/Controller.php#L34-L38)
- [ ] PUT [/wc-analytics/reports/import/cancel](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Import/Controller.php#L47-L51)
- [ ] PUT [/wc-analytics/reports/import/delete](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Import/Controller.php#L59-L63)
- [ ] GET [/wc-analytics/reports/import/status](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Import/Controller.php#L71-L75)
- [ ] GET [/wc-analytics/reports/import/totals](https://github.com/woocommerce/woocommerce/blob/9297409c5a705d1cd0ae65ec9b058271bd90851e/plugins/woocommerce/src/Admin/API/Reports/Import/Controller.php#L83-L87)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions