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

# Create a summary statement run

POST https://rest.test.zuora.com/v1/summary-statement-runs
Content-Type: application/json

Allows you to initiate the generation of a summary statement run.
You can specify parameters such as the run type (AdHoc or scheduled) and the target account categories (single or multiple accounts).


Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/billing-documents/summary-statements/create-summary-statement-run

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

### Headers

- `Idempotency-Key` (string, optional) — Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types. With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.
- `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-Entity-Ids` (string, optional) — An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you should not set this header.
- `Zuora-Org-Ids` (string, optional) — Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. This header is important in Multi-Org (MO) setups because it defines the organization context under which the API should operate—mainly used for read access or data visibility filtering. If the header is not set, the operation is performed in scope of the user's accessible orgs.
- `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/).

### Body (application/json)

This endpoint expects a SummaryStatementRunRequestType.

- `runType` (enum, required) — The scheduled type of the run which can either be AdHoc or Scheduled. Currently, only `AdHoc` is supported.
  - Allowed values: `AdHoc`
- `targetAccountCategory` (enum, required) — Specifies the type of account filter. If the filter type is set to `AllAccounts`, `AccountsWithOpenInvoices`, `AccountsWithOpenBalances`, `AccountsWithoutInvoices`, or `AccountsWithoutInvoicesAndOpenBalances`, you can further refine the filter using `batchName` and `billCycleDay`. However, these criteria are not applicable when the filter type is `SingleAccount`.
  - Allowed values: `SingleAccount`, `AllAccounts`, `AccountsWithOpenInvoices`, `AccountsWithOpenBalances`, `AccountsWithoutInvoices`, `AccountsWithoutInvoicesAndOpenBalances`
- `dateRangeType` (enum, required) — The date range for the statement. If `PreviousThreeCalendarMonth` or `PreviousOneCalendarMonth` is selected, the start and end dates are automatically calculated. For example, if `PreviousThreeCalendarMonth` is chosen today (2024-08-20), the dates would be 2024-05-01 to 2024-07-31.
  - Allowed values: `Custom`, `PreviousThreeCalendarMonth`, `PreviousOneCalendarMonth`
- `accountKey` (string, optional, nullable) — The related account ID or account number when the filter type is `SingleAccount`.
- `batchName` (string, optional) — The batch name used for filtering accounts, for example, Batch1.
- `billCycleDay` (string, optional, nullable) — The bill cycle day for filtering accounts, with values ranging from '01' to '31'.
- `startDate` (date, optional) — Required when `Custom` is selected for the date range. The start date can be set to a maximum of 5 years in the past and must follow the format YYYY-MM-DD.
- `endDate` (date, optional) — When creating a statement run, this field cannot be manually entered. If `Custom` is selected, the end date automatically defaults to today’s date in the tenant’s timezone.
- `autoEmailEnabled` (boolean, optional) — Indicates whether to send an email after a statement is generated. Acceptable values are `true` or `false`. If unspecified, the default value is `false`.
- `description` (string, optional) — A text description of the statement run.

## Response

### 200

OK

- `id` (string, optional) — The unique identifier for the statement run.
- `statementRunNumber` (string, optional) — The number of the statement run.
- `runType` (enum, optional) — The scheduled type of the run which can either be AdHoc or Scheduled. Currently, only `AdHoc` is supported.
  - Allowed values: `AdHoc`
- `targetAccountCategory` (enum, optional) — Specifies the type of account filter. If the filter type is set to `AllAccounts`, `AccountsWithOpenInvoices`, `AccountsWithOpenBalances`, `AccountsWithoutInvoices`, or `AccountsWithoutInvoicesAndOpenBalances`, you can further refine the filter using `batchName` and `billCycleDay`. However, these criteria are not applicable when the filter type is `SingleAccount`.
  - Allowed values: `SingleAccount`, `AllAccounts`, `AccountsWithOpenInvoices`, `AccountsWithOpenBalances`, `AccountsWithoutInvoices`, `AccountsWithoutInvoicesAndOpenBalances`
- `accountKey` (string, optional, nullable) — When the filter type is `SingleAccount`, this field contains the related account ID.
- `batchName` (string, optional) — The name of the batch used for filtering accounts.
- `billCycleDay` (string, optional, nullable) — The bill cycle day for filtering accounts, with values ranging from '01' to '31'.
- `dateRangeType` (enum, optional) — The date range for the statement.
  - Allowed values: `PreviousThreeCalendarMonth`, `PreviousOneCalendarMonth`, `PreviousOneCalendarMonth`
- `startDate` (date, optional) — The start date.
- `endDate` (date, optional) — The end date, which defaults to today’s date when `Custom` is selected. This field cannot be manually entered.
- `autoEmailEnabled` (boolean, optional) — Indicates whether to send an email after a statement is generated.
- `description` (string, optional) — A text description of the statement run.
- `status` (enum, optional) — The status of the run.
  - Allowed values: `Pending`, `Processing`, `Completed`, `Error`, `Terminated`
- `createdById` (string, optional) — The ID of the user who created the statement run.
- `createdDate` (string, optional) — The date and time the statement run was created.
- `success` (boolean, optional) — Indicates whether the operation was successful.
- `updatedById` (string, optional) — The ID of the user who last updated the statement run.
- `updatedDate` (string, optional) — The date the statement run was last updated.

## Errors

### 500 Internal Server Error

Internal Server Error

- `reasons` (list of ErrorResponseReasonsItems, optional)

### 400 Client Request Error

Request Errors

- `processId` (string, optional) — The ID of the process that handles the operation.
- `reasons` (list of CommonResponseReasonsItems, optional) — The container of the error code and message. This field is available only if the `success` field is `false`.
- `requestId` (string, optional) — Unique identifier of the request.
- `success` (boolean, optional) — Indicates whether the call succeeded.

## Types

### ErrorResponseReasonsItems

- `code` (string, optional) — The error code of response.
- `message` (string, optional) — The detail information of the error response

### CommonResponseReasonsItems

- `code` (string, optional) — The error code of response.
- `message` (string, optional) — The detail information of the error response

## Examples

### response

**Response**

```json
{
  "id": "402881869169397401916d8ff8d218c5",
  "statementRunNumber": "SSR-00000004",
  "runType": "AdHoc",
  "targetAccountCategory": "AllAccounts",
  "accountKey": null,
  "batchName": "Batch51",
  "billCycleDay": null,
  "dateRangeType": "PreviousThreeCalendarMonth",
  "startDate": "2024-05-01",
  "endDate": "2024-07-31",
  "autoEmailEnabled": false,
  "description": "HelloWorld",
  "status": "Pending",
  "createdById": "402881e522cf4f9b0122cf5d82860002",
  "createdDate": "2024-08-19 19:13:57",
  "success": true,
  "updatedById": "402881e522cf4f9b0122cf5d82860002",
  "updatedDate": "2024-08-20 10:13:57.586"
}
```

**SDK Code**

```python response
import requests

