---
title: "Reconcile Pending"
method: POST
path: "/api/billing/transactions/reconcile-pending"
tags: ["billing"]
---

# Reconcile Pending

`POST /api/billing/transactions/reconcile-pending`

## Request

- Base URL: `https://app.dataassist.io` (the document declares no server; this is the origin it was published from)
- URL: `https://app.dataassist.io/api/billing/transactions/reconcile-pending`
- Auth: none declared

Scan this org's non-terminal purchases and reconcile each against Razorpay.

Called by the SPA when the Billing page loads. Handles two cases where a
webhook never reached us:

  1. `payment.captured` lost → row stuck `pending`. We ask Razorpay, and
     if a payment is captured we flip to `completed` and credit the balance.
  2. `payment.failed` arrived but the subsequent retry's `payment.captured`
     was lost → row is `failed` even though money moved. Same recovery —
     Razorpay returns the captured payment on the same order, we flip
     `failed → completed`.

For (2) we time-bound the scan to the last 7 days so we don't repeatedly
query Razorpay for ancient genuinely-failed rows.

## Response `200`

Successful Response

- unknown

---

[API](https://skmtc.dev/dataassist/apis/dataassist-io-server.md) · [All operations](https://skmtc.dev/dataassist/apis/dataassist-io-server/llms.txt) · [OpenAPI document](https://skmtc.dev/dataassist/apis/dataassist-io-server/revisions/43b22ccf75fe?raw)
