API Finance Close Review
Use this skill for tasks that ask you to return a JSON decision or reconciliation result from a local batch/scope payload and a shared finance, ERP, or compliance API.
First Steps
- Read the user prompt, every local payload file under
input/payloads/ or payloads/, and the answer template if present.
- Treat the runner-provided API base URL as the system of record. Do not use local exports, snapshots, or stale payload records as current truth when they conflict with the API.
- Inspect
/endpoints when available. Prefer /api/... endpoints and fall back to unprefixed equivalents only if needed.
- Query only the scoped IDs from the prompt or payload unless the template asks for a broader rollup. Use exact-match query parameters by field name, with
limit and offset for pagination.
- Return one JSON object matching the template exactly. Preserve requested units, date, casing, status labels, and list sort order. Do not include narrative text outside JSON.
Use Decimal or equivalent fixed-point arithmetic for money. If the prompt asks for cents, output integer cents; if it asks for dollars, output two-decimal numbers.
Reimbursement And AP Batch Reviews
For each scoped claim, fetch:
- Current claim:
/api/claims or /api/claims/{claim_id}
- AP bills:
/api/ap/bills?claim_id=...
- Payments for candidate bill IDs:
/api/ap/payments?bill_id=...
- Close logs when stale exports or close refreshes are mentioned:
/api/close/logs
- Aging only as supporting context; live claim, bill, and payment records determine release posture.
Evaluate current records, not stale AP snapshots:
- A claim is release-ready only when the claim is approved or otherwise already paid, the claim has required receipt/support status for the task, and there is a live bill that matches the claim amount, currency, and vendor when vendor data is present.
- Ignore void bills. Treat draft bills as not released. Treat amount, currency, vendor, or claim-link mismatches as AP evidence exceptions, even if the stale export showed a row.
- A cleared payment on a matched bill means the claim is settled. Processing or scheduled payments are in flight and do not make the claim settled unless the template specifically treats in-flight payments as eligible.
- If a paid claim has multiple bills, prefer the matched bill with cleared payment evidence over an older mismatched or scheduled bill.
- If the claim itself is not approved or paid, or required receipts/support are missing or partial for an unpaid claim, classify it as needing owner cleanup rather than AP release.
- Open AP balance for release fields should be based on valid matched bills minus cleared payments. Do not reduce open balance for merely processing or scheduled payments unless the prompt defines that behavior.
When a template asks for stale snapshot corrections, map current API facts to the template's correction codes:
- Unapproved or receipt-blocked claim: block or mark not ready.
- Void bill: ignore or replace the stale row.
- Amount, vendor, currency, or claim mismatch: exclude or correct the AP evidence.
- Current matched paid bill: replace stale evidence with the paid bill.
- Current matched bill with processing/scheduled payment: mark as in flight, not settled.
Sort claim ID lists ascending. Set batch status from the classified results: clean only if every scoped item is settled or release-ready under the prompt; otherwise use the template's blocked, refresh, or not-ready status label.
Vendor Onboarding Release Reviews
For each scoped business ID, fetch:
- Compliance object:
/api/compliance/objects?business_id=...
- Ownership:
/api/compliance/ownership/{business_id}
- Registry:
/api/compliance/registry/{business_id}
- Screening:
/api/compliance/screening/{business_id}
- Bank:
/api/compliance/bank/{business_id}
- Vendor master by the compliance object's
vendor_id: /api/vendors?vendor_id=...
Use the review or as-of date from the prompt or payload for date-sensitive checks.
Reportable UBO count is the count of unique owner names with ownership_pct >= 25; duplicate owner names count once.
Build hard-stop flags from current facts and sort each flag list lexicographically:
confirmed_pep: screening or object pep_status is confirmed_pep.
shell_company_suspected: ownership or object marks shell-company suspicion.
bank_closed: bank status is closed.
bank_name_mismatch: bank status is name_mismatch.
expired_license: registry license expiry is before the review/as-of date.
screening_not_run: sanctions or PEP screening is not_run.
missing_required_documents: required fields or documents are missing.
vendor_on_hold: linked vendor master status is on_hold.
- Add an analogous sanctions-hit flag if the API returns a non-clear sanctions result and the template supports it.
Decision pattern for onboarding release:
approve only when there are no hard-stop flags.
awaiting_information when the only blockers are information gaps such as missing documents or screening not run.
escalate when any severe blocker is present: confirmed PEP, sanctions hit, shell-company suspicion, bank closure/name mismatch, expired license, vendor hold, or registry identity defect.
Follow-up or queue ID lists are the non-approved businesses. Overall release readiness is true only when every scoped business is approved.
Account-Change Payment Release Reviews
For account-change batches, use the same compliance, registry, bank, screening, ownership, and vendor records, but apply payment-release posture rather than onboarding labels.
Common derived lists:
- Bank mismatch IDs: bank status
name_mismatch. Keep bank-closed records in the broader review/hold set unless the template names a separate closed-bank list.
- Invalid tax IDs: registry tax ID fails the expected
TIN plus six digits pattern, or the registry tax ID conflicts with the linked vendor master tax ID.
- Expired license IDs: license expiry is before the review/as-of date.
- Risk score override flags: risk score meets or exceeds the local high-risk threshold in the prompt/payload; when no threshold is supplied, treat
>= 70 as requiring override review.
- Review queue IDs: every scoped business whose final decision is not release.
Decision precedence:
escalate for identity or compliance-judgment issues such as invalid tax/registry identity, PEP concern, sanctions hit, shell-company suspicion, or contradictory registry/vendor identity.
hold for operational remediation issues such as bank not verified or closed, expired license, missing documents, screening not run, vendor hold, or risk-score override when no escalation issue is present.
release only when all release-control checks pass.
Do not copy the source system's current review status as the decision; derive the release posture from current control evidence.
Prepaid Close Reconciliations
Read the local prepaid scope for selected invoice IDs, accounts, entity, and close period. Fetch:
- Invoices:
/api/prepaids/invoices or /prepaids/invoices
- GL balances:
/api/prepaids/gl-balances or /gl/balances
Filter to the scoped invoice IDs and requested accounts. Use the GL ending balance for the requested period and entity.
For straight-line invoices, use the invoice record's monthly_amortization; do not recalculate a daily amount. Count service months by calendar month inclusively:
- Target-month amortization is
monthly_amortization if the close month falls between the service start month and service end month, inclusive; otherwise it is zero.
- Cumulative amortization through the close month is
monthly_amortization * number_of_service_months_elapsed, capped to the invoice's service months and original amount when necessary.
- Ending balance is
original_amount - cumulative_amortization, rounded to two decimals and not below zero except for harmless rounding residuals.
For each account rollup:
- Sum selected invoice count, original amount, target-month amortization, cumulative amortization, and schedule ending balance.
variance_amount = schedule_ending_balance - gl_ending_balance.
- Set
variance_flag when the absolute variance exceeds the prompt/template tolerance; if no tolerance is given, use more than one cent.
- Set account status to the template's reconciliation-required label when there is a variance, missing/default term flag, or invoice exception; otherwise use the reconciled/clean label from the template.
Invoice flags:
default_missing_term_flag is true for data-quality flags such as missing contract dates, missing terms, or default terms.
exception_flag is true when data_quality_flags is non-empty, the recognition method is unsupported, required dates/amounts are missing, or the invoice violates prompt-specific scope rules.
Sort invoice IDs and business/claim IDs as requested by the prompt or template.
1---2name: api-finance-close-review3description: Solve API-backed finance close, reimbursement/AP release, vendor compliance release, account-change review, and prepaid reconciliation tasks using local payload scope plus a runner-provided JSON API.4metadata:5 source: https://skillmd.com/skills/prism-shadow/api-finance-close-review6---78# API Finance Close Review910Use this skill for tasks that ask you to return a JSON decision or reconciliation result from a local batch/scope payload and a shared finance, ERP, or compliance API.1112## First Steps13141. Read the user prompt, every local payload file under `input/payloads/` or `payloads/`, and the answer template if present.152. Treat the runner-provided API base URL as the system of record. Do not use local exports, snapshots, or stale payload records as current truth when they conflict with the API.163. Inspect `/endpoints` when available. Prefer `/api/...` endpoints and fall back to unprefixed equivalents only if needed.174. Query only the scoped IDs from the prompt or payload unless the template asks for a broader rollup. Use exact-match query parameters by field name, with `limit` and `offset` for pagination.185. Return one JSON object matching the template exactly. Preserve requested units, date, casing, status labels, and list sort order. Do not include narrative text outside JSON.1920Use `Decimal` or equivalent fixed-point arithmetic for money. If the prompt asks for cents, output integer cents; if it asks for dollars, output two-decimal numbers.2122## Reimbursement And AP Batch Reviews2324For each scoped claim, fetch:2526- Current claim: `/api/claims` or `/api/claims/{claim_id}`27- AP bills: `/api/ap/bills?claim_id=...`28- Payments for candidate bill IDs: `/api/ap/payments?bill_id=...`29- Close logs when stale exports or close refreshes are mentioned: `/api/close/logs`30- Aging only as supporting context; live claim, bill, and payment records determine release posture.3132Evaluate current records, not stale AP snapshots:3334- A claim is release-ready only when the claim is approved or otherwise already paid, the claim has required receipt/support status for the task, and there is a live bill that matches the claim amount, currency, and vendor when vendor data is present.35- Ignore void bills. Treat draft bills as not released. Treat amount, currency, vendor, or claim-link mismatches as AP evidence exceptions, even if the stale export showed a row.36- A cleared payment on a matched bill means the claim is settled. Processing or scheduled payments are in flight and do not make the claim settled unless the template specifically treats in-flight payments as eligible.37- If a paid claim has multiple bills, prefer the matched bill with cleared payment evidence over an older mismatched or scheduled bill.38- If the claim itself is not approved or paid, or required receipts/support are missing or partial for an unpaid claim, classify it as needing owner cleanup rather than AP release.39- Open AP balance for release fields should be based on valid matched bills minus cleared payments. Do not reduce open balance for merely processing or scheduled payments unless the prompt defines that behavior.4041When a template asks for stale snapshot corrections, map current API facts to the template's correction codes:4243- Unapproved or receipt-blocked claim: block or mark not ready.44- Void bill: ignore or replace the stale row.45- Amount, vendor, currency, or claim mismatch: exclude or correct the AP evidence.46- Current matched paid bill: replace stale evidence with the paid bill.47- Current matched bill with processing/scheduled payment: mark as in flight, not settled.4849Sort claim ID lists ascending. Set batch status from the classified results: clean only if every scoped item is settled or release-ready under the prompt; otherwise use the template's blocked, refresh, or not-ready status label.5051## Vendor Onboarding Release Reviews5253For each scoped business ID, fetch:5455- Compliance object: `/api/compliance/objects?business_id=...`56- Ownership: `/api/compliance/ownership/{business_id}`57- Registry: `/api/compliance/registry/{business_id}`58- Screening: `/api/compliance/screening/{business_id}`59- Bank: `/api/compliance/bank/{business_id}`60- Vendor master by the compliance object's `vendor_id`: `/api/vendors?vendor_id=...`6162Use the review or as-of date from the prompt or payload for date-sensitive checks.6364Reportable UBO count is the count of unique owner names with `ownership_pct >= 25`; duplicate owner names count once.6566Build hard-stop flags from current facts and sort each flag list lexicographically:6768- `confirmed_pep`: screening or object `pep_status` is `confirmed_pep`.69- `shell_company_suspected`: ownership or object marks shell-company suspicion.70- `bank_closed`: bank status is `closed`.71- `bank_name_mismatch`: bank status is `name_mismatch`.72- `expired_license`: registry license expiry is before the review/as-of date.73- `screening_not_run`: sanctions or PEP screening is `not_run`.74- `missing_required_documents`: required fields or documents are missing.75- `vendor_on_hold`: linked vendor master status is `on_hold`.76- Add an analogous sanctions-hit flag if the API returns a non-clear sanctions result and the template supports it.7778Decision pattern for onboarding release:7980- `approve` only when there are no hard-stop flags.81- `awaiting_information` when the only blockers are information gaps such as missing documents or screening not run.82- `escalate` when any severe blocker is present: confirmed PEP, sanctions hit, shell-company suspicion, bank closure/name mismatch, expired license, vendor hold, or registry identity defect.8384Follow-up or queue ID lists are the non-approved businesses. Overall release readiness is true only when every scoped business is approved.8586## Account-Change Payment Release Reviews8788For account-change batches, use the same compliance, registry, bank, screening, ownership, and vendor records, but apply payment-release posture rather than onboarding labels.8990Common derived lists:9192- Bank mismatch IDs: bank status `name_mismatch`. Keep bank-closed records in the broader review/hold set unless the template names a separate closed-bank list.93- Invalid tax IDs: registry tax ID fails the expected `TIN` plus six digits pattern, or the registry tax ID conflicts with the linked vendor master tax ID.94- Expired license IDs: license expiry is before the review/as-of date.95- Risk score override flags: risk score meets or exceeds the local high-risk threshold in the prompt/payload; when no threshold is supplied, treat `>= 70` as requiring override review.96- Review queue IDs: every scoped business whose final decision is not release.9798Decision precedence:99100- `escalate` for identity or compliance-judgment issues such as invalid tax/registry identity, PEP concern, sanctions hit, shell-company suspicion, or contradictory registry/vendor identity.101- `hold` for operational remediation issues such as bank not verified or closed, expired license, missing documents, screening not run, vendor hold, or risk-score override when no escalation issue is present.102- `release` only when all release-control checks pass.103104Do not copy the source system's current review status as the decision; derive the release posture from current control evidence.105106## Prepaid Close Reconciliations107108Read the local prepaid scope for selected invoice IDs, accounts, entity, and close period. Fetch:109110- Invoices: `/api/prepaids/invoices` or `/prepaids/invoices`111- GL balances: `/api/prepaids/gl-balances` or `/gl/balances`112113Filter to the scoped invoice IDs and requested accounts. Use the GL ending balance for the requested period and entity.114115For straight-line invoices, use the invoice record's `monthly_amortization`; do not recalculate a daily amount. Count service months by calendar month inclusively:116117- Target-month amortization is `monthly_amortization` if the close month falls between the service start month and service end month, inclusive; otherwise it is zero.118- Cumulative amortization through the close month is `monthly_amortization * number_of_service_months_elapsed`, capped to the invoice's service months and original amount when necessary.119- Ending balance is `original_amount - cumulative_amortization`, rounded to two decimals and not below zero except for harmless rounding residuals.120121For each account rollup:122123- Sum selected invoice count, original amount, target-month amortization, cumulative amortization, and schedule ending balance.124- `variance_amount = schedule_ending_balance - gl_ending_balance`.125- Set `variance_flag` when the absolute variance exceeds the prompt/template tolerance; if no tolerance is given, use more than one cent.126- Set account status to the template's reconciliation-required label when there is a variance, missing/default term flag, or invoice exception; otherwise use the reconciled/clean label from the template.127128Invoice flags:129130- `default_missing_term_flag` is true for data-quality flags such as missing contract dates, missing terms, or default terms.131- `exception_flag` is true when `data_quality_flags` is non-empty, the recognition method is unsupported, required dates/amounts are missing, or the invoice violates prompt-specific scope rules.132133Sort invoice IDs and business/claim IDs as requested by the prompt or template.