Skip to content

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.

POST/api/v1/exports

Requests 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-Key required
  • Modes: Test and live
  • Authentication: API key with the ledger:write scope
  • Since: M8

Request

Body

A JSON object (Content-Type: application/json):

FieldTypeRequiredDescription
fromstringYesThe first day, in the legal entity's time zone (YYYY-MM-DD).
tostringYesThe last day, included; at most 366 days after from, and not after today.

Response

201 Created with a JSON object:

FieldTypeDescription
idexp_… ID
object"data_export"
livemodeboolean
entityIdent_… ID
kindone of accounting, organization
statusone of queued, running, ready, expired, failedqueued, then running, then ready (files downloadable for 30 days, then expired) or failed.
fromstringThe first day covered, in the entity's time zone.
tostringThe last day covered (included).
timeZonestring
requestedByobject
requestedBy.typestring
requestedBy.idstring
glMappingVersioninteger or nullThe general-ledger mapping used (0: none was set).
filesarray of object
files[].partone of journal, invoices, credit_notes
files[].fileIdfile_… ID
files[].filenamestring
files[].contentTypestring
files[].sizeinteger
files[].sha256string
files[].rowsintegerData rows (without the header).
summaryobject or null
failureobject or null
readyAtdate-time or null
expiresAtdate-time or null
createdAtdate-time
updatedAtdate-time
versioninteger

Examples

The third quarter

HTTP
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):

JSON
{
  "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

CodeHTTP statusWhenWhat to do
validation_failed400from or to isn't a calendar date.Fix the fields listed in details.issues and send the request again.
export_period_invalid400from 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_reused409The idempotency key was used before for another request.Use a new Idempotency-Key for a different request, or resend the original request unchanged.
scope_required400The 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_denied403You 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_allowed403You 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.