Request an accounting export
The exports.create operation: POST /api/v1/exports in the REST API and the exports_create tool in the MCP server.
/api/v1/exportsRequests the legal entity's accounting export for a period: calendar days from to to (included) in the
entity's time zone, every brand of the entity, in the mode of the request. It is built in the background
(usually within a minute): poll exports.get until status is ready. Three CSV files (RFC 4180, UTF-8):
- journal: one row per ledger entry of every posted transaction effective in the period, with the brand,
the Ownrecord account, the entity's general-ledger account from its mapping (
exports.gl_mapping.set), debit or credit in the entry's currency (exact decimals) and what the transaction links to (payment, invoice and credit note numbers, refund, dispute). Each transaction balances per currency; all periods together sum to the trial balance; - invoice register: every invoice issued in the period (numbers, dates, customer, totals, status);
- credit-note register: every credit note issued in the period, with its original invoice.
Download the files from the console (entity → Exports) for 30 days.
At a glance
- REST:
POST /api/v1/exports - MCP tool:
exports_create - Operation ID:
exports.create - Scope: Legal entity
- Permission:
ledger:write - Risk tier:
write - Dry run: Supported (send
Ownrecord-Dry-Run: true) - Idempotency:
Idempotency-Keyrequired - Modes: Test and live
- Authentication: API key with the
ledger:writescope - Since: M8
Request
Body
A JSON object (Content-Type: application/json):
| Field | Type | Required | Description |
|---|---|---|---|
from | string | Yes | The first day, in the legal entity's time zone (YYYY-MM-DD). |
to | string | Yes | The last day, included; at most 366 days after from, and not after today. |
Response
201 Created with a JSON object:
| Field | Type | Description |
|---|---|---|
id | exp_… ID | |
object | "data_export" | |
livemode | boolean | |
entityId | ent_… ID | |
kind | one of accounting, organization | |
status | one of queued, running, ready, expired, failed | queued, then running, then ready (files downloadable for 30 days, then expired) or failed. |
from | string | The first day covered, in the entity's time zone. |
to | string | The last day covered (included). |
timeZone | string | |
requestedBy | object | |
requestedBy.type | string | |
requestedBy.id | string | |
glMappingVersion | integer or null | The general-ledger mapping used (0: none was set). |
files | array of object | |
files[].part | one of journal, invoices, credit_notes | |
files[].fileId | file_… ID | |
files[].filename | string | |
files[].contentType | string | |
files[].size | integer | |
files[].sha256 | string | |
files[].rows | integer | Data rows (without the header). |
summary | object or null | |
failure | object or null | |
readyAt | date-time or null | |
expiresAt | date-time or null | |
createdAt | date-time | |
updatedAt | date-time | |
version | integer |
Examples
The third quarter
POST /api/v1/exports
Authorization: Bearer or_test_…
Idempotency-Key: 3f1c9a52-7d0e-4b8f-9a61-0c2d5e8b7f14
Content-Type: application/json
{
"from": "2026-07-01",
"to": "2026-09-30"
}
Response (201):
{
"id": "exp_01m4tx5nj8emwbyf7y9vcf4aaa",
"object": "data_export",
"livemode": false,
"entityId": "ent_01m4tx5nj8emwbyf7y9vcf47zm",
"kind": "accounting",
"status": "queued",
"from": "2026-07-01",
"to": "2026-09-30",
"timeZone": "Europe/Zagreb",
"requestedBy": {
"type": "user",
"id": "usr_01m4tx5nj8emwbyf7y9vcf47zk"
},
"glMappingVersion": null,
"files": [],
"summary": null,
"failure": null,
"readyAt": null,
"expiresAt": null,
"createdAt": "2026-10-02T08:00:00.000Z",
"updatedAt": "2026-10-02T08:00:00.000Z",
"version": 1
}
Errors
| Code | HTTP status | When | What to do |
|---|---|---|---|
validation_failed | 400 | from or to isn't a calendar date. | Fix the fields listed in details.issues and send the request again. |
export_period_invalid | 400 | from is after to, the period is longer than 366 days, or it ends after today in the entity's time zone. | Give from and to as calendar dates (YYYY-MM-DD) in the entity's time zone, from on or before to, at most 366 days in all, and not ending in the future. |
idempotency_key_reused | 409 | The idempotency key was used before for another request. | Use a new Idempotency-Key for a different request, or resend the original request unchanged. |
scope_required | 400 | The request names no legal entity (an org key without Ownrecord-Entity, or a brand key: exports belong to the entity). | Call the operation with credentials or a target at its level: an organization, a legal entity, a brand or the platform (details.required_scope). |
permission_denied | 403 | You can't export this entity's books or change its mapping (ledger:write: finance, owners and admins). | Ask an organization owner or admin for a role or scope that allows this action. |
livemode_not_allowed | 403 | You have no live-mode access, so you can't use live exports. | Use test mode, or credentials for the target's mode. Developers need live access granted by an organization owner or admin. |
It can also return these common errors: api_version_unsupported, invalid_json, unsupported_media_type, authentication_required, api_key_invalid, resource_not_found, idempotency_key_required, idempotency_in_progress, approval_required, approval_rejected, approval_expired, stale_approval, approval_policy_denied, rate_limited, internal_error.