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

# Self Report

Self-reported invoice and cashflow data endpoints

## Submit self-reported cashflows

> Submit cashflow items for the authenticated organization. Each entry in \`items\` takes one of three shapes, selected by its \`type\` field:\
> \
> \- \`transaction\` — an individual transaction with a precise \`datetime\` and a required \`externalId\` for deduplication.\
> \- \`aggregate\` — a daily total for a \`date\` (zero allowed for no-activity days).\
> \- \`collateral\` — a cumulative collateral snapshot for a \`date\`.\
> \
> Items flow through the standard capture → normalize pipeline. Transactions and aggregates become ledger entries; collateral snapshots are stored in the dedicated collateral\_snapshots table.

```json
{"openapi":"3.0.3","info":{"title":"Credit Coop API","version":"3.0.0"},"tags":[{"name":"Self Report","description":"Self-reported invoice and cashflow data endpoints"}],"servers":[{"url":"https://api.creditcoop.xyz"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"API key in the format: cc_xxx_yyy (for customer API routes)"}},"schemas":{"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer"}}}}},"paths":{"/v3/self-report/cashflows":{"post":{"operationId":"submitSelfReportCashflows","summary":"Submit self-reported cashflows","tags":["Self Report"],"description":"Submit cashflow items for the authenticated organization. Each entry in `items` takes one of three shapes, selected by its `type` field:\n\n- `transaction` — an individual transaction with a precise `datetime` and a required `externalId` for deduplication.\n- `aggregate` — a daily total for a `date` (zero allowed for no-activity days).\n- `collateral` — a cumulative collateral snapshot for a `date`.\n\nItems flow through the standard capture → normalize pipeline. Transactions and aggregates become ledger entries; collateral snapshots are stored in the dedicated collateral_snapshots table.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"items":{"description":"A single cashflow item. Its shape is selected by the `type` field: transaction, aggregate, or collateral.","oneOf":[{"title":"Transaction","description":"Individual transaction (type=transaction). Requires a precise datetime and an externalId for deduplication.","type":"object","required":["type","amount","currency","datetime","direction","externalId"],"properties":{"type":{"type":"string","enum":["transaction"]},"amount":{"type":"number","exclusiveMinimum":0,"description":"Transaction amount (positive)"},"currency":{"type":"string","minLength":1,"maxLength":20,"description":"Currency code (stored as-is)"},"datetime":{"type":"string","format":"date-time","description":"ISO 8601 datetime (e.g. 2026-03-01T14:30:00Z)"},"direction":{"type":"string","enum":["inflow","outflow"],"description":"Cashflow direction"},"externalId":{"type":"string","minLength":1,"maxLength":255,"description":"Customer transaction ID (required for deduplication)"},"category":{"type":"string","maxLength":100}}},{"title":"Aggregate","description":"Daily aggregate total (type=aggregate). Zero allowed for no-activity days.","type":"object","required":["type","amount","currency","date","direction"],"properties":{"type":{"type":"string","enum":["aggregate"]},"amount":{"type":"number","minimum":0,"description":"Aggregate amount (zero allowed for no-activity days)"},"currency":{"type":"string","minLength":1,"maxLength":20,"description":"Currency code (stored as-is)"},"date":{"type":"string","format":"date","description":"ISO 8601 date (YYYY-MM-DD)"},"direction":{"type":"string","enum":["inflow","outflow"],"description":"Cashflow direction"},"category":{"type":"string","maxLength":100}}},{"title":"Collateral","description":"Cumulative collateral snapshot (type=collateral).","type":"object","required":["type","amount","currency","date"],"properties":{"type":{"type":"string","enum":["collateral"]},"amount":{"type":"number","minimum":0,"description":"Cumulative collateral amount (zero allowed)"},"currency":{"type":"string","minLength":1,"maxLength":20,"description":"Currency code (stored as-is)"},"date":{"type":"string","format":"date","description":"Snapshot date (YYYY-MM-DD)"},"category":{"type":"string","maxLength":100}}}]}}},"additionalProperties":false}}}},"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["message","captureId","jobId","itemCount"],"properties":{"message":{"type":"string"},"captureId":{"type":"string","format":"uuid"},"jobId":{"type":"string"},"itemCount":{"type":"integer"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.creditcoop.xyz/developer-api-docs/self-report.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
