> This page is for Internet banking (beta).

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

# Create statement export (async)

POST https://client.api.corpx.com/v1/accounts/{accountId}/exports
Content-Type: application/json

Queues an asynchronous export of the account statement for the given date range
(`format`: `csv`, `pdf`, `xlsx`, or `ofx`). Poll `GET /v1/accounts/{accountId}/exports`
until status is `COMPLETED`, then download via
`GET /v1/accounts/{accountId}/exports/{exportId}/download`.
The file contains **live** statement rows from the banking partner (ISPB `50871921`).
Columns match the statement, plus `ispb`. The last column is `pixKey` —
the same field as on each statement item (incoming key on a credit; destination
key on a debit). Empty outside PIX and on older rows. Saldo após transação
(`balance`) is **not** included. CSV and XLSX use the requested date range
in full (no row cap). PDF clamps dates to 21/05/2026 … today (an end
date in the future becomes today) and does not truncate at 10,000 rows.
XLSX continues on extra sheets
(`Statement_2`, …) if a single Excel sheet fills.
The PDF is A4 landscape, in Portuguese (type, direction and status
labels, never raw enums), and carries the tenant's brand: the PNG logo
from the tenant branding or, without one, the tenant's name. CorpX
appears only in the footer. Long cells wrap instead of being cut, so the
end-to-end ID and the counterparty name come out whole; the
counterparty CPF/CNPJ is shown in full. There is no balance column.
`ofx` (OFX 1.0.2, for accounting and ERP reconciliation) lists the same
live rows in ascending order: credit positive, debit negative, `FITID`
from the transaction ID, `BANKID` 681, and `LEDGERBAL` with the account
balance at the moment the file is generated. `ofx` is only accepted
with `type=statement`.

Reference: https://en.docs.api.corpx.com/ib/referencia/accounts/create-account-export

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

### 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).
- `X-Request-Timestamp` (string, required) — Unix seconds. Required on the signed host; tolerance is 300s either way (`403 request_timestamp_skew`).
- `X-Content-SHA256` (string, required) — Lowercase hex SHA-256 of the body. An empty body hashes the empty string, so the header is always present. Mismatch returns `400 body_hash_mismatch`.
- `X-Request-Signature` (string, required) — Detached JWS (`<protected>..<signature>`, ES256 or PS256) over `METHOD\nPATH?QUERY\nTIMESTAMP\nIDEMPOTENCY_KEY_OR_EMPTY\nX_CONTENT_SHA256`.

### Body (application/json)

This endpoint expects an ExportCreateRequest.

- `type` (enum, required) — Export type. Only `statement` is supported.
  - Allowed values: `statement`
- `startDate` (date, required) — Inclusive start date (YYYY-MM-DD).
- `endDate` (date, required) — Inclusive end date (YYYY-MM-DD).
- `format` (enum, optional, default: csv) — File format. `csv` and `xlsx` share the same columns. `pdf` is a formatted statement (dates clamped to 21/05/2026 … today). `ofx` is OFX 1.0.2 for accounting reconciliation.
  - Allowed values: `csv`, `pdf`, `xlsx`, `ofx`
- `hideEndToEnd` (boolean, optional, default: false) — When true, the statement file omits the end-to-end id. In `csv` and `xlsx` the "ID fim a fim" column stays in place but is empty, so column positions do not move. In `pdf` the id column is titled "Identificador" and shows only the identifier. In `ofx` the id is removed from `REFNUM`, `MEMO` and `FITID`. Applies to statement exports only; ignored for other types. Defaults to false.

## Response

### 202

Export job accepted.

- `exportId` (string, required)
- `accountId` (string, required)
- `tenantId` (string, required)
- `type` (string, required)
- `status` (enum, required)
  - Allowed values: `PENDING`, `PROCESSING`, `COMPLETED`, `FAILED`
- `createdAt` (datetime, required)
- `format` (enum, optional)
  - Allowed values: `csv`, `pdf`, `xlsx`, `ofx`
- `params` (map from string to any, optional) — The request echoed back, including `hideEndToEnd` when it was set.
- `rowCount` (integer, optional)
- `errorReason` (string, optional)
- `completedAt` (datetime, optional)

## Errors

### 400 Bad Request Error

Invalid request sent by client.

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

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

### 500 Internal Server Error

Unexpected server error.

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

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

## Examples

**Request**

```json
{
  "type": "statement",
  "startDate": "2026-05-01",
  "endDate": "2026-05-07",
  "format": "csv"
}
```

**Response**

