Commerce

Get shop analytics

The shop's sales over a window.

Orders placed by created_at and paid by paid_at, in the shop's currency, beside the window before.

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

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/analytics'
{  "currency": "string",  "period": "string",  "start": "2019-08-24T14:15:22Z",  "end": "2019-08-24T14:15:22Z",  "totals": {    "orders": 0,    "paid_orders": 0,    "customers": 0,    "revenue": "1500.00",    "gmv": "string",    "average_order": "string"  },  "previous": {    "orders": 0,    "paid_orders": 0,    "customers": 0,    "revenue": "1500.00",    "gmv": "string",    "average_order": "string"  },  "deltas": {    "orders_pct": 0,    "paid_orders_pct": 0,    "revenue_pct": 0,    "average_order_pct": 0  },  "granularity": "day",  "series": [    {      "bucket": "2019-08-24",      "orders": 0,      "paid_orders": 0,      "revenue": "string",      "gmv": "string"    }  ],  "breakdowns": {    "orders_by_status": {      "property1": 0,      "property2": 0    },    "payments_by_status": {      "property1": 0,      "property2": 0    },    "top_products": [      {        "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",        "name": "string",        "image": "string",        "status": "DRAFT",        "stock": 0,        "total_quantity": 0,        "total_amount": "1500.00"      }    ]  }}