`GET /api/marketplace/purchases/{id}/invoices` — #1111 FUND 3: the billing history of one subscription licence, newest first.
const url = 'https://example.com/api/marketplace/purchases/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/invoices';const options = {method: 'GET', headers: {cookie: 'supacloud_session=<supacloud_session>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/marketplace/purchases/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/invoices \ --cookie supacloud_session=<supacloud_session>Workspace-scoped like the cancellation, and for the same reason: the entitlement belongs to the workspace that paid, so its billing record does too.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”OK
#1111 — one row per Stripe invoice OUTCOME on a subscription purchase.
Two jobs in one row: it is the webhook idempotency key (UNIQUE (provider_invoice_id, outcome) — a replayed invoice.paid inserts nothing,
so nothing is booked twice) and the per-period audit trail, linking the paid
period to the seller ledger row it produced.
object
The seller-earnings row this period booked. None for a failed invoice
and for a platform-as-seller sale (#928 writes no payout row).
paid | payment_failed.
The negative ledger row the reversal booked, if any.
#1125 — set once this period was refunded. Also the idempotency guard:
the reversal is applied by a CAS on refunded_at IS NULL, so Stripe’s
repeated charge.refunded deliveries cannot reverse a period twice.
The CUMULATIVE amount Stripe last reported as refunded for this period. Stripe grows this figure across partial refunds, so the stored value is what lets a LARGER later refund extend the reversal instead of being dropped as a replay.
Example generated
[ { "amount_minor": 1, "created_at": "2026-04-15T12:00:00Z", "currency": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "ledger_entry_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "outcome": "example", "period_end": "2026-04-15T12:00:00Z", "period_start": "2026-04-15T12:00:00Z", "provider_invoice_id": "example", "purchase_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "refund_ledger_entry_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "refunded_at": "2026-04-15T12:00:00Z", "refunded_minor": 1 }]Authentication required
The canonical JSON body of every error response. Every AppError serializes as
this exact shape; code is the generated stable machine-readable vocabulary.
object
Present only on an MCP budget refusal (429) — the refusing layer + retry hint.
object
The refusing layer.
The layer’s budget.
Seconds until a retry can pass, or null when it never will for this session.
Calls already counted in the layer.
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.
object
Weighted workspace slots already held by starting/running agent runs.
The budget cap that refused.
Effective spend of the refusing budget scope (spend + in-flight reservations).
The workspace’s configured agent-concurrency cap.
The provider whose budget cap refused; absent for the workspace-wide cap.
Runner labels a fail-policy placement required and no runner offered.
Example
{ "code": "not_found"}No such purchase in the caller’s workspace (a purchase of another workspace is indistinguishable from an unknown id)
The canonical JSON body of every error response. Every AppError serializes as
this exact shape; code is the generated stable machine-readable vocabulary.
object
Present only on an MCP budget refusal (429) — the refusing layer + retry hint.
object
The refusing layer.
The layer’s budget.
Seconds until a retry can pass, or null when it never will for this session.
Calls already counted in the layer.
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.
object
Weighted workspace slots already held by starting/running agent runs.
The budget cap that refused.
Effective spend of the refusing budget scope (spend + in-flight reservations).
The workspace’s configured agent-concurrency cap.
The provider whose budget cap refused; absent for the workspace-wide cap.
Runner labels a fail-policy placement required and no runner offered.
Example
{ "code": "not_found"}Structured server error
The canonical JSON body of every error response. Every AppError serializes as
this exact shape; code is the generated stable machine-readable vocabulary.
object
Present only on an MCP budget refusal (429) — the refusing layer + retry hint.
object
The refusing layer.
The layer’s budget.
Seconds until a retry can pass, or null when it never will for this session.
Calls already counted in the layer.
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.
object
Weighted workspace slots already held by starting/running agent runs.
The budget cap that refused.
Effective spend of the refusing budget scope (spend + in-flight reservations).
The workspace’s configured agent-concurrency cap.
The provider whose budget cap refused; absent for the workspace-wide cap.
Runner labels a fail-policy placement required and no runner offered.
Example
{ "code": "not_found"}