Build a Cross-Border Trade Invoice Treasury Reconciliation Queue — implementation
Linked challenge: Build a Cross-Border Trade Invoice Treasury Reconciliation Queue
Prompt source
implementation73 lines11 sectionsNo variables1 code block
## Build
Cross-reference enterprise trade invoice payments against cross-border SWIFT MT103 remittances and OpenAttestation certificates of origin. Flag currency conversion variances and withholding tax discrepancies for treasury settlement.
## User
Fintech corporate treasury operations officer
## Workflow
1. Ingest structured trade invoice line items and corresponding multi-currency bank remittance logs.
2. Audit OpenAttestation wrapped origin certificates to verify preferential trade duty exemptions.
3. Compute spot exchange rate variances and Singapore Goods and Services Tax input deductions.
4. Format unresolved ledger discrepancies into prioritized treasury investigation tickets for human review.
## Interface
Financial ledger reconciliation table highlighting payment reference numbers, currency differentials, and tax variance badges.
## Data
Normalized tabular fixtures of trade invoices, simulated bank statement wire records, and OpenAttestation trade certificates.
Starter examples below are synthetic. They are not downloaded records.
## Source
[OpenAttestation](https://raw.githubusercontent.com/Open-Attestation/open-attestation/master/README.md)
Applies open-attestation getData and validateSchema functions to verify underlying preferential origin certificates during tax audits.
## Tools
langgraph, pydantic, open-attestation.
LangGraph manages stateful cyclic reconciliation graphs that route settlement exceptions across multi-stage accounting rules.
API-hosted model supporting structured arithmetic verification and treasury ledger explanation drafting.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Reconciles payment invoice amounts against bank credit records within specified tolerance margins.
- Verifies digital signatures on accompanying OpenAttestation trade origin documents.
- Identifies tax calculation mismatches exceeding 0.5% variance thresholds.
- Outputs structured reconciliation journals without initiating live banking transfer instructions.
## Starter Examples
```json
[
{
"input": {
"invoice_id": "INV-771",
"invoice_amount_usd": 50000,
"agreed_fx_rate": 1.34,
"received_amount_sgd": 67000,
"gst_treatment": "ZERO_RATED_EXPORT",
"oa_origin_valid": true
},
"expected_output": {
"reconciliation_status": "MATCHED",
"variance_sgd": 0,
"tax_conformance": true,
"treasury_disposition": "AUTO_RECONCILED",
"settlement_ledger_id": "SETTLE-9901"
}
},
{
"input": {
"invoice_id": "INV-772",
"invoice_amount_usd": 20000,
"agreed_fx_rate": 1.35,
"received_amount_sgd": 25500,
"gst_treatment": "STANDARD_RATED_9_PCT",
"oa_origin_valid": false
},
"expected_output": {
"reconciliation_status": "DISCREPANCY_FLAGGED",
"variance_sgd": -1500,
"tax_conformance": false,
"treasury_disposition": "ANALYST_INVESTIGATION_REQUIRED",
"reasons": [
"FX conversion variance exceeds threshold",
"Invalid certificate of origin attestation"
]
}
}
]
```
## Safety
Treasury reconciliation records are internal accounting logs only. No direct API writes to banking payment rails occur.
Use mock external writes. Require human review before any real deployment.