Get order statistics
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/orders/statistics';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://apibase.ecomweb.app/api/v1/stores/example/orders/statistics \ --header 'x-api-key: <x-api-key>'Returns the store’s order counts by order, fulfillment, shipping and payment status, plus total revenue (paid and captured orders), average order value and the number of distinct customers.
Required scopes: read:orders
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Responses
Section titled “Responses”object
Number of orders in the store.
Order counts by order status.
object
Orders awaiting confirmation.
Confirmed orders.
Orders being processed.
Cancelled orders.
Orders on hold.
Completed orders.
Order counts by fulfillment status.
object
Orders not yet fulfilled.
Fulfilled orders.
Returned orders.
Orders with a return requested.
Order counts by shipping status.
object
Orders not yet shipped.
Shipped orders.
Orders in transit.
Orders out for delivery.
Delivered orders.
Orders whose delivery failed.
Order counts by payment status.
object
Orders awaiting payment.
Orders with an authorized payment.
Paid orders.
Orders with a captured payment.
Orders whose payment failed.
Refunded orders.
Orders whose payment was voided.
Revenue from orders that are paid or captured.
Average order value.
Number of distinct customers who placed orders.
Example generated
{ "total_orders": 1, "by_order_status": { "pending": 1, "confirmed": 1, "processing": 1, "cancelled": 1, "on_hold": 1, "completed": 1 }, "by_fulfillment_status": { "unfulfilled": 1, "fulfilled": 1, "returned": 1, "return_requested": 1 }, "by_shipping_status": { "not_shipped": 1, "shipped": 1, "in_transit": 1, "out_for_delivery": 1, "delivered": 1, "delivery_failed": 1 }, "by_payment_status": { "pending": 1, "authorized": 1, "paid": 1, "captured": 1, "failed": 1, "refunded": 1, "voided": 1 }, "total_revenue": 1, "avg_order_value": 1, "unique_customers": 1}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}