---
title: "List orphaned Bill.com bills tracked by SGOS"
method: GET
path: "/api/admin/billcom/orphaned-bills"
tags: ["Bill.com Integration"]
---

# List orphaned Bill.com bills tracked by SGOS

`GET /api/admin/billcom/orphaned-bills`

## Request

- Base URL: `https://api.production.yourmedley.com`
- URL: `https://api.production.yourmedley.com/api/admin/billcom/orphaned-bills`
- Auth: none declared

Returns the count and detail of failed payments that still carry a Bill.com bill id —
orphaned, potentially-payable bills left behind when a payment failed after its bill
was created but the automatic void could not complete (MED-1237 AC2). Read-only;
used to surface the volume of orphans before running the reconciliation cleanup.

Only surfaces orphans created after the MED-1237 fix shipped. Orphans from prior
occurrences have no persisted bill id and require a one-time Bill.com-side scan.

## Response `200`

Orphaned bill count and detail

- object
  - `success` boolean
  - `data` object
    - `count` integer: Number of tracked orphaned bills
    - `orphaned_bills` object[]

## Other responses

- `401`: Unauthorized
- `403`: Forbidden — requires an internal role
- `500`: Internal server error

---

[API](https://skmtc.dev/withmedley/apis/medley-api.md) - [All operations](https://skmtc.dev/withmedley/apis/medley-api/llms.txt) - [OpenAPI document](https://skmtc.dev/withmedley/apis/medley-api/revisions/40aaac5ca6bd?raw)
