> This page is for BaaS.

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

# Dispatch a Boleto Charge batch

POST https://tenant.api.corpx.com/v1/accounts/{accountId}/boleto/charge/batches/{batchId}/dispatch

Atomically reserves quota for every item and moves a non-empty `DRAFT`
batch to `QUEUED`. Processing is asynchronous.

Dispatch starts only when **all** items fit both the tenant and account
remaining quota. Otherwise it returns
`429 boleto_charge_monthly_limit_exceeded`, reserves nothing, starts no
issuance, and leaves the batch `DRAFT`. Once admitted, every slot is
consumed permanently, including items that later fail at the
settlement bank.

Subscribe to `boleto.charge.batch.completed` for the terminal batch
state. Continue to use individual boleto events for registration and
payment lifecycle.


Reference: https://en.docs.api.corpx.com/baas/referencia/boleto-charge/dispatch-boleto-charge-batch

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `accountId` (string, required) — Account identifier.
- `batchId` (string, required) — Boleto Charge batch identifier returned by the create endpoint.

### Headers

- `X-Tenant-Id` (string, required) — Tenant context used for authorization and routing.
- `Idempotency-Key` (string, optional) — Optional client-generated idempotency token (recommended for safe retries).

## Response

### 200

Idempotent repeat; the batch had already been dispatched

- `batchId` (string, required) — Batch identifier.
- `name` (string, required) — Optional operator-facing name; empty when omitted.
- `status` (enum, required) — Batch lifecycle. Only `DRAFT` is editable. `COMPLETED`, `PARTIAL_FAILED`, and `FAILED` are terminal for issuance attempts; individual boleto registration and payment continue afterwards.
  - Allowed values: `DRAFT`, `QUEUED`, `PROCESSING`, `COMPLETED`, `PARTIAL_FAILED`, `FAILED`
- `totalItems` (integer, required) — Number of staged items.
- `quotaReserved` (integer, required) — Slots permanently reserved when dispatch was admitted.
- `statistics` (BoletoChargeBatchStatistics, required) — Current generation progress and payment conversion.
- `createdAt` (datetime, required) — Draft creation instant, in UTC.
- `updatedAt` (datetime, required) — Last persisted batch/statistics update, in UTC.
- `items` (list of BoletoChargeBatchItem, required) — Current page of staged items and issuance results.
- `page` (integer, required) — Current item page.
- `pageSize` (integer, required) — Requested item page size.
- `totalPages` (integer, required) — Number of item pages.
- `hasNext` (boolean, required) — Whether another item page exists.
- `dispatchedAt` (datetime, optional, nullable) — Instant quota was reserved and the batch was queued.
- `completedAt` (datetime, optional, nullable) — Instant every issuance attempt reached an outcome.

### 202

Quota reserved atomically and batch queued, or beneficiary registration is still pending (`boleto_charge_beneficiary_pending`, no quota reserved, batch remains DRAFT).

- `Boleto Charge_dispatchBoletoChargeBatch_Response_202`
  - BoletoChargeBatchDetail: BoletoChargeBatchDetail
  - BoletoChargeDispatchBoletoChargeBatchResponse2021

## Errors

### 403 Forbidden Error

Requester does not have permission to perform the operation.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

### 404 Not Found Error

`boleto_charge_batch_not_found`.

- `any`

### 409 Conflict Error

`boleto_charge_batch_empty` or an identifier already reserved by another issuance.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

### 422 Unprocessable Entity Error

Beneficiary is ineligible or under review.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

### 429 Too Many Requests Error

`boleto_charge_monthly_limit_exceeded`. No quota is reserved and the batch remains `DRAFT`.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

### 502 Bad Gateway Error

Beneficiary registration failed at the settlement bank. After a rejection in the last 24 hours, `Retry-After` carries the seconds left, as in single issuance.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

### 503 Service Unavailable Error

Quota storage or batch workflow is temporarily unavailable.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

## Types

### BoletoChargeBatchStatistics

Current generation progress and payment conversion.

- `generation` (BoletoChargeBatchGenerationStats, required) — Issuance-attempt progress for the batch.
- `payment` (BoletoChargeBatchPaymentStats, required) — Payment conversion across generated boletos. Failed issuance items are excluded from every denominator.

