---
title: "Rank customers by revenue"
description: "Find the customers with the highest exact gross revenue without exposing contact details."
canonical: "https://studio.inttegro.com/inttegro-mcp/workflows/revenue/rank-customers-by-revenue"
format: inttegro-machine-docs/v1
language: "Ruby"
sdk_version: "v10.0.0"
reader_profile: optional
reader_manifest: "https://studio.inttegro.com/machine/ruby/readers/index.json"
reader_identification: "Optional: declare your client only if known and your current-session capabilities; use reader_manifest for supplemental recommendations."
preamble_estimated_tokens: 603
model_token_report: "https://studio.inttegro.com/machine/token-report.json"
preamble_questions: 5
preamble_source: "general"
recommended_mcp_tools: ["get_customer","get_customer_analytics"]
estimated_tokens: 1163
token_estimate_method: "utf8_bytes_divided_by_4"
---

## Machine preamble

**Summary:** Find the customers with the highest exact gross revenue without exposing contact details. This Ruby representation uses the selected SDK's native names wherever Studio has a verified mapping.

### Five questions

#### Q1. When should the reader use Rank customers by revenue?

Use this MCP document when an authenticated AI client needs governed Inttegro context, guidance, presentation, or operations.

#### Q2. What is authoritative on this page?

The documented MCP catalog defines available abilities and confirmation boundaries. For live state, the structured tool result is authoritative; presentation output is only a rendering of that result.

#### Q3. What page-specific constraint matters most?

Read operations do not authorize mutations. Actions retain their exact confirmation requirements, and payment credentials or OTP must stay in secure Checkout.

#### Q4. Can Inttegro MCP materially help with this task?

Yes, when the reader has an authenticated MCP connection and the task needs live context, guided planning, or a supported operation. The strongest matches are `get_customer`, `get_customer_analytics`; their exact roles and boundaries are listed below.

#### Q5. How should the reader verify the answer and continue?

Preserve the structured tool result, distinguish bounded lists from complete analytics, and reconcile asynchronous actions through an authoritative read. Continue with [Review a customer's revenue](https://studio.inttegro.com/machine/ruby/inttegro-mcp/workflows/customers/review-a-customer-revenue.md) and [get_customer_analytics](https://studio.inttegro.com/machine/ruby/inttegro-mcp/tools.md#get_customer_analytics) when those concerns enter scope.

### Recommended MCP assistance

Use these through an authenticated Inttegro MCP connection. This document remains the contract source.

- [`get_customer`](https://studio.inttegro.com/machine/ruby/inttegro-mcp/tools.md#get_customer) — read; no mutation confirmation. Gets one customer by ID using a minimized projection that reports channel availability without exposing raw contact details.
- [`get_customer_analytics`](https://studio.inttegro.com/machine/ruby/inttegro-mcp/tools.md#get_customer_analytics) — analytics read; no mutation confirmation. Ranks customers or inspects one customer by paid orders and gross revenue, alongside the exact new-customer count for the period.

## Document content

# Rank customers by revenue

Use customer analytics to understand purchase value without turning the result into a contact list.

### Prompt

> **Copyable prompt:**
>
> Rank the top customers by gross revenue for the last 30 days in GHS. Include
> exact revenue and paid-order counts with the Flint chart. Show customer IDs,
> but do not reveal names, contact details, or delivery addresses.

The agent uses [`get_customer_analytics`](https://studio.inttegro.com/machine/ruby/inttegro-mcp/tools.md#get_customer_analytics). The result contains customer IDs and aggregate purchase activity, not personal contact data.

## Sample response: Top customers by gross revenue

Customer IDs support permitted follow-up without exposing contact details.

- **Row 1**: Customer: cus\_example\_01; Paid orders: 12; Gross revenue: GHS 6,850.00
- **Row 2**: Customer: cus\_example\_02; Paid orders: 9; Gross revenue: GHS 5,420.00
- **Row 3**: Customer: cus\_example\_03; Paid orders: 7; Gross revenue: GHS 3,190.00

### Gross revenue by customer

- **cus\_example\_01**: GHS 6,850.00
- **cus\_example\_02**: GHS 5,420.00
- **cus\_example\_03**: GHS 3,190.00

To inspect one customer's exact aggregate activity, use [Review a customer's revenue](https://studio.inttegro.com/machine/ruby/inttegro-mcp/workflows/customers/review-a-customer-revenue.md).
