api.suitsbooks.nlGuideReference

Calling the Functions

This page shows how to actually invoke the reconciliation and helper functions. Replace COMPANYID with your UUID.

1) Run Reconciliation

SELECT public.athena_reconcile_general_v1_9_i(
  p_company_id => 'COMPANYID'
);
  • Processes documents vs. transactions.

  • Inserts matches into reconciliations.

  • Returns counts summary JSON.

2) Stage Results (and optional Auto-Verify)

SELECT public.auto_stage_reconciliations_v1(
  p_reconciliation_config_id => '3dae610e-2326-46b8-ba18-85f54961e4ca'
);
  • Populates reconciliations_staging for any new reconciliations.

  • If config allows → auto-verify those above threshold.

3) Bulk Unverify

SELECT public.reconciliations_unverify_bulk_v1();
  • Unverify all currently verified reconciliations (with optional filters).

  • Cascades to documents and transactions.

Common Workflow

  1. athena_reconcile_general_v1_9_i → generate reconciliations.

  2. auto_stage_reconciliations_v1 → stage + auto-verify.

  3. Manual toggles/verify/unverify via reconciliations_staging_update_v2.

  4. Optional mass rollback with reconciliations_unverify_bulk_v1.