### BoletoChargeBatchItem

One staged issuance request and its eventual result.

- `itemId` (string, required) — Batch-local item identifier used by the delete route.
- `position` (integer, required) — Stable order of this item inside the batch.
- `identifier` (string, required) — Required account-wide idempotency identifier from the request.
- `status` (enum, required) — Current item issuance state.
  - Allowed values: `PENDING`, `PROCESSING`, `ISSUED`, `FAILED`
- `request` (BoletoChargeCreateRequest, required) — One boleto issuance request. `identifier` is required and is the sole idempotency key for this account; `Idempotency-Key` is not a fallback.
- `createdAt` (datetime, required) — Item staging instant, in UTC.
- `updatedAt` (datetime, required) — Last item/result update, in UTC.
- `error` (BoletoChargeBatchItemError, optional) — Failure recorded for an item that did not produce a boleto.
- `charge` (BoletoChargeBatchItemCharge, optional) — Local mirror snapshot for a successfully issued batch item.

### BoletoChargeBatchDetail

Boleto Charge batch summary and current statistics.

- `batchId` (string, required) — Batch identifier.
- `name` (string, required) — Optional operator-facing name; empty when omitted.
- `status` (enum, required) — Batch lifecycle. Only `DRAFT` is editable. `COMPLETED`, `PARTIAL_FAILED`, and `FAILED` are terminal for issuance attempts; individual boleto registration and payment continue afterwards.
  - Allowed values: `DRAFT`, `QUEUED`, `PROCESSING`, `COMPLETED`, `PARTIAL_FAILED`, `FAILED`
- `totalItems` (integer, required) — Number of staged items.
- `quotaReserved` (integer, required) — Slots permanently reserved when dispatch was admitted.
- `statistics` (BoletoChargeBatchStatistics, required) — Current generation progress and payment conversion.
- `createdAt` (datetime, required) — Draft creation instant, in UTC.
- `updatedAt` (datetime, required) — Last persisted batch/statistics update, in UTC.
- `items` (list of BoletoChargeBatchItem, required) — Current page of staged items and issuance results.
- `page` (integer, required) — Current item page.
- `pageSize` (integer, required) — Requested item page size.
- `totalPages` (integer, required) — Number of item pages.
- `hasNext` (boolean, required) — Whether another item page exists.
- `dispatchedAt` (datetime, optional, nullable) — Instant quota was reserved and the batch was queued.
- `completedAt` (datetime, optional, nullable) — Instant every issuance attempt reached an outcome.

### BoletoChargeDispatchBoletoChargeBatchResponse2021

- `errorCode` (enum, optional)
  - Allowed values: `boleto_charge_beneficiary_pending`
- `message` (string, optional)
- `beneficiary` (map from string to any, optional)

### ErrorResponsePartner

Raw error from the settlement bank, when the failure came from it. Diagnostic only.

- `code` (string, optional)
- `message` (string, optional)
- `field` (string, optional) — Field the partner pointed at, when any.

### BoletoChargeBatchGenerationStats

Issuance-attempt progress for the batch.

- `total` (integer, required) — Total items in the batch.
- `pending` (integer, required) — Items not yet started.
- `processing` (integer, required) — Items whose issuance attempt is running.
- `issued` (integer, required) — Items for which the settlement bank generated a boleto.
- `failed` (integer, required) — Items whose issuance attempt ended without a generated boleto.
- `progressPercentage` (double, required) — `(issued + failed) / total × 100`; zero when total is zero.

### BoletoChargeBatchPaymentStats

Payment conversion across generated boletos. Failed issuance items are excluded from every denominator.

- `issued` (integer, required) — Generated boletos, the conversion denominator.
- `paid` (integer, required) — Issued boletos already settled.
- `unpaid` (integer, required) — Issued boletos not yet settled.
- `overdue` (integer, required) — Issued and unpaid boletos currently overdue.
- `paidAmount` (double, required) — Sum actually paid in BRL.
- `conversionRate` (double, required) — `paid / issued × 100`; zero when issued is zero.

