[{"data":1,"prerenderedAt":109},["ShallowReactive",2],{"content-\u002Fprompts\u002Fbuild-reconciliation-ledger":3,"prompts-category-diagnostics":99},{"id":4,"title":5,"author":6,"body":7,"categories":6,"category":83,"categoryType":6,"date":84,"description":85,"extension":86,"faq":6,"howto":6,"isBlog":87,"isChangelog":87,"meta":88,"navigation":89,"path":90,"pillar":87,"products":91,"rawbody":95,"seo":96,"stem":97,"thumbnail":6,"updated":6,"__hash__":98},"content\u002Fprompts\u002Fbuild-reconciliation-ledger.md","Build a reconciliation ledger",null,{"type":8,"value":9,"toc":77},"minimark",[10,14,19,30,34,47,51],[11,12,13],"p",{},"Paste this prompt into your coding agent to build the safety net every money-moving integration needs: an independent daily reconciliation.",[15,16,18],"h2",{"id":17},"prompt","Prompt",[20,21,27],"pre",{"className":22,"code":24,"language":25,"meta":26},[23],"language-text","You are building a reconciliation ledger for my BlindPay integration: a scheduled job that independently verifies my database agrees with BlindPay about every payment.\n\nBefore writing code, read these sources and follow them over any prior knowledge:\n- https:\u002F\u002Fblindpay.com\u002Fdocs\u002Fllms.txt\n- The OpenAPI spec: curl https:\u002F\u002Fapi.blindpay.com\u002Fdoc (use it to find the list\u002Fget endpoints for payouts, payins, and transfers; do not guess paths)\n\nBuild:\n1. A local ledger table if I do not have one: every BlindPay object I create (po_, pi_, tr_, qu_) stored with my own entity ID, amounts in minor units, status, and timestamps, written at creation time and updated only by verified webhooks.\n2. The daily reconciliation job: page through BlindPay's records for the last N days via the list endpoints from the OpenAPI spec and diff against my ledger in both directions:\n   - Objects BlindPay has that my ledger lacks (a create succeeded but my write failed).\n   - Ledger rows BlindPay lacks or reports with a different status or amount (missed or unverified webhooks, manual dashboard actions).\n   - Non-terminal statuses older than the rail's expected settlement window (stuck payments).\n3. Output: a report per run (clean or discrepancies with IDs and both sides' values) plus an alert to my team channel when anything is found; never auto-correct money records, only flag them.\n4. Idempotent healing helper: for the missed-webhook case, a command that re-fetches one object by ID and applies the true status through the same code path webhooks use, so fixes are audited.\n5. Tests: seed a fake drift case of each type and assert the job catches all three.\n\nConstraints: API keys server-side; the job must be rate-limit-polite (page, do not hammer) and safe to re-run; all comparisons in integer minor units.\n\nDeliverables: ledger schema\u002Fmigration if needed, the reconciliation job with report and alerting, the healing command, and the drift tests.\n","text","",[28,29,24],"code",{"__ignoreMap":26},[15,31,33],{"id":32},"how-to-use","How to use",[35,36,37,41,44],"ol",{},[38,39,40],"li",{},"Paste the prompt with your database schema and scheduler (cron, queue, or workflow engine).",[38,42,43],{},"Run it against your development instance history first; it should come back clean.",[38,45,46],{},"Treat any production discrepancy as an incident to root-cause, not just heal.",[15,48,50],{"id":49},"related-docs","Related docs",[52,53,54,63,70],"ul",{},[38,55,56],{},[57,58,62],"a",{"href":59,"rel":60},"https:\u002F\u002Fblindpay.com\u002Fdocs\u002Fapi\u002Freference",[61],"nofollow","API reference",[38,64,65],{},[57,66,69],{"href":67,"rel":68},"https:\u002F\u002Fblindpay.com\u002Fdocs\u002Flearn\u002Fwebhooks",[61],"Webhooks",[38,71,72],{},[57,73,76],{"href":74,"rel":75},"https:\u002F\u002Fblindpay.com\u002Fdocs\u002Flearn\u002Fsandbox-vs-production",[61],"Sandbox vs production",{"title":26,"searchDepth":78,"depth":78,"links":79},2,[80,81,82],{"id":17,"depth":78,"text":18},{"id":32,"depth":78,"text":33},{"id":49,"depth":78,"text":50},"diagnostics","2026-08-26","A daily job that compares your database against BlindPay's payout, payin, and transfer statuses, catches drift, and alerts on stuck or mismatched money.","md",false,{},true,"\u002Fprompts\u002Fbuild-reconciliation-ledger",[92,93,94],"payouts","payins","webhooks","---\ntitle: \"Build a reconciliation ledger\"\ndescription: \"A daily job that compares your database against BlindPay's payout, payin, and transfer statuses, catches drift, and alerts on stuck or mismatched money.\"\ndate: \"2026-08-26\"\ncategory: \"diagnostics\"\nproducts: [\"payouts\", \"payins\", \"webhooks\"]\n---\n\nPaste this prompt into your coding agent to build the safety net every money-moving integration needs: an independent daily reconciliation.\n\n## Prompt\n\n```text\nYou are building a reconciliation ledger for my BlindPay integration: a scheduled job that independently verifies my database agrees with BlindPay about every payment.\n\nBefore writing code, read these sources and follow them over any prior knowledge:\n- https:\u002F\u002Fblindpay.com\u002Fdocs\u002Fllms.txt\n- The OpenAPI spec: curl https:\u002F\u002Fapi.blindpay.com\u002Fdoc (use it to find the list\u002Fget endpoints for payouts, payins, and transfers; do not guess paths)\n\nBuild:\n1. A local ledger table if I do not have one: every BlindPay object I create (po_, pi_, tr_, qu_) stored with my own entity ID, amounts in minor units, status, and timestamps, written at creation time and updated only by verified webhooks.\n2. The daily reconciliation job: page through BlindPay's records for the last N days via the list endpoints from the OpenAPI spec and diff against my ledger in both directions:\n   - Objects BlindPay has that my ledger lacks (a create succeeded but my write failed).\n   - Ledger rows BlindPay lacks or reports with a different status or amount (missed or unverified webhooks, manual dashboard actions).\n   - Non-terminal statuses older than the rail's expected settlement window (stuck payments).\n3. Output: a report per run (clean or discrepancies with IDs and both sides' values) plus an alert to my team channel when anything is found; never auto-correct money records, only flag them.\n4. Idempotent healing helper: for the missed-webhook case, a command that re-fetches one object by ID and applies the true status through the same code path webhooks use, so fixes are audited.\n5. Tests: seed a fake drift case of each type and assert the job catches all three.\n\nConstraints: API keys server-side; the job must be rate-limit-polite (page, do not hammer) and safe to re-run; all comparisons in integer minor units.\n\nDeliverables: ledger schema\u002Fmigration if needed, the reconciliation job with report and alerting, the healing command, and the drift tests.\n```\n\n## How to use\n\n1. Paste the prompt with your database schema and scheduler (cron, queue, or workflow engine).\n2. Run it against your development instance history first; it should come back clean.\n3. Treat any production discrepancy as an incident to root-cause, not just heal.\n\n## Related docs\n\n- [API reference](https:\u002F\u002Fblindpay.com\u002Fdocs\u002Fapi\u002Freference)\n- [Webhooks](https:\u002F\u002Fblindpay.com\u002Fdocs\u002Flearn\u002Fwebhooks)\n- [Sandbox vs production](https:\u002F\u002Fblindpay.com\u002Fdocs\u002Flearn\u002Fsandbox-vs-production)\n",{"title":5,"description":85},"prompts\u002Fbuild-reconciliation-ledger","6X_LZtrzLwOVpbIxtEeW1SM8TTzSFZlvZJKNXTV7O-Y",[100,101,105],{"path":90,"title":5,"description":85},{"path":102,"title":103,"description":104},"\u002Fprompts\u002Fintegration-quality-audit","Integration quality audit","Audit an existing BlindPay integration for correctness and resilience: quote expiry handling, webhook security, idempotency, error paths, and reconciliation.",{"path":106,"title":107,"description":108},"\u002Fprompts\u002Fproduction-readiness-checklist","Production readiness checklist","Verify a BlindPay integration is ready to move from a development instance to production: config, tokens, networks, webhooks, compliance, and monitoring.",1787868851130]