Herald
OpenapiBilling invoice

Per-resource invoice apply-eligibility (read-only, context-level).

Decision order: ownership → provider → policy → seller config → external-invoice-exists, then delegates the verdict to the pure `determine_invoice_apply_route`. The endpoint resolves facts; the pure function owns the rules (single home — avoids divergence from the write path `validate_invoice_creation_policy` / `apply_invoice`).

GET
/api/user/bill/invoices/apply-eligibility

Decision order: ownership → provider → policy → seller config → external-invoice-exists, then delegates the verdict to the pure determine_invoice_apply_route. The endpoint resolves facts; the pure function owns the rules (single home — avoids divergence from the write path validate_invoice_creation_policy / apply_invoice).

Authorization

bearer_auth
headerAuthorizationBearer <token>

Query Parameters

referenceType*string

"payment_attempt" | "subscription".

referenceId*string
Formatuuid

Response Body

Apply eligibility for the referenced resource

application/json
  1. response

Per-resource invoice apply-eligibility (read-only, context-level).

Returned by GET /api/user/bill/invoices/apply-eligibility so the frontend can gate the Apply Invoice button BEFORE submit. Users consume this verdict; they do NOT read admin config/policy APIs directly.

canApply*boolean

Whether the user can apply for a manual Herald invoice on this resource.

provider?|

Resolved payment_provider ("stripe"|"wechat"|"creem"|"apple"|"google"|None).

reason?|

Human-readable reason when apply is not available, else None.

referenceId*string

Echoes the queried reference id.

Formatuuid
referenceType*string

Echoes the queried reference type: "payment_attempt" | "subscription".

route*string

"external_provider" | "manual_fallback" | "disabled".

Example Request
curl -X GET 'https://example.com/api/user/bill/invoices/apply-eligibility?referenceType=string&referenceId=497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
{
  "canApply": true,
  "provider": "string",
  "reason": "string",
  "referenceId": "8502eb05-558d-4480-8511-c1011710b340",
  "referenceType": "string",
  "route": "string"
}