DocsGet started

Onboard with AI

Your coding assistant can write the whole integration. Give it the documentation, paste the prompt below, and review what it writes.

1. Create a key#

Open the developer console. Put the live key in STATEMENTBEAR_KEY and the test key in STATEMENTBEAR_TEST_KEY, in your environment or secret store. Do not paste either key into the chat.

2. Give it the documentation#

Connect the MCP server so the assistant can search these pages while it works. Without MCP, the prompt points it at /docs/llms-full.txt, which is the whole documentation in one file.

3. Paste the prompt#

Works in Claude Code, Cursor, Codex, Copilot or any assistant that can read a URL and edit your project.

Prompt
Integrate the StatementBear bank statement parsing API into this project.

Read the documentation first: https://statementbear.com/docs/llms-full.txt
If the StatementBear MCP server (https://statementbear.com/api/mcp) is connected, use it to look things up instead.

Requirements:
- POST each statement PDF to https://statementbear.com/api/v1/documents as the raw body with Content-Type: application/pdf.
- Read the API key from the STATEMENTBEAR_KEY environment variable. Never hardcode or commit a key.
- Send an Idempotency-Key header with every request: one unique value per document, reused on every retry of that document.
- Set a client timeout of at least 180 seconds.
- Retry 429 and 5xx responses with exponential backoff. Do not retry any other error.
- Only count credits as income on accounts with type "bank".
- When verification.reconciled is false, send the document to manual review instead of using its totals.
- Write tests that call the API with a test key from STATEMENTBEAR_TEST_KEY, using the X-Test-Scenario header to cover credit_card, multi_account, unreconciled and the error scenarios. Test calls are free.

Follow this project's existing conventions for HTTP clients, configuration and tests. When you are done, list what you changed and what I need to configure.

4. Review the result#

  • No key in the code. Search the diff for sb_live_ and sb_test_.
  • Income only from bank accounts. Credits on a credit_card account are repayments and refunds. See Amounts and directions.
  • A review path for unreconciled documents. Run the tests with the unreconciled scenario and check where the document ends up. See Verification.
  • One idempotency key per document. A new key on every retry means a timeout can be charged twice. See Idempotency and retries.

Then work through Going live before real customers' statements reach it.

Something wrong or missing on this page? [email protected]