> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://zuora.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://zuora.ferndocs.com/_mcp/server.

# List the document success rate metrics by customer group

GET https://payment-retry.apps.zuora.com/api/v1/metrics/customer_group_over_time

Gets the Document Success Rate timeseries for each customer group over the past 6 months. The data of the current month will not be included. For example, if it is April 15th today, the data for April will not be included. Data for March and earlier will be shown.


Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/payments/configurable-payment-retry/get-document-success-rate-by-customer-group

## Authentication

- `Authorization` header (basic auth, required) — The user name is the email address that you use for logging in Zuora. The password is the API token that is shown in the settings of Configurable Payment Retry.

## Response

### 200

- `customer_groups` (list of GetDocumentSuccessRateByCustomerGroupResponseCustomerGroupsItems, optional) — An array containing the Document Success Rate timeseries for each customer group represented by the customer group ID. A timeseries over the past 6 months is present in the format of `<month_year>: <document_success_rate>`. The data of the current month is not included. For example, if it is April 15th today, the data for April will not be included. Data for March and earlier will be shown.
- `success` (boolean, optional) — Indicates whether the metrics are retrieved successfully. If no data is loaded yet, a 200 response code will be returned with the success field set to `true`. All expected fields will be present but the value will be `null`.

## Types

### GetDocumentSuccessRateByCustomerGroupResponseCustomerGroupsItems

## Examples

**Response**

```json
{
  "customer_groups": [
    {
      "1": {
        "01_21": "34.25",
        "02_21": "8.99",
        "03_21": "14.92",
        "04_21": "13.21",
        "05_21": "17.53",
        "12_20": "12.30"
      },
      "2": {
        "01_21": "13.43",
        "02_21": "11.06",
        "03_21": "26.00",
        "04_21": "7.87",
        "05_21": "11.11",
        "12_20": "17.92"
      },
      "4": {
        "01_21": "12.43",
        "02_21": "19.06",
        "03_21": "17.20",
        "04_21": "9.17",
        "05_21": "11.13",
        "12_20": "15.92"
      }
    }
  ],
  "success": true
}
```

**SDK Code**

```python
import requests

url = "https://payment-retry.apps.zuora.com/api/v1/metrics/customer_group_over_time"

response = requests.get(url, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://payment-retry.apps.zuora.com/api/v1/metrics/customer_group_over_time';
const credentials = btoa("<username>:<password>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://payment-retry.apps.zuora.com/api/v1/metrics/customer_group_over_time"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<username>", "<password>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://payment-retry.apps.zuora.com/api/v1/metrics/customer_group_over_time")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<username>", "<password>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://payment-retry.apps.zuora.com/api/v1/metrics/customer_group_over_time")
  .basicAuth("<username>", "<password>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://payment-retry.apps.zuora.com/api/v1/metrics/customer_group_over_time', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://payment-retry.apps.zuora.com/api/v1/metrics/customer_group_over_time");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://payment-retry.apps.zuora.com/api/v1/metrics/customer_group_over_time")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```