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

# Retrieve payment run data

GET https://rest.test.zuora.com/v1/payment-runs/{paymentRunKey}/data

Retrieves payment run data and the processing result with details, if the `data` field was specified in the Create payment run operation.
   


Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/payments/payment-runs/get-payment-run-data

## Authentication

- `Authorization` header (bearer token, required) — Use `Bearer {{token}}` in the `Authorization` header for authentication.

## Servers

- `https://rest.test.zuora.com` (US Developer & Central Sandbox (incl. Test Drive), default)
- `https://rest.sandbox.na.zuora.com` (US API Sandbox Cloud 1)
- `https://rest.apisandbox.zuora.com` (US API Sandbox Cloud 2)
- `https://rest.na.zuora.com` (US Production Cloud 1)
- `https://rest.zuora.com` (US Production Cloud 2)
- `https://rest.test.eu.zuora.com` (EU Developer & Central Sandbox)
- `https://rest.sandbox.eu.zuora.com` (EU API Sandbox)
- `https://rest.eu.zuora.com` (EU Production)
- `https://rest.test.ap.zuora.com` (APAC Developer & Central Sandbox)
- `https://rest.ap.zuora.com` (APAC Production)

## Request

### Path parameters

- `paymentRunKey` (string, required) — The unique ID of a payment run or the payment run number. For example, 402890245f097f39015f0f074a2e0566.

### Headers

