Commerce

Get product metrics

A product's sales.

PAID orders by when they were paid, in the shop's currency; the last 30 days when no window is named.

Path Parameters

product*string

A product id. Anything that is not one is 404 resource_missing.

Formatuuid

Query Parameters

period?string
Value in"today""yesterday""this_week""last_week""last_7_days""last_30_days""last_90_days""this_month""last_month""this_year""all_time"
from?string

The first day, in East Africa Time.

Formatdate
to?string

The last day, in East Africa Time.

Formatdate
start_date?stringDeprecated

Use from. An instant; one with no zone is UTC.

end_date?stringDeprecated

Use to. An instant; one with no zone is UTC.

include_daily?boolean

Adds a daily series.

Defaultfalse

Header Parameters

X-Request-Id?string

Your id for this request; it becomes the request_id of any error. Without it the server makes one.

curl -X GET 'https://v3.ghala.io/v1/commerce/shop/products/497f6eca-6276-4993-bfeb-53cbbbba6f08/metrics'
{  "currency": "string",  "period": "string",  "start": "2019-08-24T14:15:22Z",  "end": "2019-08-24T14:15:22Z",  "total_orders": 0,  "total_customers": 0,  "total_quantity": 0,  "total_sales": "1500.00",  "available_stock": 0,  "daily": [    {      "day": "2019-08-24",      "total_amount": "1500.00",      "total_quantity": 0    }  ]}