Herald
OpenapiBilling invoice

Admin read-only attribution anomaly discovery.

Returns two anomaly classes: - `unattributed_invoices`: externally-synced invoices that lack both `subscription_id` and `payment_attempt_id` (reuses `list_admin` with `attribution=Missing`, capped at the first 100 rows). - `payments_without_invoice`: succeeded renewal / one-time payment attempts inside a 90-day window with no invoice linked via `invoice.payment_attempt_id` (anti-join read; no writes). Permission reuses `require_billing_permission(..., "view")` — same model as `GET /invoices`. Realm isolation is enforced both by the repository (`realm_id` filter) and the shared middleware.

GET
/api/bill/{realmId}/invoice-attribution/anomalies

Returns two anomaly classes:

  • unattributed_invoices: externally-synced invoices that lack both subscription_id and payment_attempt_id (reuses list_admin with attribution=Missing, capped at the first 100 rows).
  • payments_without_invoice: succeeded renewal / one-time payment attempts inside a 90-day window with no invoice linked via invoice.payment_attempt_id (anti-join read; no writes).

Permission reuses require_billing_permission(..., "view") — same model as GET /invoices. Realm isolation is enforced both by the repository (realm_id filter) and the shared middleware.

Authorization

bearer_auth
AuthorizationBearer <token>

In: header

Path Parameters

realmId*string

Realm ID

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/bill/string/invoice-attribution/anomalies"
{  "paymentsWithoutInvoice": [    {      "amount": 0,      "completedAt": "string",      "currency": "string",      "paymentAttemptId": "5c39612f-9e19-4385-8bd3-bad144d722f6",      "provider": "string",      "subscriptionId": "d079718b-ff63-45dd-947b-4950c023750f",      "targetType": "string"    }  ],  "unattributedInvoices": [    {      "accountId": "3d07c219-0a88-45be-9cfc-91e9d095a1e9",      "amountRefunded": 0,      "billingName": "string",      "createdAt": "string",      "currency": "string",      "dueDate": "2019-08-24",      "externalHostedUrl": "string",      "externalInvoiceId": "string",      "externalPdfUrl": "string",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "invoiceNumber": "string",      "paymentAttemptId": "5c39612f-9e19-4385-8bd3-bad144d722f6",      "paymentProvider": "string",      "provider": "string",      "source": "string",      "status": "string",      "subscriptionId": "d079718b-ff63-45dd-947b-4950c023750f",      "total": 0    }  ]}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}