-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add orders, orders stats, revenue stats analytics reports to API doc #250
Add orders, orders stats, revenue stats analytics reports to API doc #250
Conversation
…ts-api-doc' into add/248-analytics-reports-revenue-and-orders-api-doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ianlin, thanks for adding the wc-analytics
documentation.
I've left a few comments, mostly related to formatting, but overall the changes look good to me.
Although not introduced in this branch, I also noticed that we're mixing type definitions in a few places. For example under Revenue Stats
total_sales
is listed as number
whereas under Orders
total_sales
is listed as float
.
| `num_items_sold` | integer | Items sold. <i class="label label-info">read-only</i> | | ||
| `coupons` | integer | Amount discounted by coupons. <i class="label label-info">read-only</i> | | ||
| `coupons_count` | integer | Unique coupons count. <i class="label label-info">read-only</i> | | ||
| `total_customers` | integer | Total _customers. <i class="label label-info">read-only</i> | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an underscore in the description here _customers.
| Attribute | Type | Description | | ||
|--------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `segment_id` | integer | Segment identificator. <i class="label label-info">read-only</i> | | ||
| `subtotals` | object | Interval subtotals. See [Orders Stats Reports - Totals properties](#orders-stats-reports-totals-properties), but without `segments` atttribute. <i class="label label-info">read-only</i> | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here atttribute
should be attribute
| `date_start_gmt` | string | The date the report start, as GMT. <i class="label label-info">read-only</i> | | ||
| `date_end` | string | The date the report end, in the site's timezone. <i class="label label-info">read-only</i> | | ||
| `date_end_gmt` | string | The date the report end, as GMT. <i class="label label-info">read-only</i> | | ||
| `subtotals` | object | Interval subtotals. See [Orders Stats Reports - Totals properties](#orders-stats-reports-totals-properties), but without `products` atttribute. <i class="label label-info">read-only</i> | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here atttribute
should be attribute
|
||
| Attribute | Type | Description | | ||
|--------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `segment_id` | integer | Segment identificator. <i class="label label-info">read-only</i> | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this read Segment identifier
?
| `tax_rate_excludes` | array | Limit result set to items that don't have the specified tax rate(s) assigned. | | ||
| `customer` | string | Alias for `customer_type` (deprecated). | | ||
| `customer_type` | string | Limit result set to returning or new customers. | | ||
| `refunds` | string | Limit result set to specific types of refunds. Options: ``, `all`, `partial`, `full`, `none`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
| Parameter | Type | Description | | ||
|-----------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `context` | string | Scope under which the request is made; determines fields present in response. Options: view and edit. Default is view. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to be consistent in how options are listed in descriptions. For most of them we're wrapping the values in inline code blocks but for the different context
parameters we're not.
…oducts-api-doc Add products and product stats analytics reports to API doc
…analytics-reports-revenue-and-orders-api-doc
@martynmjones Thanks for reviewing and the nice suggestions, I've updated the PR and it's ready for another round. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for the changes @ianlin!
Left one comment re. one last typo but other than that the changes look good to me.
| `gross_sales` | number | Gross sales. <i class="label label-info">read-only</i> | | ||
| `avg_items_per_order` | integer | Average items per order. <i class="label label-info">read-only</i> | | ||
| `avg_order_value` | number | Average order value. <i class="label label-info">read-only</i> | | ||
| `total_customers` | integer | Total _customers. <i class="label label-info">read-only</i> | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one remaining typo here with _customers
in the description
Part of #248. This PR intends to merge into a feature branch feature/add-wc-analytics-reports-api-doc. But since the PR #248 hasn't been merged, the base branch of this PR is set to the
add/248-analytics-reports-products-api-doc
branch.This PR adds orders, orders stats, and revenue stats APIs to the analytics doc:
/wc-analytics/reports/orders
)/wc-analytics/reports/orders/stats
)/wc-analytics/reports/revenue/stats
)Detailed test instruction
./build.sh
build/index.html
Analytics docs
Revenue Stats
,Orders
, andOrders Stats
.