url = "https://rest.test.zuora.com/v1/summary-statement-runs"

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

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

print(response.json())
```

```javascript response
const url = 'https://rest.test.zuora.com/v1/summary-statement-runs';
const options = {method: 'POST', 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/summary-statement-runs"

	req, _ := http.NewRequest("POST", 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/summary-statement-runs")

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

request = Net::HTTP::Post.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.post("https://rest.test.zuora.com/v1/summary-statement-runs")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp response
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/v1/summary-statement-runs");
var request = new RestRequest(Method.POST);
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/summary-statement-runs")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### Example1

**Request**

```json
{
  "runType": "AdHoc",
  "targetAccountCategory": "AllAccounts",
  "dateRangeType": "PreviousOneCalendarMonth",
  "batchName": "Batch1",
  "billCycleDay": "01",
  "autoEmailEnabled": false,
  "description": "This is a sample response for accounts from a batch with a billCycleDay of 01."
}
```

**Response**

```json
{
  "id": "402881869169397401916d8ff8d218c5",
  "statementRunNumber": "SSR-00000004",
  "runType": "AdHoc",
  "targetAccountCategory": "AllAccounts",
  "accountKey": null,
  "batchName": "Batch51",
  "billCycleDay": null,
  "dateRangeType": "PreviousThreeCalendarMonth",
  "startDate": "2024-05-01",
  "endDate": "2024-07-31",
  "autoEmailEnabled": false,
  "description": "HelloWorld",
  "status": "Pending",
  "createdById": "402881e522cf4f9b0122cf5d82860002",
  "createdDate": "2024-08-19 19:13:57",
  "success": true,
  "updatedById": "402881e522cf4f9b0122cf5d82860002",
  "updatedDate": "2024-08-20 10:13:57.586"
}
```

**SDK Code**

```python Example1
import requests

url = "https://rest.test.zuora.com/v1/summary-statement-runs"

payload = {
    "runType": "AdHoc",
    "targetAccountCategory": "AllAccounts",
    "dateRangeType": "PreviousOneCalendarMonth",
    "batchName": "Batch1",
    "billCycleDay": "01",
    "autoEmailEnabled": False,
    "description": "This is a sample response for accounts from a batch with a billCycleDay of 01."
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Example1
const url = 'https://rest.test.zuora.com/v1/summary-statement-runs';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"runType":"AdHoc","targetAccountCategory":"AllAccounts","dateRangeType":"PreviousOneCalendarMonth","batchName":"Batch1","billCycleDay":"01","autoEmailEnabled":false,"description":"This is a sample response for accounts from a batch with a billCycleDay of 01."}'
};

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

```go Example1
package main

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

func main() {

	url := "https://rest.test.zuora.com/v1/summary-statement-runs"

	payload := strings.NewReader("{\n  \"runType\": \"AdHoc\",\n  \"targetAccountCategory\": \"AllAccounts\",\n  \"dateRangeType\": \"PreviousOneCalendarMonth\",\n  \"batchName\": \"Batch1\",\n  \"billCycleDay\": \"01\",\n  \"autoEmailEnabled\": false,\n  \"description\": \"This is a sample response for accounts from a batch with a billCycleDay of 01.\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://rest.test.zuora.com/v1/summary-statement-runs")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"runType\": \"AdHoc\",\n  \"targetAccountCategory\": \"AllAccounts\",\n  \"dateRangeType\": \"PreviousOneCalendarMonth\",\n  \"batchName\": \"Batch1\",\n  \"billCycleDay\": \"01\",\n  \"autoEmailEnabled\": false,\n  \"description\": \"This is a sample response for accounts from a batch with a billCycleDay of 01.\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/v1/summary-statement-runs")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"runType\": \"AdHoc\",\n  \"targetAccountCategory\": \"AllAccounts\",\n  \"dateRangeType\": \"PreviousOneCalendarMonth\",\n  \"batchName\": \"Batch1\",\n  \"billCycleDay\": \"01\",\n  \"autoEmailEnabled\": false,\n  \"description\": \"This is a sample response for accounts from a batch with a billCycleDay of 01.\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/v1/summary-statement-runs', [
  'body' => '{
  "runType": "AdHoc",
  "targetAccountCategory": "AllAccounts",
  "dateRangeType": "PreviousOneCalendarMonth",
  "batchName": "Batch1",
  "billCycleDay": "01",
  "autoEmailEnabled": false,
  "description": "This is a sample response for accounts from a batch with a billCycleDay of 01."
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Example1
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/v1/summary-statement-runs");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"runType\": \"AdHoc\",\n  \"targetAccountCategory\": \"AllAccounts\",\n  \"dateRangeType\": \"PreviousOneCalendarMonth\",\n  \"batchName\": \"Batch1\",\n  \"billCycleDay\": \"01\",\n  \"autoEmailEnabled\": false,\n  \"description\": \"This is a sample response for accounts from a batch with a billCycleDay of 01.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example1
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "runType": "AdHoc",
  "targetAccountCategory": "AllAccounts",
  "dateRangeType": "PreviousOneCalendarMonth",
  "batchName": "Batch1",
  "billCycleDay": "01",
  "autoEmailEnabled": false,
  "description": "This is a sample response for accounts from a batch with a billCycleDay of 01."
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/v1/summary-statement-runs")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

### Example2

**Request**

```json
{
  "runType": "AdHoc",
  "targetAccountCategory": "AccountsWithOpenInvoices",
  "dateRangeType": "PreviousOneCalendarMonth",
  "batchName": "Batch1",
  "autoEmailEnabled": false,
  "description": "This is a sample response for accounts from a batch with open invoices."
}
```

**Response**

```json
{
  "id": "402881869169397401916d8ff8d218c5",
  "statementRunNumber": "SSR-00000004",
  "runType": "AdHoc",
  "targetAccountCategory": "AllAccounts",
  "accountKey": null,
  "batchName": "Batch51",
  "billCycleDay": null,
  "dateRangeType": "PreviousThreeCalendarMonth",
  "startDate": "2024-05-01",
  "endDate": "2024-07-31",
  "autoEmailEnabled": false,
  "description": "HelloWorld",
  "status": "Pending",
  "createdById": "402881e522cf4f9b0122cf5d82860002",
  "createdDate": "2024-08-19 19:13:57",
  "success": true,
  "updatedById": "402881e522cf4f9b0122cf5d82860002",
  "updatedDate": "2024-08-20 10:13:57.586"
}
```

**SDK Code**

```python Example2
import requests

url = "https://rest.test.zuora.com/v1/summary-statement-runs"

payload = {
    "runType": "AdHoc",
    "targetAccountCategory": "AccountsWithOpenInvoices",
    "dateRangeType": "PreviousOneCalendarMonth",
    "batchName": "Batch1",
    "autoEmailEnabled": False,
    "description": "This is a sample response for accounts from a batch with open invoices."
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Example2
const url = 'https://rest.test.zuora.com/v1/summary-statement-runs';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"runType":"AdHoc","targetAccountCategory":"AccountsWithOpenInvoices","dateRangeType":"PreviousOneCalendarMonth","batchName":"Batch1","autoEmailEnabled":false,"description":"This is a sample response for accounts from a batch with open invoices."}'
};

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

```go Example2
package main

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

func main() {

	url := "https://rest.test.zuora.com/v1/summary-statement-runs"

	payload := strings.NewReader("{\n  \"runType\": \"AdHoc\",\n  \"targetAccountCategory\": \"AccountsWithOpenInvoices\",\n  \"dateRangeType\": \"PreviousOneCalendarMonth\",\n  \"batchName\": \"Batch1\",\n  \"autoEmailEnabled\": false,\n  \"description\": \"This is a sample response for accounts from a batch with open invoices.\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://rest.test.zuora.com/v1/summary-statement-runs")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"runType\": \"AdHoc\",\n  \"targetAccountCategory\": \"AccountsWithOpenInvoices\",\n  \"dateRangeType\": \"PreviousOneCalendarMonth\",\n  \"batchName\": \"Batch1\",\n  \"autoEmailEnabled\": false,\n  \"description\": \"This is a sample response for accounts from a batch with open invoices.\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/v1/summary-statement-runs")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"runType\": \"AdHoc\",\n  \"targetAccountCategory\": \"AccountsWithOpenInvoices\",\n  \"dateRangeType\": \"PreviousOneCalendarMonth\",\n  \"batchName\": \"Batch1\",\n  \"autoEmailEnabled\": false,\n  \"description\": \"This is a sample response for accounts from a batch with open invoices.\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/v1/summary-statement-runs', [
  'body' => '{
  "runType": "AdHoc",
  "targetAccountCategory": "AccountsWithOpenInvoices",
  "dateRangeType": "PreviousOneCalendarMonth",
  "batchName": "Batch1",
  "autoEmailEnabled": false,
  "description": "This is a sample response for accounts from a batch with open invoices."
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Example2
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/v1/summary-statement-runs");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"runType\": \"AdHoc\",\n  \"targetAccountCategory\": \"AccountsWithOpenInvoices\",\n  \"dateRangeType\": \"PreviousOneCalendarMonth\",\n  \"batchName\": \"Batch1\",\n  \"autoEmailEnabled\": false,\n  \"description\": \"This is a sample response for accounts from a batch with open invoices.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example2
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "runType": "AdHoc",
  "targetAccountCategory": "AccountsWithOpenInvoices",
  "dateRangeType": "PreviousOneCalendarMonth",
  "batchName": "Batch1",
  "autoEmailEnabled": false,
  "description": "This is a sample response for accounts from a batch with open invoices."
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/v1/summary-statement-runs")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

### Example3

**Request**

```json
{
  "runType": "AdHoc",
  "targetAccountCategory": "AccountsWithOpenInvoices",
  "dateRangeType": "PreviousOneCalendarMonth",
  "batchName": "Batch1",
  "autoEmailEnabled": false,
  "description": "This is a sample response for accounts from a batch with a billCycleDay of 01 that has open invoices."
}
```

**Response**

```json
{
  "id": "402881869169397401916d8ff8d218c5",
  "statementRunNumber": "SSR-00000004",
  "runType": "AdHoc",
  "targetAccountCategory": "AllAccounts",
  "accountKey": null,
  "batchName": "Batch51",
  "billCycleDay": null,
  "dateRangeType": "PreviousThreeCalendarMonth",
  "startDate": "2024-05-01",
  "endDate": "2024-07-31",
  "autoEmailEnabled": false,
  "description": "HelloWorld",
  "status": "Pending",
  "createdById": "402881e522cf4f9b0122cf5d82860002",
  "createdDate": "2024-08-19 19:13:57",
  "success": true,
  "updatedById": "402881e522cf4f9b0122cf5d82860002",
  "updatedDate": "2024-08-20 10:13:57.586"
}
```

**SDK Code**

```python Example3
import requests

url = "https://rest.test.zuora.com/v1/summary-statement-runs"

payload = {
    "runType": "AdHoc",
    "targetAccountCategory": "AccountsWithOpenInvoices",
    "dateRangeType": "PreviousOneCalendarMonth",
    "batchName": "Batch1",
    "autoEmailEnabled": False,
    "description": "This is a sample response for accounts from a batch with a billCycleDay of 01 that has open invoices."
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Example3
const url = 'https://rest.test.zuora.com/v1/summary-statement-runs';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"runType":"AdHoc","targetAccountCategory":"AccountsWithOpenInvoices","dateRangeType":"PreviousOneCalendarMonth","batchName":"Batch1","autoEmailEnabled":false,"description":"This is a sample response for accounts from a batch with a billCycleDay of 01 that has open invoices."}'
};

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

```go Example3
package main

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

func main() {

	url := "https://rest.test.zuora.com/v1/summary-statement-runs"

	payload := strings.NewReader("{\n  \"runType\": \"AdHoc\",\n  \"targetAccountCategory\": \"AccountsWithOpenInvoices\",\n  \"dateRangeType\": \"PreviousOneCalendarMonth\",\n  \"batchName\": \"Batch1\",\n  \"autoEmailEnabled\": false,\n  \"description\": \"This is a sample response for accounts from a batch with a billCycleDay of 01 that has open invoices.\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://rest.test.zuora.com/v1/summary-statement-runs")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"runType\": \"AdHoc\",\n  \"targetAccountCategory\": \"AccountsWithOpenInvoices\",\n  \"dateRangeType\": \"PreviousOneCalendarMonth\",\n  \"batchName\": \"Batch1\",\n  \"autoEmailEnabled\": false,\n  \"description\": \"This is a sample response for accounts from a batch with a billCycleDay of 01 that has open invoices.\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/v1/summary-statement-runs")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"runType\": \"AdHoc\",\n  \"targetAccountCategory\": \"AccountsWithOpenInvoices\",\n  \"dateRangeType\": \"PreviousOneCalendarMonth\",\n  \"batchName\": \"Batch1\",\n  \"autoEmailEnabled\": false,\n  \"description\": \"This is a sample response for accounts from a batch with a billCycleDay of 01 that has open invoices.\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/v1/summary-statement-runs', [
  'body' => '{
  "runType": "AdHoc",
  "targetAccountCategory": "AccountsWithOpenInvoices",
  "dateRangeType": "PreviousOneCalendarMonth",
  "batchName": "Batch1",
  "autoEmailEnabled": false,
  "description": "This is a sample response for accounts from a batch with a billCycleDay of 01 that has open invoices."
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Example3
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/v1/summary-statement-runs");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"runType\": \"AdHoc\",\n  \"targetAccountCategory\": \"AccountsWithOpenInvoices\",\n  \"dateRangeType\": \"PreviousOneCalendarMonth\",\n  \"batchName\": \"Batch1\",\n  \"autoEmailEnabled\": false,\n  \"description\": \"This is a sample response for accounts from a batch with a billCycleDay of 01 that has open invoices.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example3
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "runType": "AdHoc",
  "targetAccountCategory": "AccountsWithOpenInvoices",
  "dateRangeType": "PreviousOneCalendarMonth",
  "batchName": "Batch1",
  "autoEmailEnabled": false,
  "description": "This is a sample response for accounts from a batch with a billCycleDay of 01 that has open invoices."
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/v1/summary-statement-runs")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```