> For the complete documentation index, see [llms.txt](https://docs.kick.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kick.co/api/api-reference/ledgers.md).

# Ledgers

Open an entity's accrual ledger so you can post to it and report on it.

A ledger is the set of double-entry postings an entity keeps on one accounting basis. Every entity already keeps a cash ledger. The accrual ledger is opt-in, and opening it is the whole of this surface: once it exists you address it as `ledgerBasis=accruals` on [Journal Entries](/api/api-reference/journal-entries.md) and [Reports](/api/api-reference/reports.md).

The call is idempotent. An entity keeps one ledger per basis, so repeating it returns the existing ledger with `200` rather than opening a second one, and `basis: "cash"` resolves to the cash ledger the entity already has. Entities Kick does not keep books for, meaning personal entities and businesses with no legal type, are rejected with `400`.

## Open a ledger

> Opens the entity's ledger for the given accounting basis and returns it. Kick backfills the ledger from the entity's existing bookkeeping, so postings made before the accrual ledger existed are reflected in it. The call is idempotent: an entity keeps one ledger per basis, and repeating it returns the existing ledger with \`200\` instead of creating another. Entities Kick does not keep books for (personal entities, and businesses with no legal type) are rejected with \`400\`.

```json
{"openapi":"3.0.2","info":{"title":"Kick Platform API","version":"v1"},"servers":[{"description":"Production","url":"https://use.kick.co/api"}],"security":[{"organizationAccessToken":[]}],"components":{"securitySchemes":{"organizationAccessToken":{"description":"Organization access token issued by Kick, sent as `Authorization: Bearer kick_org_...`.","scheme":"bearer","type":"http"}}},"paths":{"/platform/v1/entities/{entityId}/ledgers":{"post":{"description":"Opens the entity's ledger for the given accounting basis and returns it. Kick backfills the ledger from the entity's existing bookkeeping, so postings made before the accrual ledger existed are reflected in it. The call is idempotent: an entity keeps one ledger per basis, and repeating it returns the existing ledger with `200` instead of creating another. Entities Kick does not keep books for (personal entities, and businesses with no legal type) are rejected with `400`.","operationId":"ledgers.create","parameters":[{"in":"path","name":"entityId","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"A unique key that makes the request idempotent. Retrying with the same key within 24 hours replays the original response (marked with `Idempotent-Replayed: true`) instead of executing again.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"basis":{"description":"Accounting basis of the ledger to open. `accruals` opens the entity's accrual ledger; `cash` resolves to the cash ledger every entity already keeps.","enum":["cash","accruals"],"type":"string"}},"required":["basis"],"type":"object"}}},"description":"Body"},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"ledger":{"properties":{"basis":{"enum":["cash","accruals"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"required":["id","basis","name","createdAt"],"type":"object"}},"required":["ledger"],"type":"object"}}},"description":"200"},"201":{"content":{"application/json":{"schema":{"properties":{"ledger":{"properties":{"basis":{"enum":["cash","accruals"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"}},"required":["id","basis","name","createdAt"],"type":"object"}},"required":["ledger"],"type":"object"}}},"description":"201"},"400":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"400"},"401":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"401"},"403":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"403"},"404":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"404"},"429":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"429"}},"summary":"Open a ledger","tags":["ledgers"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kick.co/api/api-reference/ledgers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
