> 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 retry cycle history for an account

GET https://payment-retry.apps.zuora.com/api/v1/payments/account_cycle_history/{account_id}

Gets information of all retry cycles for an account in Configurable Payment Retry.


Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/payments/configurable-payment-retry/get-account-cycle-history

## 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.

## Request

### Path parameters

- `account_id` (string, required) — ID of an account.

## Response

### 200

- `cycles` (list of GETAccountCycleElementResponse, optional) — An array containing information of all completed retry cycles for an account. See the example for details.

## Types

### GETAccountCycleElementResponse

- `account_id` (string, optional) — The ID of the customer account.
- `invoice_id` (string, optional) — The ID of the invoice.
- `debit_memo_id` (string, optional) — The ID of the debit memo.
- `payment_method_id` (string, optional) — The ID of the payment method.
- `currency` (string, optional) — The type of the currency used.
- `status` (string, optional) — The status of the retry cycle.
- `current_attempt_number` (double, optional) — The number of the current retry attempt.
- `next_attempt` (datetime, optional) — The date and time of the next retry attempt, in `yyyy-mm-dd hh:mm:ss` format.
- `customer_group` (string, optional) — The name of the customer group.
- `attempts` (list of GETCycleElementAttemptResponse, optional) — An array containing information of the retry attempts that have been made. See the schema and example for details.

### GETCycleElementAttemptResponse

- `attempt_number` (double, optional) — The number of the retry attempt.
- `zuora_payment_id` (string, optional) — The ID of the payment in Zuora Payments.
- `time_of_execution` (datetime, optional) — The date and time when the retry attempt was made, in `yyyy-mm-dd hh:mm:ss` format.
- `source` (string, optional) — The number of the failed payment run.
- `cpr_generated` (boolean, optional) — Indicates whether the first retry attempt was generated by Configurable Payment Retry. `true` for the cases of the first retry attempt generated by CPR and the second or later attempt. `false` for the cases that the retry attempt was made by the payment run or an external source during retry cycles.
- `success` (boolean, optional) — Indicates whether the retry attempt is successful.
- `amount_collected` (double, optional) — The amount collected in this retry attempt.
- `action_info` (GetCycleElementAttemptResponseActionInfo, optional) — Information about the action of the retry attempt.
- `retry_info` (GetCycleElementAttemptResponseRetryInfo, optional) — Information about the next retry attempt.
- `mapping_info` (GetCycleElementAttemptResponseMappingInfo, optional) — Information about the response code mapping for the retry attempt.
- `gateway_info` (GetCycleElementAttemptResponseGatewayInfo, optional) — Information about the payment gateway.

### GetCycleElementAttemptResponseActionInfo

Information about the action of the retry attempt.

- `action` (string, optional) — The action taken in the retry attempt.

### GetCycleElementAttemptResponseRetryInfo

Information about the next retry attempt.

- `next` (datetime, optional) — The date and time of the next retry attempt as determined by `criteria`, in `yyyy-mm-dd hh:mm:ss` format.
- `criteria` (string, optional) — The criteria defined in the retry configuration in the CPR UI, to specify whether the next retry will occur in an incremental time or at a specific time or day.

### GetCycleElementAttemptResponseMappingInfo

Information about the response code mapping for the retry attempt.

- `label` (string, optional) — The response code label, can be `Hard Decline`, `Soft Decline`, `System Error`, or custom labels.
- `level` (string, optional) — The response code level for the payment gateway, can be `Code` or `Description`.
- `customer_group_id` (double, optional) — The ID of the customer group.

### GetCycleElementAttemptResponseGatewayInfo

Information about the payment gateway.

- `id` (string, optional) — The ID of the payment gateway.
- `code` (string, optional) — The response code from the gateway.
- `response` (string, optional) — The response message from the gateway.

## Examples

**Response**

```json
{
  "cycles": [
    {
      "account_id": "2c92c0f96bd69165016bdcbf55ad5e62",
      "invoice_id": "2c92c0fa7849b3ff01784bc5e8ee18b5",
      "payment_method_id": "2c92c0f9774f2b3e01775f6cf2fb726a",
      "currency": "USD",
      "status": "Cycle Complete",
      "current_attempt_number": 3,
      "next_attempt": "2021-03-19T18:53:39.641Z",
      "customer_group": "All Remaining Customers",
      "attempts": [
        {
          "attempt_number": 1,
          "zuora_payment_id": "2c92c0867849d42301784bc9ce806c31",
          "time_of_execution": "2021-03-19T18:42:20.103Z",
          "source": "PR-00000371",
          "cpr_generated": false,
          "success": false,
          "amount_collected": 0,
          "action_info": {
            "action": "Retry"
          },
          "retry_info": {
            "next": "2021-03-19T09:43:28.670-09:00",
            "criteria": "incremental_time"
          },
          "mapping_info": {
            "label": "Hard Decline",
            "level": "code",
            "customer_group_id": 1
          },
          "gateway_info": {
            "id": "2c92c0f85e2d19af015e3a61d8947e5d",
            "code": "insufficient_funds",
            "response": "Your card has insufficient funds."
          }
        },
        {
          "attempt_number": 2,
          "zuora_payment_id": "2c92c09c7849d3c101784bcdfc010671",
          "time_of_execution": "2021-03-19T18:52:24.137Z",
          "source": "PR-00000372",
          "cpr_generated": true,
          "success": false,
          "amount_collected": 0,
          "action_info": {
            "action": "Stop"
          },
          "retry_info": {},
          "mapping_info": {
            "label": "Hard Decline",
            "level": "code",
            "customer_group_id": 1
          },
          "gateway_info": {
            "id": "2c92c0f85e2d19af015e3a61d8947e5d",
            "code": "insufficient_funds",
            "response": "Your card has insufficient funds."
          }
        }
      ]
    },
    {
      "account_id": "2c92c0f96bd69165016bdcbf55ad5e62",
      "invoice_id": "2c92c0fb78532b0f01785a38cede190a",
      "payment_method_id": "2c92c0f9774f2b3e01775f6cf2fb726a",
      "currency": "USD",
      "status": "Cycle Incomplete",
      "current_attempt_number": 1,
      "next_attempt": "2021-03-24T19:34:20.254Z",
      "customer_group": "All Remaining Customers",
      "attempts": [
        {
          "attempt_number": 1,
          "zuora_payment_id": "2c92c085785305e201785a51aae41969",
          "time_of_execution": "2021-03-23T16:50:18.878Z",
          "source": "PR-00000376",
          "cpr_generated": false,
          "success": false,
          "amount_collected": 0,
          "action_info": {
            "action": "Retry"
          },
          "retry_info": {
            "next": "2021-03-23T07:51:30.316-09:00",
            "criteria": "incremental_time"
          },
          "mapping_info": {
            "label": "Hard Decline",
            "level": "code",
            "customer_group_id": 1
          },
          "gateway_info": {
            "id": "2c92c0f85e2d19af015e3a61d8947e5d",
            "code": "insufficient_funds",
            "response": "Your card has insufficient funds."
          }
        }
      ]
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://payment-retry.apps.zuora.com/api/v1/payments/account_cycle_history/account_id"

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

print(response.json())
```

```javascript
const url = 'https://payment-retry.apps.zuora.com/api/v1/payments/account_cycle_history/account_id';
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/payments/account_cycle_history/account_id"

	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/payments/account_cycle_history/account_id")

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/payments/account_cycle_history/account_id")
  .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/payments/account_cycle_history/account_id', [
  '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/payments/account_cycle_history/account_id");
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/payments/account_cycle_history/account_id")! 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()
```