### BoletoChargeCreateRequest

One boleto issuance request. `identifier` is required and is the sole idempotency key for this account; `Idempotency-Key` is not a fallback.

- `identifier` (string, required) — Caller-owned idempotency key, unique per account.
- `dueDate` (date, required) — Due date, YYYY-MM-DD.
- `amount` (BoletoChargeCreateRequestAmount, required) — Face amount of the boleto.
- `payer` (BoletoChargeCreateRequestPayer, required) — Who must pay the boleto.
- `issueDate` (date, optional) — Issue date, YYYY-MM-DD. dueDate cannot be before it.
- `interest` (BoletoChargeFee, optional) — Interest or fine. startDate, when set, must be after dueDate.
- `fine` (BoletoChargeFee, optional) — Interest or fine. startDate, when set, must be after dueDate.
- `discount` (BoletoChargeCreateRequestDiscount, optional) — Early-payment discount. Each groups[].limitDate must be before dueDate.
- `abatement` (BoletoChargeCreateRequestAbatement, optional) — Fixed abatement. Together with discounts it must not reach amount.nominal.
- `allowPartialPayment` (boolean, optional) — Accept a payment below the amount.
- `allowDivergentPayment` (boolean, optional) — Accept an amount other than the face value, within min and max.
- `divergentPaymentMode` (enum, optional) — How a divergent payment is bounded.
  - Allowed values: `anyValue`, `minMax`, `minOnly`
- `minPaymentAmount` (double, optional) — Minimum accepted payment when divergent payment is on. Not greater than maxPaymentAmount.
- `maxPaymentAmount` (double, optional) — Maximum accepted payment when divergent payment is on.
- `expirationPolicy` (BoletoChargeCreateRequestExpirationPolicy, optional) — How long the boleto can be paid. There is no write-off of an open boleto; paymentLimitDate is how you bound validity.

### BoletoChargeBatchItemError

Failure recorded for an item that did not produce a boleto.

- `errorCode` (string, required) — Stable machine-readable failure code.
- `message` (string, required) — Human-readable diagnostic; do not branch on it.

### BoletoChargeBatchItemCharge

Local mirror snapshot for a successfully issued batch item.

- `chargeId` (string, required) — Settlement-bank boleto identifier.
- `identifier` (string, required) — Caller-owned identifier.
- `status` (string, required) — Current mirrored boleto status.
- `registrationCondition` (string, required) — Current mirrored central-registration condition.
- `barcode` (string, required) — Barcode, when available.
- `digitableLine` (string, required) — Digitable line, when available.
- `ourNumber` (string, required) — Our number at the settlement bank.
- `amount` (BoletoChargeBatchItemChargeAmount, required) — Mirrored issuance and payment amounts in BRL.
- `updatedAt` (datetime, optional) — Last successful mirror synchronization.

### BoletoChargeCreateRequestAmount

Face amount of the boleto.

- `nominal` (double, required) — Face amount in BRL, greater than zero. Two decimal places, never cents-as-integer.
- `currency` (enum, optional, default: BRL) — Currency. Always BRL.
  - Allowed values: `BRL`

### BoletoChargeCreateRequestPayer

Who must pay the boleto.

- `name` (string, required) — Payer name.
- `personType` (enum, required) — person for CPF, company for CNPJ.
  - Allowed values: `person`, `company`
- `taxNumber` (string, required) — CPF when personType is person, CNPJ when company. Digits only.
- `email` (string, optional) — Payer email.
- `addressStreet` (string, optional) — Street.
- `addressNumber` (string, optional) — Street number.
- `addressComplement` (string, optional) — Complement.
- `addressDistrict` (string, optional) — District.
- `addressCity` (string, optional) — City.
- `addressState` (string, optional) — State, two letters.
- `addressZipCode` (string, optional) — ZIP code, 8 digits.

### BoletoChargeFee

Interest or fine. startDate, when set, must be after dueDate.

- `calculationModel` (enum, optional) — Which institution computes the amounts before and after dueDate. Optional.
  - Allowed values: `receiver-calculates-all`, `recipient-calculates-overdue`, `recipient-calculates-all`
