# 

## Prerequisites

* A valid API key with admin or manager permissions — see [Obtain API credentials](/docs/how-tos/setup/obtain-credentials)
* At least one authorized or captured transaction in the current open batch


## When to close manually

Batches close automatically at the end of each business day. Close manually when you need to:

* **Settle transactions sooner** — for example, at the end of a shift or event.
* **Control settlement timing** — align batch closure with your accounting schedule.
* **Resolve issues** — close a batch after reviewing and correcting transactions.


## Step 1: Review the current batch

List batches to see the current open batch and its transaction summary.

curl
```shell
curl -X GET \
  "https://api.dev.paradisegateway.net/v1/batches?take=5&sort_order=desc" \
  -H "APIKEY: YOUR-API-KEY"
```

Python
```python
import requests

resp = requests.get(
    "https://api.dev.paradisegateway.net/v1/batches",
    headers={"APIKEY": "YOUR-API-KEY"},
    params={"take": "5", "sort_order": "desc"},
)
print(resp.json())
```

JavaScript
```javascript
const resp = await fetch(
  "https://api.dev.paradisegateway.net/v1/batches?take=5&sort_order=desc",
  { headers: { "APIKEY": "YOUR-API-KEY" } }
);
console.log(await resp.json());
```

C#
```csharp
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("APIKEY", "YOUR-API-KEY");
var resp = await client.GetStringAsync(
    "https://api.dev.paradisegateway.net/v1/batches?take=5&sort_order=desc");
Console.WriteLine(resp);
```

Java
```java
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create(
        "https://api.dev.paradisegateway.net/v1/batches?take=5&sort_order=desc"))
    .header("APIKEY", "YOUR-API-KEY")
    .GET().build();
HttpResponse<String> resp = HttpClient.newHttpClient().send(request,
    HttpResponse.BodyHandlers.ofString());
System.out.println(resp.body());
```

Go
```go
req, _ := http.NewRequest("GET",
    "https://api.dev.paradisegateway.net/v1/batches?take=5&sort_order=desc", nil)
req.Header.Set("APIKEY", "YOUR-API-KEY")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
```

PHP
```php
$ch = curl_init(
    "https://api.dev.paradisegateway.net/v1/batches?take=5&sort_order=desc");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ["APIKEY: YOUR-API-KEY"],
]);
echo curl_exec($ch); curl_close($ch);
```

Ruby
```ruby
require "net/http"
uri = URI("https://api.dev.paradisegateway.net/v1/batches?take=5&sort_order=desc")
req = Net::HTTP::Get.new(uri, { "APIKEY" => "YOUR-API-KEY" })
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts resp.body
```

## Step 2: Close the batch

Send `PUT /v1/batches/status` to close the current open batch.

curl
```shell
curl -X PUT \
  https://api.dev.paradisegateway.net/v1/batches/status \
  -H "Content-Type: application/json" \
  -H "APIKEY: YOUR-API-KEY" \
  -d '{
    "status": "closed"
  }'
```

Python
```python
import requests

resp = requests.put(
    "https://api.dev.paradisegateway.net/v1/batches/status",
    headers={"Content-Type": "application/json", "APIKEY": "YOUR-API-KEY"},
    json={"status": "closed"},
)
print(resp.json())
```

JavaScript
```javascript
const resp = await fetch(
  "https://api.dev.paradisegateway.net/v1/batches/status",
  {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
      "APIKEY": "YOUR-API-KEY",
    },
    body: JSON.stringify({ status: "closed" }),
  }
);
console.log(await resp.json());
```

C#
```csharp
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("APIKEY", "YOUR-API-KEY");
var payload = new { status = "closed" };
var resp = await client.PutAsJsonAsync(
    "https://api.dev.paradisegateway.net/v1/batches/status", payload);
Console.WriteLine(await resp.Content.ReadAsStringAsync());
```

Java
```java
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.dev.paradisegateway.net/v1/batches/status"))
    .header("Content-Type", "application/json")
    .header("APIKEY", "YOUR-API-KEY")
    .PUT(HttpRequest.BodyPublishers.ofString("{\"status\": \"closed\"}"))
    .build();
HttpResponse<String> resp = HttpClient.newHttpClient().send(request,
    HttpResponse.BodyHandlers.ofString());
System.out.println(resp.body());
```

Go
```go
payload := strings.NewReader(`{"status": "closed"}`)
req, _ := http.NewRequest("PUT",
    "https://api.dev.paradisegateway.net/v1/batches/status", payload)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("APIKEY", "YOUR-API-KEY")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
```

PHP
```php
$ch = curl_init("https://api.dev.paradisegateway.net/v1/batches/status");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => ["Content-Type: application/json", "APIKEY: YOUR-API-KEY"],
    CURLOPT_POSTFIELDS => json_encode(["status" => "closed"]),
]);
echo curl_exec($ch); curl_close($ch);
```

Ruby
```ruby
require "net/http"; require "json"
uri = URI("https://api.dev.paradisegateway.net/v1/batches/status")
req = Net::HTTP::Put.new(uri, {
  "Content-Type" => "application/json", "APIKEY" => "YOUR-API-KEY",
})
req.body = { status: "closed" }.to_json
resp = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts resp.body
```

## Step 3: Verify the closure

After closing, list batches again to confirm the batch status changed.

```shell
curl -X GET \
  "https://api.dev.paradisegateway.net/v1/batches/status?client_id=YOUR-CLIENT-ID" \
  -H "APIKEY: YOUR-API-KEY"
```

## What happens after batch closure

1. The processor receives all transactions in the closed batch.
2. Card transactions are submitted to the card network for clearing.
3. ACH transactions are submitted to the ACH network.
4. Funds are deposited to the merchant's account within 1–3 business days.
5. A new open batch is created automatically for subsequent transactions.


What happens after batch closure
## Batch query parameters

The `GET /v1/batches` endpoint supports the same pagination and sorting as transactions.

| Parameter | Description |
|  --- | --- |
| `skip` | Records to skip |
| `take` | Records to return |
| `sort_column` | Column to sort by |
| `sort_order` | `asc` or `desc` |
| `search_text` | Free-text search |
| `term` | Filter term |


## Next steps

* [List transactions with filters](/docs/how-tos/manage-transactions/list-transactions) — view transactions within a batch
* [About batch settlement](/docs/concepts/transactions/batch-settlement) — detailed settlement process
* [Retrieve transaction details](/docs/how-tos/manage-transactions/retrieve-transaction-details) — check individual transaction status