- `Accept-Encoding` (string, optional) — Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it.
- `Content-Encoding` (string, optional) — Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.
- `Zuora-Track-Id` (string, optional) — A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`"`), and quote (`'`).
- `Zuora-Version` (string, optional) — The minor API version. For a list of available minor versions, see [API upgrades](https://developer.zuora.com/v1-api-reference/api-upgrades/).

## Response

### 200

OK

- `data` (list of GETPaymentRunDataElementResponse, optional) — Container for payment run data. Each element in the array is a record processed by the payment run.
- `success` (boolean, optional) — Returns `true` if the request was processed successfully.

## Types

### GETPaymentRunDataElementResponse

Container for custom fields of a Payment object.

- `accountId` (string, optional) — The customer account ID specified in the `data` field when creating the payment run.
- `accountNumber` (string, optional) — The customer account number specified in the `data` field when creating the payment run.
- `amount` (double, optional) — The amount specified in the `data` field when creating the payment run. `null` is returned if it was not specified.
- `amountCollected` (double, optional) — The amount that is collected.
- `amountToCollect` (double, optional) — The amount to be collected.
- `comment` (string, optional, nullable) — The comment specified in the `data` field when creating the payment run. `null` is returned if it was not specified.
- `currency` (string, optional) — This field is only available if support for standalone payments is enabled. The currency of the standalone payment. The currency of the standalone payment can be different from the payment currency defined in the customer account settings.
- `documentId` (string, optional) — The billing document ID specified in the `data` field when creating the payment run. `null` is returned if it was not specified.
- `documentNumber` (string, optional) — The billing document number specified in the `data` field when creating the payment run. `null` is returned if it was not specified.
- `documentType` (enum, optional) — The billing document type specified in the `data` field when creating the payment run. `null` is returned if it was not specified.
  - Allowed values: `Invoice`, `DebitMemo`
- `errorCode` (string, optional) — The error code of the response.
- `errorMessage` (string, optional) — The detailed information of the error response.
- `paymentGatewayId` (string, optional, nullable) — The payment gateway ID specified in the `data` field when creating the payment run. `null` is returned if it was not specified.
- `paymentMethodId` (string, optional) — The payment method ID specified in the `data` field when creating the payment run. `null` is returned if it was not specified.
- `result` (enum, optional) — Indicates whether the data is processed successfully or not.
  - Allowed values: `Processed`, `Error`
- `standalone` (boolean, optional) — This field is only available if the support for standalone payment is enabled. The value `true` indicates this is a standalone payment that is created and processed in Zuora through Zuora gateway integration but will be settled outside of Zuora. No settlement data will be created. The standalone payment cannot be applied, unapplied, or transferred.
- `transactions` (list of GETPaymentRunDataTransactionElementResponse, optional) — Container for transactions that apply to the current request. Each element contains an array of the settlement/payment applied to the record.

### GETPaymentRunDataTransactionElementResponse

- `amount` (double, optional) — The total amount of the newly generated payment. **Note:** This field is only available if `type` is `Payment`.
- `appliedAmount` (double, optional) — The amount allocated to this data record.
- `errorCode` (string, optional) — The error code of the response. **Note:** This field is only available if `type` is `Payment`.
- `errorMessage` (string, optional) — The detailed information of the error response. **Note:** This field is only available if `type` is `Payment`.
- `id` (string, optional) — The ID of the current transaction.
- `status` (enum, optional) — The status of the newly generated payment. **Note:** This field is only available if `type` is `Payment`.
  - Allowed values: `Processed`, `Processing`, `Error`
- `type` (enum, optional) — The type of the current transaction.
  - Allowed values: `Payment`, `CreditMemo`, `UnappliedPayment`, `CreditBalanceAdjustment`

## Examples

**Response**

```json
{
  "data": [
    {
      "accountId": "402881ed738ddf2001738def8db50058",
      "amount": 80,
      "amountCollected": 80,
      "amountToCollect": 80,
      "comment": "Comment1",
      "documentId": "402881ed738ddf2001738df388fd009e",
      "documentType": "Invoice",
      "paymentGatewayId": "402881ed738ddf2001738def8b630050",
      "paymentMethodId": "402881ed738ddf2001738def8e60005b",
      "result": "Processed",
      "transactions": [
        {
          "amount": 40,
          "appliedAmount": 40,
          "id": "402881ed738ddf2001738dfafad6012c",
          "status": "Processed",
          "type": "Payment"
        },
        {
          "appliedAmount": 10,
          "id": "402881ed738ddf2001738df7572400e6",
          "type": "CreditMemo"
        },
        {
          "appliedAmount": 30,
          "id": "402881ed738ddf2001738df715d800dd",
          "type": "UnappliedPayment"
        }
      ],
      "customField1__c": "cf_value1",
      "customField2__c": "cf_value2"
    },
    {
      "accountId": "402881ed738ddf2001738def8db50058",
      "amount": 70,
      "amountCollected": 70,
      "amountToCollect": 70,
      "comment": "Comment2",
      "documentId": "402881ed738ddf2001738df5b90a00c0",
      "documentType": "DebitMemo",
      "paymentGatewayId": "402881ed738ddf2001738def8b630050",
      "paymentMethodId": "402881ed738ddf2001738df97dbe00fe",
      "result": "Processed",
      "transactions": [
        {
          "amount": 70,
          "appliedAmount": 70,
          "id": "402881ed738ddf2001738dfafcbd013b",
          "status": "Processed",
          "type": "Payment"
        }
      ],
      "customField1__c": "cf_value3",
      "customField2__c": "cf_value4"
    },
    {
      "accountId": "c49b85cd8ba742edb5ab4b3da90fc4c0",
      "comment": "Comment3",
      "documentId": "7dab18d036dc4c94bbec853afb12affb",
      "documentType": "Invoice",
      "errorCode": "Invalid_Request_Data",
      "errorMessage": "Payment method is closed",
      "paymentGatewayId": "768929c2f51947e79e73703bfc9bca7d",
      "paymentMethodId": "1906df6f56f049c8b7457dc31f62d0ec",
      "result": "Error",
      "customField1__c": "cf_value5",
      "customField2__c": "cf_value6"
    }
  ],
  "success": true
}
```

**SDK Code**

```python response
import requests

url = "https://rest.test.zuora.com/v1/payment-runs/paymentRunKey/data"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript response
const url = 'https://rest.test.zuora.com/v1/payment-runs/paymentRunKey/data';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go response
package main

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

func main() {

	url := "https://rest.test.zuora.com/v1/payment-runs/paymentRunKey/data"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

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

url = URI("https://rest.test.zuora.com/v1/payment-runs/paymentRunKey/data")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.get("https://rest.test.zuora.com/v1/payment-runs/paymentRunKey/data")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://rest.test.zuora.com/v1/payment-runs/paymentRunKey/data', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp response
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/v1/payment-runs/paymentRunKey/data");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift response
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/v1/payment-runs/paymentRunKey/data")! 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()
```