- `typeId` (integer, optional) — Optional. Filled from typeKey when omitted; when sent, it must match typeKey.
- `typeKey` (string, optional) — Fee type. Interest: `exempt`, `fixed-value-calendar-day`, `fixed-value-business-day`, `percentage-calendar-day`, `percentage-business-day`, `percentage-month-calendar-day`, `percentage-month-business-day`, `percentage-year-calendar-day`, `percentage-year-business-day`. Fine: `exempt`, `fixed-value`, `percentage`. Any other value returns 400 `invalid_payload`.
- `value` (double, optional) — Amount in BRL, or a percent when typeKey says percentage. Required and greater than zero unless typeKey is exempt.
- `startDate` (date, optional) — First day the fee applies, YYYY-MM-DD, after dueDate.

### BoletoChargeCreateRequestDiscount

Early-payment discount. Each groups[].limitDate must be before dueDate.

- `calculationModel` (enum, optional) — Which institution computes the discount. Optional.
  - Allowed values: `receiver-calculates-all`, `recipient-calculates-overdue`, `recipient-calculates-all`
- `groups` (list of BoletoChargeCreateRequestDiscountGroupsItems, optional) — Discount steps.

### BoletoChargeCreateRequestAbatement

Fixed abatement. Together with discounts it must not reach amount.nominal.

- `amount` (double, optional) — Abatement in BRL, not negative.

### BoletoChargeCreateRequestExpirationPolicy

How long the boleto can be paid. There is no write-off of an open boleto; paymentLimitDate is how you bound validity.

- `allowPaymentAfterDueDate` (boolean, optional) — Whether payment is accepted after dueDate.
- `paymentLimitDate` (date, optional) — Last day payment is accepted, YYYY-MM-DD, not before dueDate.
- `blockPaymentAfterLimit` (boolean, optional) — Reject payment after paymentLimitDate.
- `decursoGraceDays` (integer, optional) — Grace days after the payment limit.

### BoletoChargeBatchItemChargeAmount

Mirrored issuance and payment amounts in BRL.

- `nominal` (double, optional) — Face amount.
- `updatedAmount` (double, optional) — Current amount after charges/reductions.
- `paid` (double, optional) — Amount already paid.
- `currency` (string, optional) — Currency, normally BRL.

### BoletoChargeCreateRequestDiscountGroupsItems

- `sequence` (integer, optional) — Step order, starting at 1.
- `typeId` (integer, optional) — Optional. Filled from typeKey when omitted; when sent, it must match typeKey.
- `typeKey` (string, optional) — Discount type: `exempt`, `fixed-value-until-date`, `percentage-until-date`, `fixed-value-anticipation-calendar-day`, `fixed-value-anticipation-business-day`, `percentage-anticipation-calendar-day`, `percentage-anticipation-business-day`. `-until-date` types require limitDate; anticipation types must not send it.
- `value` (double, optional) — Discount amount in BRL, or a percent when typeKey says percentage.
- `limitDate` (date, optional) — Last day this step applies, YYYY-MM-DD, before dueDate. Only for `-until-date` types.

## Examples

### Boleto Charge_dispatchBoletoChargeBatch_example

**Response**

```json
{
  "batchId": "bcb_01J8Y7C8D9E0F1G2H3J4",
  "name": "Cobranças de setembro",
  "status": "PROCESSING",
  "totalItems": 100,
  "quotaReserved": 100,
  "statistics": {
    "generation": {
      "total": 100,
      "pending": 70,
      "processing": 5,
      "issued": 24,
      "failed": 1,
      "progressPercentage": 25
    },
    "payment": {
      "issued": 24,
      "paid": 0,
      "unpaid": 24,
      "overdue": 0,
      "paidAmount": 0,
      "conversionRate": 0
    }
  },
  "createdAt": "2026-09-24T14:08:12Z",
  "updatedAt": "2026-09-24T14:11:00Z",
  "items": [],
  "page": 1,
  "pageSize": 50,
  "totalPages": 2,
  "hasNext": true,
  "dispatchedAt": "2026-09-24T14:10:00Z"
}
```

