Organization dashboard overview

Read the organization's headline statistics — orders, approval rates, and the top merchants across every merchant in the org.

These read-only endpoints feed the organization's home dashboard: aggregate order and revenue figures, approval-rate trends, and leaderboards of the merchants that drive the most volume.

An organization spans every merchant it contains, so these numbers roll up across all of them. Use them for a bird's-eye view; drill into a single merchant through the merchant dashboard.

These endpoints power the Tokeflow Dashboard UI at the organization level. They are session-authenticated (JWT bearer) — the token comes from signing in to the Dashboard, not from an sk_/pk_ API key. Requests also carry the x-organization-id header, and the signed-in user must be a member of that organization.

The dashboard stats object

Returned by the list and retrieve endpoints on this page.

FieldTypeDescription
total_ordersnumberEvery order in the window, including rejected attempts. This is the denominator for approval_rate and failure_rate.
successful_ordersnumberOrders that reached authorization — authorized, refunded, partially_refunded, charged_back and refund_pending. Excludes failed and canceled attempts, and orders still in flight.
approval_ratenumberApproval rate as a percentage (0-100).
failure_ratenumberFailure rate as a percentage (0-100).
order_trendarrayOrder trend data for the last 7 days.
status_distributionarrayDistribution of orders by status.
top_merchants_by_ordersarrayTop merchants by order count.
top_merchants_by_approvalarrayTop merchants by approval rate.

Endpoints

GET/api/v1/org/dashboard/routing-overview

Org

Auth: Dashboard session (JWT bearer). Organization membership required.

Get routing overview across all merchants in the organization.

Query parameters

FieldTypeRequiredDescription
pagenumberNoPage number (1-indexed). Default 1, min 1.
limitnumberNoNumber of items per page. Default 20, min 1, max 100.

Example request

curl -G https://api.tokeflow.com/api/v1/org/dashboard/routing-overview \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3" \
  --data-urlencode "page=1" \
  --data-urlencode "limit=20"

GET/api/v1/org/dashboard/stats

Org

Auth: Dashboard session (JWT bearer). Organization membership required.

Get dashboard statistics for organization.

Query parameters

FieldTypeRequiredDescription
date_fromstringNoStart date for statistics (ISO 8601 format)
date_tostringNoEnd date for statistics (ISO 8601 format)

Example request

curl -G https://api.tokeflow.com/api/v1/org/dashboard/stats \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3" \
  --data-urlencode "date_from=string" \
  --data-urlencode "date_to=string"

Example response200

{
  "total_orders": 42,
  "successful_orders": 1,
  "approval_rate": 92.4,
  "failure_rate": 92.4,
  "order_trend": [
    {
      "date": "string",
      "count": 42
    }
  ],
  "status_distribution": [
    {
      "status": "active",
      "count": 42,
      "percentage": 92.4
    }
  ],
  "top_merchants_by_orders": [
    {
      "merchant_id": "mrc_8a3f12d9",
      "merchant_name": "Acme Store",
      "order_count": 42
    }
  ],
  "top_merchants_by_approval": [
    {
      "merchant_id": "mrc_8a3f12d9",
      "merchant_name": "Acme Store",
      "approval_rate": 92.4,
      "total_orders": 42
    }
  ]
}

GET/api/v1/org/dashboard/top-merchants/by-approval-rate

Org

Auth: Dashboard session (JWT bearer). Organization membership required.

Top merchants by order approval rate for the organization.

Query parameters

FieldTypeRequiredDescription
date_fromstringNoStart date (ISO 8601). Defaults to 30 days ago.
date_tostringNoEnd date (ISO 8601). Defaults to now.
limitstringNoHow many merchants to return (default 5, max 50)
min_ordersstringNoMinimum order count for inclusion (default 10)

Example request

curl -G https://api.tokeflow.com/api/v1/org/dashboard/top-merchants/by-approval-rate \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3" \
  --data-urlencode "date_from=string" \
  --data-urlencode "date_to=string" \
  --data-urlencode "limit=string" \
  --data-urlencode "min_orders=string"

Example response200

{
  "data": [
    {
      "merchant_id": "mrc_8a3f12d9",
      "merchant_name": "Acme Store",
      "approval_rate": 92.4,
      "total_orders": 42
    }
  ]
}

GET/api/v1/org/dashboard/top-merchants/by-orders

Org

Auth: Dashboard session (JWT bearer). Organization membership required.

Top merchants by total order count for the organization.

Query parameters

FieldTypeRequiredDescription
date_fromstringNoStart date (ISO 8601). Defaults to 30 days ago.
date_tostringNoEnd date (ISO 8601). Defaults to now.
limitstringNoHow many merchants to return (default 5, max 50)

Example request

curl -G https://api.tokeflow.com/api/v1/org/dashboard/top-merchants/by-orders \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…" \
  -H "x-organization-id: org_4b21e7c3" \
  --data-urlencode "date_from=string" \
  --data-urlencode "date_to=string" \
  --data-urlencode "limit=string"

Example response200

{
  "data": [
    {
      "merchant_id": "mrc_8a3f12d9",
      "merchant_name": "Acme Store",
      "order_count": 42
    }
  ]
}

Errors

Errors use the standard envelope. The most common cases here:

HTTPMeaning
400Invalid parameters or a state that does not allow this operation.
401Missing, expired, or invalid Dashboard session token.
403Authenticated, but the signed-in user lacks access to this entity.
404The record does not exist or is not visible to this entity.

On this page