---
title: "Retrieve customer gross revenue analytics"
method: GET
path: "/customers/{external_customer_id}/analytics/gross-revenue"
tags: ["Customers"]
---

# Retrieve customer gross revenue analytics

`GET /customers/{external_customer_id}/analytics/gross-revenue`

## Request

- Base URL: `https://api-m.sandbox.paypal.com`
- URL: `https://api-m.sandbox.paypal.com/customers/{external_customer_id}/analytics/gross-revenue`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `/api/oauth-proxy` scopes: `read`, `write`
- TypeScript: <https://skmtc.dev/paypal/apis/usage-based-billing-api/docs/customers/:external_customer_id/analytics/gross-revenue/get.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `external_customer_id` string, required

## Query parameters

- `months` integer
- `currency` string: Currency code in ISO 4217 format.

## Response `200`

Customer gross revenue analytics retrieved successfully.

- GrossRevenues: Represents a collection of monthly gross revenue records for a specific customer.
  - `gross_revenues` GrossRevenue[]: An array of monthly gross revenue entries for the specified customer.
    - `month` string: The reference month for the gross revenue, formatted as an ISO 8601 year-month string ('yyyy-MM'), representing the first day of the month in UTC.
    - `amount` object: The total gross revenue amount for the specified customer during the reference month.
      - `value` number, required: The amount value in the corresponding currency unit (e.g., two decimals for USD, no decimals for JPY).
      - `currency_code` string, required: Currency code in ISO 4217 format.
    - `invoices_count` integer: The number of invoices included in the gross revenue calculation for the reference month.

## Other responses

- `400`: Bad Request - Invalid input data
- `403`: Authorization failed due to insufficient permissions.
- `404`: Resource Not Found.
- `500`: Internal Server Error - An unexpected error occurred

---

[API](https://skmtc.dev/paypal/apis/usage-based-billing-api.md) - [All operations](https://skmtc.dev/paypal/apis/usage-based-billing-api/llms.txt) - [OpenAPI document](https://skmtc.dev/paypal/apis/usage-based-billing-api/revisions/22fb46514ac4?raw)