**SDK Code**

```python Boleto Charge_dispatchBoletoChargeBatch_example
import requests

url = "https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch"

headers = {
    "X-Tenant-Id": "X-Tenant-Id",
    "Authorization": "Bearer <token>"
}

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

print(response.json())
```

```javascript Boleto Charge_dispatchBoletoChargeBatch_example
const url = 'https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch';
const options = {
  method: 'POST',
  headers: {'X-Tenant-Id': 'X-Tenant-Id', Authorization: 'Bearer <token>'}
};

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

```go Boleto Charge_dispatchBoletoChargeBatch_example
package main

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

func main() {

	url := "https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch"

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

	req.Header.Add("X-Tenant-Id", "X-Tenant-Id")
	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 Boleto Charge_dispatchBoletoChargeBatch_example
require 'uri'
require 'net/http'

url = URI("https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch")

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

request = Net::HTTP::Post.new(url)
request["X-Tenant-Id"] = 'X-Tenant-Id'
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.post("https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch")
  .header("X-Tenant-Id", "X-Tenant-Id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'X-Tenant-Id' => 'X-Tenant-Id',
  ],
]);

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

```csharp Boleto Charge_dispatchBoletoChargeBatch_example
using RestSharp;

var client = new RestClient("https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Tenant-Id", "X-Tenant-Id");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Boleto Charge_dispatchBoletoChargeBatch_example
import Foundation

let headers = [
  "X-Tenant-Id": "X-Tenant-Id",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch")! 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()
```

### Boleto Charge_dispatchBoletoChargeBatch_example

**Response**

```json
{
  "batchId": "bcb_01J8Y7C8D9E0F1G2H3J4",
  "name": "Cobranças de setembro",
  "status": "QUEUED",
  "totalItems": 100,
  "quotaReserved": 100,
  "statistics": {
    "generation": {
      "total": 100,
      "pending": 100,
      "processing": 0,
      "issued": 0,
      "failed": 0,
      "progressPercentage": 0
    },
    "payment": {
      "issued": 0,
      "paid": 0,
      "unpaid": 0,
      "overdue": 0,
      "paidAmount": 0,
      "conversionRate": 0
    }
  },
  "createdAt": "2026-09-24T14:08:12Z",
  "updatedAt": "2026-09-24T14:10:00Z",
  "items": [],
  "page": 1,
  "pageSize": 50,
  "totalPages": 2,
  "hasNext": true,
  "dispatchedAt": "2026-09-24T14:10:00Z"
}
```

**SDK Code**

```python Boleto Charge_dispatchBoletoChargeBatch_example
import requests

url = "https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch"

headers = {
    "X-Tenant-Id": "X-Tenant-Id",
    "Authorization": "Bearer <token>"
}

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

print(response.json())
```

```javascript Boleto Charge_dispatchBoletoChargeBatch_example
const url = 'https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch';
const options = {
  method: 'POST',
  headers: {'X-Tenant-Id': 'X-Tenant-Id', Authorization: 'Bearer <token>'}
};

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

```go Boleto Charge_dispatchBoletoChargeBatch_example
package main

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

func main() {

	url := "https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch"

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

	req.Header.Add("X-Tenant-Id", "X-Tenant-Id")
	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 Boleto Charge_dispatchBoletoChargeBatch_example
require 'uri'
require 'net/http'

url = URI("https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch")

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

request = Net::HTTP::Post.new(url)
request["X-Tenant-Id"] = 'X-Tenant-Id'
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.post("https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch")
  .header("X-Tenant-Id", "X-Tenant-Id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'X-Tenant-Id' => 'X-Tenant-Id',
  ],
]);

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

```csharp Boleto Charge_dispatchBoletoChargeBatch_example
using RestSharp;

var client = new RestClient("https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Tenant-Id", "X-Tenant-Id");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Boleto Charge_dispatchBoletoChargeBatch_example
import Foundation

let headers = [
  "X-Tenant-Id": "X-Tenant-Id",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://tenant.api.corpx.com/v1/accounts/accountId/boleto/charge/batches/batchId/dispatch")! 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()
```