```json
{
  "exportId": "8c1f6a2e-4d3b-4b9a-9f0e-1a2b3c4d5e6f",
  "accountId": "2e6b725b-84a0-400d-8740-22a5ba0f23e6",
  "tenantId": "tn_7f3a9c",
  "type": "PIX",
  "status": "PENDING",
  "createdAt": "2026-02-20T08:33:39Z",
  "format": "csv",
  "params": {},
  "rowCount": 3,
  "completedAt": "2026-02-20T08:33:39Z"
}
```

**SDK Code**

```python Accounts_createAccountExport_example
import requests

url = "https://client.api.corpx.com/v1/accounts/accountId/exports"

payload = {
    "type": "statement",
    "startDate": "2026-05-01",
    "endDate": "2026-05-07",
    "format": "csv"
}
headers = {
    "X-Content-SHA256": "X-Content-SHA256",
    "X-Request-Signature": "X-Request-Signature",
    "X-Request-Timestamp": "X-Request-Timestamp",
    "X-Tenant-Id": "X-Tenant-Id",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Accounts_createAccountExport_example
const url = 'https://client.api.corpx.com/v1/accounts/accountId/exports';
const options = {
  method: 'POST',
  headers: {
    'X-Content-SHA256': 'X-Content-SHA256',
    'X-Request-Signature': 'X-Request-Signature',
    'X-Request-Timestamp': 'X-Request-Timestamp',
    'X-Tenant-Id': 'X-Tenant-Id',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"type":"statement","startDate":"2026-05-01","endDate":"2026-05-07","format":"csv"}'
};

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

```go Accounts_createAccountExport_example
package main

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

func main() {

	url := "https://client.api.corpx.com/v1/accounts/accountId/exports"

	payload := strings.NewReader("{\n  \"type\": \"statement\",\n  \"startDate\": \"2026-05-01\",\n  \"endDate\": \"2026-05-07\",\n  \"format\": \"csv\"\n}")

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

	req.Header.Add("X-Content-SHA256", "X-Content-SHA256")
	req.Header.Add("X-Request-Signature", "X-Request-Signature")
	req.Header.Add("X-Request-Timestamp", "X-Request-Timestamp")
	req.Header.Add("X-Tenant-Id", "X-Tenant-Id")
	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 Accounts_createAccountExport_example
require 'uri'
require 'net/http'

url = URI("https://client.api.corpx.com/v1/accounts/accountId/exports")

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

request = Net::HTTP::Post.new(url)
request["X-Content-SHA256"] = 'X-Content-SHA256'
request["X-Request-Signature"] = 'X-Request-Signature'
request["X-Request-Timestamp"] = 'X-Request-Timestamp'
request["X-Tenant-Id"] = 'X-Tenant-Id'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"statement\",\n  \"startDate\": \"2026-05-01\",\n  \"endDate\": \"2026-05-07\",\n  \"format\": \"csv\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://client.api.corpx.com/v1/accounts/accountId/exports")
  .header("X-Content-SHA256", "X-Content-SHA256")
  .header("X-Request-Signature", "X-Request-Signature")
  .header("X-Request-Timestamp", "X-Request-Timestamp")
  .header("X-Tenant-Id", "X-Tenant-Id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"statement\",\n  \"startDate\": \"2026-05-01\",\n  \"endDate\": \"2026-05-07\",\n  \"format\": \"csv\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://client.api.corpx.com/v1/accounts/accountId/exports', [
  'body' => '{
  "type": "statement",
  "startDate": "2026-05-01",
  "endDate": "2026-05-07",
  "format": "csv"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'X-Content-SHA256' => 'X-Content-SHA256',
    'X-Request-Signature' => 'X-Request-Signature',
    'X-Request-Timestamp' => 'X-Request-Timestamp',
    'X-Tenant-Id' => 'X-Tenant-Id',
  ],
]);

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

```csharp Accounts_createAccountExport_example
using RestSharp;

var client = new RestClient("https://client.api.corpx.com/v1/accounts/accountId/exports");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Content-SHA256", "X-Content-SHA256");
request.AddHeader("X-Request-Signature", "X-Request-Signature");
request.AddHeader("X-Request-Timestamp", "X-Request-Timestamp");
request.AddHeader("X-Tenant-Id", "X-Tenant-Id");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"statement\",\n  \"startDate\": \"2026-05-01\",\n  \"endDate\": \"2026-05-07\",\n  \"format\": \"csv\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Accounts_createAccountExport_example
import Foundation

let headers = [
  "X-Content-SHA256": "X-Content-SHA256",
  "X-Request-Signature": "X-Request-Signature",
  "X-Request-Timestamp": "X-Request-Timestamp",
  "X-Tenant-Id": "X-Tenant-Id",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": "statement",
  "startDate": "2026-05-01",
  "endDate": "2026-05-07",
  "format": "csv"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://client.api.corpx.com/v1/accounts/accountId/exports")! 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()
```