Task Group 005 – Reusable Skill (SOP)
1. Environment & Base URL
- Always use the remote base URL from
environment_access.md(GDPEVO_ENV_BASE_URL). - Override any
localhostor127.0.0.1references in the prompt with the remote URL. - Do not start local environments or read
env/source directories.
2. Confirmed API Endpoints
| Endpoint | Purpose | Typical Query Params |
|---|---|---|
GET /vendors |
Vendor master data | vendor_id |
GET /claims |
Expense claim headers | claim_id |
GET /bills |
AP bill records | claim_id, bill_id |
GET /payments |
Payment records | bill_id, payment_id |
GET /prepaids/invoices |
Prepaid invoice schedules | prepaid_invoice_id |
GET /gl/balances |
Period-end GL balances | account, period (YYYY-MM) |
- Pagination: Responses wrap lists in
"data". Uselimit/offsetif counts exceed 100. - Path-parameter style:
/vendors/{id}returnsnot_found. Use query parameters instead (?vendor_id=...).
3. Task-Type Workflows
A. AP Close / Reimbursement Batch Review (train_001, train_004)
Data to pull per claim:
GET /claims?claim_id={id}→status,amount,vendor_id,receipt_status,policy_flags.GET /bills?claim_id={id}→ all bills linked to the claim.GET /payments?bill_id={bill_id}→ payment state for each bill.
Classification rules:
- Paid: Claim status is
paidand there is apaidbill with aclearedpayment matching the claim amount. - Payable / Eligible: Claim status is
approved, has a valid open AP bill (scheduledorapproved), and noclearedpayment yet. In-flight payments (processing,scheduled) keep the claim in the payable queue. - Blocked / Not-ready: Any of the following:
- Claim status is not
approved(e.g.,needs_receipt,submitted,rejected). - No bill exists for the claim.
- Bill is
void. - Bill amount ≠ claim amount (vendor or amount mismatch).
- Missing required AP-link evidence.
- Claim status is not
Stale-snapshot reconciliation (train_004):
- Treat the local CSV snapshot as context only; the API is the system of record.
- Map each claim to one
stale_snapshot_correctionsvalue:current_snapshot_ok– API matches the stale row.mark_in_flight_payment– snapshot shows no payment, but API shows aprocessing/scheduledpayment.replace_with_matched_paid_bill– snapshot references the wrong bill/amount, but API shows a paid bill that matches the claim.exclude_amount_or_vendor_mismatch– bill amount or vendor does not align with the claim.ignore_void_bill– the bill isvoidin the API.block_unapproved_claim– claim status is notapproved.
AP balance computation (train_004):
- Sum bill amounts that are not
paid/voidand have noclearedpayment. - Ignore voided or stale rows.
Close logs:
- If the API exposes
/close-logsor similar, query it by claim/bill. If the endpoint is absent, setclose_log_required.required = falseandids = []unless the prompt explicitly supplies close-log data.
B. Vendor Onboarding / Release Control (train_002, train_005)
Data to pull:
GET /vendors?vendor_id={id}for basic fields:status,bank_account_last4,tax_id,legal_name,updated_at.- Caution: Dedicated compliance/onboarding endpoints (e.g.,
/compliance,/screening,/licenses,/risk) are not confirmed on the remote API.- If present, query them for
bank_account_status,tax_valid,license_expiry,risk_score,screening_status, and UBO data. - If absent, infer release decisions from the payload context and flag missing evidence as
awaiting_information/hold.
- If present, query them for
Decision values:
- train_002:
approve,awaiting_information,escalate. - train_005:
release,hold,escalate.
Hard-stop flags (train_002):
bank_closed,bank_name_mismatch,confirmed_pep,expired_license,missing_required_documents,sanctions_confirmed,screening_not_run,shell_company_suspected,vendor_on_hold.- Sort flags alphabetically per business.
Train-005 specific lists:
bank_mismatch_ids–bank_account_status == name_mismatch.invalid_tax_ids– tax ID validation fails.expired_license_ids–license_expiry < as_of_date.review_queue_ids– any compliance/AP review required.risk_score_override_flags–risk_score >= 70.- All ID lists ascending by
business_id.
Overall release readiness:
overall_release_ready(train_002) istrueonly if every listed business getsapprove.
C. Prepaid Close Reconciliation (train_003)
Data to pull:
GET /prepaids/invoices?prepaid_invoice_id={id}for each scoped invoice.GET /gl/balances?account={acct}&period={YYYY-MM}for each account.
Amortization math:
- Use the
monthly_amortizationvalue straight from the invoice record (straight-line). - Count months elapsed from
service_startthrough the close period month (inclusive).- Example: close period
2025-03. - Invoice starting
2025-01-01→ 3 months (Jan, Feb, Mar). - Invoice starting
2025-03-01or2025-03-15→ 1 month for March. - Invoice ending
2025-03-31→ count all months in its term.
- Example: close period
cumulative_amortization_through_march = monthly_amortization × months_elapsed.ending_balance = original_amount − cumulative_amortization_through_march.- Round all currency fields to two decimals.
Variance check:
variance_amount = schedule_ending_balance − gl_ending_balance.variance_flag = abs(variance_amount) > variance_threshold_abs(from payload, e.g.,100.0).
Flags & exceptions:
default_missing_term_flagat invoice level:truewhendata_quality_flagscontainsmissing_contract_dates(or similar term-missing flag).exception_flagat invoice level:truewhendata_quality_flagsis non-empty (includesrounded_amount,missing_contract_dates, etc.).default_missing_term_invoice_ids: scoped invoices with missing-term flags, sorted ascending.exception_invoice_ids: scoped invoices with any data-quality flag, sorted ascending.
Account status mapping:
reconciled– no variance and no flags.variance_review–variance_flag == true.requires_reconciliation– missing-term/exception flags present or other schedule issues.
4. Output Conventions
- Format: Return only a JSON object matching the
answer_template.jsonschema. - Currency: Always report USD amounts with two decimal places (e.g.,
1234.50).- Note: Prompts may say "USD cents"; interpret this as cent-precision dollars (two decimals), not integer cents.
- Sorting:
- All
claim_idlists: ascending lexicographically. - All
business_idlists: ascending lexicographically. - All
invoice_idlists: ascending lexicographically. selected_invoice_ids: preserve the order given in the payload unless the template explicitly requires ascending.
- All
- Key ordering: When the template specifies
top_level_order(e.g., train_002), emit keys in that exact order. - No extra properties: Do not add keys not defined in the template (train_005 explicitly forbids additional properties).
5. Common Pitfalls
- Using localhost: Always override with the remote base URL from
environment_access.md. - Path vs. query params:
/vendors/{id}fails; use/vendors?vendor_id={id}. - Multiple bills per claim: Some claims have >1 bill. Evaluate all bills and payments before classifying the claim.
- Claim status vs. bill status: A claim may be
paidin the claim table but still have an unrelated stale bill open. Cross-check amounts and payment clearance. - Stale snapshots: Treat local CSV snapshots as context only; the API is the system of record.
- Missing compliance endpoints: If onboarding/compliance data is not exposed, fall back to
/vendorsbasic fields and default to conservative decisions (awaiting_information/hold). - Prorated months: For prepaid close, use the given
monthly_amortization; do not recalculate prorated daily amounts unless the invoice explicitly indicates daily recognition. - Zero balances: Keep
.00for zero amounts (two-decimal precision).