{
  "components": {
    "schemas": {
      "Essence.Payment.Billing.Api.Controllers.AddPaymentMethodRequest": {
        "additionalProperties": false,
        "description": "Request body for adding a new payment method token.",
        "properties": {
          "brand": {
            "nullable": true,
            "type": "string"
          },
          "expiryMonth": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "expiryYear": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "gateway": {
            "nullable": true,
            "type": "string"
          },
          "gatewayMethodId": {
            "nullable": true,
            "type": "string"
          },
          "lastFour": {
            "nullable": true,
            "type": "string"
          },
          "setAsDefault": {
            "type": "boolean"
          },
          "type": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.AddPaymentPageScriptRequest": {
        "additionalProperties": false,
        "description": "Body of `POST …/scripts`.",
        "properties": {
          "businessJustification": {
            "nullable": true,
            "type": "string"
          },
          "changeRecord": {
            "description": "The change-management reference that authorises proposing this script.",
            "nullable": true,
            "type": "string"
          },
          "scriptUrl": {
            "nullable": true,
            "type": "string"
          },
          "subresourceIntegrityHash": {
            "nullable": true,
            "type": "string"
          },
          "vendor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.AdminNetTermsRefundsController.NetTermsRefundRequest": {
        "additionalProperties": false,
        "description": "The POST body. The refunding identity is the caller, never the body.",
        "properties": {
          "amount": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "reference": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.AdminOrganisationCommercialProfileController.ApproveInvoiceCollectionRequest": {
        "additionalProperties": false,
        "description": "The approval PUT body: the terms (days) and why. The approver is the caller, never the body.",
        "properties": {
          "paymentTermsDays": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.AdminOrganisationCommercialProfileController.SetPaymentTermsRequest": {
        "additionalProperties": false,
        "description": "The PUT body: the only writable fields. Anything else in the body (a route, a payer) is ignored.",
        "properties": {
          "days": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.AdminRefundQueueController.ResolveRefundRequest": {
        "additionalProperties": false,
        "description": "The POST body. The resolving identity is the caller, never the body.",
        "properties": {
          "note": {
            "nullable": true,
            "type": "string"
          },
          "outcome": {
            "nullable": true,
            "type": "string"
          },
          "reference": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.AdminReprovisionEntitlementsRequest": {
        "additionalProperties": false,
        "description": "Request body for M:Essence.Payment.Billing.Api.Controllers.AdminSubscriptionsController.ReprovisionEntitlements(Essence.Payment.Billing.Api.Controllers.AdminReprovisionEntitlementsRequest,System.Threading.CancellationToken).",
        "properties": {
          "afterSubscriptionId": {
            "description": "Keyset cursor from a previous page's `nextCursor`.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "batchSize": {
            "description": "Page size (default 100, max 500).",
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "dryRun": {
            "description": "Report what would change and publish nothing.",
            "type": "boolean"
          },
          "pricingPlanId": {
            "description": "Restrict the walk to one pricing plan.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "description": "Why this is being run. Required — it lands on the published event's audit trail.",
            "nullable": true,
            "type": "string"
          },
          "recordBaselineOnly": {
            "description": "Record each subscription's resolved grant as already held; publish nothing.",
            "type": "boolean"
          },
          "republishUnchanged": {
            "description": "Publish the complete grant even for subscriptions that already hold it (engine-repair escape\r\nhatch). By default a subscription that would gain nothing publishes nothing.",
            "type": "boolean"
          },
          "subscriptionId": {
            "description": "Re-provision exactly this subscription instead of walking the active population.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.AdminSeedSubscriptionRequest": {
        "additionalProperties": false,
        "description": "Request body for M:Essence.Payment.Billing.Api.Controllers.AdminSubscriptionsController.SeedSubscription(Essence.Payment.Billing.Api.Controllers.AdminSeedSubscriptionRequest,System.Threading.CancellationToken).",
        "properties": {
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "overrideTrialDays": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "pricingPlanId": {
            "format": "uuid",
            "type": "string"
          },
          "subscriptionClass": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Subscription.SubscriptionClass"
          },
          "targetUserId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.AdminTaxPendingQueueController.DetermineTaxRequest": {
        "additionalProperties": false,
        "description": "The POST body. The determining identity is the caller, never the body.",
        "properties": {
          "ratePercent": {
            "description": "The rate as a PERCENTAGE (20 = 20%), 0..100. Omitted is rejected rather than defaulted — a missing rate\r\nmust never read as 0%, which is the one outcome FR-14.023a forbids outright.",
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "reason": {
            "description": "Finance's grounds for the rate.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.AdminVoidStrandedOnboardingRequest": {
        "additionalProperties": false,
        "description": "Request body for M:Essence.Payment.Billing.Api.Controllers.AdminOnboardingRecoveryController.VoidStranded(Essence.Payment.Billing.Api.Controllers.AdminVoidStrandedOnboardingRequest,System.Threading.CancellationToken).",
        "properties": {
          "applications": {
            "description": "Application references (`ESS-1A2B-3C4D`) or onboarding session ids.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "dryRun": {
            "description": "Report only (the default). Pass `false` to void.",
            "nullable": true,
            "type": "boolean"
          },
          "reason": {
            "description": "Why this is being run. Required — it is the audit line's reason.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.AppRevenueReassignmentRequest": {
        "additionalProperties": false,
        "description": "What EPIC 25 tells EPIC 14 about a transfer's money.",
        "properties": {
          "appId": {
            "description": "The application changing hands.",
            "nullable": true,
            "type": "string"
          },
          "effectiveAt": {
            "description": "The ledger cut. The same instant as the controller change, never re-derived here.",
            "format": "date-time",
            "type": "string"
          },
          "fromOrgId": {
            "description": "The outgoing owner's partner id.",
            "format": "uuid",
            "type": "string"
          },
          "toOrgId": {
            "description": "The incoming owner's partner id.",
            "format": "uuid",
            "type": "string"
          },
          "transferId": {
            "description": "The transfer — EPIC 25's key, and this reassignment's idempotency key.",
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.AppRevenueReassignmentResponse": {
        "additionalProperties": false,
        "description": "What EPIC 14 says about a prepared or executed reassignment.",
        "properties": {
          "completed": {
            "description": "True only when the reassignment did, or can, actually run.",
            "type": "boolean"
          },
          "currency": {
            "description": "The currency of OutstandingAmount.",
            "nullable": true,
            "type": "string"
          },
          "incomingDestinationBound": {
            "description": "True only when the receiving organisation has a usable payout destination — a method AND an\r\naccount id. EPIC 25's dry-run treats false as a blocker.",
            "type": "boolean"
          },
          "outstandingAmount": {
            "description": "What the outgoing owner is owed for this app at the cut.",
            "format": "double",
            "type": "number"
          },
          "reason": {
            "description": "Plain-language explanation. Never blank.",
            "nullable": true,
            "type": "string"
          },
          "settledCommissionCount": {
            "description": "How many commission rows the settlement covered.",
            "format": "int32",
            "type": "integer"
          },
          "settlementReference": {
            "description": "The settlement payout's id, or null when nothing was owed.",
            "nullable": true,
            "type": "string"
          },
          "unattributedCommissionCount": {
            "description": "How many of the outgoing owner's pending rows could not be attributed to any app, and were\r\ntherefore NOT swept into this settlement.",
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ApplyGrandfatherPriceLockRequest": {
        "additionalProperties": false,
        "description": "Request body for applying a grandfather price lock (#23327).",
        "properties": {
          "currencyCode": {
            "description": "ISO-4217 code of both amounts, e.g. `GBP`.",
            "nullable": true,
            "type": "string"
          },
          "listAmountAtLock": {
            "description": "The list price in force now — what the subscriber would pay without the lock.",
            "format": "double",
            "type": "number"
          },
          "lockedAmount": {
            "description": "The price the subscriber is held on. May be zero; never above Essence.Payment.Billing.Api.Controllers.ApplyGrandfatherPriceLockRequest.ListAmountAtLock.",
            "format": "double",
            "type": "number"
          },
          "lockedUntil": {
            "description": "When the lock stops being in force. Must be in the future.",
            "format": "date-time",
            "type": "string"
          },
          "supersedeReference": {
            "description": "The upstream EPIC 79 commercial-manager supersede decision this lock implements.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ApplyPackageVersionMigrationDeltaRequest": {
        "additionalProperties": false,
        "description": "Body of `POST api/v1/billing/package-version-migrations/{id}/apply`.",
        "properties": {
          "documentId": {
            "description": "The billing document's id, when the caller knows it. Optional.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "documentReference": {
            "description": "The invoice or credit-note reference that carried the delta.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ApprenticeshipCompletionRequest": {
        "additionalProperties": false,
        "description": "The qualification EPIC 29 issued on completion.",
        "properties": {
          "anchorReference": {
            "description": "The EPIC 4 anchor for the completion, when one exists.",
            "nullable": true,
            "type": "string"
          },
          "completedAtIso": {
            "description": "ISO-8601 instant of completion. Omit for \"now\".",
            "nullable": true,
            "type": "string"
          },
          "credentialId": {
            "description": "The EPIC 29 credential issued to the apprentice's own vault.",
            "nullable": true,
            "type": "string"
          },
          "grade": {
            "description": "Wire form: `pass` | `merit` | `distinction`.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ApproveSeatTrueUpRequest": {
        "additionalProperties": false,
        "description": "Body for the approve route.",
        "properties": {
          "role": {
            "description": "`billing-admin`, `finance-approver` or `cfo`.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ApproveWriteOffRequest": {
        "additionalProperties": false,
        "description": "Sign a proposal.",
        "properties": {
          "role": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.WriteOffApproverRole"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.AssignSeatHolderRequest": {
        "additionalProperties": false,
        "description": "Payload for assigning a seat.",
        "properties": {
          "holderRef": {
            "description": "The incoming holder (opaque org-user reference).",
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.AssignSeatRequest": {
        "additionalProperties": false,
        "description": "Body for the assign route.",
        "properties": {
          "newHolderRef": {
            "description": "The incoming holder (opaque org-user reference).",
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.BulkReclaimSeatsRequest": {
        "additionalProperties": false,
        "description": "Body for the bulk-reclaim route.",
        "properties": {
          "consentDisposition": {
            "description": "The consent disposition applied to every row.",
            "nullable": true,
            "type": "string"
          },
          "handoverRoute": {
            "description": "The handover route applied to every row.",
            "nullable": true,
            "type": "string"
          },
          "rows": {
            "description": "The rows, from multi-select or an uploaded CSV.",
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.BulkReclaimSeatsRowRequest"
            },
            "nullable": true,
            "type": "array"
          },
          "scope": {
            "description": "The scope applied to every row. Bulk offboard is refused — see the handler.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.BulkReclaimSeatsRowRequest": {
        "additionalProperties": false,
        "description": "One row of a bulk reclaim body.",
        "properties": {
          "leaverRef": {
            "description": "The departing holder.",
            "format": "uuid",
            "type": "string"
          },
          "newHolderRef": {
            "description": "The incoming holder, when the row is a leaver→new-hire mapping.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "seatRef": {
            "description": "The seat reference, when the organisation has one.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.CancelSubscriptionRequest": {
        "additionalProperties": false,
        "properties": {
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ChangeLicensedSeatsRequest": {
        "additionalProperties": false,
        "description": "The body of `PUT …/subscriptions/{id}/seats`.",
        "properties": {
          "seats": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ChangeSubscriptionCadenceRequest": {
        "additionalProperties": false,
        "description": "FR-14.003a — a same-tier billing-cadence switch. NewCadence is\r\n`MONTHLY` or `ANNUALLY`; NewCadencePrice is the price the customer\r\nwas quoted for the new cadence, because a plan holds one `BasePrice` and no second-cadence\r\nfigure for the handler to look up.",
        "properties": {
          "newCadence": {
            "nullable": true,
            "type": "string"
          },
          "newCadencePrice": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ClassifyTenantRequest": {
        "additionalProperties": false,
        "description": "Body of a classification request. The actor comes from the token, not from here.",
        "properties": {
          "class": {
            "description": "One of `customer`, `intercompany`, `internal`, `trial-non-revenue`.",
            "nullable": true,
            "type": "string"
          },
          "effectiveFrom": {
            "description": "When the class takes effect. May be backdated.",
            "format": "date-time",
            "type": "string"
          },
          "reason": {
            "description": "Why this tenant is classified this way.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.CloudMarketplaceSettlementsController.DispositionRequest": {
        "additionalProperties": false,
        "description": "A disposition finance records on a break.",
        "properties": {
          "disposition": {
            "description": "`accepted`, `written_off` or `re_tied`.",
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "description": "Why — required.",
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "description": "For `re_tied` only: the subscription the line belongs to.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.CloudMarketplaceSettlementsController.ImportSettlementRequest": {
        "additionalProperties": false,
        "description": "The period a settlement import asks the marketplace for.",
        "properties": {
          "periodEndUtc": {
            "description": "Exclusive end (UTC).",
            "format": "date-time",
            "type": "string"
          },
          "periodStartUtc": {
            "description": "Inclusive start (UTC).",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.CloudMarketplaceSettlementsController.ReassignOwnerRequest": {
        "additionalProperties": false,
        "description": "A new owner for an open break.",
        "properties": {
          "owner": {
            "description": "Who works the break from now on.",
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "description": "Why — required.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.CommitSeatResolutionRequest": {
        "additionalProperties": false,
        "description": "Body of a commit-resolution request.",
        "properties": {
          "authoritativeSource": {
            "description": "Which seat figure the admin declared authoritative: `synced`, `billed`,\r\n`assigned` or `manual`. Required, and rejected when unrecognised — the audit\r\ntrail must not claim the admin believed a figure they never named.",
            "nullable": true,
            "type": "string"
          },
          "note": {
            "description": "Optional free-text note recorded with the decision.",
            "nullable": true,
            "type": "string"
          },
          "targetSeats": {
            "description": "The billed seat count the resolution moves to.",
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ConfigureGroupSchemeBillingRequest": {
        "additionalProperties": false,
        "description": "Body of `PUT api/v1/billing/group-schemes/{schemeId}/billing-configuration`.",
        "properties": {
          "billingContactUserId": {
            "description": "Whom an aggregated invoice is addressed to. Required when `invoicingParty` is\r\n`org`: an invoice addressed to a guess is a debt the wrong party is chased for.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "invoicingParty": {
            "description": "`org` — the scheme's premiums are aggregated onto one invoice to the administering\r\n            organisation; or `individual` — each member is invoiced directly and the scheme\r\n            supplies only roster and eligibility. Fixed on the first call.",
            "nullable": true,
            "type": "string"
          },
          "paymentTermsDays": {
            "description": "Days from issue to due date on the aggregated invoice. Defaults to 30.",
            "format": "int32",
            "nullable": true,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ConfirmPaymentIntentRequest": {
        "additionalProperties": false,
        "properties": {
          "paymentGateway": {
            "nullable": true,
            "type": "string"
          },
          "paymentMethodId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.DecideDeveloperApiPlanUpgradeRequest": {
        "additionalProperties": false,
        "description": "Wire body of the approver's decision.",
        "properties": {
          "decision": {
            "description": "`approve` | `decline`.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.DeclarePartnerWithholdingRequest": {
        "additionalProperties": false,
        "description": "Body of `PUT /api/v1/payouts/settings/withholding`.",
        "properties": {
          "claimsTreatyBenefits": {
            "description": "Whether treaty relief is claimed; absent means no.",
            "nullable": true,
            "type": "boolean"
          },
          "entityType": {
            "description": "One of `company, partnership, sole-trader, individual, other`.",
            "nullable": true,
            "type": "string"
          },
          "taxResidenceCountry": {
            "description": "ISO 3166-1 alpha-2, such as `GB`.",
            "nullable": true,
            "type": "string"
          },
          "treatyArticle": {
            "description": "The article relied on, at most 64 characters; only with a claim.",
            "nullable": true,
            "type": "string"
          },
          "treatyRatePercent": {
            "description": "The rate claimed, 0–100, at most two decimals; only with a claim.",
            "format": "double",
            "nullable": true,
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.DowngradeSubscriptionRequest": {
        "additionalProperties": false,
        "properties": {
          "newPricingPlanId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.EarlyLeaverRequest": {
        "additionalProperties": false,
        "description": "An apprentice who left before completing.",
        "properties": {
          "leftAtIso": {
            "description": "ISO-8601 instant they left. Omit for \"now\".",
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "description": "Wire form: `withdrew` | `left-employment` | `transferred` | `other`.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.EnrolSeatRegisterRequest": {
        "additionalProperties": false,
        "description": "Enrolment payload.",
        "properties": {
          "seats": {
            "description": "Seats to create at enrolment; may be empty or absent.",
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SeatRegistrationEntryRequest"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.HoldSeatTrueUpRequest": {
        "additionalProperties": false,
        "description": "Body for the hold route.",
        "properties": {
          "reason": {
            "description": "The organisation's stated reason — required, so the hold can be reviewed.",
            "nullable": true,
            "type": "string"
          },
          "seatRef": {
            "description": "The disputed seat's opaque reference.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.InitiateCoolingOffCancellationRequest": {
        "additionalProperties": false,
        "description": "Body of `POST api/v1/billing/cooling-off-settlements`.",
        "properties": {
          "coolingOffDays": {
            "description": "The window length in days, 1–30; 14 when omitted.",
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "currencyCode": {
            "description": "ISO-4217; defaults to GBP.",
            "nullable": true,
            "type": "string"
          },
          "customerUserId": {
            "description": "The customer exercising the right: the party the refund returns to.",
            "format": "uuid",
            "type": "string"
          },
          "noticeReceivedAt": {
            "description": "When the customer's notice was received; now when omitted.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "price": {
            "description": "The price or premium paid.",
            "format": "double",
            "type": "number"
          },
          "purchaseReference": {
            "description": "The original purchase or policy reference.",
            "nullable": true,
            "type": "string"
          },
          "purchasedAt": {
            "description": "When the purchase was made or the policy incepted. The window runs from here.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "serviceStartedAt": {
            "description": "When the service or cover began; omit when none was used, so nothing is deducted.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "serviceTermDays": {
            "description": "The pro-rata denominator in days (e.g. 365 for annual cover); the window length when omitted.",
            "format": "int32",
            "nullable": true,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.InitiateRetainerTrustFundingRequest": {
        "additionalProperties": false,
        "description": "Body of `POST api/v1/billing/retainer-trust-fundings`.",
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "currencyCode": {
            "description": "ISO-4217; defaults to GBP.",
            "nullable": true,
            "type": "string"
          },
          "feeBasis": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.RetainerTrustFunding.RetainerFeeBasis"
          },
          "lawFirmOrganizationId": {
            "description": "The law firm whose client trust account will hold the funds.",
            "format": "uuid",
            "type": "string"
          },
          "matterReference": {
            "description": "The matter the funds are held against.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.LevyAllocationRequest": {
        "additionalProperties": false,
        "description": "What the employer console sends to commit levy funds. Mirrors `AllocationRequest` in\r\n`apps/frontend/web/org-portal/src/features/levy-account/api/levyAccountApi.ts`.",
        "properties": {
          "places": {
            "format": "int32",
            "type": "integer"
          },
          "providerOrganizationId": {
            "format": "uuid",
            "type": "string"
          },
          "sourceReference": {
            "description": "Optional idempotency key. The portal sends none and the server derives a stable one from the\r\ncommitment's own shape; EPIC 17's `LevyAllocated` consumer will send the event's\r\nallocation reference so a redelivery cannot commit the pot twice.",
            "nullable": true,
            "type": "string"
          },
          "standardId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.LevyMovementRequest": {
        "additionalProperties": false,
        "description": "A movement delivered onto an employer's levy ledger under service authority.",
        "properties": {
          "allocationId": {
            "description": "Required for a drawdown or a clawback.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "amountPence": {
            "description": "Signed minor units: credits positive, debits negative.",
            "format": "int64",
            "type": "integer"
          },
          "apprenticeshipId": {
            "nullable": true,
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "description": "Wire form: `payroll-accrual` | `government-top-up` | `drawdown` |\r\n`expiry` | `clawback`.",
            "nullable": true,
            "type": "string"
          },
          "occurredAtIso": {
            "description": "ISO-8601 instant the movement occurred. Omit for \"now\".",
            "nullable": true,
            "type": "string"
          },
          "sourceReference": {
            "description": "The originating system's own reference. Idempotency key.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.MarketplaceFulfilmentController.ActivateMarketplacePurchaseRequest": {
        "additionalProperties": false,
        "description": "Request body of M:Essence.Payment.Billing.Api.Controllers.MarketplaceFulfilmentController.Activate(System.String,Essence.Payment.Billing.Api.Controllers.MarketplaceFulfilmentController.ActivateMarketplacePurchaseRequest,System.Threading.CancellationToken).",
        "properties": {
          "purchaseToken": {
            "description": "The token the marketplace put on the landing-page URL, verbatim.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.MilestoneAchievementRequest": {
        "additionalProperties": false,
        "description": "An achievement EPIC 29 has evidenced.",
        "properties": {
          "achievedAtIso": {
            "description": "ISO-8601 instant it was achieved. Omit for \"now\".",
            "nullable": true,
            "type": "string"
          },
          "evidenceEntryId": {
            "description": "The EPIC 29 evidence entry id it was signed off against. An id, never content.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.MilestoneDrawdownRequest": {
        "additionalProperties": false,
        "description": "A release of levy funds against an evidenced milestone.",
        "properties": {
          "actorLabel": {
            "description": "Who is releasing it — the person the payment is accounted to at audit.",
            "nullable": true,
            "type": "string"
          },
          "actorRole": {
            "description": "The role they release it in.",
            "nullable": true,
            "type": "string"
          },
          "amountPence": {
            "description": "The positive amount to release, in pence.",
            "format": "int64",
            "type": "integer"
          },
          "sourceReference": {
            "description": "Optional idempotency key; one is derived from the rung when none is sent.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ModuleSubscriptionQuoteRequestDto": {
        "additionalProperties": false,
        "description": "FR-14.050a — request body for a pre-purchase module quote.",
        "properties": {
          "offeringId": {
            "description": "The marketplace offering to price.",
            "format": "uuid",
            "type": "string"
          },
          "seatCount": {
            "description": "Seats to quote for. One for an org-wide install.",
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ModuleSubscriptionSummaryDto": {
        "additionalProperties": false,
        "description": "Summary DTO for a module subscription.",
        "properties": {
          "alignedToOrgPeriod": {
            "description": "FR-14.050a — whether the module renews on the organisation's own renewal day.",
            "type": "boolean"
          },
          "billingCycle": {
            "nullable": true,
            "type": "string"
          },
          "canceledAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "cancellationTerms": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModuleCancellationTermsDto"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "firstChargeAmount": {
            "description": "FR-14.050a — what was charged at provisioning; `null` when hidden (P5-R24).",
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "isBaseModule": {
            "type": "boolean"
          },
          "nextBillingDate": {
            "description": "FR-14.050a — the next date money is taken, derived from the frozen anchor. `null` when\r\nnothing renews: a base module, a one-time purchase, a cancelled module, or one already\r\npending mid-cycle deprovision (FR-14.052a).",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "offeringId": {
            "format": "uuid",
            "type": "string"
          },
          "offeringName": {
            "nullable": true,
            "type": "string"
          },
          "price": {
            "description": "The per-seat price; `null` for an organisation shown no Essence figure (routed or route unknown, P5-R24).",
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "proration": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModuleProrationLineDto"
          },
          "provisionedAt": {
            "format": "date-time",
            "type": "string"
          },
          "recurringTotal": {
            "description": "FR-14.050a — the full-period commitment: Essence.Payment.Billing.Api.Controllers.ModuleSubscriptionSummaryDto.Price × Essence.Payment.Billing.Api.Controllers.ModuleSubscriptionSummaryDto.SeatCount; `null` when hidden (P5-R24).",
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "seatCount": {
            "description": "FR-14.050a — seats this module is billed for. One for an org-wide install.",
            "format": "int32",
            "type": "integer"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.OpenPremiumFinancePlanRequest": {
        "additionalProperties": false,
        "description": "Request body for opening a premium-finance plan.",
        "properties": {
          "agreementId": {
            "description": "The insurer's agreement identifier. Opaque to Billing.",
            "nullable": true,
            "type": "string"
          },
          "creditAgreementReference": {
            "description": "The lender's credit-agreement reference.",
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "description": "ISO currency code the whole plan is denominated in.",
            "nullable": true,
            "type": "string"
          },
          "mandateReference": {
            "description": "The mandate instalments are collected against. A reference, never an account number.",
            "nullable": true,
            "type": "string"
          },
          "policyReference": {
            "description": "The policy the premium belongs to. Opaque to Billing.",
            "nullable": true,
            "type": "string"
          },
          "policyholderUserId": {
            "description": "The policyholder repaying the credit agreement.",
            "format": "uuid",
            "type": "string"
          },
          "schedule": {
            "description": "The agreed schedule, in due order. Fixed at signing; it cannot be added to later.",
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PremiumFinance.ScheduledInstalmentInput"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.OpenSeatTrueUpRequest": {
        "additionalProperties": false,
        "description": "Body for `POST /billing/seat-true-up/organizations/{id}/open`.",
        "properties": {
          "period": {
            "description": "The quarter as `yyyy-Qn`; null means the most recently closed one.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.PackageVersionMigrationDeltaRequest": {
        "additionalProperties": false,
        "description": "Body of `POST api/v1/billing/package-version-migrations` and of its `preview`. Identical, so what\r\nthe subscriber was shown is what gets recorded.",
        "properties": {
          "currencyCode": {
            "description": "ISO-4217; defaults to GBP.",
            "nullable": true,
            "type": "string"
          },
          "currentPeriodEnd": {
            "description": "The day the current version's billing period ends.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "currentPeriodStart": {
            "description": "First day of the current version's billing period.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "currentVersionPrice": {
            "description": "The current version's price for a whole billing period.",
            "format": "double",
            "type": "number"
          },
          "fromVersion": {
            "description": "The version being left, e.g. `v3.2`.",
            "nullable": true,
            "type": "string"
          },
          "migrationEffectiveAt": {
            "description": "The migration's effective date. Must fall inside the current billing period.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "newVersionPrice": {
            "description": "The new version's price for a whole billing period.",
            "format": "double",
            "type": "number"
          },
          "packageCode": {
            "description": "The commercial package, e.g. `PKG-PROF`.",
            "nullable": true,
            "type": "string"
          },
          "subscriberUserId": {
            "description": "The subscriber who reads the preview.",
            "format": "uuid",
            "type": "string"
          },
          "subscriptionId": {
            "description": "The subscription the migration applies to.",
            "format": "uuid",
            "type": "string"
          },
          "termDays": {
            "description": "The pro-rata denominator in days; the current period's own length when omitted. Supply it where the\r\nbilling term and the invoiced period differ.",
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "toVersion": {
            "description": "The version being renewed onto, e.g. `v4.0`.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.PauseSubscriptionRequest": {
        "additionalProperties": false,
        "properties": {
          "pauseDurationDays": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.PayArrearsRequest": {
        "additionalProperties": false,
        "description": "Request body for an arrears payment.",
        "properties": {
          "amountMinor": {
            "description": "Amount paid, in minor units. May not exceed the arrears outstanding.",
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "description": "ISO currency code. Must match the plan's.",
            "nullable": true,
            "type": "string"
          },
          "paymentReference": {
            "description": "The reference for the payment already taken on the payment rails.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.PaymentPageScriptChangeRequest": {
        "additionalProperties": false,
        "description": "Body of a status change: the change-management reference that authorises it.",
        "properties": {
          "changeRecord": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.PlaceHoldRequest": {
        "additionalProperties": false,
        "description": "Place a bounded collections hold.",
        "properties": {
          "arrangementNote": {
            "description": "An optional recorded arrangement.",
            "nullable": true,
            "type": "string"
          },
          "currentLadderStage": {
            "description": "The stage the ladder resumes at when the hold lifts.",
            "format": "int32",
            "type": "integer"
          },
          "pausedUntil": {
            "description": "Mandatory expiry. Must be in the future and within the configured maximum.",
            "format": "date-time",
            "type": "string"
          },
          "reason": {
            "description": "Why. Required.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.PluginPurchaseSummaryDto": {
        "additionalProperties": false,
        "description": "Summary DTO for a plugin purchase.",
        "properties": {
          "canceledAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "offeringId": {
            "format": "uuid",
            "type": "string"
          },
          "offeringName": {
            "nullable": true,
            "type": "string"
          },
          "price": {
            "format": "double",
            "type": "number"
          },
          "pricingModel": {
            "nullable": true,
            "type": "string"
          },
          "purchasedAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.PostGroupPremiumAccrualsRequest": {
        "additionalProperties": false,
        "description": "Body of `POST …/accruals`.",
        "properties": {
          "accruals": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.GroupPremium.GroupPremiumAccrualInput"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ProcessPaymentRequest": {
        "additionalProperties": false,
        "properties": {
          "gatewayPaymentId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ProcessSubscriptionPaymentRequest": {
        "additionalProperties": false,
        "description": "Pay-now (spec §6.2). With an InvoiceId the charge is that invoice's balance:\r\nPaymentMethodId is Billing's saved PaymentMethod id and ExpectedAmount\r\nis what the customer was shown (409 if it is no longer the balance). Amount is the\r\nlegacy invoiceless charge; with an invoice it is never charged.",
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "expectedAmount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "invoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "paymentGateway": {
            "nullable": true,
            "type": "string"
          },
          "paymentMethodId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ProposeWriteOffRequest": {
        "additionalProperties": false,
        "description": "Raise a write-off proposal.",
        "properties": {
          "accountKey": {
            "description": "The account, as `org:{guid}` or `user:{guid}`.",
            "nullable": true,
            "type": "string"
          },
          "invoiceIds": {
            "description": "The invoices to dispose of. All must belong to the account and share a currency.",
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "justification": {
            "description": "Supporting narrative. Required.",
            "nullable": true,
            "type": "string"
          },
          "reasonCode": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.WriteOffReasonCode"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ProviderPaymentRequest": {
        "additionalProperties": false,
        "description": "Funds that have reached the provider for a milestone already drawn.",
        "properties": {
          "amountPence": {
            "description": "The positive amount that reached the provider, in pence.",
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ProvisionSeatRequest": {
        "additionalProperties": false,
        "description": "Payload for adding one seat.",
        "properties": {
          "planLabel": {
            "description": "The plan/tier the seat carries.",
            "nullable": true,
            "type": "string"
          },
          "seatRef": {
            "description": "The seat's stable reference.",
            "nullable": true,
            "type": "string"
          },
          "subscriptionRef": {
            "description": "The subscription the seat is billed under.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RaiseCommissionLineQueryRequest": {
        "additionalProperties": false,
        "description": "Body of `POST /api/v1/channel-commissions/{commissionId}/queries`.",
        "properties": {
          "currency": {
            "description": "The line's ISO currency code.",
            "nullable": true,
            "type": "string"
          },
          "expected": {
            "description": "The figure the partner expected, signed, in the line's currency.",
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "note": {
            "description": "Optional, at most 2,000 characters.",
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "description": "One of `rate, base, clawback, seat-change, rebate-band, missing-line, other`.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ReasonOnlyRequest": {
        "additionalProperties": false,
        "description": "A request that carries only a reason.",
        "properties": {
          "reason": {
            "description": "Why. Required.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ReclaimSeatRequest": {
        "additionalProperties": false,
        "description": "Body for `POST /billing/seat-lifecycle/organizations/{id}/reclaim`.",
        "properties": {
          "consentDisposition": {
            "description": "`revoke_all`, `transfer_to_new_holder`, `per_grant` or `undecided`.",
            "nullable": true,
            "type": "string"
          },
          "consentGrantsAffected": {
            "description": "How many outstanding grants the disposition covers, as read from the consent\r\nservice. Null means they could not be read, which blocks an offboard.",
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "handoverManagerRef": {
            "description": "The manager the org-owned work goes to, when the route names one.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "handoverRoute": {
            "description": "`new_holder`, `manager`, `org_vault` or `undecided`.",
            "nullable": true,
            "type": "string"
          },
          "leaverRef": {
            "description": "The departing holder (opaque org-user reference).",
            "format": "uuid",
            "type": "string"
          },
          "planLabel": {
            "description": "The plan/tier the seat carries.",
            "nullable": true,
            "type": "string"
          },
          "scope": {
            "description": "`seat_only` or `reclaim_and_offboard`.",
            "nullable": true,
            "type": "string"
          },
          "seatRef": {
            "description": "The seat reference, when the organisation has one; null lets Billing mint it.",
            "nullable": true,
            "type": "string"
          },
          "subscriptionRef": {
            "description": "The subscription the seat is billed under (audit context).",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RecordAccessToWorkAwardRequest": {
        "additionalProperties": false,
        "description": "An approved award delivered by the Access to Work scheme.",
        "properties": {
          "adjustmentId": {
            "nullable": true,
            "type": "string"
          },
          "approvedAmountMinor": {
            "format": "int64",
            "type": "integer"
          },
          "approvedAt": {
            "description": "ISO-8601. Stored verbatim.",
            "nullable": true,
            "type": "string"
          },
          "awardId": {
            "nullable": true,
            "type": "string"
          },
          "costsEligibleFrom": {
            "description": "ISO-8601 date, or null when the scheme stated no eligibility window.",
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "fundingCategory": {
            "description": "Wire form: `equipment` | `software` | `support-hours` | `travel` |\r\n`workplace-alteration`.",
            "nullable": true,
            "type": "string"
          },
          "schemeReference": {
            "nullable": true,
            "type": "string"
          },
          "withdrawnAt": {
            "description": "ISO-8601, present only when delivering a withdrawal.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RecordCisAnchorRequest": {
        "additionalProperties": false,
        "description": "EPIC 4's anchor reference for a bound payment.",
        "properties": {
          "anchorReference": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RecordCisVerificationRequest": {
        "additionalProperties": false,
        "description": "A CIS status check delivered by the verification service.",
        "properties": {
          "checkedAt": {
            "description": "ISO-8601. Stored verbatim, because the anchored hash is taken over it.",
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "providerReference": {
            "nullable": true,
            "type": "string"
          },
          "ratePercent": {
            "format": "double",
            "type": "number"
          },
          "source": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "description": "Wire form: `gross` | `registered` | `unmatched`.",
            "nullable": true,
            "type": "string"
          },
          "subcontractorId": {
            "nullable": true,
            "type": "string"
          },
          "verificationId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RecordCollectionAttemptRequest": {
        "additionalProperties": false,
        "description": "Request body for recording one collection attempt.",
        "properties": {
          "failureCode": {
            "description": "The scheme's refusal code when it did not. A short code — not a place to describe\r\nthe policyholder's circumstances.",
            "nullable": true,
            "type": "string"
          },
          "paymentReference": {
            "description": "The payment reference when it did.",
            "nullable": true,
            "type": "string"
          },
          "succeeded": {
            "description": "True when the mandate paid.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RecordReimbursementDecisionRequest": {
        "additionalProperties": false,
        "description": "The scheme's ruling on a submitted claim.",
        "properties": {
          "decision": {
            "description": "Wire form: `approve` | `reject`.",
            "nullable": true,
            "type": "string"
          },
          "rejectionReason": {
            "description": "Required when rejecting.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RecordReimbursementDisbursementRequest": {
        "additionalProperties": false,
        "description": "The reference under which the money moved to the employer.",
        "properties": {
          "disbursementRef": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RecordRetainerClearanceRequest": {
        "additionalProperties": false,
        "description": "Body of `POST api/v1/billing/retainer-trust-fundings/{id}/clearance`.",
        "properties": {
          "outcome": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.RetainerTrust.RetainerClearanceOutcome"
          },
          "paymentReference": {
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RefundPaymentRequest": {
        "additionalProperties": false,
        "description": "Request body for a refund operation.",
        "properties": {
          "amount": {
            "description": "Refund amount in the payment's currency; null is a full refund.",
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "businessJustification": {
            "description": "FR-14.015b: the written justification an aged (> 90-day) refund needs; recorded with the\r\nrefund's authorisation chain.",
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "description": "Human-readable reason for the refund.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RefundRetainerTrustFundingRequest": {
        "additionalProperties": false,
        "description": "Body of `POST api/v1/billing/retainer-trust-fundings/{id}/refund`.",
        "properties": {
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RegisterApprovedProviderRequest": {
        "additionalProperties": false,
        "description": "An approved training provider as the register published them.",
        "properties": {
          "name": {
            "nullable": true,
            "type": "string"
          },
          "providerOrganizationId": {
            "format": "uuid",
            "type": "string"
          },
          "registerReference": {
            "nullable": true,
            "type": "string"
          },
          "withdrawnAtIso": {
            "description": "ISO-8601, present only when approval has been withdrawn.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RegisterFundedStandardRequest": {
        "additionalProperties": false,
        "description": "A funded standard as the scheme published it.",
        "properties": {
          "coInvestmentPercent": {
            "format": "int32",
            "type": "integer"
          },
          "fundingBandCapPence": {
            "format": "int64",
            "type": "integer"
          },
          "standardId": {
            "nullable": true,
            "type": "string"
          },
          "title": {
            "nullable": true,
            "type": "string"
          },
          "withdrawnAtIso": {
            "description": "ISO-8601, present only when funding has been withdrawn.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RegisterPartnerMetricRequest": {
        "additionalProperties": false,
        "description": "FR-14.313 — the registration body.",
        "properties": {
          "metricCode": {
            "description": "The code a use will be metered under.",
            "nullable": true,
            "type": "string"
          },
          "offeringId": {
            "description": "The listing the metric belongs to.",
            "format": "uuid",
            "type": "string"
          },
          "partnerId": {
            "description": "The builder. Honoured ONLY for a billing admin acting on a builder's behalf; a partner caller's\r\nown id is resolved from its standing and a mismatch here is refused.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "unit": {
            "description": "What one unit measures — \"tiles\", \"lookups\", \"renders\".",
            "nullable": true,
            "type": "string"
          },
          "unitPriceGbp": {
            "description": "The builder's price for one unit, in GBP.",
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ReleaseCisPaymentRequest": {
        "additionalProperties": false,
        "description": "What the surface sends to release a payment. Mirrors `ReleaseCisPaymentInput` in\r\n`modules/business/src/ui/api/cisPayRunClient.ts`.",
        "properties": {
          "labourPence": {
            "format": "int64",
            "type": "integer"
          },
          "materialsPence": {
            "format": "int64",
            "type": "integer"
          },
          "overrideReason": {
            "description": "Present only when releasing over a stale-but-valid check.",
            "nullable": true,
            "type": "string"
          },
          "payRunId": {
            "nullable": true,
            "type": "string"
          },
          "subcontractorId": {
            "nullable": true,
            "type": "string"
          },
          "vatPence": {
            "format": "int64",
            "type": "integer"
          },
          "verificationId": {
            "description": "The EPIC 53 verification being bound.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ReleaseCoolingOffRefundRequest": {
        "additionalProperties": false,
        "description": "Body of `POST api/v1/billing/cooling-off-settlements/{id}/release`.",
        "properties": {
          "refundReference": {
            "description": "The provider's reference for the money returned to the customer.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ReleaseGrandfatherPriceLockRequest": {
        "additionalProperties": false,
        "description": "Request body for withdrawing a grandfather price lock (#23327).",
        "properties": {
          "reason": {
            "description": "Why the lock is being withdrawn. Required — a price rise with no stated reason is not auditable.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RenewalOutcomeRequest": {
        "additionalProperties": false,
        "description": "EPIC 85's renewal-outcome request body (`HttpBillingSignalAdapter.ExecuteRenewalOutcomeAsync`).",
        "properties": {
          "authorisationReference": {
            "description": "The deal-desk approval of a retention concession, if any.",
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "description": "ISO-4217 currency of Value.",
            "nullable": true,
            "type": "string"
          },
          "outcome": {
            "description": "`Renew`, `Expand`, `Contract` or `Churn`.",
            "nullable": true,
            "type": "string"
          },
          "value": {
            "description": "The annualised value the renewal concluded at.",
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.RequestDeveloperApiPlanUpgradeRequest": {
        "additionalProperties": false,
        "description": "Wire body of `POST /api/v1/subscriptions/developer-api/upgrade-requests`.",
        "properties": {
          "developerId": {
            "format": "uuid",
            "type": "string"
          },
          "keyId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "toTierCode": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ResolveSeatTrueUpHoldRequest": {
        "additionalProperties": false,
        "description": "Body for the hold-resolution route.",
        "properties": {
          "reason": {
            "description": "The resolution reason, recorded on the line.",
            "nullable": true,
            "type": "string"
          },
          "upheld": {
            "description": "Whether the dispute is upheld (the held amount is written off).",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.SaveCisContractorPolicyRequest": {
        "additionalProperties": false,
        "description": "An organisation's CIS settings.",
        "properties": {
          "citbLevyEnabled": {
            "type": "boolean"
          },
          "citbLevyRatePercent": {
            "format": "double",
            "type": "number"
          },
          "deductOnLabourOnly": {
            "type": "boolean"
          },
          "makerCheckerEnabled": {
            "type": "boolean"
          },
          "reverifyAfterDays": {
            "format": "int32",
            "type": "integer"
          },
          "reverseChargeVat": {
            "type": "boolean"
          },
          "staleVerificationPosture": {
            "description": "Wire form: `block` | `warn-and-allow`.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.ScheduleMilestonesRequest": {
        "additionalProperties": false,
        "description": "An apprentice's funding schedule as the scheme or the provider agreement states it.",
        "properties": {
          "allocationId": {
            "description": "The allocation whose committed places fund this apprenticeship.",
            "format": "uuid",
            "type": "string"
          },
          "apprenticeReference": {
            "description": "The opaque reference the employer's surfaces show in place of a name.",
            "nullable": true,
            "type": "string"
          },
          "milestones": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.LevyAccount.ApprenticeshipMilestoneInput"
            },
            "nullable": true,
            "type": "array"
          },
          "standardId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.SeatReclaimPolicyRequest": {
        "additionalProperties": false,
        "description": "Body for the policy route.",
        "properties": {
          "defaultHandoverRoute": {
            "description": "The pre-selected handover route.",
            "nullable": true,
            "type": "string"
          },
          "defaultScope": {
            "description": "`seat_only` or `reclaim_and_offboard`.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.SeatRegistrationEntryRequest": {
        "additionalProperties": false,
        "description": "One seat in an enrolment payload.",
        "properties": {
          "holderRef": {
            "description": "The holder to record, or null to add the seat unheld.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "planLabel": {
            "description": "The plan/tier the seat carries.",
            "nullable": true,
            "type": "string"
          },
          "seatRef": {
            "description": "The seat's stable reference.",
            "nullable": true,
            "type": "string"
          },
          "subscriptionRef": {
            "description": "The subscription the seat is billed under.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.SetOrganizationBillingDetailsRequest": {
        "additionalProperties": false,
        "description": "Body of `PUT api/v1/billing/organization-details`.",
        "properties": {
          "addressLine1": {
            "nullable": true,
            "type": "string"
          },
          "addressLine2": {
            "nullable": true,
            "type": "string"
          },
          "city": {
            "nullable": true,
            "type": "string"
          },
          "countryCode": {
            "description": "ISO-3166 alpha-2, e.g. \"GB\".",
            "nullable": true,
            "type": "string"
          },
          "postalCode": {
            "description": "Optional: not every country has postal codes.",
            "nullable": true,
            "type": "string"
          },
          "stateOrRegion": {
            "nullable": true,
            "type": "string"
          },
          "taxId": {
            "description": "Optional VAT / tax identification number.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.SetPriceBookStateRequest": {
        "additionalProperties": false,
        "properties": {
          "endPilot": {
            "type": "boolean"
          },
          "isAuthority": {
            "nullable": true,
            "type": "boolean"
          },
          "isPublicSectorProvider": {
            "nullable": true,
            "type": "boolean"
          },
          "pilotEndsAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "pilotStartsAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "procurementFrameworkCode": {
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.StartPaymentMethodSetupRequest": {
        "additionalProperties": false,
        "description": "Request body for starting a card-collection flow. Every field is optional —\r\nan empty body collects a personal card on the primary gateway.",
        "properties": {
          "email": {
            "nullable": true,
            "type": "string"
          },
          "gateway": {
            "nullable": true,
            "type": "string"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "onboardingSessionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "paymentMethodTypes": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.StopGroupPremiumAccrualRequest": {
        "additionalProperties": false,
        "description": "Body of `POST …/members/{memberRef}/stop-accrual`.",
        "properties": {
          "effectiveFrom": {
            "description": "`yyyy-MM-dd` — the first day not covered (cover end + 1).",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.SubmitReimbursementClaimRequest": {
        "additionalProperties": false,
        "description": "What the employer console sends to claim reimbursement. Mirrors\r\n`ReimbursementClaimRequest` in\r\n`apps/frontend/web/org-portal/src/features/adjustment-console/types.ts`.",
        "properties": {
          "adjustmentId": {
            "nullable": true,
            "type": "string"
          },
          "claimedAmountMinor": {
            "description": "What the employer actually spent, in minor units. May be under the award.",
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "employerReference": {
            "description": "The employer's own invoice/PO reference, for their reconciliation.",
            "nullable": true,
            "type": "string"
          },
          "incurredOn": {
            "description": "ISO-8601 date the cost was incurred.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.SwitchSubscriptionLicenceRequest": {
        "additionalProperties": false,
        "description": "The body of `POST …/subscriptions/{id}/switch`.",
        "properties": {
          "newPricingPlanId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.TakeOwnershipRequest": {
        "additionalProperties": false,
        "description": "Claim an account onto a named owner.",
        "properties": {
          "ownership": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.CollectionsLadderOwnership"
          },
          "reason": {
            "description": "Why. Required.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.UpdateSubscriptionRequest": {
        "additionalProperties": false,
        "properties": {
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "paymentMethodId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.UpgradeDeveloperApiPlanRequest": {
        "additionalProperties": false,
        "description": "Wire body of `POST /api/v1/subscriptions/developer-api/upgrade`.",
        "properties": {
          "breachedDimension": {
            "nullable": true,
            "type": "string"
          },
          "developerId": {
            "format": "uuid",
            "type": "string"
          },
          "keyId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "toTierCode": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.UpgradeSubscriptionRequest": {
        "additionalProperties": false,
        "properties": {
          "newPricingPlanId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.UpholdCommissionLineQueryRequest": {
        "additionalProperties": false,
        "description": "Body of `POST /api/v1/commission-queries/{id}/uphold`.",
        "properties": {
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Api.Controllers.VoidInvoiceRequest": {
        "additionalProperties": false,
        "description": "Body for M:Essence.Payment.Billing.Api.Controllers.InvoicesController.VoidInvoice(System.Guid,Essence.Payment.Billing.Api.Controllers.VoidInvoiceRequest,System.Threading.CancellationToken). The reason is recorded in the\r\ninvoice metadata and the InvoiceVoidedEvent for audit (debt-2026-06-21-121).",
        "properties": {
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.ChainParticipants.RegisterChainParticipantCommand": {
        "additionalProperties": false,
        "properties": {
          "invoicingPartyName": {
            "nullable": true,
            "type": "string"
          },
          "orgId": {
            "format": "uuid",
            "type": "string"
          },
          "parentParticipantId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "partnerTier": {
            "nullable": true,
            "type": "string"
          },
          "role": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.ChainParticipants.SetChainParticipantCommercialContactCommand": {
        "additionalProperties": false,
        "properties": {
          "clearInvoicingPartyName": {
            "type": "boolean"
          },
          "clearRelationshipManager": {
            "type": "boolean"
          },
          "invoicingPartyName": {
            "nullable": true,
            "type": "string"
          },
          "participantId": {
            "format": "uuid",
            "type": "string"
          },
          "relationshipManagerEmail": {
            "nullable": true,
            "type": "string"
          },
          "relationshipManagerName": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.ConsumerRemedies.ApplyUseWearDeductionCommand": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "appliedByPartyId": {
            "format": "uuid",
            "type": "string"
          },
          "jurisdiction": {
            "nullable": true,
            "type": "string"
          },
          "legalBasis": {
            "nullable": true,
            "type": "string"
          },
          "sellerStatedReason": {
            "nullable": true,
            "type": "string"
          },
          "settlementId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.ConsumerRemedies.ReconcileRemedyOwnershipCommand": {
        "additionalProperties": false,
        "properties": {
          "priorTransferFound": {
            "type": "boolean"
          },
          "rightfulHolderUserId": {
            "format": "uuid",
            "type": "string"
          },
          "settlementId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.ConsumerRemedies.RecordConsumerRemedyCommand": {
        "additionalProperties": false,
        "properties": {
          "claimReference": {
            "nullable": true,
            "type": "string"
          },
          "claimantUserId": {
            "format": "uuid",
            "type": "string"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "originalReceiptReference": {
            "nullable": true,
            "type": "string"
          },
          "remedyAgreedAt": {
            "format": "date-time",
            "type": "string"
          },
          "remedyAmount": {
            "format": "double",
            "type": "number"
          },
          "remedyType": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.ConsumerRemedySettlement.ConsumerRemedyType"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.ConsumerRemedies.ReviewUseWearDeductionCommand": {
        "additionalProperties": false,
        "properties": {
          "accept": {
            "type": "boolean"
          },
          "disputeReason": {
            "nullable": true,
            "type": "string"
          },
          "settlementId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Enterprise.ActivateEnterpriseContractCommand": {
        "additionalProperties": false,
        "properties": {
          "contractId": {
            "format": "uuid",
            "type": "string"
          },
          "secondApproverId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Enterprise.AdvanceEnterpriseDunningCommand": {
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "contractId": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceDueDate": {
            "format": "date-time",
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Enterprise.AmendEnterpriseContractCommand": {
        "additionalProperties": false,
        "properties": {
          "additionalCommitment": {
            "format": "double",
            "type": "number"
          },
          "additionalSeats": {
            "format": "int32",
            "type": "integer"
          },
          "contractId": {
            "format": "uuid",
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "effectiveDate": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Enterprise.CreateEnterpriseContractCommand": {
        "additionalProperties": false,
        "properties": {
          "autoRenew": {
            "type": "boolean"
          },
          "committedSeats": {
            "format": "int32",
            "type": "integer"
          },
          "contractEnd": {
            "format": "date-time",
            "type": "string"
          },
          "contractStart": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "customPrice": {
            "format": "double",
            "type": "number"
          },
          "invoiceCadence": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "originatedBy": {
            "format": "uuid",
            "type": "string"
          },
          "overageSeatRate": {
            "format": "double",
            "type": "number"
          },
          "paymentTermsDays": {
            "format": "int32",
            "type": "integer"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Family.AcceptFamilyInviteCommand": {
        "additionalProperties": false,
        "properties": {
          "memberId": {
            "format": "uuid",
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Family.InviteFamilyMemberCommand": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Family.OpenFamilyRosterCommand": {
        "additionalProperties": false,
        "properties": {
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.GroupPremium.GroupPremiumAccrualInput": {
        "additionalProperties": false,
        "properties": {
          "basis": {
            "nullable": true,
            "type": "string"
          },
          "coveredDays": {
            "format": "int32",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "grossMinor": {
            "format": "int64",
            "type": "integer"
          },
          "memberRef": {
            "nullable": true,
            "type": "string"
          },
          "periodFrom": {
            "nullable": true,
            "type": "string"
          },
          "periodTo": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Invoices.CreateInvoiceCommand": {
        "additionalProperties": false,
        "properties": {
          "dueDate": {
            "format": "date-time",
            "type": "string"
          },
          "lineItems": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Invoices.CreateInvoiceLineItemDto"
            },
            "nullable": true,
            "type": "array"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "type": {
            "nullable": true,
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Invoices.CreateInvoiceLineItemDto": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "nullable": true,
            "type": "string"
          },
          "periodEnd": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "quantity": {
            "format": "double",
            "type": "number"
          },
          "taxInclusive": {
            "type": "boolean"
          },
          "taxRate": {
            "format": "double",
            "type": "number"
          },
          "unitPrice": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Invoices.GenerateUsageInvoiceCommand": {
        "additionalProperties": false,
        "properties": {
          "dueDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "includeOverageCharges": {
            "type": "boolean"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "taxRate": {
            "format": "double",
            "type": "number"
          },
          "useConsolidatedLineItems": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.LevyAccount.ApprenticeshipMilestoneInput": {
        "additionalProperties": false,
        "properties": {
          "isCompletionPayment": {
            "type": "boolean"
          },
          "milestoneCode": {
            "nullable": true,
            "type": "string"
          },
          "milestoneTitle": {
            "nullable": true,
            "type": "string"
          },
          "plannedPence": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.LevyAccount.ApprovedProviderDto": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "registerReference": {
            "nullable": true,
            "type": "string"
          },
          "withdrawnAtIso": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.LevyAccount.FundedStandardDto": {
        "additionalProperties": false,
        "properties": {
          "coInvestmentPercent": {
            "format": "int32",
            "type": "integer"
          },
          "fundingBandCapPence": {
            "format": "int64",
            "type": "integer"
          },
          "standardId": {
            "nullable": true,
            "type": "string"
          },
          "title": {
            "nullable": true,
            "type": "string"
          },
          "withdrawnAtIso": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Marketplace.CloudMarketplaceSettlementImportDto": {
        "additionalProperties": false,
        "properties": {
          "exceptionCount": {
            "format": "int32",
            "type": "integer"
          },
          "importId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "lineCount": {
            "format": "int32",
            "type": "integer"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.CloudMarketplaceSettlementLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "marketplaceCode": {
            "nullable": true,
            "type": "string"
          },
          "matchedCount": {
            "format": "int32",
            "type": "integer"
          },
          "openExceptionCount": {
            "format": "int32",
            "type": "integer"
          },
          "outcome": {
            "nullable": true,
            "type": "string"
          },
          "reportReference": {
            "nullable": true,
            "type": "string"
          },
          "totals": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.CloudMarketplaceSettlementTotalDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Marketplace.CloudMarketplaceSettlementLineDto": {
        "additionalProperties": false,
        "properties": {
          "adjustmentAmount": {
            "format": "double",
            "type": "number"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "distributorMarginAmount": {
            "format": "double",
            "type": "number"
          },
          "distributorMarginPercent": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "exceptionCode": {
            "nullable": true,
            "type": "string"
          },
          "exceptionDetail": {
            "nullable": true,
            "type": "string"
          },
          "exceptionOwner": {
            "nullable": true,
            "type": "string"
          },
          "grossAmount": {
            "format": "double",
            "type": "number"
          },
          "isOpen": {
            "type": "boolean"
          },
          "lineId": {
            "format": "uuid",
            "type": "string"
          },
          "marketplaceLineReference": {
            "nullable": true,
            "type": "string"
          },
          "marketplaceSubscriptionId": {
            "nullable": true,
            "type": "string"
          },
          "netAmount": {
            "format": "double",
            "type": "number"
          },
          "periodEndUtc": {
            "format": "date-time",
            "type": "string"
          },
          "periodStartUtc": {
            "format": "date-time",
            "type": "string"
          },
          "position": {
            "format": "int32",
            "type": "integer"
          },
          "reportedUsageQuantity": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "resolution": {
            "nullable": true,
            "type": "string"
          },
          "resolvedAtUtc": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "retiedSubscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "trail": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.CloudMarketplaceSettlementTrailEntryDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Marketplace.CloudMarketplaceSettlementTotalDto": {
        "additionalProperties": false,
        "properties": {
          "adjustmentAmount": {
            "format": "double",
            "type": "number"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "distributorMarginAmount": {
            "format": "double",
            "type": "number"
          },
          "grossAmount": {
            "format": "double",
            "type": "number"
          },
          "netAmount": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Marketplace.CloudMarketplaceSettlementTrailEntryDto": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "nullable": true,
            "type": "string"
          },
          "actor": {
            "nullable": true,
            "type": "string"
          },
          "owner": {
            "nullable": true,
            "type": "string"
          },
          "previousOwner": {
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "recordedAtUtc": {
            "format": "date-time",
            "type": "string"
          },
          "sequence": {
            "format": "int32",
            "type": "integer"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Marketplace.MarketplaceActivationResultDto": {
        "additionalProperties": false,
        "properties": {
          "marketplaceActivated": {
            "type": "boolean"
          },
          "marketplaceCode": {
            "nullable": true,
            "type": "string"
          },
          "marketplaceFailureCode": {
            "nullable": true,
            "type": "string"
          },
          "marketplaceSubscriptionId": {
            "nullable": true,
            "type": "string"
          },
          "replayed": {
            "type": "boolean"
          },
          "subscription": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Marketplace.MarketplaceLifecycleResultDto": {
        "additionalProperties": false,
        "properties": {
          "change": {
            "nullable": true,
            "type": "string"
          },
          "eventId": {
            "nullable": true,
            "type": "string"
          },
          "outcome": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderPayoutStatusDto": {
        "additionalProperties": false,
        "properties": {
          "clawedBackGbp": {
            "format": "double",
            "type": "number"
          },
          "paidGbp": {
            "format": "double",
            "type": "number"
          },
          "pendingGbp": {
            "format": "double",
            "type": "number"
          },
          "refundedGbp": {
            "format": "double",
            "type": "number"
          },
          "reversedGbp": {
            "format": "double",
            "type": "number"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "voidedGbp": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderStatementDto": {
        "additionalProperties": false,
        "properties": {
          "exchangeTakePercent": {
            "format": "double",
            "type": "number"
          },
          "offerings": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderStatementOfferingDto"
            },
            "nullable": true,
            "type": "array"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "period": {
            "nullable": true,
            "type": "string"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderStatementMoneyDto"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderStatementMetricDto": {
        "additionalProperties": false,
        "properties": {
          "metricCode": {
            "nullable": true,
            "type": "string"
          },
          "money": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderStatementMoneyDto"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "unit": {
            "nullable": true,
            "type": "string"
          },
          "unitPriceGbp": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "unitsUsed": {
            "format": "double",
            "type": "number"
          },
          "uses": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderStatementMoneyDto": {
        "additionalProperties": false,
        "properties": {
          "payout": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderPayoutStatusDto"
          },
          "ratedGbp": {
            "format": "double",
            "type": "number"
          },
          "ratedLines": {
            "format": "int32",
            "type": "integer"
          },
          "shareGbp": {
            "format": "double",
            "type": "number"
          },
          "takeGbp": {
            "format": "double",
            "type": "number"
          },
          "unitsRated": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderStatementOfferingDto": {
        "additionalProperties": false,
        "properties": {
          "metrics": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderStatementMetricDto"
            },
            "nullable": true,
            "type": "array"
          },
          "offeringId": {
            "format": "uuid",
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderStatementMoneyDto"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto": {
        "additionalProperties": false,
        "properties": {
          "exchangeTakePercent": {
            "format": "double",
            "type": "number"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "metricCode": {
            "nullable": true,
            "type": "string"
          },
          "offeringId": {
            "format": "uuid",
            "type": "string"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "unit": {
            "nullable": true,
            "type": "string"
          },
          "unitPriceGbp": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Payments.CreatePaymentCommand": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "invoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "paymentGateway": {
            "nullable": true,
            "type": "string"
          },
          "paymentMethod": {
            "nullable": true,
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Payments.CreatePaymentIntentCommand": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "captureImmediately": {
            "type": "boolean"
          },
          "confirmImmediately": {
            "type": "boolean"
          },
          "customerId": {
            "nullable": true,
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "paymentGateway": {
            "nullable": true,
            "type": "string"
          },
          "paymentMethodId": {
            "nullable": true,
            "type": "string"
          },
          "require3DSecure": {
            "type": "boolean"
          },
          "returnUrl": {
            "nullable": true,
            "type": "string"
          },
          "statementDescriptor": {
            "nullable": true,
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Payouts.CreatePayoutCommand": {
        "additionalProperties": false,
        "properties": {
          "commissionRate": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "totalRevenue": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Payouts.ProcessPayoutCommand": {
        "additionalProperties": false,
        "properties": {
          "payoutId": {
            "format": "uuid",
            "type": "string"
          },
          "transactionId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Payouts.RecordPayoutDisbursementFailureCommand": {
        "additionalProperties": false,
        "properties": {
          "failureReason": {
            "nullable": true,
            "type": "string"
          },
          "payoutId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Payouts.ReissuePayoutManuallyCommand": {
        "additionalProperties": false,
        "properties": {
          "manualReference": {
            "nullable": true,
            "type": "string"
          },
          "payoutId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.PremiumFinance.ScheduledInstalmentInput": {
        "additionalProperties": false,
        "properties": {
          "amountMinor": {
            "format": "int64",
            "type": "integer"
          },
          "dueOn": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.PriceBook.OrganizationPriceBookStateDto": {
        "additionalProperties": false,
        "properties": {
          "isAuthority": {
            "type": "boolean"
          },
          "isPublicSectorProvider": {
            "type": "boolean"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "pilotActive": {
            "type": "boolean"
          },
          "pilotEndsAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "pilotStartsAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "procurementFrameworkCode": {
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "setAt": {
            "format": "date-time",
            "type": "string"
          },
          "setBy": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.PricingPlans.CreatePricingPlanCommand": {
        "additionalProperties": false,
        "properties": {
          "basePrice": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "billingPeriod": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.BillingPeriodDto"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "features": {
            "additionalProperties": {},
            "nullable": true,
            "type": "object"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "tier": {
            "nullable": true,
            "type": "string"
          },
          "trialDays": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.PricingPlans.UpdatePricingPlanCommand": {
        "additionalProperties": false,
        "properties": {
          "basePrice": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "boundOrganizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "features": {
            "additionalProperties": {},
            "nullable": true,
            "type": "object"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "isPubliclyListed": {
            "nullable": true,
            "type": "boolean"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "releaseOrganizationBinding": {
            "type": "boolean"
          },
          "skuCodes": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "trialDays": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.RenewalOutcomes.RenewalOutcomeResponse": {
        "additionalProperties": false,
        "properties": {
          "executed": {
            "type": "boolean"
          },
          "executionReference": {
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.RetainerTrust.RetainerClearanceOutcome": {
        "enum": [
          0,
          1,
          2
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Application.Commands.Skus.CreateSkuCommand": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "nullable": true,
            "type": "string"
          },
          "entitlements": {
            "additionalProperties": {
              "format": "int32",
              "nullable": true,
              "type": "integer"
            },
            "nullable": true,
            "type": "object"
          },
          "family": {
            "nullable": true,
            "type": "string"
          },
          "listPrice": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "prerequisites": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Skus.ImportSkuRegistryCommand": {
        "additionalProperties": false,
        "properties": {
          "skus": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Skus.SkuRegistryItem"
            },
            "nullable": true,
            "type": "array"
          },
          "sourceRef": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Skus.SkuRegistryImportResult": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "format": "int32",
            "type": "integer"
          },
          "deprecated": {
            "format": "int32",
            "type": "integer"
          },
          "errors": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "grantsAdded": {
            "format": "int32",
            "type": "integer"
          },
          "grantsRemoved": {
            "format": "int32",
            "type": "integer"
          },
          "metricCodesAdded": {
            "format": "int32",
            "type": "integer"
          },
          "skipped": {
            "format": "int32",
            "type": "integer"
          },
          "unchanged": {
            "format": "int32",
            "type": "integer"
          },
          "withdrawn": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Skus.SkuRegistryItem": {
        "additionalProperties": false,
        "properties": {
          "aliasOf": {
            "nullable": true,
            "type": "string"
          },
          "code": {
            "nullable": true,
            "type": "string"
          },
          "displayName": {
            "nullable": true,
            "type": "string"
          },
          "disposition": {
            "nullable": true,
            "type": "string"
          },
          "entitlements": {
            "additionalProperties": {
              "format": "int32",
              "type": "integer"
            },
            "nullable": true,
            "type": "object"
          },
          "family": {
            "nullable": true,
            "type": "string"
          },
          "includesUsers": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "licenceTier": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "maxPerOwner": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "metricCodes": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "minimumInstanceTier": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "minimumTermMonths": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "prerequisites": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "price": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "priceUnitSize": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "ratifiedBy": {
            "nullable": true,
            "type": "string"
          },
          "requiresInstanceTierAtLeast": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "requiresPartnerStanding": {
            "nullable": true,
            "type": "boolean"
          },
          "subname": {
            "nullable": true,
            "type": "string"
          },
          "successor": {
            "nullable": true,
            "type": "string"
          },
          "who": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Skus.TransitionSkuStatusCommand": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "nullable": true,
            "type": "string"
          },
          "successorSkuCode": {
            "nullable": true,
            "type": "string"
          },
          "targetStatus": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.SponsoredBilling.ConvertSponsoredEntitlementToSelfPayCommand": {
        "additionalProperties": false,
        "properties": {
          "paymentMethodId": {
            "nullable": true,
            "type": "string"
          },
          "sponsoredEntitlementId": {
            "format": "uuid",
            "type": "string"
          },
          "targetPricingPlanId": {
            "format": "uuid",
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Sponsorships.AudienceSelectorRequest": {
        "additionalProperties": false,
        "properties": {
          "autoEnrol": {
            "type": "boolean"
          },
          "csvRef": {
            "nullable": true,
            "type": "string"
          },
          "segmentIds": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "type": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Sponsorships.CancelSponsorshipCommand": {
        "additionalProperties": false,
        "properties": {
          "attestationAccepted": {
            "type": "boolean"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Sponsorships.CreateSponsorshipCommand": {
        "additionalProperties": false,
        "properties": {
          "audience": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.AudienceSelectorRequest"
          },
          "budgetCapMinor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "expiresAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "lawfulBasis": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.LawfulBasisAttestationRequest"
          },
          "moduleId": {
            "nullable": true,
            "type": "string"
          },
          "moduleName": {
            "nullable": true,
            "type": "string"
          },
          "recipientResolution": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.RecipientResolutionSummaryRequest"
          },
          "sponsorDisplayName": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Sponsorships.DispatchRecipientRequest": {
        "additionalProperties": false,
        "properties": {
          "contactHash": {
            "nullable": true,
            "type": "string"
          },
          "destinationEmail": {
            "nullable": true,
            "type": "string"
          },
          "destinationPhone": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Sponsorships.DispatchSponsorshipInvitesCommand": {
        "additionalProperties": false,
        "properties": {
          "recipients": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.DispatchRecipientRequest"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Sponsorships.LawfulBasisAttestationRequest": {
        "additionalProperties": false,
        "properties": {
          "attested": {
            "type": "boolean"
          },
          "authoriser": {
            "nullable": true,
            "type": "string"
          },
          "basis": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Sponsorships.RecipientResolutionSummaryRequest": {
        "additionalProperties": false,
        "properties": {
          "csvRef": {
            "nullable": true,
            "type": "string"
          },
          "dispatchable": {
            "format": "int32",
            "type": "integer"
          },
          "duplicates": {
            "format": "int32",
            "type": "integer"
          },
          "existingUsers": {
            "format": "int32",
            "type": "integer"
          },
          "invalid": {
            "format": "int32",
            "type": "integer"
          },
          "newContacts": {
            "format": "int32",
            "type": "integer"
          },
          "suppressed": {
            "format": "int32",
            "type": "integer"
          },
          "totalRows": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Sponsorships.UpdateSponsorshipAudienceCommand": {
        "additionalProperties": false,
        "properties": {
          "autoEnrol": {
            "type": "boolean"
          },
          "csvRef": {
            "nullable": true,
            "type": "string"
          },
          "recipientResolution": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.RecipientResolutionSummaryRequest"
          },
          "segmentIds": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "type": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Subscriptions.ChannelRouteDto": {
        "additionalProperties": false,
        "properties": {
          "channelPartnerId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "dealRegistrationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "hostingSovereignInstanceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "operatorOrganizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "route": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Subscriptions.CreateSubscriptionCommand": {
        "additionalProperties": false,
        "properties": {
          "channelRoute": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Subscriptions.ChannelRouteDto"
          },
          "collectionMethod": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Subscription.CollectionMethod"
          },
          "confirmedPrice": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CheckoutPriceDto"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "dealAuthorisationReference": {
            "nullable": true,
            "type": "string"
          },
          "isBaseSubscription": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Subscriptions.CreateSubscriptionItemDto"
            },
            "nullable": true,
            "type": "array"
          },
          "licensedSeats": {
            "format": "int32",
            "type": "integer"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "offeredPrice": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CheckoutPriceDto"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "overrideTrialDays": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "pricingPlanId": {
            "format": "uuid",
            "type": "string"
          },
          "providerInstancePrice": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Subscriptions.ProviderInstancePriceDto"
          },
          "reEngagementTouchId": {
            "nullable": true,
            "type": "string"
          },
          "skuCode": {
            "nullable": true,
            "type": "string"
          },
          "startDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "subscriptionClass": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Subscription.SubscriptionClass"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Subscriptions.CreateSubscriptionItemDto": {
        "additionalProperties": false,
        "properties": {
          "pricingPlanId": {
            "format": "uuid",
            "type": "string"
          },
          "quantity": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Subscriptions.ProviderInstancePriceDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "hostingOfferId": {
            "format": "uuid",
            "type": "string"
          },
          "priceSource": {
            "nullable": true,
            "type": "string"
          },
          "resolvedAtUtc": {
            "format": "date-time",
            "type": "string"
          },
          "sovereignInstanceId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Usage.CreateUsageRecordCommand": {
        "additionalProperties": false,
        "properties": {
          "actionDigest": {
            "nullable": true,
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {},
            "nullable": true,
            "type": "object"
          },
          "metricName": {
            "nullable": true,
            "type": "string"
          },
          "metricValue": {
            "format": "double",
            "type": "number"
          },
          "quotaReservationKey": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "timestamp": {
            "format": "date-time",
            "type": "string"
          },
          "unit": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Commands.Usage.QuotaReservationReleaseResponseDto": {
        "additionalProperties": false,
        "properties": {
          "idempotencyKey": {
            "nullable": true,
            "type": "string"
          },
          "outcome": {
            "nullable": true,
            "type": "string"
          },
          "released": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.AccessToWorkAwardDto": {
        "additionalProperties": false,
        "properties": {
          "adjustmentId": {
            "nullable": true,
            "type": "string"
          },
          "approvedAmountMinor": {
            "format": "int64",
            "type": "integer"
          },
          "approvedAt": {
            "nullable": true,
            "type": "string"
          },
          "awardId": {
            "nullable": true,
            "type": "string"
          },
          "costsEligibleFrom": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "fundingCategory": {
            "nullable": true,
            "type": "string"
          },
          "schemeReference": {
            "nullable": true,
            "type": "string"
          },
          "withdrawnAt": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.AccountCollectionsStateDto": {
        "additionalProperties": false,
        "properties": {
          "accountId": {
            "format": "uuid",
            "type": "string"
          },
          "accountKey": {
            "nullable": true,
            "type": "string"
          },
          "accountKind": {
            "nullable": true,
            "type": "string"
          },
          "arrangementNote": {
            "nullable": true,
            "type": "string"
          },
          "automationPausedUntil": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "automationSuppressed": {
            "type": "boolean"
          },
          "holdCount": {
            "format": "int32",
            "type": "integer"
          },
          "holdPlacedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "holdPlacedByRef": {
            "nullable": true,
            "type": "string"
          },
          "holdReason": {
            "nullable": true,
            "type": "string"
          },
          "ladderStageAtHold": {
            "format": "int32",
            "type": "integer"
          },
          "ownerRef": {
            "nullable": true,
            "type": "string"
          },
          "ownership": {
            "nullable": true,
            "type": "string"
          },
          "ownershipReason": {
            "nullable": true,
            "type": "string"
          },
          "ownershipTakenAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "suppressionReason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ActivationAttributionByTouchDto": {
        "additionalProperties": false,
        "properties": {
          "attributedActivationCount": {
            "format": "int32",
            "type": "integer"
          },
          "firstActivationAt": {
            "format": "date-time",
            "type": "string"
          },
          "lastActivationAt": {
            "format": "date-time",
            "type": "string"
          },
          "reEngagementTouchId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ActivationAttributionLinkageDto": {
        "additionalProperties": false,
        "properties": {
          "activatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "eventPairEmitted": {
            "type": "boolean"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "plan": {
            "nullable": true,
            "type": "string"
          },
          "reEngagementTouchId": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "tier": {
            "nullable": true,
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ActivationAttributionReportDto": {
        "additionalProperties": false,
        "properties": {
          "byTouch": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ActivationAttributionByTouchDto"
            },
            "nullable": true,
            "type": "array"
          },
          "distinctTouches": {
            "format": "int32",
            "type": "integer"
          },
          "linkages": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ActivationAttributionLinkageDto"
            },
            "nullable": true,
            "type": "array"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "totalAttributedActivations": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ApprovedDealTermsDto": {
        "additionalProperties": false,
        "properties": {
          "accountId": {
            "format": "uuid",
            "type": "string"
          },
          "appliedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "appliedToSubscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "approvalLevel": {
            "nullable": true,
            "type": "string"
          },
          "approvedAt": {
            "format": "date-time",
            "type": "string"
          },
          "approvedBy": {
            "nullable": true,
            "type": "string"
          },
          "approvedCurrencyCode": {
            "nullable": true,
            "type": "string"
          },
          "approvedValue": {
            "format": "double",
            "type": "number"
          },
          "authorisationReference": {
            "nullable": true,
            "type": "string"
          },
          "caseId": {
            "format": "uuid",
            "type": "string"
          },
          "isApplied": {
            "type": "boolean"
          },
          "opportunityId": {
            "format": "uuid",
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "requestedBy": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ArrearsEpisodeDto": {
        "additionalProperties": false,
        "properties": {
          "closedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "closureReason": {
            "nullable": true,
            "type": "string"
          },
          "episodeNumber": {
            "format": "int32",
            "type": "integer"
          },
          "isOpen": {
            "type": "boolean"
          },
          "openedAt": {
            "format": "date-time",
            "type": "string"
          },
          "openedByInstalmentSequence": {
            "format": "int32",
            "type": "integer"
          },
          "openingArrearsMinor": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ArrearsPaymentDto": {
        "additionalProperties": false,
        "properties": {
          "amountMinor": {
            "format": "int64",
            "type": "integer"
          },
          "arrearsCleared": {
            "type": "boolean"
          },
          "outstandingAfterMinor": {
            "format": "int64",
            "type": "integer"
          },
          "paidAt": {
            "format": "date-time",
            "type": "string"
          },
          "paymentReference": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ArrearsPaymentResultDto": {
        "additionalProperties": false,
        "properties": {
          "accepted": {
            "type": "boolean"
          },
          "arrearsCleared": {
            "type": "boolean"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "outstandingArrearsMinor": {
            "format": "int64",
            "type": "integer"
          },
          "paymentReference": {
            "nullable": true,
            "type": "string"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.AttributedActorDto": {
        "additionalProperties": false,
        "properties": {
          "actorLabel": {
            "nullable": true,
            "type": "string"
          },
          "role": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.AudienceSelectorDto": {
        "additionalProperties": false,
        "properties": {
          "autoEnrol": {
            "type": "boolean"
          },
          "csvRef": {
            "nullable": true,
            "type": "string"
          },
          "estimatedReach": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.ValueObjects.KAnonCount"
          },
          "segmentIds": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "type": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.BillingActualsDto": {
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "contractVersion": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "freshnessBudgetHours": {
            "format": "int32",
            "type": "integer"
          },
          "isStale": {
            "type": "boolean"
          },
          "lastActualAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "paidInvoiceCount": {
            "format": "int32",
            "type": "integer"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "realisedSubtotal": {
            "format": "double",
            "type": "number"
          },
          "realisedTax": {
            "format": "double",
            "type": "number"
          },
          "realisedTotal": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.BillingDegradationNoticeDto": {
        "additionalProperties": false,
        "properties": {
          "billedThroughDisplayName": {
            "nullable": true,
            "type": "string"
          },
          "cause": {
            "nullable": true,
            "type": "string"
          },
          "consequenceAtUtc": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "message": {
            "nullable": true,
            "type": "string"
          },
          "noticeKind": {
            "nullable": true,
            "type": "string"
          },
          "payerActionRequired": {
            "type": "boolean"
          },
          "readOnlyFromUtc": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "readOnlySinceUtc": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "reinstatementByUtc": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "state": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.BillingPeriodDto": {
        "additionalProperties": false,
        "properties": {
          "interval": {
            "nullable": true,
            "type": "string"
          },
          "intervalCount": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.BulkSeatReclaimOutcomeDto": {
        "additionalProperties": false,
        "properties": {
          "failureReason": {
            "nullable": true,
            "type": "string"
          },
          "leaverRef": {
            "format": "uuid",
            "type": "string"
          },
          "seatReassignmentId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "succeeded": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CancellationPreviewDto": {
        "additionalProperties": false,
        "properties": {
          "affectedReach": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.ValueObjects.KAnonCount"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "invoiceLines": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ProRataInvoiceLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "nextInvoiceAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "proRataChargeMinor": {
            "format": "int64",
            "type": "integer"
          },
          "proRataCreditMinor": {
            "format": "int64",
            "type": "integer"
          },
          "requiresAttestation": {
            "type": "boolean"
          },
          "sponsorshipId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ChainParticipantDto": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invoicingPartyName": {
            "nullable": true,
            "type": "string"
          },
          "orgId": {
            "format": "uuid",
            "type": "string"
          },
          "parentParticipantId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "partnerTier": {
            "nullable": true,
            "type": "string"
          },
          "relationshipManagerEmail": {
            "nullable": true,
            "type": "string"
          },
          "relationshipManagerName": {
            "nullable": true,
            "type": "string"
          },
          "role": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ChannelCommissionDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "calculatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "dealId": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "isClawback": {
            "type": "boolean"
          },
          "model": {
            "nullable": true,
            "type": "string"
          },
          "paidAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "partnerId": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ChannelCommissionStatementDto": {
        "additionalProperties": false,
        "properties": {
          "commissions": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelCommissionDto"
            },
            "nullable": true,
            "type": "array"
          },
          "partnerId": {
            "nullable": true,
            "type": "string"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "totalPaid": {
            "format": "double",
            "type": "number"
          },
          "totalPending": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ChannelOrderDto": {
        "additionalProperties": false,
        "properties": {
          "attributionChain": {
            "nullable": true,
            "type": "string"
          },
          "buyPrice": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "commercialModel": {
            "nullable": true,
            "type": "string"
          },
          "commissionRate": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "customerOrgId": {
            "nullable": true,
            "type": "string"
          },
          "dealId": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "orderValue": {
            "format": "double",
            "type": "number"
          },
          "partnerId": {
            "nullable": true,
            "type": "string"
          },
          "referralFee": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ChannelPartnerRevenueDto": {
        "additionalProperties": false,
        "properties": {
          "commission": {
            "format": "double",
            "type": "number"
          },
          "orderCount": {
            "format": "int32",
            "type": "integer"
          },
          "partnerId": {
            "nullable": true,
            "type": "string"
          },
          "partnerName": {
            "nullable": true,
            "type": "string"
          },
          "revenue": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ChannelReportDto": {
        "additionalProperties": false,
        "properties": {
          "byPartner": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelPartnerRevenueDto"
            },
            "nullable": true,
            "type": "array"
          },
          "totalChannelCommissions": {
            "format": "double",
            "type": "number"
          },
          "totalChannelPayouts": {
            "format": "double",
            "type": "number"
          },
          "totalChannelRevenue": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ChannelTrueUpLineDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "commissionId": {
            "format": "uuid",
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "dealId": {
            "nullable": true,
            "type": "string"
          },
          "earnedAt": {
            "format": "date-time",
            "type": "string"
          },
          "kind": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ChannelTrueUpOrderDto": {
        "additionalProperties": false,
        "properties": {
          "acknowledgedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "actualValue": {
            "format": "double",
            "type": "number"
          },
          "adjustmentAmount": {
            "format": "double",
            "type": "number"
          },
          "adjustmentInvoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "channelOrderId": {
            "format": "uuid",
            "type": "string"
          },
          "dealId": {
            "nullable": true,
            "type": "string"
          },
          "orderedValue": {
            "format": "double",
            "type": "number"
          },
          "reconciledAt": {
            "format": "date-time",
            "type": "string"
          },
          "trueUpId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ChannelTrueUpPeriodDto": {
        "additionalProperties": false,
        "properties": {
          "lines": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelTrueUpLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "orders": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelTrueUpOrderDto"
            },
            "nullable": true,
            "type": "array"
          },
          "period": {
            "nullable": true,
            "type": "string"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "totals": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelTrueUpTotalDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ChannelTrueUpTotalDto": {
        "additionalProperties": false,
        "properties": {
          "accrued": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "delta": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "trueUpAdjustment": {
            "format": "double",
            "type": "number"
          },
          "truedUp": {
            "format": "double",
            "nullable": true,
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CheckoutPriceDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CheckoutPriceQuoteDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "offeredAmount": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "offeredCurrency": {
            "nullable": true,
            "type": "string"
          },
          "priceChanged": {
            "type": "boolean"
          },
          "purchasable": {
            "type": "boolean"
          },
          "requiresConfirmation": {
            "type": "boolean"
          },
          "skuCode": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "unavailableReason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ChurnReportDto": {
        "additionalProperties": false,
        "properties": {
          "churnRate": {
            "format": "double",
            "type": "number"
          },
          "involuntaryChurn": {
            "format": "int32",
            "type": "integer"
          },
          "netChurn": {
            "format": "int32",
            "type": "integer"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "voluntaryChurn": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CisContractorPolicyDto": {
        "additionalProperties": false,
        "properties": {
          "citbLevyEnabled": {
            "type": "boolean"
          },
          "citbLevyRatePercent": {
            "format": "double",
            "type": "number"
          },
          "deductOnLabourOnly": {
            "type": "boolean"
          },
          "isStatutoryDefault": {
            "type": "boolean"
          },
          "makerCheckerEnabled": {
            "type": "boolean"
          },
          "organizationId": {
            "nullable": true,
            "type": "string"
          },
          "reverifyAfterDays": {
            "format": "int32",
            "type": "integer"
          },
          "reverseChargeVat": {
            "type": "boolean"
          },
          "staleVerificationPosture": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CisDeductionBreakdownDto": {
        "additionalProperties": false,
        "properties": {
          "citbLevyPence": {
            "format": "int64",
            "type": "integer"
          },
          "deductionBasePence": {
            "format": "int64",
            "type": "integer"
          },
          "deductionPence": {
            "format": "int64",
            "type": "integer"
          },
          "grossPence": {
            "format": "int64",
            "type": "integer"
          },
          "labourPence": {
            "format": "int64",
            "type": "integer"
          },
          "materialsPence": {
            "format": "int64",
            "type": "integer"
          },
          "netPence": {
            "format": "int64",
            "type": "integer"
          },
          "ratePercent": {
            "format": "double",
            "type": "number"
          },
          "reverseChargeApplied": {
            "type": "boolean"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "vatPence": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CisDeductionStatementDto": {
        "additionalProperties": false,
        "properties": {
          "breakdown": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDeductionBreakdownDto"
          },
          "contentHash": {
            "nullable": true,
            "type": "string"
          },
          "contractorName": {
            "nullable": true,
            "type": "string"
          },
          "contractorOrganizationId": {
            "nullable": true,
            "type": "string"
          },
          "dueBy": {
            "nullable": true,
            "type": "string"
          },
          "issuedAt": {
            "nullable": true,
            "type": "string"
          },
          "paymentDate": {
            "nullable": true,
            "type": "string"
          },
          "paymentId": {
            "nullable": true,
            "type": "string"
          },
          "statementId": {
            "nullable": true,
            "type": "string"
          },
          "subcontractorId": {
            "nullable": true,
            "type": "string"
          },
          "subcontractorName": {
            "nullable": true,
            "type": "string"
          },
          "taxMonthEnding": {
            "nullable": true,
            "type": "string"
          },
          "verification": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisVerificationBindingDto"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CisDisbursementDto": {
        "additionalProperties": false,
        "properties": {
          "anchorReference": {
            "nullable": true,
            "type": "string"
          },
          "binding": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisVerificationBindingDto"
          },
          "deductionPence": {
            "format": "int64",
            "type": "integer"
          },
          "netPence": {
            "format": "int64",
            "type": "integer"
          },
          "paidAt": {
            "nullable": true,
            "type": "string"
          },
          "payRunId": {
            "nullable": true,
            "type": "string"
          },
          "paymentId": {
            "nullable": true,
            "type": "string"
          },
          "statement": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDeductionStatementDto"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CisFreshnessOverrideDto": {
        "additionalProperties": false,
        "properties": {
          "ageDays": {
            "format": "double",
            "type": "number"
          },
          "overriddenAt": {
            "nullable": true,
            "type": "string"
          },
          "overriddenBy": {
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CisVerificationBindingDto": {
        "additionalProperties": false,
        "properties": {
          "boundAt": {
            "nullable": true,
            "type": "string"
          },
          "canonicalForm": {
            "nullable": true,
            "type": "string"
          },
          "checkedAt": {
            "nullable": true,
            "type": "string"
          },
          "contentHash": {
            "nullable": true,
            "type": "string"
          },
          "contractVersion": {
            "nullable": true,
            "type": "string"
          },
          "override": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisFreshnessOverrideDto"
          },
          "paymentId": {
            "nullable": true,
            "type": "string"
          },
          "providerReference": {
            "nullable": true,
            "type": "string"
          },
          "ratePercent": {
            "format": "double",
            "type": "number"
          },
          "source": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subcontractorId": {
            "nullable": true,
            "type": "string"
          },
          "verificationId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CisVerificationRecordDto": {
        "additionalProperties": false,
        "properties": {
          "checkedAt": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "nullable": true,
            "type": "string"
          },
          "providerReference": {
            "nullable": true,
            "type": "string"
          },
          "ratePercent": {
            "format": "double",
            "type": "number"
          },
          "recordedAt": {
            "nullable": true,
            "type": "string"
          },
          "relianceEndsAt": {
            "nullable": true,
            "type": "string"
          },
          "source": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subcontractorId": {
            "nullable": true,
            "type": "string"
          },
          "taxYear": {
            "nullable": true,
            "type": "string"
          },
          "verificationId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CommissionLineQueryDto": {
        "additionalProperties": false,
        "properties": {
          "ageDays": {
            "format": "int32",
            "type": "integer"
          },
          "closedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "commissionId": {
            "format": "uuid",
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "decisionReason": {
            "nullable": true,
            "type": "string"
          },
          "difference": {
            "format": "double",
            "type": "number"
          },
          "expected": {
            "format": "double",
            "type": "number"
          },
          "held": {
            "format": "double",
            "type": "number"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "isClawbackLine": {
            "type": "boolean"
          },
          "ledger": {
            "format": "double",
            "type": "number"
          },
          "note": {
            "nullable": true,
            "type": "string"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "raisedAt": {
            "format": "date-time",
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "trail": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CommissionLineQueryEventDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CommissionLineQueryEventDto": {
        "additionalProperties": false,
        "properties": {
          "actorRole": {
            "nullable": true,
            "type": "string"
          },
          "amount": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "detail": {
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "nullable": true,
            "type": "string"
          },
          "occurredAt": {
            "format": "date-time",
            "type": "string"
          },
          "sequence": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CompletionAuditJoinDto": {
        "additionalProperties": false,
        "properties": {
          "anchorReference": {
            "nullable": true,
            "type": "string"
          },
          "apprenticeReference": {
            "nullable": true,
            "type": "string"
          },
          "apprenticeshipId": {
            "nullable": true,
            "type": "string"
          },
          "completedAtIso": {
            "nullable": true,
            "type": "string"
          },
          "credentialId": {
            "nullable": true,
            "type": "string"
          },
          "evidenceEntryIds": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "grade": {
            "nullable": true,
            "type": "string"
          },
          "reconciliationLineIds": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "standardId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto": {
        "additionalProperties": false,
        "properties": {
          "claimReference": {
            "nullable": true,
            "type": "string"
          },
          "claimantUserId": {
            "format": "uuid",
            "type": "string"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "deduction": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UseWearDeductionDto"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "isBlockedByDeductionReview": {
            "type": "boolean"
          },
          "netReleasedAmount": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "originalReceiptReference": {
            "nullable": true,
            "type": "string"
          },
          "ownershipReconciledAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "priorTransferFound": {
            "type": "boolean"
          },
          "proposedNetAmount": {
            "format": "double",
            "type": "number"
          },
          "remedyAgreedAt": {
            "format": "date-time",
            "type": "string"
          },
          "remedyAmount": {
            "format": "double",
            "type": "number"
          },
          "remedyType": {
            "nullable": true,
            "type": "string"
          },
          "rightfulHolderUserId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "settledAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto": {
        "additionalProperties": false,
        "properties": {
          "coolingOffEndsAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "customerUserId": {
            "format": "uuid",
            "type": "string"
          },
          "daysElapsed": {
            "format": "int32",
            "type": "integer"
          },
          "deduction": {
            "format": "double",
            "type": "number"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "noticeReceivedAt": {
            "format": "date-time",
            "type": "string"
          },
          "price": {
            "format": "double",
            "type": "number"
          },
          "providerOrganizationId": {
            "format": "uuid",
            "type": "string"
          },
          "purchaseReference": {
            "nullable": true,
            "type": "string"
          },
          "purchasedAt": {
            "format": "date-time",
            "type": "string"
          },
          "refundAmount": {
            "format": "double",
            "type": "number"
          },
          "refundReference": {
            "nullable": true,
            "type": "string"
          },
          "refundSettledAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "serviceStartedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "serviceTermDays": {
            "format": "int32",
            "type": "integer"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CreditLiabilityReportDto": {
        "additionalProperties": false,
        "properties": {
          "activeBalance": {
            "format": "double",
            "type": "number"
          },
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "deferredBalance": {
            "format": "double",
            "type": "number"
          },
          "expiringWithin30Days": {
            "format": "double",
            "type": "number"
          },
          "expiringWithin60Days": {
            "format": "double",
            "type": "number"
          },
          "expiringWithin90Days": {
            "format": "double",
            "type": "number"
          },
          "projected30DayBurn": {
            "format": "double",
            "type": "number"
          },
          "projected60DayBurn": {
            "format": "double",
            "type": "number"
          },
          "projected90DayBurn": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CreditNoteDto": {
        "additionalProperties": false,
        "properties": {
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "issuedAt": {
            "format": "date-time",
            "type": "string"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CreditNoteLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "number": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "originalInvoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "originalInvoiceNumber": {
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "subtotal": {
            "format": "double",
            "type": "number"
          },
          "taxAmount": {
            "format": "double",
            "type": "number"
          },
          "total": {
            "format": "double",
            "type": "number"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          },
          "vatInclusive": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.CreditNoteLineDto": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "nullable": true,
            "type": "string"
          },
          "gross": {
            "format": "double",
            "type": "number"
          },
          "net": {
            "format": "double",
            "type": "number"
          },
          "quantity": {
            "format": "double",
            "type": "number"
          },
          "tax": {
            "format": "double",
            "type": "number"
          },
          "taxInclusive": {
            "type": "boolean"
          },
          "taxRatePercent": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.DegradedSubscriptionLineDto": {
        "additionalProperties": false,
        "properties": {
          "degradationAgeHours": {
            "format": "double",
            "type": "number"
          },
          "degradedSinceUtc": {
            "format": "date-time",
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "paymentFailureCount": {
            "format": "int32",
            "type": "integer"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.DeveloperApiPlanCheckoutDto": {
        "additionalProperties": false,
        "properties": {
          "chargeReference": {
            "nullable": true,
            "type": "string"
          },
          "correlationId": {
            "nullable": true,
            "type": "string"
          },
          "previousTierCode": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "nullable": true,
            "type": "string"
          },
          "tierCode": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.DeveloperApiPlanTierDto": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "isPurchasable": {
            "type": "boolean"
          },
          "isSellableNow": {
            "type": "boolean"
          },
          "listPrice": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "planSkuCode": {
            "nullable": true,
            "type": "string"
          },
          "requiresSalesContact": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.DeveloperApiUpgradeRequestDto": {
        "additionalProperties": false,
        "properties": {
          "approverEmail": {
            "nullable": true,
            "type": "string"
          },
          "requestId": {
            "nullable": true,
            "type": "string"
          },
          "requestedAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "toTierCode": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.EarlyLeaverDto": {
        "additionalProperties": false,
        "properties": {
          "apprenticeReference": {
            "nullable": true,
            "type": "string"
          },
          "apprenticeshipId": {
            "nullable": true,
            "type": "string"
          },
          "lastAchievedMilestoneCode": {
            "nullable": true,
            "type": "string"
          },
          "leftAtIso": {
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.EnterpriseAgreementOverviewDto": {
        "additionalProperties": false,
        "properties": {
          "actualSpend": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyFigureDto"
          },
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "autoRenew": {
            "nullable": true,
            "type": "boolean"
          },
          "committedSpend": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "contractVersion": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "eaActive": {
            "type": "boolean"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "seatPosition": {
            "nullable": true,
            "type": "string"
          },
          "seatPositionLabel": {
            "nullable": true,
            "type": "string"
          },
          "seatsAssigned": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatFigureDto"
          },
          "seatsCommitted": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "termEnd": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "termStart": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto": {
        "additionalProperties": false,
        "properties": {
          "activatedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "autoRenew": {
            "type": "boolean"
          },
          "committedSeats": {
            "format": "int32",
            "type": "integer"
          },
          "contractEnd": {
            "format": "date-time",
            "type": "string"
          },
          "contractStart": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "customPrice": {
            "format": "double",
            "type": "number"
          },
          "dunningInvoiceDueDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "dunningInvoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "dunningStep": {
            "nullable": true,
            "type": "string"
          },
          "firstInvoiceAmount": {
            "format": "double",
            "type": "number"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceCadence": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "overageSeatRate": {
            "format": "double",
            "type": "number"
          },
          "paymentTermsDays": {
            "format": "int32",
            "type": "integer"
          },
          "requiresSecondApproval": {
            "type": "boolean"
          },
          "secondApproverId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "suspendedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ExecutiveDashboardDto": {
        "additionalProperties": false,
        "properties": {
          "arr": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "generatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "grossMarginPercent": {
            "format": "double",
            "type": "number"
          },
          "mrr": {
            "format": "double",
            "type": "number"
          },
          "periodChannelCommissions": {
            "format": "double",
            "type": "number"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodGrossMargin": {
            "format": "double",
            "type": "number"
          },
          "periodRevenue": {
            "format": "double",
            "type": "number"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "revenueByStream": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueStreamLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "topCustomers": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.TopCustomerRevenueDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ExtendSandboxSponsorshipRequest": {
        "additionalProperties": false,
        "properties": {
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "sponsoredUntil": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.FamilyInviteForUserDto": {
        "additionalProperties": false,
        "properties": {
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "invitedAt": {
            "format": "date-time",
            "type": "string"
          },
          "memberId": {
            "format": "uuid",
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.FamilyMemberDto": {
        "additionalProperties": false,
        "properties": {
          "acceptedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "email": {
            "nullable": true,
            "type": "string"
          },
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invitedAt": {
            "format": "date-time",
            "type": "string"
          },
          "occupiesSeat": {
            "type": "boolean"
          },
          "releasedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto": {
        "additionalProperties": false,
        "properties": {
          "availableSeats": {
            "format": "int32",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "maxSeats": {
            "format": "int32",
            "type": "integer"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMemberDto"
            },
            "nullable": true,
            "type": "array"
          },
          "occupiedSeats": {
            "format": "int32",
            "type": "integer"
          },
          "ownerUserId": {
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.FamilyRosterForUserDto": {
        "additionalProperties": false,
        "properties": {
          "availableSeats": {
            "format": "int32",
            "type": "integer"
          },
          "found": {
            "type": "boolean"
          },
          "maxSeats": {
            "format": "int32",
            "type": "integer"
          },
          "occupiedSeats": {
            "format": "int32",
            "type": "integer"
          },
          "role": {
            "nullable": true,
            "type": "string"
          },
          "rosterId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.GrandfatherPriceLockDto": {
        "additionalProperties": false,
        "properties": {
          "appliedBy": {
            "format": "uuid",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "inForce": {
            "type": "boolean"
          },
          "listAmountAtLock": {
            "format": "double",
            "type": "number"
          },
          "lockedAmount": {
            "format": "double",
            "type": "number"
          },
          "lockedUntil": {
            "format": "date-time",
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "preExpiryNoticeDue": {
            "type": "boolean"
          },
          "preExpiryNoticeIssuedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "releaseReason": {
            "nullable": true,
            "type": "string"
          },
          "releasedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "supersedeReference": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.GrandfatheredCohortDto": {
        "additionalProperties": false,
        "properties": {
          "assumedChurnRateOnExpiry": {
            "format": "double",
            "type": "number"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "deferredRevenueToLockEnd": {
            "format": "double",
            "type": "number"
          },
          "foregoneToDate": {
            "format": "double",
            "type": "number"
          },
          "lockedSubscriberCount": {
            "format": "int32",
            "type": "integer"
          },
          "locksExcludedForUnknownPeriod": {
            "format": "int32",
            "type": "integer"
          },
          "locksNoLongerInForce": {
            "format": "int32",
            "type": "integer"
          },
          "locksWithDeltaFromLockRecord": {
            "format": "int32",
            "type": "integer"
          },
          "locksWithMeasuredDelta": {
            "format": "int32",
            "type": "integer"
          },
          "months": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrandfatheredCohortMonthDto"
            },
            "nullable": true,
            "type": "array"
          },
          "periodDeferredRevenue": {
            "format": "double",
            "type": "number"
          },
          "projectedAnnualUpliftOnExpiry": {
            "format": "double",
            "type": "number"
          },
          "supersedeReference": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.GrandfatheredCohortFinanceReportDto": {
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "assumedChurnRateOnExpiry": {
            "format": "double",
            "type": "number"
          },
          "cohorts": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrandfatheredCohortDto"
            },
            "nullable": true,
            "type": "array"
          },
          "resolutionRowsRead": {
            "format": "int32",
            "type": "integer"
          },
          "supersedeReference": {
            "nullable": true,
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.GrandfatheredCohortMonthDto": {
        "additionalProperties": false,
        "properties": {
          "deferredRevenueToLockEnd": {
            "format": "double",
            "type": "number"
          },
          "expiringWithinNinetyDays": {
            "type": "boolean"
          },
          "listPrice": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "lockExpiryMonth": {
            "nullable": true,
            "type": "string"
          },
          "lockedPrice": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "lockedSubscriberCount": {
            "format": "int32",
            "type": "integer"
          },
          "periodDeferredRevenue": {
            "format": "double",
            "type": "number"
          },
          "pricesVary": {
            "type": "boolean"
          },
          "projectedAnnualUpliftOnExpiry": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.GrantSandboxSponsorshipRequest": {
        "additionalProperties": false,
        "properties": {
          "grantId": {
            "format": "uuid",
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "purpose": {
            "nullable": true,
            "type": "string"
          },
          "reference": {
            "nullable": true,
            "type": "string"
          },
          "skuCode": {
            "nullable": true,
            "type": "string"
          },
          "sponsoredUntil": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.GroupPremiumAccrualDto": {
        "additionalProperties": false,
        "properties": {
          "basis": {
            "nullable": true,
            "type": "string"
          },
          "coveredDays": {
            "format": "int32",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "grossMinor": {
            "format": "int64",
            "type": "integer"
          },
          "memberRef": {
            "nullable": true,
            "type": "string"
          },
          "periodDays": {
            "format": "int32",
            "type": "integer"
          },
          "periodFrom": {
            "nullable": true,
            "type": "string"
          },
          "periodTo": {
            "nullable": true,
            "type": "string"
          },
          "postedAt": {
            "format": "date-time",
            "type": "string"
          },
          "postingReference": {
            "nullable": true,
            "type": "string"
          },
          "revision": {
            "format": "int32",
            "type": "integer"
          },
          "schemeId": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "voidReason": {
            "nullable": true,
            "type": "string"
          },
          "voidedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.GroupPremiumPostingResultDto": {
        "additionalProperties": false,
        "properties": {
          "accruals": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupPremiumAccrualDto"
            },
            "nullable": true,
            "type": "array"
          },
          "posted": {
            "format": "int32",
            "type": "integer"
          },
          "postingReference": {
            "nullable": true,
            "type": "string"
          },
          "revised": {
            "format": "int32",
            "type": "integer"
          },
          "unchanged": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.GroupPremiumSchemeLedgerDto": {
        "additionalProperties": false,
        "properties": {
          "accruals": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupPremiumAccrualDto"
            },
            "nullable": true,
            "type": "array"
          },
          "accruedCount": {
            "format": "int32",
            "type": "integer"
          },
          "accruedTotalMinor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "from": {
            "nullable": true,
            "type": "string"
          },
          "schemeId": {
            "nullable": true,
            "type": "string"
          },
          "stops": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupPremiumStopDto"
            },
            "nullable": true,
            "type": "array"
          },
          "to": {
            "nullable": true,
            "type": "string"
          },
          "voidedCount": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.GroupPremiumStopDto": {
        "additionalProperties": false,
        "properties": {
          "effectiveFrom": {
            "nullable": true,
            "type": "string"
          },
          "memberRef": {
            "nullable": true,
            "type": "string"
          },
          "schemeId": {
            "nullable": true,
            "type": "string"
          },
          "stoppedAt": {
            "format": "date-time",
            "type": "string"
          },
          "voidedAccruals": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupPremiumAccrualDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.GroupSchemeAggregationResultDto": {
        "additionalProperties": false,
        "properties": {
          "billingModel": {
            "nullable": true,
            "type": "string"
          },
          "chargedMinor": {
            "format": "int64",
            "type": "integer"
          },
          "creditNoteId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "creditNoteNumber": {
            "nullable": true,
            "type": "string"
          },
          "creditedMinor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "invoiceNumber": {
            "nullable": true,
            "type": "string"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeInvoicedLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "memberCount": {
            "format": "int32",
            "type": "integer"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "runReference": {
            "nullable": true,
            "type": "string"
          },
          "schemeId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.GroupSchemeBillingConfigurationDto": {
        "additionalProperties": false,
        "properties": {
          "billingContactUserId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "billingModel": {
            "nullable": true,
            "type": "string"
          },
          "configuredAt": {
            "format": "date-time",
            "type": "string"
          },
          "invoicingParty": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "paymentTermsDays": {
            "format": "int32",
            "type": "integer"
          },
          "schemeId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.GroupSchemeBillingLedgerDto": {
        "additionalProperties": false,
        "properties": {
          "billedMinor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "invoicingParty": {
            "nullable": true,
            "type": "string"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeInvoicedLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "pendingMinor": {
            "format": "int64",
            "type": "integer"
          },
          "schemeId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.GroupSchemeInvoicedLineDto": {
        "additionalProperties": false,
        "properties": {
          "accrualId": {
            "format": "uuid",
            "type": "string"
          },
          "accrualRevision": {
            "format": "int32",
            "type": "integer"
          },
          "amountMinor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceNumber": {
            "nullable": true,
            "type": "string"
          },
          "memberRef": {
            "nullable": true,
            "type": "string"
          },
          "periodFrom": {
            "nullable": true,
            "type": "string"
          },
          "periodTo": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.HeldLicenceDto": {
        "additionalProperties": false,
        "properties": {
          "licenceFamily": {
            "nullable": true,
            "type": "string"
          },
          "licenceTier": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "skuCode": {
            "nullable": true,
            "type": "string"
          },
          "sponsored": {
            "type": "boolean"
          },
          "sponsoredUntil": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "termCommitmentEndUtc": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.HeldSandboxLicenceDto": {
        "additionalProperties": false,
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "currentPeriodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "licenceStatus": {
            "nullable": true,
            "type": "string"
          },
          "reusable": {
            "type": "boolean"
          },
          "skuCode": {
            "nullable": true,
            "type": "string"
          },
          "sponsored": {
            "type": "boolean"
          },
          "sponsoredUntil": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "sponsorshipPurpose": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.InstalmentAttemptDto": {
        "additionalProperties": false,
        "properties": {
          "attemptNumber": {
            "format": "int32",
            "type": "integer"
          },
          "attemptedAt": {
            "format": "date-time",
            "type": "string"
          },
          "failureCode": {
            "nullable": true,
            "type": "string"
          },
          "outcome": {
            "nullable": true,
            "type": "string"
          },
          "paymentReference": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.InvoiceDto": {
        "additionalProperties": false,
        "properties": {
          "blobReference": {
            "nullable": true,
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "dueDate": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceNumber": {
            "nullable": true,
            "type": "string"
          },
          "lineItems": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceLineItemDto"
            },
            "nullable": true,
            "type": "array"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "paidDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "subtotal": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "taxAmount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "totalAmount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "type": {
            "nullable": true,
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.InvoiceLineItemDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "periodEnd": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "quantity": {
            "format": "double",
            "type": "number"
          },
          "taxAmount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "taxRate": {
            "format": "double",
            "type": "number"
          },
          "unitPrice": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.InvoluntaryChurnReportDto": {
        "additionalProperties": false,
        "properties": {
          "affectedEntitlementsCount": {
            "format": "int32",
            "type": "integer"
          },
          "averageDegradationAgeHours": {
            "format": "double",
            "type": "number"
          },
          "currentlyDegradedCount": {
            "format": "int32",
            "type": "integer"
          },
          "degradedSubscriptions": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.DegradedSubscriptionLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "involuntarilyCanceledCount": {
            "format": "int32",
            "type": "integer"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "totalPaymentFailures": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.LawfulBasisRecordDto": {
        "additionalProperties": false,
        "properties": {
          "attested": {
            "type": "boolean"
          },
          "attestedAt": {
            "format": "date-time",
            "type": "string"
          },
          "attestedBy": {
            "nullable": true,
            "type": "string"
          },
          "authoriser": {
            "nullable": true,
            "type": "string"
          },
          "basis": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.LevyAccountDto": {
        "additionalProperties": false,
        "properties": {
          "allocations": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.LevyAllocationDto"
            },
            "nullable": true,
            "type": "array"
          },
          "availablePence": {
            "format": "int64",
            "type": "integer"
          },
          "committedPence": {
            "format": "int64",
            "type": "integer"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.LevyLedgerEntryDto"
            },
            "nullable": true,
            "type": "array"
          },
          "lastReconciledAtIso": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.LevyAllocationDto": {
        "additionalProperties": false,
        "properties": {
          "allocationId": {
            "nullable": true,
            "type": "string"
          },
          "coInvestmentPercent": {
            "format": "int32",
            "type": "integer"
          },
          "committedPence": {
            "format": "int64",
            "type": "integer"
          },
          "createdAtIso": {
            "nullable": true,
            "type": "string"
          },
          "drawnPence": {
            "format": "int64",
            "type": "integer"
          },
          "fundingBandCapPence": {
            "format": "int64",
            "type": "integer"
          },
          "places": {
            "format": "int32",
            "type": "integer"
          },
          "provider": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.LevyProviderDto"
          },
          "standardId": {
            "nullable": true,
            "type": "string"
          },
          "standardTitle": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.LevyLedgerEntryDto": {
        "additionalProperties": false,
        "properties": {
          "allocationId": {
            "nullable": true,
            "type": "string"
          },
          "amountPence": {
            "format": "int64",
            "type": "integer"
          },
          "apprenticeshipId": {
            "nullable": true,
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "entryId": {
            "nullable": true,
            "type": "string"
          },
          "expiresAtIso": {
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "nullable": true,
            "type": "string"
          },
          "occurredAtIso": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.LevyProviderDto": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MarketplacePayoutSettlementDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "gatewayPayoutId": {
            "nullable": true,
            "type": "string"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MarketplacePayoutSettlementLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "netAmount": {
            "format": "double",
            "type": "number"
          },
          "payoutDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "payoutId": {
            "format": "uuid",
            "type": "string"
          },
          "reconciles": {
            "type": "boolean"
          },
          "settledTotal": {
            "format": "double",
            "type": "number"
          },
          "taxWithheld": {
            "format": "double",
            "type": "number"
          },
          "transactionIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "unattributedLineCount": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MarketplacePayoutSettlementLineDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "commissionId": {
            "format": "uuid",
            "type": "string"
          },
          "isClawback": {
            "type": "boolean"
          },
          "productType": {
            "nullable": true,
            "type": "string"
          },
          "transactionAmount": {
            "format": "double",
            "type": "number"
          },
          "transactionDate": {
            "format": "date-time",
            "type": "string"
          },
          "transactionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MarketplacePayoutSettlementsDto": {
        "additionalProperties": false,
        "properties": {
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "payouts": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MarketplacePayoutSettlementDto"
            },
            "nullable": true,
            "type": "array"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MemberBillingRehomeDto": {
        "additionalProperties": false,
        "properties": {
          "alreadyApplied": {
            "type": "boolean"
          },
          "billingRehomed": {
            "type": "boolean"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "newSelfPaySubscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "outcome": {
            "nullable": true,
            "type": "string"
          },
          "prorationCreditMinorUnits": {
            "format": "int64",
            "type": "integer"
          },
          "prorationCredited": {
            "type": "boolean"
          },
          "rehomeId": {
            "format": "uuid",
            "type": "string"
          },
          "rehomeRequestId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MergeDispositionDto": {
        "additionalProperties": false,
        "properties": {
          "combinedEntitlements": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "mergeSessionId": {
            "format": "uuid",
            "type": "string"
          },
          "noDoubleCharge": {
            "type": "boolean"
          },
          "orgSeatMember": {
            "type": "boolean"
          },
          "refundMinorUnits": {
            "format": "int64",
            "type": "integer"
          },
          "retiredPlan": {
            "nullable": true,
            "type": "string"
          },
          "settled": {
            "type": "boolean"
          },
          "survivorAccountId": {
            "format": "uuid",
            "type": "string"
          },
          "survivorPlan": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MeteredSkuRevenueReportDto": {
        "additionalProperties": false,
        "properties": {
          "baseCurrency": {
            "nullable": true,
            "type": "string"
          },
          "period": {
            "nullable": true,
            "type": "string"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MeteredSkuRevenueRowDto"
            },
            "nullable": true,
            "type": "array"
          },
          "unattributedBilledUnits": {
            "format": "int64",
            "type": "integer"
          },
          "unattributedRevenue": {
            "format": "double",
            "type": "number"
          },
          "unconvertibleLineCount": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MeteredSkuRevenueRowDto": {
        "additionalProperties": false,
        "properties": {
          "billedUnits": {
            "format": "int64",
            "type": "integer"
          },
          "displayName": {
            "nullable": true,
            "type": "string"
          },
          "revenue": {
            "format": "double",
            "type": "number"
          },
          "skuCode": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MetricUsageSummary": {
        "additionalProperties": false,
        "properties": {
          "billableUsage": {
            "format": "double",
            "type": "number"
          },
          "estimatedCost": {
            "format": "double",
            "type": "number"
          },
          "firstUsageTimestamp": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "includedQuantity": {
            "format": "double",
            "type": "number"
          },
          "isOverage": {
            "type": "boolean"
          },
          "isUnlimited": {
            "type": "boolean"
          },
          "latestUsageTimestamp": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "limit": {
            "format": "double",
            "type": "number"
          },
          "metricType": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.UsageRecord.UsageMetricType"
          },
          "overageAmount": {
            "format": "double",
            "type": "number"
          },
          "recordCount": {
            "format": "int32",
            "type": "integer"
          },
          "remainingQuota": {
            "format": "double",
            "type": "number"
          },
          "totalUsage": {
            "format": "double",
            "type": "number"
          },
          "unit": {
            "nullable": true,
            "type": "string"
          },
          "usagePercentage": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ModuleAddOnPricingDto": {
        "additionalProperties": false,
        "properties": {
          "cadence": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "label": {
            "nullable": true,
            "type": "string"
          },
          "price": {
            "format": "double",
            "type": "number"
          },
          "sku": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ModuleCancellationTermsDto": {
        "additionalProperties": false,
        "properties": {
          "entitlementEndsAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "noticeDays": {
            "format": "int32",
            "type": "integer"
          },
          "policy": {
            "nullable": true,
            "type": "string"
          },
          "refundsUnusedPeriod": {
            "type": "boolean"
          },
          "summary": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ModuleMeteredItemPricingDto": {
        "additionalProperties": false,
        "properties": {
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "label": {
            "nullable": true,
            "type": "string"
          },
          "price": {
            "format": "double",
            "type": "number"
          },
          "sku": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ModulePlanFeatureDto": {
        "additionalProperties": false,
        "properties": {
          "featureCode": {
            "nullable": true,
            "type": "string"
          },
          "quota": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ModulePlanPricingDto": {
        "additionalProperties": false,
        "properties": {
          "basePrice": {
            "format": "double",
            "type": "number"
          },
          "cadence": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "features": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModulePlanFeatureDto"
            },
            "nullable": true,
            "type": "array"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "sku": {
            "nullable": true,
            "type": "string"
          },
          "tier": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ModulePricingDto": {
        "additionalProperties": false,
        "properties": {
          "addOns": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModuleAddOnPricingDto"
            },
            "nullable": true,
            "type": "array"
          },
          "meteredItems": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModuleMeteredItemPricingDto"
            },
            "nullable": true,
            "type": "array"
          },
          "moduleId": {
            "nullable": true,
            "type": "string"
          },
          "plans": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModulePlanPricingDto"
            },
            "nullable": true,
            "type": "array"
          },
          "pricingPublished": {
            "type": "boolean"
          },
          "skuProductToken": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ModuleProrationLineDto": {
        "additionalProperties": false,
        "properties": {
          "basisDays": {
            "format": "int32",
            "type": "integer"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "isProrated": {
            "type": "boolean"
          },
          "proratedDays": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ModuleSubscriptionQuoteDto": {
        "additionalProperties": false,
        "properties": {
          "alignedToOrgPeriod": {
            "type": "boolean"
          },
          "billingCycle": {
            "nullable": true,
            "type": "string"
          },
          "cancellationTerms": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModuleCancellationTermsDto"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "firstChargeAmount": {
            "format": "double",
            "type": "number"
          },
          "firstPeriodStart": {
            "format": "date-time",
            "type": "string"
          },
          "isBaseModule": {
            "type": "boolean"
          },
          "isRecurring": {
            "type": "boolean"
          },
          "nextBillingDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "offeringId": {
            "format": "uuid",
            "type": "string"
          },
          "offeringName": {
            "nullable": true,
            "type": "string"
          },
          "proration": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModuleProrationLineDto"
          },
          "recurringTotal": {
            "format": "double",
            "type": "number"
          },
          "seatCount": {
            "format": "int32",
            "type": "integer"
          },
          "unitPrice": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MoneyDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MoneyFigureDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "available": {
            "type": "boolean"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "unavailableReason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MonthlyRevenueDto": {
        "additionalProperties": false,
        "properties": {
          "commission": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "month": {
            "nullable": true,
            "type": "string"
          },
          "revenue": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "subscriptionCount": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MrrBySourceDto": {
        "additionalProperties": false,
        "properties": {
          "mrr": {
            "format": "double",
            "type": "number"
          },
          "source": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MrrByStreamLineDto": {
        "additionalProperties": false,
        "properties": {
          "arr": {
            "format": "double",
            "type": "number"
          },
          "contributingRecords": {
            "format": "int32",
            "type": "integer"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "mrr": {
            "format": "double",
            "type": "number"
          },
          "stream": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MrrByStreamReportDto": {
        "additionalProperties": false,
        "properties": {
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "reportedAt": {
            "format": "date-time",
            "type": "string"
          },
          "streams": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MrrByStreamLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "totalArr": {
            "format": "double",
            "type": "number"
          },
          "totalMrr": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MrrByTierDto": {
        "additionalProperties": false,
        "properties": {
          "mrr": {
            "format": "double",
            "type": "number"
          },
          "subscriptionCount": {
            "format": "int32",
            "type": "integer"
          },
          "tier": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MrrHistoryDto": {
        "additionalProperties": false,
        "properties": {
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "points": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MrrHistoryPointDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MrrHistoryPointDto": {
        "additionalProperties": false,
        "properties": {
          "arr": {
            "format": "double",
            "type": "number"
          },
          "basis": {
            "nullable": true,
            "type": "string"
          },
          "label": {
            "nullable": true,
            "type": "string"
          },
          "month": {
            "nullable": true,
            "type": "string"
          },
          "mrr": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MrrReportDto": {
        "additionalProperties": false,
        "properties": {
          "bySource": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MrrBySourceDto"
            },
            "nullable": true,
            "type": "array"
          },
          "byTier": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MrrByTierDto"
            },
            "nullable": true,
            "type": "array"
          },
          "exclusions": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueExclusionDisclosureDto"
          },
          "reportedAt": {
            "format": "date-time",
            "type": "string"
          },
          "totalArr": {
            "format": "double",
            "type": "number"
          },
          "totalMrr": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.MyFamilyMembershipDto": {
        "additionalProperties": false,
        "properties": {
          "pendingInvites": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyInviteForUserDto"
            },
            "nullable": true,
            "type": "array"
          },
          "pendingInvitesWithheld": {
            "nullable": true,
            "type": "string"
          },
          "roster": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyRosterForUserDto"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.NetTermsRefundDto": {
        "additionalProperties": false,
        "properties": {
          "alreadyRefunded": {
            "type": "boolean"
          },
          "amount": {
            "format": "double",
            "type": "number"
          },
          "authorization": {
            "nullable": true,
            "type": "string"
          },
          "creditNoteId": {
            "format": "uuid",
            "type": "string"
          },
          "creditNoteNumber": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "disposition": {
            "nullable": true,
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "ledgerCreditId": {
            "format": "uuid",
            "type": "string"
          },
          "ledgerCreditStatus": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgConsumptionMeterDto": {
        "additionalProperties": false,
        "properties": {
          "included": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "metric": {
            "nullable": true,
            "type": "string"
          },
          "metricLabel": {
            "nullable": true,
            "type": "string"
          },
          "unitLabel": {
            "nullable": true,
            "type": "string"
          },
          "used": {
            "format": "double",
            "type": "number"
          },
          "warningThreshold": {
            "format": "double",
            "nullable": true,
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgConsumptionSnapshotDto": {
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "meters": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgConsumptionMeterDto"
            },
            "nullable": true,
            "type": "array"
          },
          "projectedMonthlyCost": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "projectedMonthlyCostUnavailableReason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgCreditBalanceDto": {
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "balance": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "earnedThisMonth": {
            "format": "double",
            "type": "number"
          },
          "expiringWithin90Days": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgDunningBlastRadiusDto": {
        "additionalProperties": false,
        "properties": {
          "billedSeats": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "modules": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgDunningModuleDto"
            },
            "nullable": true,
            "type": "array"
          },
          "seatsProvenance": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgDunningModuleDto": {
        "additionalProperties": false,
        "properties": {
          "degradesAtUtc": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "moduleSubscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "state": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgDunningPositionDto": {
        "additionalProperties": false,
        "properties": {
          "asOfUtc": {
            "format": "date-time",
            "type": "string"
          },
          "blastRadius": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgDunningBlastRadiusDto"
          },
          "pastDue": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgDunningSubscriptionDto"
            },
            "nullable": true,
            "type": "array"
          },
          "restoration": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgDunningRestorationDto"
          },
          "state": {
            "nullable": true,
            "type": "string"
          },
          "timeline": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgDunningTimelineEntryDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgDunningRestorationDto": {
        "additionalProperties": false,
        "properties": {
          "modulesReEntitled": {
            "format": "int32",
            "type": "integer"
          },
          "notYetRestored": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgDunningUnrestoredDto"
            },
            "nullable": true,
            "type": "array"
          },
          "restoredAtUtc": {
            "format": "date-time",
            "type": "string"
          },
          "subscriptionsRestored": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgDunningRetryDto": {
        "additionalProperties": false,
        "properties": {
          "attempt": {
            "format": "int32",
            "type": "integer"
          },
          "dayOffset": {
            "format": "int32",
            "type": "integer"
          },
          "scheduledUtc": {
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgDunningSubscriptionDto": {
        "additionalProperties": false,
        "properties": {
          "amountDue": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "billedThroughDisplayName": {
            "nullable": true,
            "type": "string"
          },
          "consequence": {
            "nullable": true,
            "type": "string"
          },
          "consequenceAtUtc": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "failureCount": {
            "format": "int32",
            "type": "integer"
          },
          "gracePeriodEndsUtc": {
            "format": "date-time",
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "invoiceNumber": {
            "nullable": true,
            "type": "string"
          },
          "pastDueSinceUtc": {
            "format": "date-time",
            "type": "string"
          },
          "planName": {
            "nullable": true,
            "type": "string"
          },
          "retrySchedule": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgDunningRetryDto"
            },
            "nullable": true,
            "type": "array"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgDunningTimelineEntryDto": {
        "additionalProperties": false,
        "properties": {
          "atUtc": {
            "format": "date-time",
            "type": "string"
          },
          "detail": {
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "nullable": true,
            "type": "string"
          },
          "label": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgDunningUnrestoredDto": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "nullable": true,
            "type": "string"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgHeldSkuDto": {
        "additionalProperties": false,
        "properties": {
          "family": {
            "nullable": true,
            "type": "string"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "skuId": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "subscriptionStatus": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgHeldSkuSetDto": {
        "additionalProperties": false,
        "properties": {
          "available": {
            "type": "boolean"
          },
          "held": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgHeldSkuDto"
            },
            "nullable": true,
            "type": "array"
          },
          "unavailableReason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgInvoiceChainContextDto": {
        "additionalProperties": false,
        "properties": {
          "invoicingPartyName": {
            "nullable": true,
            "type": "string"
          },
          "invoicingPartyOrgId": {
            "format": "uuid",
            "type": "string"
          },
          "invoicingPartyRole": {
            "nullable": true,
            "type": "string"
          },
          "relationshipManagerEmail": {
            "nullable": true,
            "type": "string"
          },
          "relationshipManagerName": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgInvoiceDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "number": {
            "nullable": true,
            "type": "string"
          },
          "raisedAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgInvoiceListDto": {
        "additionalProperties": false,
        "properties": {
          "chainContext": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgInvoiceChainContextDto"
          },
          "hasMore": {
            "type": "boolean"
          },
          "invoices": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgInvoiceDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgModuleLineDto": {
        "additionalProperties": false,
        "properties": {
          "cancelAtPeriodEnd": {
            "type": "boolean"
          },
          "cancelBlockedReason": {
            "nullable": true,
            "type": "string"
          },
          "cancelEffectiveAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "cancelableAtPeriodEnd": {
            "type": "boolean"
          },
          "entitlementEndsAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "isBaseModule": {
            "type": "boolean"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "offeringId": {
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgSeatRegisterDto": {
        "additionalProperties": false,
        "properties": {
          "assignedSeats": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "enrolled": {
            "type": "boolean"
          },
          "enrolledAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "registeredSeats": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "seats": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RegisteredSeatDto"
            },
            "nullable": true,
            "type": "array"
          },
          "unavailableReason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgSubscriptionLineDto": {
        "additionalProperties": false,
        "properties": {
          "commercialRoute": {
            "nullable": true,
            "type": "string"
          },
          "endsAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "isBaseSubscription": {
            "type": "boolean"
          },
          "licenceFamily": {
            "nullable": true,
            "type": "string"
          },
          "licenceTier": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "licensedSeats": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "minimumSeats": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "minimumTermMonths": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "payerOrganizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "periodAmount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "planName": {
            "nullable": true,
            "type": "string"
          },
          "primarySkuCode": {
            "nullable": true,
            "type": "string"
          },
          "renewalDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "skus": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgHeldSkuDto"
            },
            "nullable": true,
            "type": "array"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "termCommitmentEndUtc": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "tier": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrgSubscriptionSummaryDto": {
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "billedThroughDisplayName": {
            "nullable": true,
            "type": "string"
          },
          "commercialRoute": {
            "nullable": true,
            "type": "string"
          },
          "entitlementActive": {
            "type": "boolean"
          },
          "modules": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgModuleLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "paymentTermsDays": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "pricesHidden": {
            "type": "boolean"
          },
          "privileges": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PlanPrivilegeDto"
            },
            "nullable": true,
            "type": "array"
          },
          "privilegesFromPlanName": {
            "nullable": true,
            "type": "string"
          },
          "seatsAssigned": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatFigureDto"
          },
          "seatsBilled": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatFigureDto"
          },
          "skus": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgHeldSkuSetDto"
          },
          "subscriptions": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgSubscriptionLineDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrganisationCommercialProfileDto": {
        "additionalProperties": false,
        "properties": {
          "channelPartnerId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "dealRegistrationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "effectivePaymentTermsDays": {
            "format": "int32",
            "type": "integer"
          },
          "hostingSovereignInstanceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "invoiceCollectionApprovalReason": {
            "nullable": true,
            "type": "string"
          },
          "invoiceCollectionApproved": {
            "type": "boolean"
          },
          "invoiceCollectionApprovedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "invoiceCollectionApprovedBy": {
            "nullable": true,
            "type": "string"
          },
          "invoiceCollectionRevokedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "invoiceCollectionRevokedBy": {
            "nullable": true,
            "type": "string"
          },
          "organizationDisplayName": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "payerDisplayName": {
            "nullable": true,
            "type": "string"
          },
          "payerOrganizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "paymentTermsDaysOverride": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "paymentTermsOverriddenAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "paymentTermsOverriddenBy": {
            "nullable": true,
            "type": "string"
          },
          "paymentTermsOverrideReason": {
            "nullable": true,
            "type": "string"
          },
          "route": {
            "nullable": true,
            "type": "string"
          },
          "setAt": {
            "format": "date-time",
            "type": "string"
          },
          "setBy": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrganisationLicenceContextDto": {
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "commercialRoute": {
            "nullable": true,
            "type": "string"
          },
          "held": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.HeldLicenceDto"
            },
            "nullable": true,
            "type": "array"
          },
          "highestHeldInstanceTier": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "partnerStanding": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrganizationBillingDetailsDto": {
        "additionalProperties": false,
        "properties": {
          "addressLine1": {
            "nullable": true,
            "type": "string"
          },
          "addressLine2": {
            "nullable": true,
            "type": "string"
          },
          "city": {
            "nullable": true,
            "type": "string"
          },
          "countryCode": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "postalCode": {
            "nullable": true,
            "type": "string"
          },
          "recorded": {
            "type": "boolean"
          },
          "stateOrRegion": {
            "nullable": true,
            "type": "string"
          },
          "taxId": {
            "nullable": true,
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OrganizationWholesaleRateDto": {
        "additionalProperties": false,
        "properties": {
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "isAuthoritative": {
            "type": "boolean"
          },
          "moduleId": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "perSeatPrice": {
            "format": "double",
            "nullable": true,
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OverageDetectionResultDto": {
        "additionalProperties": false,
        "properties": {
          "hasOverages": {
            "readOnly": true,
            "type": "boolean"
          },
          "hasWarnings": {
            "readOnly": true,
            "type": "boolean"
          },
          "overages": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OverageDto"
            },
            "nullable": true,
            "type": "array"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "totalIssues": {
            "format": "int32",
            "readOnly": true,
            "type": "integer"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          },
          "warnings": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageWarningDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.OverageDto": {
        "additionalProperties": false,
        "properties": {
          "currentUsage": {
            "format": "double",
            "type": "number"
          },
          "estimatedCost": {
            "format": "double",
            "type": "number"
          },
          "limit": {
            "format": "double",
            "type": "number"
          },
          "metricType": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.UsageRecord.UsageMetricType"
          },
          "overageAmount": {
            "format": "double",
            "type": "number"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "unit": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto": {
        "additionalProperties": false,
        "properties": {
          "appliedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "appliedDocumentId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "appliedDocumentReference": {
            "nullable": true,
            "type": "string"
          },
          "chargeAmount": {
            "format": "double",
            "type": "number"
          },
          "createdAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "creditAmount": {
            "format": "double",
            "type": "number"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "currentPeriodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "currentPeriodStart": {
            "format": "date-time",
            "type": "string"
          },
          "currentVersionPrice": {
            "format": "double",
            "type": "number"
          },
          "fromVersion": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "lineType": {
            "nullable": true,
            "type": "string"
          },
          "migrationEffectiveAt": {
            "format": "date-time",
            "type": "string"
          },
          "netAmount": {
            "format": "double",
            "type": "number"
          },
          "newVersionPrice": {
            "format": "double",
            "type": "number"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "packageCode": {
            "nullable": true,
            "type": "string"
          },
          "remainingDays": {
            "format": "int32",
            "type": "integer"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriberUserId": {
            "format": "uuid",
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "termDays": {
            "format": "int32",
            "type": "integer"
          },
          "toVersion": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PartnerAnalyticsDto": {
        "additionalProperties": false,
        "properties": {
          "activeSubscriptions": {
            "format": "int32",
            "type": "integer"
          },
          "averageCustomerLifetimeValue": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "averageTransactionValue": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "canceledSubscriptions": {
            "format": "int32",
            "type": "integer"
          },
          "commissionRate": {
            "format": "double",
            "type": "number"
          },
          "failedPayments": {
            "format": "int32",
            "type": "integer"
          },
          "monthlyRevenue": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MonthlyRevenueDto"
            },
            "nullable": true,
            "type": "array"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "partnerName": {
            "nullable": true,
            "type": "string"
          },
          "paymentSuccessRate": {
            "format": "double",
            "type": "number"
          },
          "pendingCommission": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "revenueGrowthRate": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "successfulPayments": {
            "format": "int32",
            "type": "integer"
          },
          "topPlans": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PlanPerformanceDto"
            },
            "nullable": true,
            "type": "array"
          },
          "totalCommission": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "totalCommissionPaidOut": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "totalPayments": {
            "format": "int32",
            "type": "integer"
          },
          "totalRevenue": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "totalSubscriptions": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PartnerCommissionLineQueriesDto": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CommissionLineQueryDto"
            },
            "nullable": true,
            "type": "array"
          },
          "openCount": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PartnerDashboardSummaryDto": {
        "additionalProperties": false,
        "properties": {
          "activeSubscriptionCount": {
            "format": "int32",
            "type": "integer"
          },
          "commissionRate": {
            "format": "double",
            "type": "number"
          },
          "currentMonthCommission": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "currentMonthRevenue": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "lifetimeCommission": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "lifetimeRevenue": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "partnerName": {
            "nullable": true,
            "type": "string"
          },
          "paymentSuccessRate": {
            "format": "double",
            "type": "number"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "totalCustomerCount": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PartnerPayoutDestinationDto": {
        "additionalProperties": false,
        "properties": {
          "accountReference": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "method": {
            "nullable": true,
            "type": "string"
          },
          "minimumPayoutAmount": {
            "format": "double",
            "type": "number"
          },
          "onFile": {
            "type": "boolean"
          },
          "partnerStatus": {
            "nullable": true,
            "type": "string"
          },
          "readyToBePaid": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PartnerPayoutSettingsDto": {
        "additionalProperties": false,
        "properties": {
          "destination": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PartnerPayoutDestinationDto"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "withholding": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PartnerWithholdingDeclarationDto"
          },
          "withholdingCalculation": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PartnerWithholdingDeclarationDto": {
        "additionalProperties": false,
        "properties": {
          "claimsTreatyBenefits": {
            "type": "boolean"
          },
          "declaredAt": {
            "format": "date-time",
            "type": "string"
          },
          "entityType": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "revision": {
            "format": "int32",
            "type": "integer"
          },
          "taxResidenceCountry": {
            "nullable": true,
            "type": "string"
          },
          "treatyArticle": {
            "nullable": true,
            "type": "string"
          },
          "treatyRatePercent": {
            "format": "double",
            "nullable": true,
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PaymentDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "failureReason": {
            "nullable": true,
            "type": "string"
          },
          "gatewayPaymentId": {
            "nullable": true,
            "type": "string"
          },
          "gatewayResponse": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "paymentGateway": {
            "nullable": true,
            "type": "string"
          },
          "paymentMethod": {
            "nullable": true,
            "type": "string"
          },
          "processedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "retryCount": {
            "format": "int32",
            "type": "integer"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PaymentIntentDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "clientSecret": {
            "nullable": true,
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "customerId": {
            "nullable": true,
            "type": "string"
          },
          "declineCode": {
            "nullable": true,
            "type": "string"
          },
          "errorCode": {
            "nullable": true,
            "type": "string"
          },
          "errorMessage": {
            "nullable": true,
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "invoiceStatus": {
            "nullable": true,
            "type": "string"
          },
          "isTestMode": {
            "type": "boolean"
          },
          "metadata": {
            "additionalProperties": {
              "nullable": true,
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "nextAction": {
            "nullable": true,
            "type": "string"
          },
          "outcome": {
            "nullable": true,
            "type": "string"
          },
          "paymentId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "paymentIntentId": {
            "nullable": true,
            "type": "string"
          },
          "paymentMethodId": {
            "nullable": true,
            "type": "string"
          },
          "requiresAction": {
            "type": "boolean"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "threeDSecureUrl": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PaymentMethodDto": {
        "additionalProperties": false,
        "properties": {
          "brand": {
            "nullable": true,
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "expiryMonth": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "expiryYear": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "gateway": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          },
          "lastFour": {
            "nullable": true,
            "type": "string"
          },
          "overdueSettlement": {
            "nullable": true,
            "type": "string"
          },
          "type": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PaymentMethodSetupDto": {
        "additionalProperties": false,
        "properties": {
          "clientSdkUrl": {
            "nullable": true,
            "type": "string"
          },
          "clientSecret": {
            "nullable": true,
            "type": "string"
          },
          "customerId": {
            "nullable": true,
            "type": "string"
          },
          "environment": {
            "nullable": true,
            "type": "string"
          },
          "gateway": {
            "nullable": true,
            "type": "string"
          },
          "paymentMethodTypes": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "publishableKey": {
            "nullable": true,
            "type": "string"
          },
          "setupIntentId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PaymentPageScriptDto": {
        "additionalProperties": false,
        "properties": {
          "authorisingChangeRecord": {
            "nullable": true,
            "type": "string"
          },
          "businessJustification": {
            "nullable": true,
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lastVerifiedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "scriptUrl": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subresourceIntegrityHash": {
            "nullable": true,
            "type": "string"
          },
          "vendor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PaymentPageScriptRegisterDto": {
        "additionalProperties": false,
        "properties": {
          "environmentKey": {
            "nullable": true,
            "type": "string"
          },
          "history": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentPageScriptStatusChangeDto"
            },
            "nullable": true,
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "scripts": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentPageScriptDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PaymentPageScriptStatusChangeDto": {
        "additionalProperties": false,
        "properties": {
          "changeRecord": {
            "nullable": true,
            "type": "string"
          },
          "changedAt": {
            "format": "date-time",
            "type": "string"
          },
          "changedBy": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "newStatus": {
            "nullable": true,
            "type": "string"
          },
          "previousStatus": {
            "nullable": true,
            "type": "string"
          },
          "scriptId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PayoutDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "approvalValueGbp": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "approvedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "approvedBy": {
            "nullable": true,
            "type": "string"
          },
          "awaitingApproval": {
            "type": "boolean"
          },
          "batchId": {
            "nullable": true,
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "failureCount": {
            "format": "int32",
            "type": "integer"
          },
          "failureReason": {
            "nullable": true,
            "type": "string"
          },
          "firstFailedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "gatewayPayoutId": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutItemDto"
            },
            "nullable": true,
            "type": "array"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "netAmount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "nextRetryAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "payoutDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "payoutMethod": {
            "nullable": true,
            "type": "string"
          },
          "requiresApproval": {
            "type": "boolean"
          },
          "statement": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutStatementDto"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "taxWithheld": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PayoutItemDto": {
        "additionalProperties": false,
        "properties": {
          "baseAmount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "commissionAmount": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "commissionRate": {
            "format": "double",
            "type": "number"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "payoutId": {
            "format": "uuid",
            "type": "string"
          },
          "transactionId": {
            "format": "uuid",
            "type": "string"
          },
          "transactionType": {
            "nullable": true,
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PayoutManualReissueTaskDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "failureReason": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "manualReference": {
            "nullable": true,
            "type": "string"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "payoutId": {
            "format": "uuid",
            "type": "string"
          },
          "raisedAt": {
            "format": "date-time",
            "type": "string"
          },
          "resolvedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "retriesAttempted": {
            "format": "int32",
            "type": "integer"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PayoutStatementDto": {
        "additionalProperties": false,
        "properties": {
          "archivedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "available": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PayoutStreamLineDto": {
        "additionalProperties": false,
        "properties": {
          "commissionCount": {
            "format": "int32",
            "type": "integer"
          },
          "commissionsTotal": {
            "format": "double",
            "type": "number"
          },
          "gaps": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "kind": {
            "nullable": true,
            "type": "string"
          },
          "payoutCount": {
            "format": "int32",
            "type": "integer"
          },
          "payoutsTotal": {
            "format": "double",
            "type": "number"
          },
          "pendingTotal": {
            "format": "double",
            "type": "number"
          },
          "taxWithheldTotal": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PayoutStreamReconciliationDto": {
        "additionalProperties": false,
        "properties": {
          "channel": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutStreamLineDto"
          },
          "gaps": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "isBalanced": {
            "type": "boolean"
          },
          "marketplace": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutStreamLineDto"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PlanPerformanceDto": {
        "additionalProperties": false,
        "properties": {
          "commission": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "planId": {
            "format": "uuid",
            "type": "string"
          },
          "planName": {
            "nullable": true,
            "type": "string"
          },
          "revenue": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "subscriptionCount": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PlanPrivilegeDto": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "nullable": true,
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "group": {
            "nullable": true,
            "type": "string"
          },
          "label": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PremiumFinanceInstalmentDto": {
        "additionalProperties": false,
        "properties": {
          "amountMinor": {
            "format": "int64",
            "type": "integer"
          },
          "amountPaidMinor": {
            "format": "int64",
            "type": "integer"
          },
          "attempts": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InstalmentAttemptDto"
            },
            "nullable": true,
            "type": "array"
          },
          "dueOn": {
            "nullable": true,
            "type": "string"
          },
          "lastFailureCode": {
            "nullable": true,
            "type": "string"
          },
          "sequence": {
            "format": "int32",
            "type": "integer"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PremiumFinancePlanDto": {
        "additionalProperties": false,
        "properties": {
          "agreementId": {
            "nullable": true,
            "type": "string"
          },
          "arrearsEpisodes": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ArrearsEpisodeDto"
            },
            "nullable": true,
            "type": "array"
          },
          "arrearsPayments": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ArrearsPaymentDto"
            },
            "nullable": true,
            "type": "array"
          },
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "creditAgreementReference": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "financedAmountMinor": {
            "format": "int64",
            "type": "integer"
          },
          "instalments": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinanceInstalmentDto"
            },
            "nullable": true,
            "type": "array"
          },
          "insurerOrganizationId": {
            "format": "uuid",
            "type": "string"
          },
          "mandateReference": {
            "nullable": true,
            "type": "string"
          },
          "outstandingArrearsMinor": {
            "format": "int64",
            "type": "integer"
          },
          "policyReference": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PremiumFinancePositionDto": {
        "additionalProperties": false,
        "properties": {
          "agreementId": {
            "nullable": true,
            "type": "string"
          },
          "arrearsEpisodeNumber": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "arrearsSince": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "inArrears": {
            "type": "boolean"
          },
          "instalmentCount": {
            "format": "int32",
            "type": "integer"
          },
          "instalmentsCollected": {
            "format": "int32",
            "type": "integer"
          },
          "instalmentsInArrears": {
            "format": "int32",
            "type": "integer"
          },
          "nextInstalment": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinanceInstalmentDto"
          },
          "outstandingArrearsMinor": {
            "format": "int64",
            "type": "integer"
          },
          "planStatus": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PricingPlanDto": {
        "additionalProperties": false,
        "properties": {
          "additionalPrivileges": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PlanPrivilegeDto"
            },
            "nullable": true,
            "type": "array"
          },
          "audience": {
            "nullable": true,
            "type": "string"
          },
          "basePrice": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "billingPeriod": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.BillingPeriodDto"
          },
          "billingUnit": {
            "nullable": true,
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "features": {
            "additionalProperties": {},
            "nullable": true,
            "type": "object"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "includesEverythingFrom": {
            "nullable": true,
            "type": "string"
          },
          "isActive": {
            "type": "boolean"
          },
          "licenceFamily": {
            "nullable": true,
            "type": "string"
          },
          "licenceTier": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "minimumSeats": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "minimumTermMonths": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "privileges": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PlanPrivilegeDto"
            },
            "nullable": true,
            "type": "array"
          },
          "skuCodes": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "tier": {
            "nullable": true,
            "type": "string"
          },
          "trialDays": {
            "format": "int32",
            "type": "integer"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ProRataInvoiceLineDto": {
        "additionalProperties": false,
        "properties": {
          "amountMinor": {
            "format": "int64",
            "type": "integer"
          },
          "description": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.PurchaseSandboxLicenceRequest": {
        "additionalProperties": false,
        "properties": {
          "convertsSponsoredSubscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "purchaseId": {
            "format": "uuid",
            "type": "string"
          },
          "skuCode": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.QuotaCheckRequestDto": {
        "additionalProperties": false,
        "properties": {
          "metricCode": {
            "nullable": true,
            "type": "string"
          },
          "organisationId": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "nullable": true,
            "type": "string"
          },
          "requestedUnits": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "sku": {
            "nullable": true,
            "type": "string"
          },
          "subjectId": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "nullable": true,
            "type": "string"
          },
          "units": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "usage": {
            "format": "double",
            "nullable": true,
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.QuotaCheckResponseDto": {
        "additionalProperties": false,
        "properties": {
          "allowed": {
            "type": "boolean"
          },
          "limit": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "limitExact": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "message": {
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "reasonCode": {
            "nullable": true,
            "type": "string"
          },
          "remaining": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "requiredAction": {
            "nullable": true,
            "type": "string"
          },
          "retryAfterSeconds": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "used": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "usedExact": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "withinLimit": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.QuotaInfoDto": {
        "additionalProperties": false,
        "properties": {
          "currentUsage": {
            "format": "double",
            "type": "number"
          },
          "isNearLimit": {
            "type": "boolean"
          },
          "isOverLimit": {
            "type": "boolean"
          },
          "limit": {
            "format": "double",
            "type": "number"
          },
          "metricType": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.UsageRecord.UsageMetricType"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "remaining": {
            "format": "double",
            "type": "number"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "unit": {
            "nullable": true,
            "type": "string"
          },
          "usagePercentage": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.QuotaLeaseRequestDto": {
        "additionalProperties": false,
        "properties": {
          "blockUnits": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "idempotencyKey": {
            "nullable": true,
            "type": "string"
          },
          "metricCode": {
            "nullable": true,
            "type": "string"
          },
          "organisationId": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "nullable": true,
            "type": "string"
          },
          "requestedUnits": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "sku": {
            "nullable": true,
            "type": "string"
          },
          "subjectId": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "nullable": true,
            "type": "string"
          },
          "ttlSeconds": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "units": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "usage": {
            "format": "double",
            "nullable": true,
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.QuotaLeaseResponseDto": {
        "additionalProperties": false,
        "properties": {
          "allowed": {
            "type": "boolean"
          },
          "expiresAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "grantedUnits": {
            "format": "int32",
            "type": "integer"
          },
          "idempotencyKey": {
            "nullable": true,
            "type": "string"
          },
          "leaseId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "leaseKey": {
            "nullable": true,
            "type": "string"
          },
          "limit": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "limitExact": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "message": {
            "nullable": true,
            "type": "string"
          },
          "outstandingHeld": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "overageUnits": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "reasonCode": {
            "nullable": true,
            "type": "string"
          },
          "remaining": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "replayed": {
            "type": "boolean"
          },
          "requiredAction": {
            "nullable": true,
            "type": "string"
          },
          "retryAfterSeconds": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "ttlSeconds": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "used": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "usedExact": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "withinLimit": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.QuotaLeaseSettleRequestDto": {
        "additionalProperties": false,
        "properties": {
          "sequence": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "usedUnits": {
            "format": "double",
            "nullable": true,
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.QuotaLeaseSettleResponseDto": {
        "additionalProperties": false,
        "properties": {
          "grantedUnits": {
            "format": "double",
            "type": "number"
          },
          "leaseId": {
            "format": "uuid",
            "type": "string"
          },
          "outcome": {
            "nullable": true,
            "type": "string"
          },
          "recordedUnits": {
            "format": "double",
            "type": "number"
          },
          "replayed": {
            "type": "boolean"
          },
          "returnedUnits": {
            "format": "double",
            "type": "number"
          },
          "sequence": {
            "format": "int64",
            "type": "integer"
          },
          "usedUnits": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.QuotaReservationReleaseRequestDto": {
        "additionalProperties": false,
        "properties": {
          "idempotencyKey": {
            "nullable": true,
            "type": "string"
          },
          "metricCode": {
            "nullable": true,
            "type": "string"
          },
          "organisationId": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "nullable": true,
            "type": "string"
          },
          "requestedUnits": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "sku": {
            "nullable": true,
            "type": "string"
          },
          "subjectId": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "nullable": true,
            "type": "string"
          },
          "units": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "usage": {
            "format": "double",
            "nullable": true,
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.QuotaReservationRequestDto": {
        "additionalProperties": false,
        "properties": {
          "actionDigest": {
            "nullable": true,
            "type": "string"
          },
          "idempotencyKey": {
            "nullable": true,
            "type": "string"
          },
          "metricCode": {
            "nullable": true,
            "type": "string"
          },
          "organisationId": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "nullable": true,
            "type": "string"
          },
          "requestedUnits": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "sku": {
            "nullable": true,
            "type": "string"
          },
          "subjectId": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "nullable": true,
            "type": "string"
          },
          "units": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "usage": {
            "format": "double",
            "nullable": true,
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.QuotaReservationResponseDto": {
        "additionalProperties": false,
        "properties": {
          "allowed": {
            "type": "boolean"
          },
          "expiresAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "idempotencyKey": {
            "nullable": true,
            "type": "string"
          },
          "isOverage": {
            "type": "boolean"
          },
          "limit": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "limitExact": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "message": {
            "nullable": true,
            "type": "string"
          },
          "outstandingReserved": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "overageUnits": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "reasonCode": {
            "nullable": true,
            "type": "string"
          },
          "remaining": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "replayed": {
            "type": "boolean"
          },
          "requiredAction": {
            "nullable": true,
            "type": "string"
          },
          "reservationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "retryAfterSeconds": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "used": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "usedExact": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "withinLimit": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RecordUsageEventRequestDto": {
        "additionalProperties": false,
        "properties": {
          "metadata": {
            "additionalProperties": {},
            "nullable": true,
            "type": "object"
          },
          "metric": {
            "nullable": true,
            "type": "string"
          },
          "occurredAt": {
            "format": "date-time",
            "type": "string"
          },
          "quantity": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RecordUsageEventResponseDto": {
        "additionalProperties": false,
        "properties": {
          "replayed": {
            "type": "boolean"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "usageRecordId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RefundDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "estimatedArrivalDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "paymentId": {
            "format": "uuid",
            "type": "string"
          },
          "processedAt": {
            "format": "date-time",
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "refundId": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RefundQueueItemDto": {
        "additionalProperties": false,
        "properties": {
          "applicationReference": {
            "nullable": true,
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceNumber": {
            "nullable": true,
            "type": "string"
          },
          "onboardingSessionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "resolution": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RefundResolutionDto"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "totalAmount": {
            "format": "double",
            "type": "number"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RefundResolutionDto": {
        "additionalProperties": false,
        "properties": {
          "note": {
            "nullable": true,
            "type": "string"
          },
          "outcome": {
            "nullable": true,
            "type": "string"
          },
          "reference": {
            "nullable": true,
            "type": "string"
          },
          "resolvedAt": {
            "format": "date-time",
            "type": "string"
          },
          "resolvedBy": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RegisteredSeatDto": {
        "additionalProperties": false,
        "properties": {
          "assignedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "holderRef": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "lastChangedAt": {
            "format": "date-time",
            "type": "string"
          },
          "origin": {
            "nullable": true,
            "type": "string"
          },
          "planLabel": {
            "nullable": true,
            "type": "string"
          },
          "releasedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "seatRef": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionRef": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RehomeDepartingMemberRequestDto": {
        "additionalProperties": false,
        "properties": {
          "departingMemberUserId": {
            "format": "uuid",
            "type": "string"
          },
          "familyOwnerUserId": {
            "format": "uuid",
            "type": "string"
          },
          "familySubscriptionId": {
            "nullable": true,
            "type": "string"
          },
          "occurredAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "rehomeRequestId": {
            "format": "uuid",
            "type": "string"
          },
          "seatId": {
            "nullable": true,
            "type": "string"
          },
          "targetPlanId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto": {
        "additionalProperties": false,
        "properties": {
          "adjustmentId": {
            "nullable": true,
            "type": "string"
          },
          "claimId": {
            "nullable": true,
            "type": "string"
          },
          "claimedAmountMinor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "disbursementRef": {
            "nullable": true,
            "type": "string"
          },
          "paidAt": {
            "nullable": true,
            "type": "string"
          },
          "rejectionReason": {
            "nullable": true,
            "type": "string"
          },
          "state": {
            "nullable": true,
            "type": "string"
          },
          "submittedAt": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RenewalPriceResolutionDto": {
        "additionalProperties": false,
        "properties": {
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "effectivePeriodStart": {
            "format": "date-time",
            "type": "string"
          },
          "grandfatherLockApplied": {
            "type": "boolean"
          },
          "grandfatherLockedUntil": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "grandfatherPriceLockId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "listAmountForegone": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "priceSource": {
            "nullable": true,
            "type": "string"
          },
          "pricingPlanId": {
            "format": "uuid",
            "type": "string"
          },
          "resolvedAmount": {
            "format": "double",
            "type": "number"
          },
          "resolvedAt": {
            "format": "date-time",
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ReprovisionSubscriptionEntitlementsResultDto": {
        "additionalProperties": false,
        "properties": {
          "baselined": {
            "format": "int32",
            "type": "integer"
          },
          "dryRun": {
            "type": "boolean"
          },
          "evidenceFallbacks": {
            "format": "int32",
            "type": "integer"
          },
          "evidenceIndexesReady": {
            "type": "boolean"
          },
          "examined": {
            "format": "int32",
            "type": "integer"
          },
          "nextCursor": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "reprovisioned": {
            "format": "int32",
            "type": "integer"
          },
          "skippedMissingPlan": {
            "format": "int32",
            "type": "integer"
          },
          "subscriptions": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReprovisionedSubscriptionDto"
            },
            "nullable": true,
            "type": "array"
          },
          "unchanged": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.ReprovisionedSubscriptionDto": {
        "additionalProperties": false,
        "properties": {
          "addedFeatureCodes": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "featureCodes": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "pricingPlanId": {
            "format": "uuid",
            "type": "string"
          },
          "published": {
            "type": "boolean"
          },
          "skipReason": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "clearedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "clientUserId": {
            "format": "uuid",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "failedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "failureReason": {
            "nullable": true,
            "type": "string"
          },
          "feeBasis": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lawFirmOrganizationId": {
            "format": "uuid",
            "type": "string"
          },
          "matterReference": {
            "nullable": true,
            "type": "string"
          },
          "payment": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingPaymentDto"
          },
          "paymentReference": {
            "nullable": true,
            "type": "string"
          },
          "refundedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "releasedToMatterAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingPaymentDto": {
        "additionalProperties": false,
        "properties": {
          "clientSdkUrl": {
            "nullable": true,
            "type": "string"
          },
          "clientSecret": {
            "nullable": true,
            "type": "string"
          },
          "environment": {
            "nullable": true,
            "type": "string"
          },
          "gateway": {
            "nullable": true,
            "type": "string"
          },
          "paymentIntentId": {
            "nullable": true,
            "type": "string"
          },
          "publishableKey": {
            "nullable": true,
            "type": "string"
          },
          "requiresAction": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RevenueByCurrencyDto": {
        "additionalProperties": false,
        "properties": {
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "revenue": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RevenueBySourceDto": {
        "additionalProperties": false,
        "properties": {
          "revenue": {
            "format": "double",
            "type": "number"
          },
          "source": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RevenueByStreamReportDto": {
        "additionalProperties": false,
        "properties": {
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "streams": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueStreamLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "totalRevenue": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RevenueByTierDto": {
        "additionalProperties": false,
        "properties": {
          "revenue": {
            "format": "double",
            "type": "number"
          },
          "subscriptionCount": {
            "format": "int32",
            "type": "integer"
          },
          "tier": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RevenueClassificationAssignmentDto": {
        "additionalProperties": false,
        "properties": {
          "class": {
            "nullable": true,
            "type": "string"
          },
          "classifiedBy": {
            "nullable": true,
            "type": "string"
          },
          "effectiveFrom": {
            "format": "date-time",
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "recordedAtUtc": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RevenueClassificationExceptionDto": {
        "additionalProperties": false,
        "properties": {
          "exceptionId": {
            "format": "uuid",
            "type": "string"
          },
          "firstContext": {
            "nullable": true,
            "type": "string"
          },
          "firstObservedAtUtc": {
            "format": "date-time",
            "type": "string"
          },
          "lastObservedAtUtc": {
            "format": "date-time",
            "type": "string"
          },
          "observationCount": {
            "format": "int32",
            "type": "integer"
          },
          "tenantId": {
            "format": "uuid",
            "type": "string"
          },
          "tenantType": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.RevenueClassification.RevenueTenantType"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RevenueExclusionDisclosureDto": {
        "additionalProperties": false,
        "properties": {
          "byClass": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueExclusionLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "excludedTenantCount": {
            "format": "int32",
            "type": "integer"
          },
          "exclusionApplied": {
            "type": "boolean"
          },
          "summary": {
            "nullable": true,
            "type": "string"
          },
          "totalExcludedAmount": {
            "format": "double",
            "type": "number"
          },
          "unclassifiedAmount": {
            "format": "double",
            "type": "number"
          },
          "unclassifiedTenantCount": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RevenueExclusionLineDto": {
        "additionalProperties": false,
        "properties": {
          "class": {
            "nullable": true,
            "type": "string"
          },
          "excludedAmount": {
            "format": "double",
            "type": "number"
          },
          "tenantCount": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RevenueReportDto": {
        "additionalProperties": false,
        "properties": {
          "byCurrency": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueByCurrencyDto"
            },
            "nullable": true,
            "type": "array"
          },
          "bySource": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueBySourceDto"
            },
            "nullable": true,
            "type": "array"
          },
          "byTier": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueByTierDto"
            },
            "nullable": true,
            "type": "array"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "exclusions": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueExclusionDisclosureDto"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "totalRevenue": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RevenueStreamLineDto": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "nullable": true,
            "type": "string"
          },
          "revenue": {
            "format": "double",
            "type": "number"
          },
          "stream": {
            "nullable": true,
            "type": "string"
          },
          "transactionCount": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RollbackSandboxLicenceRequest": {
        "additionalProperties": false,
        "properties": {
          "purchaseId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.RoutedSeatTrueUpDto": {
        "additionalProperties": false,
        "properties": {
          "commercialRoute": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "pricesHidden": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SandboxLicenceContextDto": {
        "additionalProperties": false,
        "properties": {
          "audience": {
            "nullable": true,
            "type": "string"
          },
          "billedThroughDisplayName": {
            "nullable": true,
            "type": "string"
          },
          "held": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.HeldSandboxLicenceDto"
            },
            "nullable": true,
            "type": "array"
          },
          "highestHeldInstanceTier": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "mode": {
            "nullable": true,
            "type": "string"
          },
          "offers": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicenceOfferDto"
            },
            "nullable": true,
            "type": "array"
          },
          "onBehalfOfPayer": {
            "type": "boolean"
          },
          "ownerOrganizationId": {
            "format": "uuid",
            "type": "string"
          },
          "partnerStanding": {
            "nullable": true,
            "type": "string"
          },
          "pricesHidden": {
            "type": "boolean"
          },
          "route": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SandboxLicenceOfferDto": {
        "additionalProperties": false,
        "properties": {
          "cadence": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "eligible": {
            "type": "boolean"
          },
          "licenceTier": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "maxPerOwner": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "price": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "refusal": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicenceRefusalDto"
          },
          "selfServicePurchasable": {
            "type": "boolean"
          },
          "skuCode": {
            "nullable": true,
            "type": "string"
          },
          "subname": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SandboxLicencePurchaseDto": {
        "additionalProperties": false,
        "properties": {
          "amountDue": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "awaitingPaymentInvoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "commercialRoute": {
            "nullable": true,
            "type": "string"
          },
          "convertedFromSubscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "convertsSponsoredSubscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "currentPeriodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "endDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "invoiceToOrganizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "licenceFamily": {
            "nullable": true,
            "type": "string"
          },
          "licenceTier": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "ownerOrganizationId": {
            "format": "uuid",
            "type": "string"
          },
          "replay": {
            "type": "boolean"
          },
          "skuCode": {
            "nullable": true,
            "type": "string"
          },
          "sponsored": {
            "type": "boolean"
          },
          "sponsoredUntil": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "sponsorshipPurpose": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SandboxLicenceRefusalDto": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "nullable": true,
            "type": "string"
          },
          "heldSubscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "rule": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SandboxLicenceRollbackDto": {
        "additionalProperties": false,
        "properties": {
          "invoiceSettlement": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SandboxSponsorshipDto": {
        "additionalProperties": false,
        "properties": {
          "extensions": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxSponsorshipExtensionDto"
            },
            "nullable": true,
            "type": "array"
          },
          "grantedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "grantedBy": {
            "nullable": true,
            "type": "string"
          },
          "licenceFamily": {
            "nullable": true,
            "type": "string"
          },
          "licenceTier": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "ownerOrganizationId": {
            "format": "uuid",
            "type": "string"
          },
          "reference": {
            "nullable": true,
            "type": "string"
          },
          "replay": {
            "type": "boolean"
          },
          "skuCode": {
            "nullable": true,
            "type": "string"
          },
          "sponsored": {
            "type": "boolean"
          },
          "sponsoredUntil": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "sponsorshipPurpose": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SandboxSponsorshipExtensionDto": {
        "additionalProperties": false,
        "properties": {
          "extendedAt": {
            "format": "date-time",
            "type": "string"
          },
          "extendedBy": {
            "nullable": true,
            "type": "string"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatBillingSpanDto": {
        "additionalProperties": false,
        "properties": {
          "activeFrom": {
            "format": "date-time",
            "type": "string"
          },
          "activeTo": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "held": {
            "type": "boolean"
          },
          "holdReason": {
            "nullable": true,
            "type": "string"
          },
          "seatRef": {
            "nullable": true,
            "type": "string"
          },
          "stoppedReason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatChangeRecordDto": {
        "additionalProperties": false,
        "properties": {
          "accessRevokedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "actorRef": {
            "format": "uuid",
            "type": "string"
          },
          "consentDisposition": {
            "nullable": true,
            "type": "string"
          },
          "consentGrantsAffected": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "evidenceFailureReason": {
            "nullable": true,
            "type": "string"
          },
          "evidenceState": {
            "nullable": true,
            "type": "string"
          },
          "handoverRoute": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "kept": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatEnvelopeLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "leaverRef": {
            "format": "uuid",
            "type": "string"
          },
          "newHolderRef": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "noNewChargeRaised": {
            "type": "boolean"
          },
          "personalStateCarriedOver": {
            "type": "boolean"
          },
          "planLabel": {
            "nullable": true,
            "type": "string"
          },
          "reassignedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "reclaimedAt": {
            "format": "date-time",
            "type": "string"
          },
          "revoked": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatEnvelopeLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "scope": {
            "nullable": true,
            "type": "string"
          },
          "seatRef": {
            "nullable": true,
            "type": "string"
          },
          "seatRefOrigin": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatDiffRowDto": {
        "additionalProperties": false,
        "properties": {
          "consentState": {
            "nullable": true,
            "type": "string"
          },
          "driftKind": {
            "nullable": true,
            "type": "string"
          },
          "externalRef": {
            "nullable": true,
            "type": "string"
          },
          "holdsBilledSeat": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatDriftAlertDto": {
        "additionalProperties": false,
        "properties": {
          "acknowledgedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "acknowledgedBy": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "alertId": {
            "format": "uuid",
            "type": "string"
          },
          "billedSeats": {
            "format": "int32",
            "type": "integer"
          },
          "closedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "direction": {
            "nullable": true,
            "type": "string"
          },
          "impactAmount": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "raisedAt": {
            "format": "date-time",
            "type": "string"
          },
          "resolvedByDecisionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "seatDelta": {
            "format": "int32",
            "type": "integer"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "syncedSeats": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatEnvelopeLineDto": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "nullable": true,
            "type": "string"
          },
          "entitlementRef": {
            "nullable": true,
            "type": "string"
          },
          "label": {
            "nullable": true,
            "type": "string"
          },
          "revokedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatFigureDto": {
        "additionalProperties": false,
        "properties": {
          "available": {
            "type": "boolean"
          },
          "seats": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "source": {
            "nullable": true,
            "type": "string"
          },
          "unavailableReason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatNoticeDto": {
        "additionalProperties": false,
        "properties": {
          "consentDisposition": {
            "nullable": true,
            "type": "string"
          },
          "effectiveAt": {
            "format": "date-time",
            "type": "string"
          },
          "effectiveAtConfirmed": {
            "type": "boolean"
          },
          "handoverRoute": {
            "nullable": true,
            "type": "string"
          },
          "inheritedPreviousHolderState": {
            "type": "boolean"
          },
          "orgFeatures": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatEnvelopeLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "personalVaultRetained": {
            "type": "boolean"
          },
          "planLabel": {
            "nullable": true,
            "type": "string"
          },
          "role": {
            "nullable": true,
            "type": "string"
          },
          "seatReassignmentId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatReclaimPolicyDto": {
        "additionalProperties": false,
        "properties": {
          "defaultHandoverRoute": {
            "nullable": true,
            "type": "string"
          },
          "defaultScope": {
            "nullable": true,
            "type": "string"
          },
          "orgConfigured": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatReclaimPreviewDto": {
        "additionalProperties": false,
        "properties": {
          "canConfirmOffboard": {
            "type": "boolean"
          },
          "defaultHandoverRoute": {
            "nullable": true,
            "type": "string"
          },
          "defaultScope": {
            "nullable": true,
            "type": "string"
          },
          "defaultsAreOrgConfigured": {
            "type": "boolean"
          },
          "envelopeUnavailableReason": {
            "nullable": true,
            "type": "string"
          },
          "kept": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatEnvelopeLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "leaverRef": {
            "format": "uuid",
            "type": "string"
          },
          "offboardBlockedReason": {
            "nullable": true,
            "type": "string"
          },
          "revoked": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatEnvelopeLineDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatReconciliationDto": {
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "assigned": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatFigureDto"
          },
          "billed": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatFigureDto"
          },
          "billingPeriodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "billingPeriodStart": {
            "format": "date-time",
            "type": "string"
          },
          "canCommitResolution": {
            "type": "boolean"
          },
          "contractVersion": {
            "nullable": true,
            "type": "string"
          },
          "costUnavailableReason": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "daysRemainingInPeriod": {
            "format": "int32",
            "type": "integer"
          },
          "direction": {
            "nullable": true,
            "type": "string"
          },
          "directionLabel": {
            "nullable": true,
            "type": "string"
          },
          "openAlert": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatDriftAlertDto"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "pendingDecision": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatResolutionDecisionDto"
          },
          "perSeatPerMonth": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "requiresResolution": {
            "type": "boolean"
          },
          "resolutionUnavailableReason": {
            "nullable": true,
            "type": "string"
          },
          "rosterAvailable": {
            "type": "boolean"
          },
          "rosterUnavailableReason": {
            "nullable": true,
            "type": "string"
          },
          "seatDelta": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "seats": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatDiffRowDto"
            },
            "nullable": true,
            "type": "array"
          },
          "synced": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatFigureDto"
          },
          "toleranceSeats": {
            "format": "int32",
            "type": "integer"
          },
          "trueUpAmount": {
            "format": "double",
            "nullable": true,
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatResolutionDecisionDto": {
        "additionalProperties": false,
        "properties": {
          "authoritativeSource": {
            "nullable": true,
            "type": "string"
          },
          "canUndo": {
            "type": "boolean"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "decidedAt": {
            "format": "date-time",
            "type": "string"
          },
          "decidedBy": {
            "format": "uuid",
            "type": "string"
          },
          "decisionId": {
            "format": "uuid",
            "type": "string"
          },
          "effectedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "failureReason": {
            "nullable": true,
            "type": "string"
          },
          "linkedInvoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "note": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "proratedAmount": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "recurringMonthlyDelta": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "seatChange": {
            "format": "int32",
            "type": "integer"
          },
          "seatDriftAlertId": {
            "format": "uuid",
            "type": "string"
          },
          "seatsAfter": {
            "format": "int32",
            "type": "integer"
          },
          "seatsBefore": {
            "format": "int32",
            "type": "integer"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "undoWindowEndsAt": {
            "format": "date-time",
            "type": "string"
          },
          "undoneAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatResolutionPreviewDto": {
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "available": {
            "type": "boolean"
          },
          "contractVersion": {
            "nullable": true,
            "type": "string"
          },
          "costUnavailableReason": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "currentBilledSeats": {
            "format": "int32",
            "type": "integer"
          },
          "daysRemainingInPeriod": {
            "format": "int32",
            "type": "integer"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "perSeatPerMonth": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "proratedAmount": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "recurringMonthlyDelta": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "reducesSeats": {
            "type": "boolean"
          },
          "seatChange": {
            "format": "int32",
            "type": "integer"
          },
          "targetSeats": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatTrueUpApprovalDto": {
        "additionalProperties": false,
        "properties": {
          "approvedAt": {
            "format": "date-time",
            "type": "string"
          },
          "approverRef": {
            "format": "uuid",
            "type": "string"
          },
          "grossAmountAtApproval": {
            "format": "double",
            "type": "number"
          },
          "role": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatTrueUpPeriodDto": {
        "additionalProperties": false,
        "properties": {
          "approvalUnavailableReason": {
            "nullable": true,
            "type": "string"
          },
          "approvals": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpApprovalDto"
            },
            "nullable": true,
            "type": "array"
          },
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "auditAnchorRef": {
            "nullable": true,
            "type": "string"
          },
          "averageDeployedSeats": {
            "format": "double",
            "type": "number"
          },
          "billableSeatMonths": {
            "format": "double",
            "type": "number"
          },
          "cadenceIsContractLocked": {
            "type": "boolean"
          },
          "cadenceLabel": {
            "nullable": true,
            "type": "string"
          },
          "canApprove": {
            "type": "boolean"
          },
          "canReconcile": {
            "type": "boolean"
          },
          "chargeDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "committedSeats": {
            "format": "int32",
            "type": "integer"
          },
          "contractAvailable": {
            "type": "boolean"
          },
          "contractUnavailableReason": {
            "nullable": true,
            "type": "string"
          },
          "contractVersion": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "floorDisclosure": {
            "nullable": true,
            "type": "string"
          },
          "grossAmount": {
            "format": "double",
            "type": "number"
          },
          "heldGrossAmount": {
            "format": "double",
            "type": "number"
          },
          "initiatedByRef": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "lockedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "lockedByApproval": {
            "type": "boolean"
          },
          "metered": {
            "type": "boolean"
          },
          "meteringBasis": {
            "nullable": true,
            "type": "string"
          },
          "meteringUnavailableReason": {
            "nullable": true,
            "type": "string"
          },
          "netAmount": {
            "format": "double",
            "type": "number"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "outstandingApprovals": {
            "format": "int32",
            "type": "integer"
          },
          "overageRatePerSeatPerMonth": {
            "format": "double",
            "type": "number"
          },
          "payableGrossAmount": {
            "format": "double",
            "type": "number"
          },
          "peakDeployedSeats": {
            "format": "int32",
            "type": "integer"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodLabel": {
            "nullable": true,
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "reconcileWindowClosesAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "requiredApprovalTier": {
            "nullable": true,
            "type": "string"
          },
          "requiredApprovalTierReason": {
            "nullable": true,
            "type": "string"
          },
          "runId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "samples": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatUsageSampleDto"
            },
            "nullable": true,
            "type": "array"
          },
          "seatSpans": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatBillingSpanDto"
            },
            "nullable": true,
            "type": "array"
          },
          "seatSpansNote": {
            "nullable": true,
            "type": "string"
          },
          "segments": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpSegmentDto"
            },
            "nullable": true,
            "type": "array"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "statusLabel": {
            "nullable": true,
            "type": "string"
          },
          "taxLabel": {
            "nullable": true,
            "type": "string"
          },
          "vatAmount": {
            "format": "double",
            "type": "number"
          },
          "vatRatePercent": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatTrueUpSegmentDto": {
        "additionalProperties": false,
        "properties": {
          "days": {
            "format": "int32",
            "type": "integer"
          },
          "daysInMonth": {
            "format": "int32",
            "type": "integer"
          },
          "deployedSeats": {
            "format": "int32",
            "type": "integer"
          },
          "end": {
            "format": "date-time",
            "type": "string"
          },
          "grossAmount": {
            "format": "double",
            "type": "number"
          },
          "netAmount": {
            "format": "double",
            "type": "number"
          },
          "overCommittedSeats": {
            "format": "int32",
            "type": "integer"
          },
          "start": {
            "format": "date-time",
            "type": "string"
          },
          "vatAmount": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SeatUsageSampleDto": {
        "additionalProperties": false,
        "properties": {
          "activeSeats": {
            "format": "int32",
            "type": "integer"
          },
          "date": {
            "format": "date-time",
            "type": "string"
          },
          "overCommittedSeats": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SetDefaultPaymentMethodResultDto": {
        "additionalProperties": false,
        "properties": {
          "overdueSettlement": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SkuDto": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "nullable": true,
            "type": "string"
          },
          "entitlements": {
            "additionalProperties": {
              "format": "int32",
              "type": "integer"
            },
            "nullable": true,
            "type": "object"
          },
          "family": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "listPrice": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "prerequisites": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "successorSkuCode": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SkuSummaryDto": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "nullable": true,
            "type": "string"
          },
          "disposition": {
            "nullable": true,
            "type": "string"
          },
          "licenceFamily": {
            "nullable": true,
            "type": "string"
          },
          "licenceTier": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "listPrice": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "maxPerOwner": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "minimumInstanceTier": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "minimumTermMonths": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "prerequisiteCodes": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "priceBasis": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "successorSkuCode": {
            "nullable": true,
            "type": "string"
          },
          "withdrawalEffectiveAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SlaBreachCreditDto": {
        "additionalProperties": false,
        "properties": {
          "breachDetectedAt": {
            "format": "date-time",
            "type": "string"
          },
          "breachId": {
            "format": "uuid",
            "type": "string"
          },
          "calculation": {
            "nullable": true,
            "type": "string"
          },
          "creditAmount": {
            "format": "double",
            "type": "number"
          },
          "creditIssued": {
            "type": "boolean"
          },
          "creditPercent": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "decidedAt": {
            "format": "date-time",
            "type": "string"
          },
          "downtimeMinutes": {
            "format": "double",
            "type": "number"
          },
          "ledgerCreditId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "measuredUptimePct": {
            "format": "double",
            "type": "number"
          },
          "measurementPeriod": {
            "nullable": true,
            "type": "string"
          },
          "measurementWindowEnd": {
            "format": "date-time",
            "type": "string"
          },
          "measurementWindowStart": {
            "format": "date-time",
            "type": "string"
          },
          "outcome": {
            "nullable": true,
            "type": "string"
          },
          "outcomeLabel": {
            "nullable": true,
            "type": "string"
          },
          "recipientPolicy": {
            "nullable": true,
            "type": "string"
          },
          "recordId": {
            "format": "uuid",
            "type": "string"
          },
          "serviceName": {
            "nullable": true,
            "type": "string"
          },
          "shortfallPct": {
            "format": "double",
            "type": "number"
          },
          "slaBasis": {
            "nullable": true,
            "type": "string"
          },
          "slaBasisLabel": {
            "nullable": true,
            "type": "string"
          },
          "targetUptimePct": {
            "format": "double",
            "type": "number"
          },
          "tier": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SlaCreditBandDto": {
        "additionalProperties": false,
        "properties": {
          "atOrBelowUptimePct": {
            "format": "double",
            "type": "number"
          },
          "creditPercentOfMonthlyFee": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SlaCreditRollupDto": {
        "additionalProperties": false,
        "properties": {
          "breachCount": {
            "format": "int32",
            "type": "integer"
          },
          "creditedCount": {
            "format": "int32",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "exceptionCount": {
            "format": "int32",
            "type": "integer"
          },
          "from": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "generatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "notEligibleCount": {
            "format": "int32",
            "type": "integer"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaBreachCreditDto"
            },
            "nullable": true,
            "type": "array"
          },
          "scope": {
            "nullable": true,
            "type": "string"
          },
          "scopeId": {
            "format": "uuid",
            "type": "string"
          },
          "to": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "totalCreditAmount": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SlaCreditTermsDto": {
        "additionalProperties": false,
        "properties": {
          "bands": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaCreditBandDto"
            },
            "nullable": true,
            "type": "array"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "recipientPolicy": {
            "nullable": true,
            "type": "string"
          },
          "source": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto": {
        "additionalProperties": false,
        "properties": {
          "computedAtIso": {
            "nullable": true,
            "type": "string"
          },
          "earlyLeavers": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EarlyLeaverDto"
            },
            "nullable": true,
            "type": "array"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SpendReconciliationLineDto": {
        "additionalProperties": false,
        "properties": {
          "achievedAtIso": {
            "nullable": true,
            "type": "string"
          },
          "allocationId": {
            "nullable": true,
            "type": "string"
          },
          "apprenticeReference": {
            "nullable": true,
            "type": "string"
          },
          "apprenticeshipId": {
            "nullable": true,
            "type": "string"
          },
          "attributedTo": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.AttributedActorDto"
          },
          "drawnPence": {
            "format": "int64",
            "type": "integer"
          },
          "isCompletionPayment": {
            "type": "boolean"
          },
          "lineId": {
            "nullable": true,
            "type": "string"
          },
          "milestoneAchieved": {
            "type": "boolean"
          },
          "milestoneCode": {
            "nullable": true,
            "type": "string"
          },
          "milestoneTitle": {
            "nullable": true,
            "type": "string"
          },
          "paidToProviderPence": {
            "format": "int64",
            "type": "integer"
          },
          "plannedPence": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SponsorPlanDistributionDto": {
        "additionalProperties": false,
        "properties": {
          "activeUserCount": {
            "format": "int32",
            "type": "integer"
          },
          "featureSet": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SponsorReportDto": {
        "additionalProperties": false,
        "properties": {
          "activeUserCount": {
            "format": "int32",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "planDistribution": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorPlanDistributionDto"
            },
            "nullable": true,
            "type": "array"
          },
          "sponsorOrgId": {
            "nullable": true,
            "type": "string"
          },
          "totalInvoiceAmount": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SponsoredBillingSummaryDto": {
        "additionalProperties": false,
        "properties": {
          "activeUserCount": {
            "format": "int32",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "featureSet": {
            "nullable": true,
            "type": "string"
          },
          "gracePeriodEnd": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "maxUsers": {
            "format": "int32",
            "type": "integer"
          },
          "monthlyCost": {
            "format": "double",
            "type": "number"
          },
          "sponsorOrgId": {
            "nullable": true,
            "type": "string"
          },
          "sponsorshipId": {
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "wholesalePerSeatPrice": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "wholesaleRate": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SponsoredByOrgDto": {
        "additionalProperties": false,
        "properties": {
          "activeSponsorships": {
            "format": "int32",
            "type": "integer"
          },
          "activeUserCount": {
            "format": "int32",
            "type": "integer"
          },
          "orgId": {
            "nullable": true,
            "type": "string"
          },
          "revenue": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SponsoredReportDto": {
        "additionalProperties": false,
        "properties": {
          "byOrg": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsoredByOrgDto"
            },
            "nullable": true,
            "type": "array"
          },
          "totalActiveSponsorships": {
            "format": "int32",
            "type": "integer"
          },
          "totalSponsoredRevenue": {
            "format": "double",
            "type": "number"
          },
          "totalSponsoredUsers": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SponsorshipDispatchReceiptDto": {
        "additionalProperties": false,
        "properties": {
          "alreadyDispatchedSkipped": {
            "format": "int32",
            "type": "integer"
          },
          "coldInvitesDispatched": {
            "format": "int32",
            "type": "integer"
          },
          "existingUsersDeferred": {
            "format": "int32",
            "type": "integer"
          },
          "remainingAllowance": {
            "format": "int32",
            "type": "integer"
          },
          "sponsorshipId": {
            "format": "uuid",
            "type": "string"
          },
          "submitted": {
            "format": "int32",
            "type": "integer"
          },
          "suppressedSkipped": {
            "format": "int32",
            "type": "integer"
          },
          "unresolvedSkipped": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SponsorshipDto": {
        "additionalProperties": false,
        "properties": {
          "attestationAcceptedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "audience": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.AudienceSelectorDto"
          },
          "budgetCapMinor": {
            "format": "int64",
            "type": "integer"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "expiresAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lawfulBasis": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.LawfulBasisRecordDto"
          },
          "moduleId": {
            "nullable": true,
            "type": "string"
          },
          "moduleName": {
            "nullable": true,
            "type": "string"
          },
          "sponsorOrgId": {
            "format": "uuid",
            "type": "string"
          },
          "startsAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SponsorshipInvoiceDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "dueDate": {
            "format": "date-time",
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceNumber": {
            "nullable": true,
            "type": "string"
          },
          "issuedAt": {
            "format": "date-time",
            "type": "string"
          },
          "paidAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SponsorshipLifecycleEntryDto": {
        "additionalProperties": false,
        "properties": {
          "actorRole": {
            "nullable": true,
            "type": "string"
          },
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "eventType": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "sponsorshipId": {
            "format": "uuid",
            "type": "string"
          },
          "subjectRedacted": {
            "type": "boolean"
          },
          "summary": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SponsorshipLifecyclePageDto": {
        "additionalProperties": false,
        "properties": {
          "page": {
            "format": "int32",
            "type": "integer"
          },
          "pageSize": {
            "format": "int32",
            "type": "integer"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipLifecycleEntryDto"
            },
            "nullable": true,
            "type": "array"
          },
          "totalRows": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SponsorshipUptakeDto": {
        "additionalProperties": false,
        "properties": {
          "activated": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.ValueObjects.KAnonCount"
          },
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "converted": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.ValueObjects.KAnonCount"
          },
          "granted": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.ValueObjects.KAnonCount"
          },
          "sponsorshipId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.StrandedOnboardingApplicationDto": {
        "additionalProperties": false,
        "properties": {
          "application": {
            "nullable": true,
            "type": "string"
          },
          "onboardingSessionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "outcome": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.StrandedOnboardingSubscriptionDto": {
        "additionalProperties": false,
        "properties": {
          "awaitingPaymentInvoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "licenceFamily": {
            "nullable": true,
            "type": "string"
          },
          "onboardingSessionId": {
            "format": "uuid",
            "type": "string"
          },
          "outcome": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SubjectErasureObligationDto": {
        "additionalProperties": false,
        "properties": {
          "endsAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SubjectErasureObligationSummaryDto": {
        "additionalProperties": false,
        "properties": {
          "evaluatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "hasActiveObligation": {
            "type": "boolean"
          },
          "obligations": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubjectErasureObligationDto"
            },
            "nullable": true,
            "type": "array"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SubjectSubscriptionDto": {
        "additionalProperties": false,
        "properties": {
          "currentPeriodEnd": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "currentPeriodStart": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "entitlementActive": {
            "type": "boolean"
          },
          "startDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subjectId": {
            "format": "uuid",
            "type": "string"
          },
          "subjectType": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "tier": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SubjectVaultEntitlementDto": {
        "additionalProperties": false,
        "properties": {
          "entitlementActive": {
            "type": "boolean"
          },
          "storageQuotaBytes": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "storageUnlimited": {
            "type": "boolean"
          },
          "subjectId": {
            "format": "uuid",
            "type": "string"
          },
          "subjectType": {
            "nullable": true,
            "type": "string"
          },
          "tier": {
            "nullable": true,
            "type": "string"
          },
          "vaultStrategy": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SubscriptionDto": {
        "additionalProperties": false,
        "properties": {
          "awaitingPaymentInvoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "billingPeriod": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.BillingPeriodDto"
          },
          "canceledAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "cancellationReason": {
            "nullable": true,
            "type": "string"
          },
          "collectionMethod": {
            "nullable": true,
            "type": "string"
          },
          "commercialRoute": {
            "nullable": true,
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "currentPeriodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "currentPeriodStart": {
            "format": "date-time",
            "type": "string"
          },
          "endDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceToOrganizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionItemDto"
            },
            "nullable": true,
            "type": "array"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "pendingPlanChangeId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "pendingUpgradePlanId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "planChangeEffectiveDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "pricingPlanId": {
            "format": "uuid",
            "type": "string"
          },
          "sponsored": {
            "type": "boolean"
          },
          "sponsoredUntil": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "sponsorshipPurpose": {
            "nullable": true,
            "type": "string"
          },
          "startDate": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "tier": {
            "nullable": true,
            "type": "string"
          },
          "trialEndDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "trialStartDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SubscriptionGrandfatherStateDto": {
        "additionalProperties": false,
        "properties": {
          "lock": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrandfatherPriceLockDto"
          },
          "resolutions": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RenewalPriceResolutionDto"
            },
            "nullable": true,
            "type": "array"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SubscriptionItemDto": {
        "additionalProperties": false,
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "pricingPlanId": {
            "format": "uuid",
            "type": "string"
          },
          "quantity": {
            "format": "int32",
            "type": "integer"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "unitPrice": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MoneyDto"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SubscriptionPlanSummaryDto": {
        "additionalProperties": false,
        "properties": {
          "currentPeriodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "currentPeriodStart": {
            "format": "date-time",
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "tier": {
            "nullable": true,
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.SubscriptionStateHistoryDto": {
        "additionalProperties": false,
        "properties": {
          "changedAt": {
            "format": "date-time",
            "type": "string"
          },
          "changedBy": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "newStatus": {
            "nullable": true,
            "type": "string"
          },
          "previousStatus": {
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.TaxDeterminationDto": {
        "additionalProperties": false,
        "properties": {
          "determinedAt": {
            "format": "date-time",
            "type": "string"
          },
          "determinedBy": {
            "nullable": true,
            "type": "string"
          },
          "ratePercent": {
            "format": "double",
            "type": "number"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.TaxPendingQueueItemDto": {
        "additionalProperties": false,
        "properties": {
          "attempts": {
            "format": "int32",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "determination": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.TaxDeterminationDto"
          },
          "escalated": {
            "type": "boolean"
          },
          "escalatesAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "heldForHours": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "heldSince": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceNumber": {
            "nullable": true,
            "type": "string"
          },
          "lastFailureReason": {
            "nullable": true,
            "type": "string"
          },
          "lineCount": {
            "format": "int32",
            "type": "integer"
          },
          "netAmount": {
            "format": "double",
            "type": "number"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "subscriptionInvoluntarilyPaused": {
            "type": "boolean"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.TenantRevenueClassificationDto": {
        "additionalProperties": false,
        "properties": {
          "asOfUtc": {
            "format": "date-time",
            "type": "string"
          },
          "currentClass": {
            "nullable": true,
            "type": "string"
          },
          "history": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueClassificationAssignmentDto"
            },
            "nullable": true,
            "type": "array"
          },
          "isRevenueBearing": {
            "type": "boolean"
          },
          "tenantId": {
            "format": "uuid",
            "type": "string"
          },
          "tenantType": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.RevenueClassification.RevenueTenantType"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.TopCustomerRevenueDto": {
        "additionalProperties": false,
        "properties": {
          "customerKey": {
            "nullable": true,
            "type": "string"
          },
          "customerScope": {
            "nullable": true,
            "type": "string"
          },
          "invoiceCount": {
            "format": "int32",
            "type": "integer"
          },
          "revenue": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.UpgradeChargePreviewDto": {
        "additionalProperties": false,
        "properties": {
          "appliesImmediately": {
            "type": "boolean"
          },
          "awaitingPaymentInvoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "incomingCharge": {
            "format": "double",
            "type": "number"
          },
          "ledgerCredit": {
            "format": "double",
            "type": "number"
          },
          "netCharge": {
            "format": "double",
            "type": "number"
          },
          "outgoingCredit": {
            "format": "double",
            "type": "number"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodTotalDays": {
            "format": "int32",
            "type": "integer"
          },
          "planName": {
            "nullable": true,
            "type": "string"
          },
          "pricesIncludeTax": {
            "type": "boolean"
          },
          "pricingPlanId": {
            "format": "uuid",
            "type": "string"
          },
          "remainingDays": {
            "format": "int32",
            "type": "integer"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "subtotal": {
            "format": "double",
            "type": "number"
          },
          "taxAmount": {
            "format": "double",
            "type": "number"
          },
          "totalPayable": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.UsageCostDisclosureDto": {
        "additionalProperties": false,
        "properties": {
          "billableQuantity": {
            "format": "double",
            "type": "number"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "disclosedCost": {
            "format": "double",
            "type": "number"
          },
          "includedQuantity": {
            "format": "double",
            "type": "number"
          },
          "isBillable": {
            "type": "boolean"
          },
          "metricType": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.UsageRecord.UsageMetricType"
          },
          "planName": {
            "nullable": true,
            "type": "string"
          },
          "pricingPlanId": {
            "format": "uuid",
            "type": "string"
          },
          "projectedQuantity": {
            "format": "double",
            "type": "number"
          },
          "summary": {
            "nullable": true,
            "type": "string"
          },
          "tierBreakdown": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageCostTierDto"
            },
            "nullable": true,
            "type": "array"
          },
          "unit": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.UsageCostTierDto": {
        "additionalProperties": false,
        "properties": {
          "cost": {
            "format": "double",
            "type": "number"
          },
          "pricePerUnit": {
            "format": "double",
            "type": "number"
          },
          "quantity": {
            "format": "double",
            "type": "number"
          },
          "tierEnd": {
            "format": "double",
            "type": "number"
          },
          "tierStart": {
            "format": "double",
            "type": "number"
          },
          "unit": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.UsageRecordDto": {
        "additionalProperties": false,
        "properties": {
          "aggregated": {
            "type": "boolean"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "metricType": {
            "nullable": true,
            "type": "string"
          },
          "metricValue": {
            "format": "double",
            "type": "number"
          },
          "notMetered": {
            "type": "boolean"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "quotaReservationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "quotaReservationReplayed": {
            "type": "boolean"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "timestamp": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.UsageSummaryDto": {
        "additionalProperties": false,
        "properties": {
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "metricSummaries": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MetricUsageSummary"
            },
            "nullable": true,
            "type": "array"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.UsageWarningDto": {
        "additionalProperties": false,
        "properties": {
          "alertThresholdPercentage": {
            "format": "double",
            "type": "number"
          },
          "currentUsage": {
            "format": "double",
            "type": "number"
          },
          "limit": {
            "format": "double",
            "type": "number"
          },
          "message": {
            "nullable": true,
            "readOnly": true,
            "type": "string"
          },
          "metricType": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.UsageRecord.UsageMetricType"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "unit": {
            "nullable": true,
            "type": "string"
          },
          "usagePercentage": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.UseWearDeductionDto": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "appliedAt": {
            "format": "date-time",
            "type": "string"
          },
          "appliedByPartyId": {
            "format": "uuid",
            "type": "string"
          },
          "consumerDisputeReason": {
            "nullable": true,
            "type": "string"
          },
          "consumerReviewedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "jurisdiction": {
            "nullable": true,
            "type": "string"
          },
          "legalBasis": {
            "nullable": true,
            "type": "string"
          },
          "reviewStatus": {
            "nullable": true,
            "type": "string"
          },
          "sellerStatedReason": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.VoidStrandedOnboardingSubscriptionsResultDto": {
        "additionalProperties": false,
        "properties": {
          "applications": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.StrandedOnboardingApplicationDto"
            },
            "nullable": true,
            "type": "array"
          },
          "dryRun": {
            "type": "boolean"
          },
          "eligible": {
            "format": "int32",
            "type": "integer"
          },
          "subscriptions": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.StrandedOnboardingSubscriptionDto"
            },
            "nullable": true,
            "type": "array"
          },
          "voided": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.WriteOffApprovalDto": {
        "additionalProperties": false,
        "properties": {
          "amountAtApproval": {
            "format": "double",
            "type": "number"
          },
          "approvedAt": {
            "format": "date-time",
            "type": "string"
          },
          "approverRef": {
            "nullable": true,
            "type": "string"
          },
          "role": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.WriteOffProposalDto": {
        "additionalProperties": false,
        "properties": {
          "accountId": {
            "format": "uuid",
            "type": "string"
          },
          "accountKey": {
            "nullable": true,
            "type": "string"
          },
          "accountKind": {
            "nullable": true,
            "type": "string"
          },
          "ageDays": {
            "format": "int32",
            "type": "integer"
          },
          "amount": {
            "format": "double",
            "type": "number"
          },
          "anchoredAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "approvals": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.WriteOffApprovalDto"
            },
            "nullable": true,
            "type": "array"
          },
          "auditAnchorReference": {
            "nullable": true,
            "type": "string"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "executedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "executedByRef": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invoices": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.WriteOffProposalInvoiceDto"
            },
            "nullable": true,
            "type": "array"
          },
          "justification": {
            "nullable": true,
            "type": "string"
          },
          "reasonCode": {
            "nullable": true,
            "type": "string"
          },
          "rejectedByRef": {
            "nullable": true,
            "type": "string"
          },
          "rejectionReason": {
            "nullable": true,
            "type": "string"
          },
          "requestedAt": {
            "format": "date-time",
            "type": "string"
          },
          "requestedByRef": {
            "nullable": true,
            "type": "string"
          },
          "requiredApproverCount": {
            "format": "int32",
            "type": "integer"
          },
          "requiredTier": {
            "nullable": true,
            "type": "string"
          },
          "requiresCfoSignOff": {
            "type": "boolean"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.DTOs.WriteOffProposalInvoiceDto": {
        "additionalProperties": false,
        "properties": {
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceNumber": {
            "nullable": true,
            "type": "string"
          },
          "outstandingAmount": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.AccountHealth.AccountHealthSignalDto": {
        "additionalProperties": false,
        "properties": {
          "normalisedValue": {
            "format": "double",
            "type": "number"
          },
          "observedAt": {
            "format": "date-time",
            "type": "string"
          },
          "rawValue": {
            "format": "double",
            "type": "number"
          },
          "signalKey": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.AccountHealth.AccountHealthSignalsResponse": {
        "additionalProperties": false,
        "properties": {
          "signals": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.AccountHealth.AccountHealthSignalDto"
            },
            "nullable": true,
            "type": "array"
          },
          "windowEnd": {
            "format": "date-time",
            "type": "string"
          },
          "windowStart": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Channel.RoutedOrganisationDto": {
        "additionalProperties": false,
        "properties": {
          "amountError": {
            "nullable": true,
            "type": "string"
          },
          "commercialRoute": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "instanceSkuCode": {
            "nullable": true,
            "type": "string"
          },
          "licencePosture": {
            "nullable": true,
            "type": "string"
          },
          "licensedSeats": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "nextInvoiceDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "nextPeriodBuyAmount": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "organizationDisplayName": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "paymentTermsDays": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "userLicenceSkuCode": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.ChannelReceivables.PartnerCurrencyPosition": {
        "additionalProperties": false,
        "properties": {
          "bucket": {
            "nullable": true,
            "type": "string"
          },
          "byBucket": {
            "additionalProperties": {
              "format": "double",
              "type": "number"
            },
            "nullable": true,
            "type": "object"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "daysPastDue": {
            "format": "int32",
            "type": "integer"
          },
          "oldestDueDate": {
            "format": "date-time",
            "type": "string"
          },
          "openItemCount": {
            "format": "int32",
            "type": "integer"
          },
          "totalOutstanding": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.ChannelReceivables.PartnerReceivableItem": {
        "additionalProperties": false,
        "properties": {
          "bucket": {
            "nullable": true,
            "type": "string"
          },
          "channelOrderId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "daysPastDue": {
            "format": "int32",
            "type": "integer"
          },
          "dueDate": {
            "format": "date-time",
            "type": "string"
          },
          "invoiceDate": {
            "format": "date-time",
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceNumber": {
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "nullable": true,
            "type": "string"
          },
          "outstanding": {
            "format": "double",
            "type": "number"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.ChannelReceivables.PartnerReceivablesPosition": {
        "additionalProperties": false,
        "properties": {
          "ageingBasis": {
            "nullable": true,
            "type": "string"
          },
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.ChannelReceivables.PartnerReceivableItem"
            },
            "nullable": true,
            "type": "array"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "positions": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.ChannelReceivables.PartnerCurrencyPosition"
            },
            "nullable": true,
            "type": "array"
          },
          "uninvoicedBuySellOrders": {
            "format": "int32",
            "type": "integer"
          },
          "writtenOff": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.ChannelReceivables.PartnerWrittenOff"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.ChannelReceivables.PartnerWrittenOff": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Commissions.CommissionDto": {
        "additionalProperties": false,
        "properties": {
          "commissionAmount": {
            "format": "double",
            "type": "number"
          },
          "commissionRate": {
            "format": "double",
            "type": "number"
          },
          "commissionType": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "earnedDate": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "paidDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "partnerCode": {
            "nullable": true,
            "type": "string"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "paymentId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "payoutId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "productType": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "transactionAmount": {
            "format": "double",
            "type": "number"
          },
          "transactionDate": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Commissions.PendingBalanceDto": {
        "additionalProperties": false,
        "properties": {
          "commissionCount": {
            "format": "int32",
            "type": "integer"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "pendingAmount": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.CorporateGroups.CorporateGroupBillingRollupDto": {
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "basis": {
            "nullable": true,
            "type": "string"
          },
          "complete": {
            "type": "boolean"
          },
          "entities": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.CorporateGroups.GroupEntityBillingDto"
            },
            "nullable": true,
            "type": "array"
          },
          "excludedCount": {
            "format": "int32",
            "type": "integer"
          },
          "parentOrgId": {
            "format": "uuid",
            "type": "string"
          },
          "periodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "periodStart": {
            "format": "date-time",
            "type": "string"
          },
          "totals": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.CorporateGroups.GroupCurrencyTotalDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.CorporateGroups.GroupCurrencyAmountDto": {
        "additionalProperties": false,
        "properties": {
          "credited": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "invoiceCount": {
            "format": "int32",
            "type": "integer"
          },
          "oneTime": {
            "format": "double",
            "type": "number"
          },
          "subscription": {
            "format": "double",
            "type": "number"
          },
          "total": {
            "format": "double",
            "type": "number"
          },
          "usage": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.CorporateGroups.GroupCurrencyTotalDto": {
        "additionalProperties": false,
        "properties": {
          "credited": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "entityCount": {
            "format": "int32",
            "type": "integer"
          },
          "invoiceCount": {
            "format": "int32",
            "type": "integer"
          },
          "oneTime": {
            "format": "double",
            "type": "number"
          },
          "subscription": {
            "format": "double",
            "type": "number"
          },
          "total": {
            "format": "double",
            "type": "number"
          },
          "usage": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.CorporateGroups.GroupEntityBillingDto": {
        "additionalProperties": false,
        "properties": {
          "amounts": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.CorporateGroups.GroupCurrencyAmountDto"
            },
            "nullable": true,
            "type": "array"
          },
          "invoiceCount": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "isCrossBorder": {
            "type": "boolean"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "residencyJurisdiction": {
            "nullable": true,
            "type": "string"
          },
          "role": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Licences.OrganisationLicencePostureDto": {
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "cause": {
            "nullable": true,
            "type": "string"
          },
          "offboardedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "posture": {
            "nullable": true,
            "type": "string"
          },
          "retentionEndsAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "since": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "suspendedLicences": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Licences.SuspendedLicenceDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Licences.SuspendedLicenceDto": {
        "additionalProperties": false,
        "properties": {
          "licenceFamily": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "suspendedAtUtc": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Marketplace.CloudMarketplaceSettlementBreakDto": {
        "additionalProperties": false,
        "properties": {
          "ageDays": {
            "format": "int32",
            "type": "integer"
          },
          "importedAtUtc": {
            "format": "date-time",
            "type": "string"
          },
          "line": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.CloudMarketplaceSettlementLineDto"
          },
          "marketplaceCode": {
            "nullable": true,
            "type": "string"
          },
          "reportReference": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Marketplace.CloudMarketplaceSettlementExceptionsDto": {
        "additionalProperties": false,
        "properties": {
          "breaks": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Marketplace.CloudMarketplaceSettlementBreakDto"
            },
            "nullable": true,
            "type": "array"
          },
          "count": {
            "format": "int32",
            "type": "integer"
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Marketplace.CloudMarketplaceSettlementPeriodCloseDto": {
        "additionalProperties": false,
        "properties": {
          "dispositionedCount": {
            "format": "int32",
            "type": "integer"
          },
          "isClosed": {
            "type": "boolean"
          },
          "lineCount": {
            "format": "int32",
            "type": "integer"
          },
          "marketplaceCode": {
            "nullable": true,
            "type": "string"
          },
          "matchedCount": {
            "format": "int32",
            "type": "integer"
          },
          "openCount": {
            "format": "int32",
            "type": "integer"
          },
          "periodEndUtc": {
            "format": "date-time",
            "type": "string"
          },
          "periodStartUtc": {
            "format": "date-time",
            "type": "string"
          },
          "reportCount": {
            "format": "int32",
            "type": "integer"
          },
          "reportReferences": {
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "state": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Partners.CommissionSummaryDto": {
        "additionalProperties": false,
        "properties": {
          "averageCommissionAmount": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "earliestCommission": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "excludedForeignCurrencyCommissions": {
            "format": "int32",
            "type": "integer"
          },
          "latestCommission": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "totalCommissions": {
            "format": "int32",
            "type": "integer"
          },
          "totalEarned": {
            "format": "double",
            "type": "number"
          },
          "totalPaid": {
            "format": "double",
            "type": "number"
          },
          "totalPending": {
            "format": "double",
            "type": "number"
          },
          "totalVoided": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Partners.MonthlyTrendDto": {
        "additionalProperties": false,
        "properties": {
          "commissionCount": {
            "format": "int32",
            "type": "integer"
          },
          "month": {
            "format": "int32",
            "type": "integer"
          },
          "monthName": {
            "nullable": true,
            "type": "string"
          },
          "payoutCount": {
            "format": "int32",
            "type": "integer"
          },
          "totalEarned": {
            "format": "double",
            "type": "number"
          },
          "totalPaid": {
            "format": "double",
            "type": "number"
          },
          "year": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Partners.PartnerFinancialReportDto": {
        "additionalProperties": false,
        "properties": {
          "commissionSummary": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.CommissionSummaryDto"
          },
          "generatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "monthlyTrends": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.MonthlyTrendDto"
            },
            "nullable": true,
            "type": "array"
          },
          "partnerCode": {
            "nullable": true,
            "type": "string"
          },
          "partnerId": {
            "format": "uuid",
            "type": "string"
          },
          "partnerName": {
            "nullable": true,
            "type": "string"
          },
          "payoutSummary": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.PayoutSummaryDto"
          },
          "reportPeriodEnd": {
            "format": "date-time",
            "type": "string"
          },
          "reportPeriodStart": {
            "format": "date-time",
            "type": "string"
          },
          "revenueShareBreakdown": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.RevenueShareBreakdownDto"
            },
            "nullable": true,
            "type": "array"
          },
          "status": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Partners.PayoutSummaryDto": {
        "additionalProperties": false,
        "properties": {
          "averagePayoutAmount": {
            "format": "double",
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "lastPayoutDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "nextScheduledPayout": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "oldestPendingManualFirstFailedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "pendingManualCount": {
            "format": "int32",
            "type": "integer"
          },
          "pendingManualForeignCurrencyCount": {
            "format": "int32",
            "type": "integer"
          },
          "totalFailed": {
            "format": "double",
            "type": "number"
          },
          "totalPaidOut": {
            "format": "double",
            "type": "number"
          },
          "totalPayouts": {
            "format": "int32",
            "type": "integer"
          },
          "totalPending": {
            "format": "double",
            "type": "number"
          },
          "totalPendingManual": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Partners.RevenueShareBreakdownDto": {
        "additionalProperties": false,
        "properties": {
          "effectiveRate": {
            "format": "double",
            "type": "number"
          },
          "productType": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionTier": {
            "nullable": true,
            "type": "string"
          },
          "totalCommissions": {
            "format": "double",
            "type": "number"
          },
          "totalRevenue": {
            "format": "double",
            "type": "number"
          },
          "transactionCount": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Receivables.AccountCollectionsDetail": {
        "additionalProperties": false,
        "properties": {
          "arrangementNote": {
            "nullable": true,
            "type": "string"
          },
          "constituents": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Receivables.ReceivableConstituent"
            },
            "nullable": true,
            "type": "array"
          },
          "escalationHistory": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Receivables.EscalationHistoryEntry"
            },
            "nullable": true,
            "type": "array"
          },
          "holdCount": {
            "format": "int32",
            "type": "integer"
          },
          "ladderStageAtHold": {
            "format": "int32",
            "type": "integer"
          },
          "position": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Receivables.AccountReceivablesPosition"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Receivables.AccountCollectionsDetailDto": {
        "additionalProperties": false,
        "properties": {
          "detail": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Receivables.AccountCollectionsDetail"
          },
          "state": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.AccountCollectionsStateDto"
          },
          "writeOffProposals": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.WriteOffProposalDto"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Receivables.AccountReceivablesPosition": {
        "additionalProperties": false,
        "properties": {
          "accountId": {
            "format": "uuid",
            "type": "string"
          },
          "accountKey": {
            "nullable": true,
            "type": "string"
          },
          "accountKind": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.CollectionsAccountKind"
          },
          "bucket": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.ReceivablesAgeingBucket"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "daysPastDue": {
            "format": "int32",
            "type": "integer"
          },
          "holdReason": {
            "nullable": true,
            "type": "string"
          },
          "holdUntil": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "lastContactAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "lastContactLadder": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.CollectionsLadderKind"
          },
          "lastContactStage": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "oldestBasisDate": {
            "format": "date-time",
            "type": "string"
          },
          "openItemCount": {
            "format": "int32",
            "type": "integer"
          },
          "ownerRef": {
            "nullable": true,
            "type": "string"
          },
          "ownership": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.CollectionsLadderOwnership"
          },
          "pastEscalationWindow": {
            "type": "boolean"
          },
          "suppressionReason": {
            "nullable": true,
            "type": "string"
          },
          "totalOutstanding": {
            "format": "double",
            "type": "number"
          },
          "writtenOffValue": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Receivables.AgeingBandTotal": {
        "additionalProperties": false,
        "properties": {
          "accountCount": {
            "format": "int32",
            "type": "integer"
          },
          "bucket": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.ReceivablesAgeingBucket"
          },
          "value": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Receivables.CollectionsPerformance": {
        "additionalProperties": false,
        "properties": {
          "billedInWindow": {
            "format": "double",
            "type": "number"
          },
          "closingReceivables": {
            "format": "double",
            "type": "number"
          },
          "collectedInWindow": {
            "format": "double",
            "type": "number"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "daysSalesOutstanding": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "openingReceivables": {
            "format": "double",
            "type": "number"
          },
          "overNinetyValue": {
            "format": "double",
            "type": "number"
          },
          "pendingWriteOffValue": {
            "format": "double",
            "type": "number"
          },
          "recoveryRate": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "writeOffRate": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "writtenOffInWindow": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Receivables.CollectionsWorklistPage": {
        "additionalProperties": false,
        "properties": {
          "asAt": {
            "format": "date-time",
            "type": "string"
          },
          "basisDescription": {
            "nullable": true,
            "type": "string"
          },
          "currencySubtotals": {
            "additionalProperties": {
              "format": "double",
              "type": "number"
            },
            "nullable": true,
            "type": "object"
          },
          "positions": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Receivables.AccountReceivablesPosition"
            },
            "nullable": true,
            "type": "array"
          },
          "totalMatching": {
            "format": "int32",
            "type": "integer"
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Receivables.CurrencyAgeingSummary": {
        "additionalProperties": false,
        "properties": {
          "bands": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Receivables.AgeingBandTotal"
            },
            "nullable": true,
            "type": "array"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "totalAccounts": {
            "format": "int32",
            "type": "integer"
          },
          "totalOutstanding": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Receivables.EscalationHistoryEntry": {
        "additionalProperties": false,
        "properties": {
          "attemptedAt": {
            "format": "date-time",
            "type": "string"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "detail": {
            "nullable": true,
            "type": "string"
          },
          "ladder": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.CollectionsLadderKind"
          },
          "nextActionDate": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "outcome": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.EscalationOutcome"
          },
          "stage": {
            "format": "int32",
            "type": "integer"
          },
          "totalOutstanding": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Receivables.ReceivableConstituent": {
        "additionalProperties": false,
        "properties": {
          "bucket": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.ReceivablesAgeingBucket"
          },
          "currencyCode": {
            "nullable": true,
            "type": "string"
          },
          "daysPastDue": {
            "format": "int32",
            "type": "integer"
          },
          "dueDate": {
            "format": "date-time",
            "type": "string"
          },
          "invoiceDate": {
            "format": "date-time",
            "type": "string"
          },
          "invoiceId": {
            "format": "uuid",
            "type": "string"
          },
          "invoiceNumber": {
            "nullable": true,
            "type": "string"
          },
          "outstanding": {
            "format": "double",
            "type": "number"
          },
          "status": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Invoice.InvoiceStatus"
          },
          "type": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Invoice.InvoiceType"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Receivables.ReceivablesAgeingSummary": {
        "additionalProperties": false,
        "properties": {
          "asAt": {
            "format": "date-time",
            "type": "string"
          },
          "basisDescription": {
            "nullable": true,
            "type": "string"
          },
          "currencies": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Receivables.CurrencyAgeingSummary"
            },
            "nullable": true,
            "type": "array"
          },
          "scannedItemCount": {
            "format": "int32",
            "type": "integer"
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.SeatReconciliation.SeatDriftExposureDayDto": {
        "additionalProperties": false,
        "properties": {
          "billedSeats": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "day": {
            "format": "date-time",
            "type": "string"
          },
          "exposure": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "lastObservedAt": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "observations": {
            "format": "int32",
            "type": "integer"
          },
          "observed": {
            "type": "boolean"
          },
          "overSeats": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "peakOverSeats": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "perSeatPerMonth": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "seatDelta": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "syncedSeats": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.SeatReconciliation.SeatDriftExposureDto": {
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "contractVersion": {
            "nullable": true,
            "type": "string"
          },
          "costUnavailableReason": {
            "nullable": true,
            "type": "string"
          },
          "cumulativeExposure": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "days": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.SeatReconciliation.SeatDriftExposureDayDto"
            },
            "nullable": true,
            "type": "array"
          },
          "exposureComplete": {
            "type": "boolean"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "observedDays": {
            "format": "int32",
            "type": "integer"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "outstanding": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.SeatReconciliation.SeatDriftExposureDayDto"
          },
          "overProvisionedSeatDays": {
            "format": "int32",
            "type": "integer"
          },
          "overSeatDays": {
            "format": "int32",
            "type": "integer"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          },
          "underBilledDays": {
            "format": "int32",
            "type": "integer"
          },
          "unobservedDays": {
            "format": "int32",
            "type": "integer"
          },
          "unpricedUnderBilledDays": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.SeatReconciliation.SeatReconciliationHistoryDto": {
        "additionalProperties": false,
        "properties": {
          "alerts": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatDriftAlertDto"
            },
            "nullable": true,
            "type": "array"
          },
          "asOf": {
            "format": "date-time",
            "type": "string"
          },
          "decisions": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatResolutionDecisionDto"
            },
            "nullable": true,
            "type": "array"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Subledger.BillingsSnapshot": {
        "additionalProperties": false,
        "properties": {
          "billingEventIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "invoices": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Subledger.SubledgerInvoice"
            },
            "nullable": true,
            "type": "array"
          },
          "total": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Subledger.DiscountApprovalAttribution": {
        "enum": [
          0,
          1,
          2
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Application.Queries.Subledger.DiscountObservation": {
        "additionalProperties": false,
        "properties": {
          "approvalLevel": {
            "nullable": true,
            "type": "string"
          },
          "approvedBy": {
            "nullable": true,
            "type": "string"
          },
          "approvedValue": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "attribution": {
            "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Subledger.DiscountApprovalAttribution"
          },
          "authorisationReference": {
            "nullable": true,
            "type": "string"
          },
          "dealDeskCaseId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "reference": {
            "nullable": true,
            "type": "string"
          },
          "value": {
            "format": "double",
            "type": "number"
          },
          "withinApprovalPolicy": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Subledger.EntitlementObservation": {
        "additionalProperties": false,
        "properties": {
          "estimatedValue": {
            "format": "double",
            "type": "number"
          },
          "hasActiveSubscription": {
            "type": "boolean"
          },
          "isFromLapsedPlan": {
            "type": "boolean"
          },
          "reference": {
            "nullable": true,
            "type": "string"
          },
          "skuCode": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Subledger.LeakageObservations": {
        "additionalProperties": false,
        "properties": {
          "discounts": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Subledger.DiscountObservation"
            },
            "nullable": true,
            "type": "array"
          },
          "entitlements": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Subledger.EntitlementObservation"
            },
            "nullable": true,
            "type": "array"
          },
          "invoices": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Subledger.SubledgerInvoice"
            },
            "nullable": true,
            "type": "array"
          },
          "pricedSkus": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Subledger.PricedSkuObservation"
            },
            "nullable": true,
            "type": "array"
          },
          "usage": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Subledger.UsageObservation"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Subledger.PricedSkuObservation": {
        "additionalProperties": false,
        "properties": {
          "hasMeteringPath": {
            "type": "boolean"
          },
          "price": {
            "format": "double",
            "type": "number"
          },
          "skuCode": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Subledger.ReceivablesSnapshot": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Subledger.SubledgerItem"
            },
            "nullable": true,
            "type": "array"
          },
          "oldestItemAgeDays": {
            "format": "int32",
            "type": "integer"
          },
          "total": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Subledger.SubledgerInvoice": {
        "additionalProperties": false,
        "properties": {
          "hasPostedJournal": {
            "type": "boolean"
          },
          "reference": {
            "nullable": true,
            "type": "string"
          },
          "value": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Subledger.SubledgerItem": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "format": "double",
            "type": "number"
          },
          "label": {
            "nullable": true,
            "type": "string"
          },
          "reference": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Subledger.UsageObservation": {
        "additionalProperties": false,
        "properties": {
          "hasInvoiceLine": {
            "type": "boolean"
          },
          "reference": {
            "nullable": true,
            "type": "string"
          },
          "skuCode": {
            "nullable": true,
            "type": "string"
          },
          "value": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Usage.VerificationCheckUsageDto": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Usage.VerificationCheckUsageLineDto"
            },
            "nullable": true,
            "type": "array"
          },
          "propertyId": {
            "nullable": true,
            "type": "string"
          },
          "recordedCount": {
            "format": "int32",
            "type": "integer"
          },
          "requestId": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionId": {
            "format": "uuid",
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Queries.Usage.VerificationCheckUsageLineDto": {
        "additionalProperties": false,
        "properties": {
          "amountMinor": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "applicantId": {
            "nullable": true,
            "type": "string"
          },
          "check": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "includedAllowance": {
            "format": "double",
            "nullable": true,
            "type": "number"
          },
          "includedInPlan": {
            "type": "boolean"
          },
          "metricCode": {
            "nullable": true,
            "type": "string"
          },
          "occurredAt": {
            "format": "date-time",
            "type": "string"
          },
          "pricing": {
            "nullable": true,
            "type": "string"
          },
          "propertyId": {
            "nullable": true,
            "type": "string"
          },
          "quantity": {
            "format": "double",
            "type": "number"
          },
          "sku": {
            "nullable": true,
            "type": "string"
          },
          "unitPriceMinor": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "usageRecordId": {
            "format": "uuid",
            "type": "string"
          },
          "verificationId": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Application.Services.EntitlementEvidenceIndexReadiness": {
        "additionalProperties": false,
        "properties": {
          "indexes": {
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true,
            "type": "object"
          },
          "ready": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Contracts.Entitlements.CapacityCheckRequestDto": {
        "additionalProperties": false,
        "properties": {
          "currentCount": {
            "format": "int64",
            "type": "integer"
          },
          "featureCode": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "requested": {
            "format": "int64",
            "type": "integer"
          },
          "userId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Contracts.Entitlements.CapacityCheckResponseDto": {
        "additionalProperties": false,
        "properties": {
          "addOn": {
            "format": "int64",
            "type": "integer"
          },
          "allowance": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "allowed": {
            "type": "boolean"
          },
          "currentCount": {
            "format": "int64",
            "type": "integer"
          },
          "decision": {
            "nullable": true,
            "type": "string"
          },
          "included": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "message": {
            "nullable": true,
            "type": "string"
          },
          "remaining": {
            "format": "int64",
            "nullable": true,
            "type": "integer"
          },
          "requested": {
            "format": "int64",
            "type": "integer"
          },
          "upgradeMessage": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Contracts.Entitlements.CheckEntitlementRequestDto": {
        "additionalProperties": false,
        "properties": {
          "featureCode": {
            "nullable": true,
            "type": "string"
          },
          "organizationId": {
            "format": "uuid",
            "type": "string"
          },
          "pricingPlanId": {
            "format": "uuid",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Contracts.Entitlements.CheckEntitlementResponseDto": {
        "additionalProperties": false,
        "properties": {
          "hasAccess": {
            "type": "boolean"
          },
          "quotaExhausted": {
            "type": "boolean"
          },
          "reason": {
            "nullable": true,
            "type": "string"
          },
          "requiredPlanTier": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Contracts.Entitlements.ModuleProvisioningEntitlementResponseDto": {
        "additionalProperties": false,
        "properties": {
          "moduleSlotLimit": {
            "format": "int32",
            "type": "integer"
          },
          "requiredPlanTier": {
            "nullable": true,
            "type": "string"
          },
          "subscriptionActive": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Essence.Payment.Billing.Contracts.RevenueClassification.RevenueTenantType": {
        "enum": [
          1,
          2
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.Collections.CollectionsAccountKind": {
        "enum": [
          1,
          2
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.Collections.CollectionsLadderKind": {
        "enum": [
          1,
          2,
          3,
          4,
          5
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.Collections.CollectionsLadderOwnership": {
        "enum": [
          1,
          2,
          3,
          4,
          5
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.Collections.EscalationOutcome": {
        "enum": [
          1,
          2,
          3
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.Collections.ReceivablesAgeingBucket": {
        "enum": [
          0,
          1,
          2,
          3,
          4
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.Collections.WriteOffApproverRole": {
        "enum": [
          1,
          2
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.Collections.WriteOffProposalStatus": {
        "enum": [
          1,
          2,
          3,
          4,
          5
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.Collections.WriteOffReasonCode": {
        "enum": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.ConsumerRemedySettlement.ConsumerRemedyType": {
        "enum": [
          0,
          1,
          2
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.Invoice.InvoiceStatus": {
        "enum": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.Invoice.InvoiceType": {
        "enum": [
          1,
          2,
          3,
          4,
          5
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.RetainerTrustFunding.RetainerFeeBasis": {
        "enum": [
          0,
          1,
          2
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.Subscription.CollectionMethod": {
        "enum": [
          0,
          1
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.Subscription.SubscriptionClass": {
        "enum": [
          0,
          1
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.Aggregates.UsageRecord.UsageMetricType": {
        "enum": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20,
          21,
          22,
          23,
          24,
          25,
          26,
          27,
          28,
          29,
          30,
          31,
          32,
          33,
          34,
          35,
          36,
          37,
          38,
          39,
          40,
          41,
          42,
          43,
          44,
          45,
          46,
          47,
          48,
          49,
          50,
          51,
          52,
          53,
          54,
          55,
          56,
          57,
          58,
          59,
          60,
          61,
          62,
          63,
          64,
          65,
          66,
          67,
          68,
          69,
          70,
          71,
          72,
          73,
          74,
          75,
          76,
          77,
          78,
          79,
          80,
          81,
          82,
          83,
          84,
          85,
          86,
          87,
          88,
          89,
          90,
          91,
          92,
          93,
          94,
          95,
          96,
          97,
          98,
          99,
          100,
          101,
          102,
          103,
          104,
          105,
          106,
          107,
          108,
          109,
          110,
          111,
          112,
          113,
          114,
          115,
          116,
          117,
          118,
          119,
          120,
          121,
          122,
          123,
          124,
          125,
          126,
          127,
          128,
          129,
          130,
          131,
          132,
          133,
          134,
          135,
          136,
          137,
          138,
          139,
          140,
          141,
          142,
          143,
          144,
          145,
          146,
          147,
          148,
          149,
          150,
          151,
          152,
          153,
          154,
          155,
          156,
          157,
          158,
          159,
          160,
          161,
          162,
          163,
          164,
          166,
          167,
          168,
          169,
          170,
          171,
          172,
          173,
          174,
          175,
          176,
          177,
          178,
          179,
          180,
          181,
          182,
          183,
          184,
          185,
          186,
          187,
          188,
          189,
          190,
          191,
          192,
          193
        ],
        "format": "int32",
        "type": "integer"
      },
      "Essence.Payment.Billing.Domain.ValueObjects.KAnonCount": {
        "additionalProperties": false,
        "properties": {
          "floor": {
            "format": "int32",
            "type": "integer"
          },
          "suppressed": {
            "type": "boolean"
          },
          "value": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Essence.Platform.Contracts.Pagination.CursorResult`1[[Essence.Payment.Billing.Application.DTOs.PayoutDto, Essence.Payment.Billing.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]": {
        "additionalProperties": false,
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
            },
            "nullable": true,
            "type": "array"
          },
          "nextCursor": {
            "nullable": true,
            "type": "string"
          },
          "pageSize": {
            "format": "int32",
            "type": "integer"
          },
          "previousCursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Platform.Contracts.Pagination.CursorResult`1[[Essence.Payment.Billing.Application.Queries.Channel.RoutedOrganisationDto, Essence.Payment.Billing.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]": {
        "additionalProperties": false,
        "properties": {
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Channel.RoutedOrganisationDto"
            },
            "nullable": true,
            "type": "array"
          },
          "nextCursor": {
            "nullable": true,
            "type": "string"
          },
          "pageSize": {
            "format": "int32",
            "type": "integer"
          },
          "previousCursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Essence.Platform.Contracts.Pagination.PagedResult`1[[Essence.Payment.Billing.Application.DTOs.SkuSummaryDto, Essence.Payment.Billing.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]": {
        "additionalProperties": false,
        "properties": {
          "hasNextPage": {
            "readOnly": true,
            "type": "boolean"
          },
          "hasPreviousPage": {
            "readOnly": true,
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SkuSummaryDto"
            },
            "nullable": true,
            "type": "array"
          },
          "pageNumber": {
            "format": "int32",
            "type": "integer"
          },
          "pageSize": {
            "format": "int32",
            "type": "integer"
          },
          "totalCount": {
            "format": "int32",
            "type": "integer"
          },
          "totalPages": {
            "format": "int32",
            "readOnly": true,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Microsoft.AspNetCore.Mvc.ProblemDetails": {
        "additionalProperties": {},
        "properties": {
          "detail": {
            "nullable": true,
            "type": "string"
          },
          "instance": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "format": "int32",
            "nullable": true,
            "type": "integer"
          },
          "title": {
            "nullable": true,
            "type": "string"
          },
          "type": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "Bearer": {
        "description": "JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token.",
        "in": "header",
        "name": "Authorization",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "contact": {
      "email": "api@essence.platform",
      "name": "Essence Platform Team",
      "url": "https://essence.platform"
    },
    "description": "Production-Ready Billing & Subscription Management API.\n\nAll endpoints require a Bearer token issued by the Essence Auth service (WS-D 5.1 foundation adoption), except /api/v1/webhooks/* which uses signature verification.",
    "license": {
      "name": "Proprietary",
      "url": "https://essence.platform/license"
    },
    "title": "Essence Payment & Billing API",
    "version": "v1.0"
  },
  "openapi": "3.0.1",
  "paths": {
    "/api/v1/Analytics/partners/{partnerId}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodStart",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodEnd",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "includeMonthlyBreakdown",
            "schema": {
              "default": true,
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "includeTopPlans",
            "schema": {
              "default": true,
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "topPlansCount",
            "schema": {
              "default": 5,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PartnerAnalyticsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PartnerAnalyticsDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PartnerAnalyticsDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get comprehensive partner analytics.",
        "tags": [
          "Analytics"
        ]
      }
    },
    "/api/v1/Analytics/partners/{partnerId}/export": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodStart",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodEnd",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "403": {
            "content": {
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Export partner analytics to CSV.",
        "tags": [
          "Analytics"
        ]
      }
    },
    "/api/v1/Analytics/partners/{partnerId}/summary": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PartnerDashboardSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PartnerDashboardSummaryDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PartnerDashboardSummaryDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get partner dashboard summary.",
        "tags": [
          "Analytics"
        ]
      }
    },
    "/api/v1/BillingActuals/organizations/{organizationId}": {
      "get": {
        "parameters": [
          {
            "description": "The organisation to scope actuals to.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Inclusive window start (UTC); defaults to one year before periodEnd.",
            "in": "query",
            "name": "periodStart",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Inclusive window end (UTC); defaults to now.",
            "in": "query",
            "name": "periodEnd",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Freshness budget driving the staleness flag (default 24h).",
            "in": "query",
            "name": "freshnessBudgetHours",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.BillingActualsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.BillingActualsDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.BillingActualsDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Get realised billing actuals for an organisation over a period.",
        "tags": [
          "BillingActuals"
        ]
      }
    },
    "/api/v1/Entitlements/check": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.CheckEntitlementRequestDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.CheckEntitlementRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.CheckEntitlementRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.CheckEntitlementResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.CheckEntitlementResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.CheckEntitlementResponseDto"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Checks whether an organisation is entitled to provision an instance\r\n(or, for any other feature code, returns the ADR-018 boundary\r\ndenial — this endpoint is the provisioning/quota authority only).",
        "tags": [
          "Entitlements"
        ]
      }
    },
    "/api/v1/Entitlements/{organizationId}/module-provisioning": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.ModuleProvisioningEntitlementResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.ModuleProvisioningEntitlementResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.ModuleProvisioningEntitlementResponseDto"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Resolves an organisation's module-slot quota — the tier ceiling EPIC 7's\r\norg dashboard enforces before provisioning another paid module\r\n(FR-07.007). A module SLOT is a quota, so it is answered here and not by\r\nthe EntitlementEngine (ADR-018: Billing owns provisioning/quota because\r\nonly Billing holds the plan and its allowances).\r\n            \r\n<br>This is the exact contract EPIC 7's\r\n`BillingModuleEntitlementReader` has always called and which no\r\nservice implemented, leaving the Starter/Professional module ceilings\r\nenforced nowhere on the deployed fleet (debt-2026-08-15-249).",
        "tags": [
          "Entitlements"
        ]
      }
    },
    "/api/v1/Invoices": {
      "get": {
        "parameters": [
          {
            "description": "1-based page number.",
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "description": "Number of records per page (max 100).",
            "in": "query",
            "name": "pageSize",
            "schema": {
              "default": 20,
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "description": "Optional status filter: Pending, Paid, Overdue, Draft, Canceled.",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "summary": "List invoices for the authenticated user.",
        "tags": [
          "Invoices"
        ]
      },
      "post": {
        "description": "The owning `UserId` and `OrganizationId` are derived from\r\nthe JWT principal — any value supplied in the request body is\r\noverwritten (debt-2026-05-11-163, A07). Admin-on-behalf creation\r\nis routed through a separate Essence.Payment.Billing.Api.Authorization.BillingPolicies.Admin\r\nendpoint and is intentionally not exposed here.\r\n            \r\nExceptions propagate to the foundation GlobalExceptionHandler / local\r\nExceptionHandlingMiddleware (debt-2026-05-17-118): domain exceptions\r\nare mapped to ProblemDetails with the typed Code; unexpected\r\nexceptions surface as 500 with a traceId only — no `ex.Message`\r\nleakage.",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Invoices.CreateInvoiceCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Invoices.CreateInvoiceCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Invoices.CreateInvoiceCommand"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Create a new invoice.",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/api/v1/Invoices/usage": {
      "post": {
        "description": "#19044 — the caller is authorised against the <em>subscription</em> before anything is issued: an unknown or\r\nforeign subscription is the same bare 404 (#18174), and an organisation's subscription needs its billing admin.\r\nUntil then the command ran first and ownership was checked on the invoice it had already persisted, so a\r\nstranger holding a subscription id got a 403 <em>and</em> an invoice raised against someone else's subscription.\r\nA period whose usage a live usage invoice already covers is refused 409 by the handler.",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Invoices.GenerateUsageInvoiceCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Invoices.GenerateUsageInvoiceCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Invoices.GenerateUsageInvoiceCommand"
              }
            }
          },
          "description": "Usage invoice generation parameters"
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Generate a usage-based invoice for a subscription.",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/api/v1/Invoices/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get an invoice by ID.",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/api/v1/Invoices/{id}/download": {
      "get": {
        "description": "`{id}/pdf` is the path EPIC 14's `api-contracts.md` publishes and the one\r\n            essence-web's invoice history calls; `{id}/download` is kept for the admin portal.\r\n            Until #7692 only `download` was routed, so the contract path 404'd for every id —\r\n            real or not — and read as \"no PDF was ever generated\" (#8495). The PDF is generated on\r\n            demand either way; it never depended on `BlobReference`.",
        "parameters": [
          {
            "description": "Invoice ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "text/json": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "description": "Server Error"
          }
        },
        "summary": "Download invoice as PDF.",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/api/v1/Invoices/{id}/download-url": {
      "get": {
        "description": "When the blob store cannot be reached (Global has none) the answer is 503\r\n`INVOICE_DOWNLOAD_URL_UNAVAILABLE`, not a 500; `GET {id}/pdf` serves the same PDF without it (#14485).",
        "parameters": [
          {
            "description": "Invoice ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "URL expiry in minutes; clamped to\r\n            Essence.Payment.Billing.Api.Controllers.InvoicesController.MaxSasExpiryMinutes (15) per debt-2026-05-11-040.",
            "in": "query",
            "name": "expiryMinutes",
            "schema": {
              "default": 15,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              },
              "text/plain": {
                "schema": {}
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "summary": "Get secure download URL for invoice PDF (with temporary SAS token).",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/api/v1/Invoices/{id}/pdf": {
      "get": {
        "description": "`{id}/pdf` is the path EPIC 14's `api-contracts.md` publishes and the one\r\n            essence-web's invoice history calls; `{id}/download` is kept for the admin portal.\r\n            Until #7692 only `download` was routed, so the contract path 404'd for every id —\r\n            real or not — and read as \"no PDF was ever generated\" (#8495). The PDF is generated on\r\n            demand either way; it never depended on `BlobReference`.",
        "parameters": [
          {
            "description": "Invoice ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "text/json": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "description": "Server Error"
          }
        },
        "summary": "Download invoice as PDF.",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/api/v1/Invoices/{id}/resend": {
      "post": {
        "description": "Commercial Licence P6 N9: under `Billing:Notices:Mode=Enforce` the invoice is sent to its PAYER — whoever\r\nasked — with the PDF attached, and the answer is 202 Accepted (Notifications delivers it from the outbox). A\r\nrouted payer with no billing contact answers 409 `INVOICE_PAYER_UNADDRESSABLE`. Under Off and Audit nothing\r\nis sent and an issued invoice answers 501 `INVOICE_EMAIL_DELIVERY_UNAVAILABLE` (#8495). A draft answers\r\n409 `INVOICE_NOT_RENDERABLE` in every Mode. Authorised via Essence.Payment.Billing.Api.Authorization.BillingPolicies.ResourceOwner\r\nafter the invoice is loaded, then the routed-figure gate (a routed organisation's member gets a bare 404).",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          },
          "501": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "summary": "Resend the invoice email notification.",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/api/v1/Invoices/{id}/void": {
      "post": {
        "description": "Used by the Instance Service's provisioning-rollback saga to compensate the\r\nStep-3 invoice when an organisation instance fails to provision\r\n(debt-2026-06-21-121). Authorised via\r\nEssence.Payment.Billing.Api.Authorization.BillingPolicies.ResourceOwner after the invoice is loaded — the\r\ncaller must own the invoice or hold the BillingAdmin role (the Instance\r\nservice account does). Voiding a paid invoice is rejected by the domain\r\ninvariant and surfaces as a 400 via the global exception handler; an\r\nalready-void invoice is an idempotent no-op success.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.VoidInvoiceRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.VoidInvoiceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.VoidInvoiceRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Void an unpaid invoice.",
        "tags": [
          "Invoices"
        ]
      }
    },
    "/api/v1/Payments": {
      "get": {
        "parameters": [
          {
            "description": "Optional user filter. Non-admin callers may\r\n            only filter by their own id; admins may filter by any user.",
            "in": "query",
            "name": "userId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "1-based page number.",
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "description": "Number of records per page (max 100).",
            "in": "query",
            "name": "pageSize",
            "schema": {
              "default": 20,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "List payment history for a user.",
        "tags": [
          "Payments"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payments.CreatePaymentCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payments.CreatePaymentCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payments.CreatePaymentCommand"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Create a new payment. The owning `UserId` is taken from the\r\nJWT principal — any value supplied in the body is overwritten\r\n(debt-2026-05-11-163, A07).",
        "tags": [
          "Payments"
        ]
      }
    },
    "/api/v1/Payments/intents": {
      "post": {
        "description": "This endpoint creates a Payment Intent in the payment gateway and returns\r\na client secret for client-side confirmation. This is the modern, recommended\r\napproach for handling payments with SCA (Strong Customer Authentication) support.\r\n            \r\nWorkflow:\r\n1. Client calls this endpoint to create Payment Intent\r\n2. Server returns client_secret\r\n3. Client uses Stripe.js (or similar) to confirm payment with 3D Secure\r\n4. Client calls /confirm endpoint after authentication\r\n5. Server verifies payment status\r\n            \r\nOwning `UserId` is taken from the JWT principal — body-supplied\r\nvalues are overwritten (debt-2026-05-11-163, A07).",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payments.CreatePaymentIntentCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payments.CreatePaymentIntentCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payments.CreatePaymentIntentCommand"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Create a Payment Intent for client-side confirmation.\r\nReturns client secret for Stripe.js or client-side SDK.",
        "tags": [
          "Payments"
        ]
      }
    },
    "/api/v1/Payments/intents/{paymentIntentId}": {
      "get": {
        "description": "Retrieves the current status of a Payment Intent from the gateway.\r\nUseful for checking payment status after 3D Secure redirect or\r\nfor polling payment status on the client side.",
        "parameters": [
          {
            "in": "path",
            "name": "paymentIntentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "gateway",
            "schema": {
              "default": "Stripe",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get Payment Intent status from the payment gateway.",
        "tags": [
          "Payments"
        ]
      }
    },
    "/api/v1/Payments/intents/{paymentIntentId}/confirm": {
      "post": {
        "description": "Call this endpoint after the customer completes 3D Secure authentication.\r\nThe endpoint retrieves the latest payment status from the gateway and\r\nupdates the local payment record accordingly.",
        "parameters": [
          {
            "in": "path",
            "name": "paymentIntentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ConfirmPaymentIntentRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ConfirmPaymentIntentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ConfirmPaymentIntentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Confirm a Payment Intent after 3D Secure authentication.",
        "tags": [
          "Payments"
        ]
      }
    },
    "/api/v1/Payments/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get a payment by ID. Authorised via\r\nEssence.Payment.Billing.Api.Authorization.BillingPolicies.ResourceOwner.",
        "tags": [
          "Payments"
        ]
      }
    },
    "/api/v1/Payments/{id}/process": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProcessPaymentRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProcessPaymentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProcessPaymentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Process a payment through the payment gateway. The payment must\r\nbe owned by the caller; resource ownership is verified after the\r\nload and before dispatch.",
        "tags": [
          "Payments"
        ]
      }
    },
    "/api/v1/Payments/{id}/refund": {
      "post": {
        "description": "Initiates a refund through the payment gateway. A full refund is issued\r\nwhen request does not specify an amount.\r\nPartial refunds are supported by providing an amount less than the original payment.\r\nThe caller's FR-14.015a/b authority is read from their claims (Essence.Payment.Billing.Api.Authorization.RefundAuthority):\r\nthe payment's owner (self-service, full refunds within 14 days), the organisation's admin or\r\n`billing.refund` holder for its own invoices (within 90 days), or billing admin.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RefundPaymentRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RefundPaymentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RefundPaymentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RefundDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RefundDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RefundDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Process a refund for a completed payment.",
        "tags": [
          "Payments"
        ]
      }
    },
    "/api/v1/PricingPlans": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PricingPlans.CreatePricingPlanCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PricingPlans.CreatePricingPlanCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PricingPlans.CreatePricingPlanCommand"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PricingPlanDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PricingPlanDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PricingPlanDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Create a new pricing plan (Admin only).",
        "tags": [
          "PricingPlans"
        ]
      }
    },
    "/api/v1/PricingPlans/active": {
      "get": {
        "description": "#9481: the catalogue now carries both a consumer ladder and an organisation one, so a\r\ncaller building an upgrade surface must be able to ask for the right half — an individual\r\npressing \"upgrade\" was previously offered a GBP 499/month, 25-seat organisation plan.\r\nEvery plan also carries its own `audience` in the response, so a caller that wants to\r\ngroup rather than filter can.\r\n            \r\nThe parameter is optional and unfiltered by default deliberately: this endpoint is\r\n`[AllowAnonymous]` and backs the public pricing page, where showing the catalogue to\r\na visitor who has not yet said which they are is correct. An unrecognised value is refused\r\nrather than ignored — silently returning everything to a caller that asked for one\r\naudience is how a consumer gets shown an organisation plan.\r\n            \r\n<br><b>Partner plans are the one exception to \"unfiltered\".</b> They are sold under a partner\r\nagreement, not off a public price page, so the handler withholds them unless a caller\r\nnames `Partner` explicitly. A numeric value is refused for the same reason: the enum\r\nmember Partner happens to be 3, and `?audience=3` is not a caller naming it.\r\n<br><b>Unlisted plans reach only the people who maintain the price list (#12001).</b> A plan\r\nthat declares no SKU is on no ladder and is, in practice, a one-customer negotiated\r\ncontract. The handler withholds it unless the caller\r\nsatisfies the same predicate as Essence.Payment.Billing.Api.Authorization.BillingPolicies.Admin, so the admin console\r\nstill lists the plan it created while an anonymous visitor never learns it exists.\r\n",
        "parameters": [
          {
            "description": "`Consumer`, `Organisation` or `Partner` to return only plans sold to that\r\n             audience. Omitted returns the catalogue a buyer may shop from — every audience EXCEPT\r\n             Partner.",
            "in": "query",
            "name": "audience",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PricingPlanDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PricingPlanDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PricingPlanDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Get the active pricing plans, optionally narrowed to one audience.",
        "tags": [
          "PricingPlans"
        ]
      }
    },
    "/api/v1/PricingPlans/{id}": {
      "put": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PricingPlans.UpdatePricingPlanCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PricingPlans.UpdatePricingPlanCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PricingPlans.UpdatePricingPlanCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PricingPlanDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PricingPlanDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PricingPlanDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Update an existing pricing plan (Admin only). Used by the commercial console to configure a\r\nplan after creation — e.g. the Free plan's storage quota (`Features[\"limit_storagegb\"]`)\r\nand base price. Fields omitted from the body are left unchanged; a supplied `features`\r\nmap replaces the plan's features wholesale.",
        "tags": [
          "PricingPlans"
        ]
      }
    },
    "/api/v1/Skus": {
      "get": {
        "description": "The registry had a read by exact code and nothing else, so \"which SKUs does Billing\r\nactually hold\" was unanswerable through the API — which is how pricing plans came to\r\ndeclare codes that had never been seeded (#8755, OFM-001) with nobody able to see it.\r\n            \r\n<br>\r\nThe filters are parsed HERE and an unrecognised value is refused rather than ignored: a\r\nlist endpoint that quietly drops a filter it does not understand answers a narrower\r\nquestion than the caller asked, and the empty result is indistinguishable from \"there are\r\nnone of those\". Numeric input is refused too — `?status=0` is not a status a caller\r\nnamed, it is an enum's storage leaking into the wire contract.\r\n",
        "parameters": [
          {
            "description": "One of `{PLT,MOD,CAP,MKT,ADD,USG,SVC,NET}` (FR-14.134), or omitted for all.",
            "in": "query",
            "name": "family",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One of `{Draft,Active,Deprecated,Withdrawn}`, or omitted for all.",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1-based page number.",
            "in": "query",
            "name": "pageNumber",
            "schema": {
              "default": 1,
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "description": "Rows per page, clamped to 1..200.",
            "in": "query",
            "name": "pageSize",
            "schema": {
              "default": 50,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Platform.Contracts.Pagination.PagedResult`1[[Essence.Payment.Billing.Application.DTOs.SkuSummaryDto, Essence.Payment.Billing.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Platform.Contracts.Pagination.PagedResult`1[[Essence.Payment.Billing.Application.DTOs.SkuSummaryDto, Essence.Payment.Billing.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Platform.Contracts.Pagination.PagedResult`1[[Essence.Payment.Billing.Application.DTOs.SkuSummaryDto, Essence.Payment.Billing.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "List the SKU registry, optionally narrowed to one family or one lifecycle status\r\n(FR-14.130). Offset-paged; an unknown family or\r\nstatus is refused with HTTP 400.",
        "tags": [
          "Skus"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Skus.CreateSkuCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Skus.CreateSkuCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Skus.CreateSkuCommand"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SkuDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SkuDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SkuDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Register a new SKU (FR-14.130). Validates `family ∈ {PLT,MOD,CAP,MKT,ADD,USG,SVC,NET}`\r\n(FR-14.134) and persists with `status=draft` by default.",
        "tags": [
          "Skus"
        ]
      }
    },
    "/api/v1/Skus/import": {
      "post": {
        "description": "Billing seeded ONE SKU against 637 in the register, so `Sku.ListPrice` could not\r\ndetermine a charge for anything the platform sells. There was no bulk path and no\r\nupsert, so a per-SKU mirror would have failed on every duplicate code the second time\r\nthe seeder ran.\r\n            \r\n<br>\r\nIdempotent and additive: an existing SKU is left untouched, because an operator may\r\nhave edited its entitlements through the admin API and this runs on every deploy.\r\nRate-limited with the same default policy as the rest of the surface (SEC-004).\r\n",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Skus.ImportSkuRegistryCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Skus.ImportSkuRegistryCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Skus.ImportSkuRegistryCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Skus.SkuRegistryImportResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Skus.SkuRegistryImportResult"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Skus.SkuRegistryImportResult"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Import the master SKU register (deploy seeder path).",
        "tags": [
          "Skus"
        ]
      }
    },
    "/api/v1/Skus/{code}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SkuDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SkuDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SkuDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Fetch a SKU by its canonical code (FR-14.130). 404 if unknown.",
        "tags": [
          "Skus"
        ]
      }
    },
    "/api/v1/Skus/{code}/transition": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Skus.TransitionSkuStatusCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Skus.TransitionSkuStatusCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Skus.TransitionSkuStatusCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SkuDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SkuDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SkuDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Transition a SKU through its FR-14.136 lifecycle\r\n(`Draft → Active → Deprecated → Withdrawn`). An illegal transition\r\nreturns HTTP 400 (`INVALID_SKU_TRANSITION`); an unknown code 404.",
        "tags": [
          "Skus"
        ]
      }
    },
    "/api/v1/Subledger/billings": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "entity",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "currency",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Subledger.BillingsSnapshot"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "description": "Server Error"
          }
        },
        "summary": "What the entity was billed during the period (FR-84.006).",
        "tags": [
          "Subledger"
        ]
      }
    },
    "/api/v1/Subledger/leakage-observations": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "entity",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "currency",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Subledger.LeakageObservations"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "description": "Server Error"
          }
        },
        "summary": "Every input the revenue-leakage sweep inspects (FR-84.009).",
        "tags": [
          "Subledger"
        ]
      }
    },
    "/api/v1/Subledger/payments": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "entity",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "currency",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Subledger.SubledgerItem"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "description": "Server Error"
          }
        },
        "summary": "Payments recorded against the period (FR-84.008 cash leg).",
        "tags": [
          "Subledger"
        ]
      }
    },
    "/api/v1/Subledger/receivables": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "entity",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "currency",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Subledger.ReceivablesSnapshot"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "description": "Server Error"
          }
        },
        "summary": "Open receivables for the entity at the close of the period (FR-84.007).",
        "tags": [
          "Subledger"
        ]
      }
    },
    "/api/v1/Subscriptions": {
      "get": {
        "description": "Non-admin callers can only enumerate their own subscriptions: an\r\nexplicit `userId` / `orgId` that does not match the JWT\r\nprincipal is rejected with 403. Admin callers may pass any\r\n`userId` / `orgId`; absent both, the caller's own user\r\nid is used.",
        "parameters": [
          {
            "in": "query",
            "name": "userId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "orgId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "schema": {
              "default": 20,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "List subscriptions scoped to the authenticated user or organisation.",
        "tags": [
          "Subscriptions"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Subscriptions.CreateSubscriptionCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Subscriptions.CreateSubscriptionCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Subscriptions.CreateSubscriptionCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          },
          "410": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Create a new subscription. The owning `UserId` and\r\n`OrganizationId` are derived from the JWT principal — any\r\nvalue supplied in the body is overwritten (debt-2026-05-11-163, A07).",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/active": {
      "get": {
        "description": "<br>\r\n            The person is asked first. When they hold nothing entitlement-active and the token names an\r\n            organisation, the organisation's subscription is answered instead: an org-seat member's plan\r\n            is held by the organisation (frequently under the BUYER's user id), so a user-only lookup\r\n            would tell every seat holder they are on nothing.\r\n            \r\n<br>\r\n            Served for the mobile billing clients' `verifySubscription` step, which called this\r\n            path for months while it fell into `GET {id}` and failed. The literal segment wins over\r\n            the unconstrained `{id}` template, so the two do not collide.\r\n            ",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubjectSubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubjectSubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubjectSubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "summary": "The caller's OWN subscription position — whether they hold an entitlement-active\r\nsubscription, which one, and its tier snapshot. The subject is the bearer JWT's principal;\r\nnothing on the request names it, so there is nothing a client can tamper to read another\r\naccount's plan (debt-2026-06-03-1312).",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/billing-notices": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.BillingDegradationNoticeDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.BillingDegradationNoticeDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.BillingDegradationNoticeDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Returns the caller's data-minimised billing-degradation notices — one\r\nper currently-PastDue subscription the caller owns or shares (via org).\r\nCarries no invoice id / amount / pay CTA (uxf-2026-06-11-086): the\r\nrole-scoped, non-payer counterpart to the full invoice surface.",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/checkout-quote": {
      "get": {
        "description": "Call this immediately before presenting the acceptance step. When\r\n`requiresConfirmation` comes back true the client MUST re-display\r\nthe returned `amount` and obtain an explicit confirmation, then send\r\nit back as `confirmedPrice` on the create; a create that omits it is\r\nrefused with 409 `CHECKOUT_PRICE_CHANGED`.",
        "parameters": [
          {
            "in": "query",
            "name": "skuCode",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offeredAmount",
            "schema": {
              "format": "double",
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "offeredCurrency",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CheckoutPriceQuoteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CheckoutPriceQuoteDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CheckoutPriceQuoteDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "summary": "The live retail price the caller is about to ask the purchaser to accept,\r\nand whether it has moved since an offer showed them one\r\n(FR-13.039(iii), debt-2026-08-25-115).",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/erasure-obligations/{userId}": {
      "get": {
        "description": "<br>\r\n            Authorised for the subject themselves, or for a caller holding\r\n            Essence.Payment.Billing.Api.Authorization.BillingPolicies.ErasureObligationReadPermission (the compliance\r\n            service's service-to-service principal) or the billing-admin role. Deliberately\r\n            <b>not</b> gated on billing-admin alone: a DPO-initiated erasure is not made by the\r\n            subject, and the compliance service must be able to ask about any subject without\r\n            being handed authority over payouts and refunds.\r\n            \r\n<br>\r\n            Returns 200 with an empty obligation list when the subject holds nothing blocking —\r\n            which is a materially different answer from the 403/5xx the consumer records as\r\n            \"could not ask\". Never 404: an unknown subject genuinely holds no billing\r\n            obligation, and answering 404 would make \"no such customer\" indistinguishable from\r\n            \"route missing\" at the consumer.\r\n            ",
        "parameters": [
          {
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubjectErasureObligationSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubjectErasureObligationSummaryDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubjectErasureObligationSummaryDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Data-minimised erasure-obligation summary for a data subject — the billing half of\r\nthe EPIC 11 Art.17 erasure-eligibility check (FR-11.005).",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/user/{userId}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Get all subscriptions for a user. Non-admin callers may only\r\nquery their own user id.",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/user/{userId}/plan-summary": {
      "get": {
        "description": "<br>\r\n            Authorised for the subject themselves, or for a caller who satisfies\r\n            Essence.Payment.Billing.Api.Authorization.BillingPolicies.SubscriptionSummaryRead. Deliberately <b>not</b> gated on\r\n            billing-admin alone, for the same reason as the erasure-obligation summary below: an operator\r\n            answering \"what plan is this customer on?\" must be able to ask about <em>any</em> subject, and\r\n            handing them full billing-admin to do so would give a support credential authority over\r\n            payouts, refunds and pricing. The role `BillingAdmin` is in any case granted to nobody on\r\n            this platform — `RoleClaims` has no billing role among its constants — so requiring it\r\n            refused every operator who reached the overview.\r\n            \r\n<br>\r\n  <b>Why this route exists rather than a widened `GET user/{userId}`.</b> That action\r\n            returns the whole Essence.Payment.Billing.Application.DTOs.SubscriptionDto — pricing-plan id, line items and their\r\n            amounts, free-form metadata, trial dates, cancellation reason. A permission that unlocked it\r\n            would not be narrower than billing-admin in any way that mattered. This one returns the\r\n            subscription id, the organisation, the tier, the status and the current period, and nothing\r\n            else, which is what makes the grant a genuinely smaller authority.\r\n            \r\n<br>\r\n            Returns 200 with an empty list for a subject who holds no subscription — a materially\r\n            different answer from the 403/5xx a consumer records as \"could not ask\". Never 404: a subject\r\n            with no plan genuinely has none, and answering 404 would make \"no subscriptions\"\r\n            indistinguishable from \"route missing\" at the consumer, which is precisely the confusion fix\r\n            round 6 was called in to clear up elsewhere in this composition.\r\n            \r\n<br>\r\n            WHICH subscription matters is left to the consumer, as on the full list route above: a subject\r\n            may hold several, and deciding here which one is \"the\" plan would move a product judgement\r\n            into a data-minimising projection.\r\n            ",
        "parameters": [
          {
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionPlanSummaryDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionPlanSummaryDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionPlanSummaryDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Data-minimised plan summary for a subject — the billing half of the EPIC 48 PlatformAdmin\r\nuser overview (FR-48.021).",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get a subscription by ID.",
        "tags": [
          "Subscriptions"
        ]
      },
      "put": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.UpdateSubscriptionRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.UpdateSubscriptionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.UpdateSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Update mutable subscription properties (payment method, metadata).",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/{id}/cadence": {
      "post": {
        "description": "Neither an upgrade nor a downgrade: the tier, the plan and every entitlement are unchanged\r\nand only the rhythm of billing moves. The unused remainder of the current period is credited\r\npro-rata — netted against the charge going to annual, posted to the credit ledger going to\r\nmonthly — the new cadence's full price is charged, and the renewal anchor resets to today.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ChangeSubscriptionCadenceRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ChangeSubscriptionCadenceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ChangeSubscriptionCadenceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "FR-14.003a — switch the subscription's billing cadence within the same tier (monthly↔annual).",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/{id}/cancel": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CancelSubscriptionRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CancelSubscriptionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CancelSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Cancel a subscription at the end of the current billing period.",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/{id}/downgrade": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.DowngradeSubscriptionRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.DowngradeSubscriptionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.DowngradeSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Schedule a subscription downgrade to a lower-tier plan.\r\nThe change takes effect at the end of the current billing period. A plan that costs more\r\nthan the current one is 409 `not-a-downgrade` (use `upgrade`, #17854); the plan\r\nalready held is 409 `same-plan` and keeps any pending change (#18050); a Family\r\nplan with members is 409 `family-has-members` (FR-14.188).",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/{id}/history": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionStateHistoryDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionStateHistoryDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionStateHistoryDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get the state-change history for a subscription.",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/{id}/pause": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PauseSubscriptionRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PauseSubscriptionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PauseSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Pause an active subscription for the specified number of days (1–90).",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/{id}/payments": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProcessSubscriptionPaymentRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProcessSubscriptionPaymentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProcessSubscriptionPaymentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Settle the outstanding payment for a subscription (the real\r\ncheckout settlement path — §9a / B3, \"the `ProcessPayment`-class\r\npath\", not the create-intent/confirm flow used for SCA/3DS). Owning\r\n`UserId` and `SubjectEmail` are derived from the JWT\r\nprincipal — any value supplied in the body is overwritten\r\n(mirrors debt-2026-05-11-163, A07). SubjectEmail is what lets a\r\nreserved `@browsertest.essence.digital` test tenant settle\r\nthrough the guarded gateway bypass instead of a real charge.",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/{id}/payments/{paymentIntentId}/settle": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "paymentIntentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentIntentDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          },
          "502": {
            "description": "Server Error"
          }
        },
        "summary": "Stripe payments B5 (spec §5.2) — after a 3DS challenge, settle the pay-now payment from what the\r\ngateway says happened. There is no request body: the browser's account of the challenge is never read.\r\nA payment that is not one we recorded for an invoice of this subscription is 404, with no gateway call.",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/{id}/reactivate": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Reactivate a cancelled subscription within the 7-day grace period.",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/{id}/renew": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Renew a subscription, advancing its billing period.",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/{id}/resume": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Resume a paused subscription immediately.",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/{id}/upgrade": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.UpgradeSubscriptionRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.UpgradeSubscriptionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.UpgradeSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Upgrade a subscription to a higher-tier plan immediately.",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/Subscriptions/{id}/upgrade/preview": {
      "get": {
        "description": "Nothing is raised, stored, voided or published. The upgrade handler answers it with its own refusals, proration\r\nand invoice build, so `totalPayable` is the `totalAmount` of the invoice the upgrade then raises, and a\r\nchange the upgrade would refuse is refused here the same way. Authorised as the upgrade is: only someone who may\r\nmake the change is told its price.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "newPricingPlanId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UpgradeChargePreviewDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UpgradeChargePreviewDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UpgradeChargePreviewDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "AC-pupes-05 (#17359) — what `POST {id}/upgrade` to newPricingPlanId would charge now: the\r\nincoming plan's remainder, the outgoing plan's credit, the net, its VAT and the total payable.",
        "tags": [
          "Subscriptions"
        ]
      }
    },
    "/api/v1/accounts/{organizationId}/health-signals": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.AccountHealth.AccountHealthSignalsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.AccountHealth.AccountHealthSignalsResponse"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.AccountHealth.AccountHealthSignalsResponse"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "503": {
            "description": "Server Error"
          }
        },
        "summary": "The invoice and payment posture of organizationId over the trailing year.",
        "tags": [
          "AccountHealthSignals"
        ]
      }
    },
    "/api/v1/admin/subscriptions": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminSeedSubscriptionRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminSeedSubscriptionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminSeedSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Seeds a no-payment subscription (and its projected entitlements) for\r\nan arbitrary subject. Platform-admin only.",
        "tags": [
          "AdminSubscriptions"
        ]
      }
    },
    "/api/v1/admin/subscriptions/entitlements/reprovision": {
      "post": {
        "description": "<br>\r\n            Entitlements are a materialised projection computed once, at subscription creation. Widening\r\n            what a plan grants therefore corrects only subscriptions created afterwards and leaves the\r\n            existing population on the narrower set — invisible while a presence verifier is in use, and\r\n            a customer-facing denial the moment a fail-closed verifier is configured. This endpoint is\r\n            the supported way to close that gap without replaying `SubscriptionCreatedEvent`, which\r\n            other services consume as a NEW subscription.\r\n            \r\n<br>\r\n            Run it with `dryRun=true` first: the response names every subject and the exact feature\r\n            set that would be published, which is what the follow-up verification against\r\n            `POST /api/v1/entitlements/check` needs.\r\n            \r\n<br>\r\n            Large populations are walked a page at a time — pass the returned `nextCursor` back as\r\n            `afterSubscriptionId` until it comes back null.\r\n            ",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminReprovisionEntitlementsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminReprovisionEntitlementsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminReprovisionEntitlementsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReprovisionSubscriptionEntitlementsResultDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Recomputes and re-applies the entitlement grant of subscriptions that ALREADY EXIST\r\n(debt-2026-08-16-141). Platform-admin only.",
        "tags": [
          "AdminSubscriptions"
        ]
      }
    },
    "/api/v1/admin/subscriptions/entitlements/reprovision/readiness": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Services.EntitlementEvidenceIndexReadiness"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "#19134 M1 — readiness of the outbox indexes behind the re-provision's delivery-evidence baseline. A\r\npublishing re-provision is refused (409 `ENTITLEMENT_EVIDENCE_INDEXES_NOT_READY`) until\r\n`ready` is true; the platform seed polls this before its walk. Platform-admin only (class policy).",
        "tags": [
          "AdminSubscriptions"
        ]
      }
    },
    "/api/v1/admin/subscriptions/onboarding/stranded/void": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminVoidStrandedOnboardingRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminVoidStrandedOnboardingRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminVoidStrandedOnboardingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.VoidStrandedOnboardingSubscriptionsResultDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Voids ONLY a licence onboarding minted pre-claim for the named session that is PendingPayment,\r\nhas received no money, and whose session has not provisioned. DRY RUN unless `dryRun` is\r\nexplicitly false; idempotent (a re-run reports `AlreadyVoided`). Validated by the pipeline\r\n(API-002); refusals are ProblemDetails (API-003).",
        "tags": [
          "AdminOnboardingRecovery"
        ]
      }
    },
    "/api/v1/billing/admin/invoices/{invoiceId}/net-terms-refunds": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminNetTermsRefundsController.NetTermsRefundRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminNetTermsRefundsController.NetTermsRefundRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminNetTermsRefundsController.NetTermsRefundRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.NetTermsRefundDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.NetTermsRefundDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.NetTermsRefundDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Refunds the invoice: `amount` (gross, the invoice's currency; omitted = everything not yet credited), finance's\r\n`reference` (the refund is idempotent on it) and a `reason`. 200 with the credit note and ledger credit.\r\n403 `REFUND_AUTHORIZATION_REQUIRED` above the single-approver tier (FR-14.015a); 409 with a `rule` when\r\nthe invoice is not a paid net-terms invoice, was settled by a gateway payment, or the refund would be paid out by\r\nbank transfer (FR-14.015g (b), not yet executable); 409 `credit_exceeds_invoice` past the invoice total.",
        "tags": [
          "AdminNetTermsRefunds"
        ]
      }
    },
    "/api/v1/billing/admin/organisations/{organizationId}/commercial-profile": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationCommercialProfileDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationCommercialProfileDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationCommercialProfileDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "The organisation's commercial profile; 404 `commercial_profile.not_found` when it has none.",
        "tags": [
          "AdminOrganisationCommercialProfile"
        ]
      }
    },
    "/api/v1/billing/admin/organisations/{organizationId}/commercial-profile/invoice-collection-approval": {
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationCommercialProfileDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationCommercialProfileDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationCommercialProfileDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "#10555 — revokes the organisation's invoice-collection approval. New `SendInvoice` creates are refused\r\nfrom now on; subscriptions already invoiced keep their collection method. Revoking none is a no-op (200).",
        "tags": [
          "AdminOrganisationCommercialProfile"
        ]
      },
      "put": {
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminOrganisationCommercialProfileController.ApproveInvoiceCollectionRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminOrganisationCommercialProfileController.ApproveInvoiceCollectionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminOrganisationCommercialProfileController.ApproveInvoiceCollectionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationCommercialProfileDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationCommercialProfileDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationCommercialProfileDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "#10358 R6 / #10555 — approves the organisation to be invoiced (`SendInvoice`) on the given terms, with a\r\nreason (the evidence it rests on). The actor and instant are recorded from the token and the clock. Without a\r\nlive approval a `SendInvoice` subscription create is refused 403 `collection_method.invoice_not_approved`.\r\nA routed organisation is invoiced to its payer already: 400 `commercial_profile.invoice_collection_follows_payer`.",
        "tags": [
          "AdminOrganisationCommercialProfile"
        ]
      }
    },
    "/api/v1/billing/admin/organisations/{organizationId}/commercial-profile/payment-terms": {
      "put": {
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminOrganisationCommercialProfileController.SetPaymentTermsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminOrganisationCommercialProfileController.SetPaymentTermsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminOrganisationCommercialProfileController.SetPaymentTermsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationCommercialProfileDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationCommercialProfileDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationCommercialProfileDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Sets (or, with `days: null`, clears) the payment-terms override, with a reason. A routed organisation's\r\nterms follow its payer: setting an override on one is 400 `commercial_profile.terms_follow_payer` (P5-R22).",
        "tags": [
          "AdminOrganisationCommercialProfile"
        ]
      }
    },
    "/api/v1/billing/admin/refund-queue": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "includeResolved",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 200,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RefundQueueItemDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The refund-required invoices, oldest first: only those still owed unless `includeResolved=true`. At most\r\n`limit` rows (default 200, max 1000; 400 outside that).",
        "tags": [
          "AdminRefundQueue"
        ]
      }
    },
    "/api/v1/billing/admin/refund-queue/{invoiceId}/resolve": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminRefundQueueController.ResolveRefundRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminRefundQueueController.ResolveRefundRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminRefundQueueController.ResolveRefundRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RefundQueueItemDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Records how the invoice's refund was settled: `outcome` (`refunded` | `account_credit` |\r\n`not_owed`), finance's `reference` and an optional `note`. 200 with the updated row; 404 for an\r\nunknown invoice; 409 `refund_not_required` when it is not flagged, `refund_already_resolved` when it was\r\nsettled already.",
        "tags": [
          "AdminRefundQueue"
        ]
      }
    },
    "/api/v1/billing/admin/tax-pending-queue": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "includeNotYetEscalated",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 200,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.TaxPendingQueueItemDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The held invoices, longest-held first: only those escalated to finance (held past 24 h) unless\r\n`includeNotYetEscalated=true`, which also shows the backlog forming inside the window. At most\r\n`limit` rows (default 200, max 1000; 400 outside that).",
        "tags": [
          "AdminTaxPendingQueue"
        ]
      }
    },
    "/api/v1/billing/admin/tax-pending-queue/{invoiceId}/determine-tax": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminTaxPendingQueueController.DetermineTaxRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminTaxPendingQueueController.DetermineTaxRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AdminTaxPendingQueueController.DetermineTaxRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.TaxPendingQueueItemDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Determines the invoice's tax by hand and releases the hold at that rate: `ratePercent` (a\r\nPERCENTAGE — 20% VAT is `20`, not `0.2`) and the `reason` finance determined it on. 200\r\nwith the row as it now stands; 404 for an unknown invoice; 409 `invoice_not_tax_pending` when it\r\nis not held (the retry may have issued it meanwhile), `tax_hold_not_escalated` when the hold is\r\nyounger than 24 h.",
        "tags": [
          "AdminTaxPendingQueue"
        ]
      }
    },
    "/api/v1/billing/app-revenue-reassignments/execute": {
      "post": {
        "description": "Idempotent on the transfer id: a re-run returns the existing settlement rather than paying\r\nthe outgoing owner twice.",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AppRevenueReassignmentRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AppRevenueReassignmentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AppRevenueReassignmentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AppRevenueReassignmentResponse"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Settle the outgoing owner and bind the incoming one, effective at the cut (journey step 4).",
        "tags": [
          "AppRevenueReassignments"
        ]
      }
    },
    "/api/v1/billing/app-revenue-reassignments/prepare": {
      "post": {
        "description": "A 200 with `incomingDestinationBound = false` is the interesting answer, not an error:\r\nit is the finding the acquirer has to act on, and EPIC 25's dry-run turns it into a blocking\r\ngate rather than a warning.",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AppRevenueReassignmentRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AppRevenueReassignmentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AppRevenueReassignmentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AppRevenueReassignmentResponse"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Check that the reassignment will be able to run. Moves no money (journey step 2).",
        "tags": [
          "AppRevenueReassignments"
        ]
      }
    },
    "/api/v1/billing/catalogue/{moduleId}/pricing": {
      "get": {
        "parameters": [
          {
            "description": "The module identifier from the module registry.",
            "in": "path",
            "name": "moduleId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The active organisation, sent by the portal as `X-Organization-Id` and verified\r\nagainst the caller's own org claim.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModulePricingDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModulePricingDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModulePricingDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Reads the SKU-aware list pricing for one catalogue module: its purchasable plans with\r\nthe entitlement quotas that differentiate them, its add-ons, and its individually\r\npriced metered items (AC-07.064).",
        "tags": [
          "OrgBillingCatalogue"
        ]
      }
    },
    "/api/v1/billing/consumption/meters": {
      "get": {
        "parameters": [
          {
            "description": "The active organisation, sent by the portal as `X-Organization-Id` and\r\nverified against the caller's own org claim.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgConsumptionSnapshotDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgConsumptionSnapshotDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgConsumptionSnapshotDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the calling organisation's usage meters and projected end-of-period\r\ncost across its active subscriptions.",
        "tags": [
          "OrgBillingConsumption"
        ]
      }
    },
    "/api/v1/billing/cooling-off-settlements": {
      "get": {
        "parameters": [
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Every cooling-off settlement the provider in `X-Organization-Id` recorded (its billing administrators only).",
        "tags": [
          "CoolingOffSettlements"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.InitiateCoolingOffCancellationRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.InitiateCoolingOffCancellationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.InitiateCoolingOffCancellationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Records a customer's cooling-off cancellation for the provider in `X-Organization-Id` (its billing\r\nadministrators only) and computes the deduction and refund. 201; 409 `COOLING_OFF_WINDOW_EXPIRED`\r\nafter the window.",
        "tags": [
          "CoolingOffSettlements"
        ]
      }
    },
    "/api/v1/billing/cooling-off-settlements/mine": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The caller's own cooling-off settlements, newest first, each with its deduction and refund.",
        "tags": [
          "CoolingOffSettlements"
        ]
      }
    },
    "/api/v1/billing/cooling-off-settlements/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "One settlement, for its customer, or for an administrator of its provider presenting the provider in\r\n`X-Organization-Id`. 404 for anyone else.",
        "tags": [
          "CoolingOffSettlements"
        ]
      }
    },
    "/api/v1/billing/cooling-off-settlements/{id}/release": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReleaseCoolingOffRefundRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReleaseCoolingOffRefundRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReleaseCoolingOffRefundRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CoolingOffCancellationSettlementDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Records the refund returned to the customer as cash or credit, under the provider's refund reference (its\r\nbilling administrators only). A second release is refused with 400 `BUSINESS_RULE_VIOLATION`.",
        "tags": [
          "CoolingOffSettlements"
        ]
      }
    },
    "/api/v1/billing/corporate-groups/{parentOrgId}/rollup": {
      "get": {
        "parameters": [
          {
            "description": "The parent organisation the group is rooted at.",
            "in": "path",
            "name": "parentOrgId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The month as `YYYY-MM`; the current UTC month when omitted.",
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.CorporateGroups.CorporateGroupBillingRollupDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "summary": "The group's invoiced position for one calendar month.",
        "tags": [
          "CorporateGroupBilling"
        ]
      }
    },
    "/api/v1/billing/credits/balance": {
      "get": {
        "parameters": [
          {
            "description": "The active organisation, sent by the portal as `X-Organization-Id` and\r\nverified against the caller's own org claim.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgCreditBalanceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgCreditBalanceDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgCreditBalanceDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the calling organisation's credit position: redeemable balance, credits\r\nearned this calendar month, and the face value expiring within 90 days.",
        "tags": [
          "OrgBillingCredits"
        ]
      }
    },
    "/api/v1/billing/credits/statement": {
      "get": {
        "parameters": [
          {
            "description": "The active organisation, sent by the portal as `X-Organization-Id` and\r\nverified against the caller's own org claim — the same binding the balance read\r\nperforms, and for the same reason.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The statement month as `YYYY-MM` (the portal's month picker's own value).",
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`csv` or `pdf`.",
            "in": "query",
            "name": "format",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "application/problem+json": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "text/csv": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Downloads the calling organisation's monthly credit statement as CSV or PDF\r\n(AC-07.062).",
        "tags": [
          "OrgBillingCredits"
        ]
      }
    },
    "/api/v1/billing/dunning": {
      "get": {
        "parameters": [
          {
            "description": "The active organisation, sent by the portal as `X-Organization-Id` and verified\r\nagainst the caller's own org claim.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgDunningPositionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgDunningPositionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgDunningPositionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the calling organisation's dunning position: past-due subscriptions with their\r\nretry schedule and grace deadline, the blast radius of seats and modules, the dated\r\ndegrade/restore timeline, and — after a recovery — the org-wide restoration\r\nconfirmation including anything that did NOT come back.",
        "tags": [
          "OrgBillingDunning"
        ]
      }
    },
    "/api/v1/billing/enterprise-agreement/overview": {
      "get": {
        "parameters": [
          {
            "description": "The active organisation, sent by the portal as `X-Organization-Id` and\r\nverified against the caller's own org claim and administrator role.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseAgreementOverviewDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseAgreementOverviewDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseAgreementOverviewDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the active organisation's position against its Enterprise Agreement:\r\ncommitted vs actual spend, the term and whether it renews, and deployed seats\r\nagainst the committed floor (AC-07.065).",
        "tags": [
          "OrgBillingEnterpriseAgreement"
        ]
      }
    },
    "/api/v1/billing/family/rehome": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RehomeDepartingMemberRequestDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RehomeDepartingMemberRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RehomeDepartingMemberRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MemberBillingRehomeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MemberBillingRehomeDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MemberBillingRehomeDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Re-homes a departing family-plan member onto their own self-pay subscription with a\r\nmid-cycle proration credit for the already-covered remainder of the period. Idempotent\r\non `rehomeRequestId` — a retried departure returns the first result unchanged.",
        "tags": [
          "FamilyBilling"
        ]
      }
    },
    "/api/v1/billing/grandfather-cohort-report": {
      "get": {
        "description": "Always 200, with an empty `cohorts` list when no lock matches — \"this cohort has nobody in\r\nit\" is a finding a finance surface must be able to state, not a 404.",
        "parameters": [
          {
            "description": "One cohort, by the upstream EPIC 79 supersede decision's own reference. Omit for every cohort.",
            "in": "query",
            "name": "supersedeReference",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Report as at this instant rather than now, so last month's figures can be re-run and give last\r\nmonth's answer.",
            "in": "query",
            "name": "asOf",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "The share of a cohort assumed not to renew once its lock ends, in `[0, 1]`. Defaults to\r\nthe specified surface's own modelled figure; whatever is used is returned on the response and\r\nwritten into the CSV.",
            "in": "query",
            "name": "churnRateOnExpiry",
            "schema": {
              "format": "double",
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrandfatheredCohortFinanceReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrandfatheredCohortFinanceReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrandfatheredCohortFinanceReportDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The grandfathered-cohort finance report, one entry per supersede cohort and currency. 200.",
        "tags": [
          "GrandfatheredCohortReport"
        ]
      }
    },
    "/api/v1/billing/grandfather-cohort-report/export": {
      "get": {
        "description": "Rendered from the identical DTO the JSON surface returns, so the export can never carry a\r\nfigure the API does not. One row per cohort and lock-expiry month, with each projection's\r\nassumptions as columns — a spreadsheet outlives the response that made it.",
        "parameters": [
          {
            "in": "query",
            "name": "supersedeReference",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "asOf",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "churnRateOnExpiry",
            "schema": {
              "format": "double",
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "content": {
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The same report as a CSV download (FR-14.106). 200.",
        "tags": [
          "GrandfatheredCohortReport"
        ]
      }
    },
    "/api/v1/billing/grandfather-price-locks/{subscriptionId}": {
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "subscriptionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReleaseGrandfatherPriceLockRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReleaseGrandfatherPriceLockRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReleaseGrandfatherPriceLockRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrandfatherPriceLockDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrandfatherPriceLockDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrandfatherPriceLockDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Withdraws the standing lock. Its next renewal resolves at the current list price.",
        "tags": [
          "GrandfatherPriceLocks"
        ]
      },
      "get": {
        "description": "Always 200, with `lock: null` for a subscription that has never had one. A lock whose\r\nend has passed is returned with `inForce: false` and its history intact — \"the\r\nprotection ran out\" and \"there was never any protection\" are different facts and this\r\nsurface keeps them apart.",
        "parameters": [
          {
            "in": "path",
            "name": "subscriptionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionGrandfatherStateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionGrandfatherStateDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionGrandfatherStateDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The subscription's standing lock and its audited renewal-price re-resolution timeline.",
        "tags": [
          "GrandfatherPriceLocks"
        ]
      },
      "post": {
        "description": "The next renewal at or after this call is charged `lockedAmount` rather than whatever\r\nthe current plan resolves to, and the resolution is audited with the lock recorded against\r\nit. A second lock on a subscription that already has one is refused (409) rather than\r\nlayered, so which price protects the subscriber is never ambiguous.",
        "parameters": [
          {
            "in": "path",
            "name": "subscriptionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApplyGrandfatherPriceLockRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApplyGrandfatherPriceLockRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApplyGrandfatherPriceLockRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrandfatherPriceLockDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrandfatherPriceLockDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrandfatherPriceLockDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Holds one subscription below the current list price until a stated date. 201.",
        "tags": [
          "GrandfatherPriceLocks"
        ]
      }
    },
    "/api/v1/billing/group-schemes/{schemeId}/aggregated-invoices": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "schemeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeBillingLedgerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeBillingLedgerDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeBillingLedgerDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "What the scheme has been billed, line by line and member by member, and what the next run\r\nwould bill. 404 when Billing holds no billing configuration for the scheme.",
        "tags": [
          "GroupSchemeBilling"
        ]
      },
      "post": {
        "description": "Refused 422 `scheme-bills-members-individually` when the scheme bills its members\r\ndirectly — it supplies roster and eligibility only, so no aggregated invoice exists to\r\nissue — and 422 `nothing-to-aggregate` when every premium has already been billed at\r\nits current figures (the normal answer to a second run, and NOT the same as nothing being\r\nowed).",
        "parameters": [
          {
            "in": "path",
            "name": "schemeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeAggregationResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeAggregationResultDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeAggregationResultDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Issues the scheme's next aggregated invoice: every member premium that has moved since the\r\nlast run, itemised and attributed, on ONE invoice to the organisation with\r\n`billing_model=group_scheme`, plus a credit note for any already-billed premium\r\nwithdrawn by a mid-cycle leaver.",
        "tags": [
          "GroupSchemeBilling"
        ]
      }
    },
    "/api/v1/billing/group-schemes/{schemeId}/billing-configuration": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "schemeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeBillingConfigurationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeBillingConfigurationDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeBillingConfigurationDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "How the scheme is billed. <b>404 means Billing holds no billing configuration for it</b> —\r\nthe scheme has no billing route — never \"it is billed to nobody\".",
        "tags": [
          "GroupSchemeBilling"
        ]
      },
      "put": {
        "parameters": [
          {
            "in": "path",
            "name": "schemeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ConfigureGroupSchemeBillingRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ConfigureGroupSchemeBillingRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ConfigureGroupSchemeBillingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeBillingConfigurationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeBillingConfigurationDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupSchemeBillingConfigurationDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Sets, then amends, how the scheme is billed. `invoicingParty` is fixed on the first\r\ncall: a later call naming the other party is refused 422 `invoicing-party-fixed`,\r\nbecause who owes the premiums is not an administrative detail once invoices have been issued\r\non the current reading.",
        "tags": [
          "GroupSchemeBilling"
        ]
      }
    },
    "/api/v1/billing/invoices": {
      "get": {
        "parameters": [
          {
            "description": "The active organisation, sent by the portal as `X-Organization-Id` and\r\nverified against the caller's own org claim and administrator role.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Most rows to return (bounded server-side).",
            "in": "query",
            "name": "limit",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgInvoiceListDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgInvoiceListDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgInvoiceListDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Lists the calling organisation's issued invoices, newest first.",
        "tags": [
          "OrgBillingInvoices"
        ]
      }
    },
    "/api/v1/billing/invoices/{invoiceId}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgInvoiceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgInvoiceDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgInvoiceDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "The invoice, in the org invoice list's line shape.",
        "tags": [
          "OrgBillingInvoiceDetail"
        ]
      }
    },
    "/api/v1/billing/merge/{mergeSessionId}/disposition": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "mergeSessionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "retiredAccountId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MergeDispositionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MergeDispositionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MergeDispositionDto"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Returns the merge billing disposition for a merge session — survivor-scoped: the\r\nauthenticated caller is treated as the surviving account. Post-commit this returns\r\nthe persisted, audited settlement; pre-commit it returns the disposition Billing prepared\r\nwhen EPIC 9 announced the proven session (survivor + retired billing metadata only, no\r\nvault plaintext). Supplying retiredAccountId computes a live preview\r\nwhen no preparation exists. Returns 404 when none of the three is available, or the\r\ncaller is not the session's survivor (honest-unavailable — the seam panel guards on this).",
        "tags": [
          "Merge"
        ]
      }
    },
    "/api/v1/billing/organisations/{organizationId}/licence-context": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationLicenceContextDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationLicenceContextDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganisationLicenceContextDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "The licence context of organizationId.",
        "tags": [
          "OrganisationLicenceContext"
        ]
      }
    },
    "/api/v1/billing/organisations/{organizationId}/licence-posture": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Licences.OrganisationLicencePostureDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Licences.OrganisationLicencePostureDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Licences.OrganisationLicencePostureDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "The licence posture of organizationId.",
        "tags": [
          "OrganisationLicencePosture"
        ]
      }
    },
    "/api/v1/billing/organization-details": {
      "get": {
        "parameters": [
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganizationBillingDetailsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganizationBillingDetailsDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganizationBillingDetailsDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the active organisation's billing details (organisation billing administrators only).\r\n`recorded: false` when none have been recorded.",
        "tags": [
          "OrganizationBillingDetails"
        ]
      },
      "put": {
        "parameters": [
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SetOrganizationBillingDetailsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SetOrganizationBillingDetailsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SetOrganizationBillingDetailsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganizationBillingDetailsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganizationBillingDetailsDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganizationBillingDetailsDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Records or replaces the active organisation's billing address and VAT number (organisation billing\r\nadministrators only). Every invoice addressed to the organisation afterwards carries them.",
        "tags": [
          "OrganizationBillingDetails"
        ]
      }
    },
    "/api/v1/billing/package-version-migrations": {
      "get": {
        "parameters": [
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "subscriptionId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Every delta recorded for the organisation in `X-Organization-Id` (its billing administrators only),\r\noptionally narrowed to one subscription.",
        "tags": [
          "PackageVersionMigrations"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PackageVersionMigrationDeltaRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PackageVersionMigrationDeltaRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PackageVersionMigrationDeltaRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Records the delta against the subscription, append-only, with the migration's effective date stamped. 201;\r\n409 `PACKAGE_VERSION_MIGRATION_OUTSIDE_PERIOD` when the effective date falls outside the period.",
        "tags": [
          "PackageVersionMigrations"
        ]
      }
    },
    "/api/v1/billing/package-version-migrations/mine": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The caller's own version-migration deltas, newest first, each with its credit, charge and net.",
        "tags": [
          "PackageVersionMigrations"
        ]
      }
    },
    "/api/v1/billing/package-version-migrations/preview": {
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PackageVersionMigrationDeltaRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PackageVersionMigrationDeltaRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PackageVersionMigrationDeltaRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Computes the delta for a proposed version migration and stores nothing — the figure the renewal screen\r\nshows before anything is charged. 409 `PACKAGE_VERSION_MIGRATION_OUTSIDE_PERIOD` when the effective\r\ndate falls outside the current billing period.",
        "tags": [
          "PackageVersionMigrations"
        ]
      }
    },
    "/api/v1/billing/package-version-migrations/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "One delta, for its subscriber, or for an administrator of its organisation presenting that organisation in\r\n`X-Organization-Id`. 404 for anyone else.",
        "tags": [
          "PackageVersionMigrations"
        ]
      }
    },
    "/api/v1/billing/package-version-migrations/{id}/apply": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApplyPackageVersionMigrationDeltaRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApplyPackageVersionMigrationDeltaRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApplyPackageVersionMigrationDeltaRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PackageVersionMigrationDeltaDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Stamps the invoice or credit note that carried the delta (the organisation's billing administrators only).\r\nA second apply, or applying a zero delta, is refused with 400 `BUSINESS_RULE_VIOLATION`.",
        "tags": [
          "PackageVersionMigrations"
        ]
      }
    },
    "/api/v1/billing/partner-metrics": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "FR-14.313 — every metric the caller has registered.",
        "tags": [
          "PartnerMetrics"
        ]
      },
      "post": {
        "description": "409 when the code is already registered, when it collides with a first-party Essence meter,\r\nor when it is within two characters of one (which the usage endpoint refuses as a typo, so\r\nsuch a code could never be metered at all).",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RegisterPartnerMetricRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RegisterPartnerMetricRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RegisterPartnerMetricRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "FR-14.313 — registers a metric for one of the caller's offerings. It lands Draft: nothing\r\nrates until the offering is published.",
        "tags": [
          "PartnerMetrics"
        ]
      }
    },
    "/api/v1/billing/partner-metrics/statement": {
      "get": {
        "description": "A statement shows the caller's own money only. Another builder's offering id is not an\r\nerror — it simply matches nothing of the caller's, so it cannot be used to learn that the\r\noffering exists.",
        "parameters": [
          {
            "description": "The month, `yyyy-MM` (UTC). Omitted means the current month.",
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to one of the caller's offerings.",
            "in": "query",
            "name": "offeringId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Honoured ONLY for a billing admin, who must name the builder. A partner caller's own builder\r\nis resolved from its standing and a different id here is refused.",
            "in": "query",
            "name": "partnerId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderStatementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderStatementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.BuilderStatementDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "FR-14.315 — the builder statement for one calendar month: per offering and metric, the\r\nusage, the rated amount, the exchange take, the builder share and its payout status.",
        "tags": [
          "PartnerMetrics"
        ]
      }
    },
    "/api/v1/billing/partner-metrics/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "One registration.",
        "tags": [
          "PartnerMetrics"
        ]
      }
    },
    "/api/v1/billing/partner-metrics/{id}/activate": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "FR-14.313 — the offering is published, so its metrics begin to rate. Idempotent.",
        "tags": [
          "PartnerMetrics"
        ]
      }
    },
    "/api/v1/billing/partner-metrics/{id}/withdraw": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PartnerMetrics.PartnerMetricDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "FR-14.313 — the listing is gone; the metric stops rating. Idempotent.",
        "tags": [
          "PartnerMetrics"
        ]
      }
    },
    "/api/v1/billing/retainer-trust-fundings": {
      "get": {
        "parameters": [
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "matterReference",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Every funding the firm in `X-Organization-Id` holds against matterReference\r\n(organisation billing administrators only).",
        "tags": [
          "RetainerTrustFundings"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.InitiateRetainerTrustFundingRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.InitiateRetainerTrustFundingRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.InitiateRetainerTrustFundingRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Starts funding a retainer into the named firm's client trust account. 201, awaiting clearance.",
        "tags": [
          "RetainerTrustFundings"
        ]
      }
    },
    "/api/v1/billing/retainer-trust-fundings/mine": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The caller's own retainer fundings, newest first.",
        "tags": [
          "RetainerTrustFundings"
        ]
      }
    },
    "/api/v1/billing/retainer-trust-fundings/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "One funding, for its client, or for an administrator of its firm presenting the firm in\r\n`X-Organization-Id`. 404 for anyone else.",
        "tags": [
          "RetainerTrustFundings"
        ]
      }
    },
    "/api/v1/billing/retainer-trust-fundings/{id}/clearance": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordRetainerClearanceRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordRetainerClearanceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordRetainerClearanceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Records the payment rails' clearing result for a funding awaiting clearance (FR-14.213): Cleared (with the\r\ntokenised payment's reference), Declined (with the decline reason) or TimedOut. A second outcome is refused.",
        "tags": [
          "RetainerTrustFundings"
        ]
      }
    },
    "/api/v1/billing/retainer-trust-fundings/{id}/refund": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RefundRetainerTrustFundingRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RefundRetainerTrustFundingRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RefundRetainerTrustFundingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Returns the cleared trust funds to the client (the firm's administrators only; a reason is required).\r\n409 `RETAINER_TRUST_NOT_CLEARED` before the funds have cleared.",
        "tags": [
          "RetainerTrustFundings"
        ]
      }
    },
    "/api/v1/billing/retainer-trust-fundings/{id}/release": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RetainerTrustFundingDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Opens the matter and allocates the cleared trust funds to it (the firm's administrators only).\r\n409 `RETAINER_TRUST_NOT_CLEARED` before the funds have cleared.",
        "tags": [
          "RetainerTrustFundings"
        ]
      }
    },
    "/api/v1/billing/sandbox-licences": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PurchaseSandboxLicenceRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PurchaseSandboxLicenceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PurchaseSandboxLicenceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicencePurchaseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicencePurchaseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicencePurchaseDto"
                }
              }
            },
            "description": "Success"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicencePurchaseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicencePurchaseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicencePurchaseDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Buys a sandbox licence. Idempotent on `purchaseId`: 201 when minted, 200 when this purchase\r\nhad already minted it (`replay: true`).",
        "tags": [
          "SandboxLicences"
        ]
      }
    },
    "/api/v1/billing/sandbox-licences/context": {
      "get": {
        "parameters": [
          {
            "description": "`Organisation` (the default) or `Partner`.",
            "in": "query",
            "name": "audience",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The organisation asked about; absent ⇒ the caller's own.",
            "in": "query",
            "name": "organizationId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicenceContextDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicenceContextDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicenceContextDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The sandbox licences on offer to an organisation, and the ones it holds.",
        "tags": [
          "SandboxLicences"
        ]
      }
    },
    "/api/v1/billing/sandbox-licences/sponsorships": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrantSandboxSponsorshipRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrantSandboxSponsorshipRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GrantSandboxSponsorshipRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxSponsorshipDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxSponsorshipDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxSponsorshipDto"
                }
              }
            },
            "description": "Success"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxSponsorshipDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxSponsorshipDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxSponsorshipDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "P4-R25 — Essence sponsors a sandbox: a Premium or Enterprise sandbox licence at £0 for a defined period\r\n(≤ 90 days). Platform billing admin only. Idempotent on `grantId`: 201 when minted, 200 on a replay.",
        "tags": [
          "SandboxLicences"
        ]
      }
    },
    "/api/v1/billing/sandbox-licences/{subscriptionId}/rollback": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "subscriptionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RollbackSandboxLicenceRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RollbackSandboxLicenceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RollbackSandboxLicenceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicenceRollbackDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicenceRollbackDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxLicenceRollbackDto"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Takes back a sandbox licence whose environment could not be built: cancelled now, its unpaid\r\nfirst-period invoice voided. Only inside the rollback window and only when no money was received.\r\nRe-entrant: a second call answers as the first.",
        "tags": [
          "SandboxLicences"
        ]
      }
    },
    "/api/v1/billing/sandbox-licences/{subscriptionId}/sponsorship/extend": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "subscriptionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ExtendSandboxSponsorshipRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ExtendSandboxSponsorshipRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ExtendSandboxSponsorshipRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxSponsorshipDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxSponsorshipDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SandboxSponsorshipDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "P4-R25 — a billing admin moves a sponsorship's end later — to at most 90 days from NOW (P4-R44: never more\r\nthan 90 days remaining); who, when and why are recorded.",
        "tags": [
          "SandboxLicences"
        ]
      }
    },
    "/api/v1/billing/seat-lifecycle/my-notices": {
      "get": {
        "description": "Scoped to the caller's own subject and to nobody else's. An admin route that could\r\nread another person's notice would put the leaver's and the new hire's private\r\naccounts of the change behind an org-scope check, which is not who they belong to.",
        "parameters": [
          {
            "description": "Maximum notices, most recent first.",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 10,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatNoticeDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatNoticeDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatNoticeDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the seat notices that concern the caller — their own leaver disposition\r\nnotice or new-hire confirmation.",
        "tags": [
          "OrgSeatLifecycle"
        ]
      }
    },
    "/api/v1/billing/seat-lifecycle/organizations/{organizationId}/bulk-reclaim": {
      "post": {
        "parameters": [
          {
            "description": "The organisation whose seats they are.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.BulkReclaimSeatsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.BulkReclaimSeatsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.BulkReclaimSeatsRequest"
              }
            }
          },
          "description": "The batch."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.BulkSeatReclaimOutcomeDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.BulkSeatReclaimOutcomeDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.BulkSeatReclaimOutcomeDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reclaims several seats in one operation, reporting per-row outcomes.",
        "tags": [
          "OrgSeatLifecycle"
        ]
      }
    },
    "/api/v1/billing/seat-lifecycle/organizations/{organizationId}/change-log": {
      "get": {
        "parameters": [
          {
            "description": "The organisation whose seat movements to read.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Maximum rows, most recent first.",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatChangeRecordDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatChangeRecordDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatChangeRecordDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the organisation's seat-change log — the access-review feed, deliberately\r\nseparate from the billing CSV.",
        "tags": [
          "OrgSeatLifecycle"
        ]
      }
    },
    "/api/v1/billing/seat-lifecycle/organizations/{organizationId}/policy": {
      "get": {
        "parameters": [
          {
            "description": "The organisation.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatReclaimPolicyDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatReclaimPolicyDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatReclaimPolicyDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the organisation's configurable reclaim defaults.",
        "tags": [
          "OrgSeatLifecycle"
        ]
      },
      "put": {
        "parameters": [
          {
            "description": "The organisation.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SeatReclaimPolicyRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SeatReclaimPolicyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SeatReclaimPolicyRequest"
              }
            }
          },
          "description": "The defaults."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatReclaimPolicyDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatReclaimPolicyDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatReclaimPolicyDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Sets the organisation's configurable reclaim defaults.",
        "tags": [
          "OrgSeatLifecycle"
        ]
      }
    },
    "/api/v1/billing/seat-lifecycle/organizations/{organizationId}/preview": {
      "get": {
        "parameters": [
          {
            "description": "The organisation whose seat it is.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The departing holder (opaque org-user reference).",
            "in": "query",
            "name": "leaverRef",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatReclaimPreviewDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatReclaimPreviewDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatReclaimPreviewDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads what reclaiming a holder's seat would revoke and what would stay with the\r\nseat, plus the organisation's pre-selected defaults.",
        "tags": [
          "OrgSeatLifecycle"
        ]
      }
    },
    "/api/v1/billing/seat-lifecycle/organizations/{organizationId}/reclaim": {
      "post": {
        "parameters": [
          {
            "description": "The organisation whose seat it is.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReclaimSeatRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReclaimSeatRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReclaimSeatRequest"
              }
            }
          },
          "description": "The reclaim decision."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatChangeRecordDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatChangeRecordDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatChangeRecordDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reclaims a seat from a departing holder and requests the teardown the chosen scope\r\nimplies.",
        "tags": [
          "OrgSeatLifecycle"
        ]
      }
    },
    "/api/v1/billing/seat-lifecycle/organizations/{organizationId}/records/{seatReassignmentId}/assign": {
      "post": {
        "parameters": [
          {
            "description": "The organisation whose seat it is.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The reclaimed seat record to complete.",
            "in": "path",
            "name": "seatReassignmentId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AssignSeatRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AssignSeatRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AssignSeatRequest"
              }
            }
          },
          "description": "The incoming holder."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatChangeRecordDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatChangeRecordDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatChangeRecordDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Grants a reclaimed seat to its incoming holder. No new seat, no new charge (FR-14.238);\r\n409 when the licence no longer pays for the seat (FR-14.238(c)).",
        "tags": [
          "OrgSeatLifecycle"
        ]
      }
    },
    "/api/v1/billing/seat-reconciliation/organizations/{organizationId}": {
      "get": {
        "parameters": [
          {
            "description": "The organisation to reconcile.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Seats of divergence tolerated before a drift is declared. Supplied by the caller\r\nuntil the org-level reconciliation policy store exists (EPIC 50); omitted means\r\nzero tolerance, i.e. report any divergence.",
            "in": "query",
            "name": "toleranceSeats",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatReconciliationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatReconciliationDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatReconciliationDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the organisation's seat-reconciliation position: synced headcount vs\r\nbilled quota vs assigned seats, the divergence, and the costed delta.",
        "tags": [
          "SeatReconciliation"
        ]
      }
    },
    "/api/v1/billing/seat-reconciliation/organizations/{organizationId}/alerts/{alertId}/acknowledge": {
      "post": {
        "parameters": [
          {
            "description": "The organisation the episode belongs to.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The episode to acknowledge.",
            "in": "path",
            "name": "alertId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatDriftAlertDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatDriftAlertDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatDriftAlertDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Takes ownership of an open drift episode so the queue shows who is on it.",
        "tags": [
          "SeatReconciliation"
        ]
      }
    },
    "/api/v1/billing/seat-reconciliation/organizations/{organizationId}/exposure": {
      "get": {
        "parameters": [
          {
            "description": "The organisation.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "First UTC day; omitted means the first day of the current calendar quarter.",
            "in": "query",
            "name": "from",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Last UTC day, inclusive; omitted means today. At most 366 days from from.",
            "in": "query",
            "name": "to",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.SeatReconciliation.SeatDriftExposureDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.SeatReconciliation.SeatDriftExposureDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.SeatReconciliation.SeatDriftExposureDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the organisation's daily seat-drift exposure over a window.",
        "tags": [
          "SeatDriftExposure"
        ]
      }
    },
    "/api/v1/billing/seat-reconciliation/organizations/{organizationId}/history": {
      "get": {
        "parameters": [
          {
            "description": "The organisation.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.SeatReconciliation.SeatReconciliationHistoryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.SeatReconciliation.SeatReconciliationHistoryDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.SeatReconciliation.SeatReconciliationHistoryDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the organisation's reconciliation history: every drift episode and every\r\ndecision taken against one.",
        "tags": [
          "SeatReconciliation"
        ]
      }
    },
    "/api/v1/billing/seat-reconciliation/organizations/{organizationId}/preview": {
      "get": {
        "parameters": [
          {
            "description": "The organisation to price the change for.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The billed seat count the resolution would move to.",
            "in": "query",
            "name": "targetSeats",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatResolutionPreviewDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatResolutionPreviewDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatResolutionPreviewDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Prices a candidate resolution — moving billed seats to targetSeats —\r\nwithout changing anything. Lets the surface show the true-up path and the cap path\r\nside by side before the admin chooses.",
        "tags": [
          "SeatReconciliation"
        ]
      }
    },
    "/api/v1/billing/seat-reconciliation/organizations/{organizationId}/resolution": {
      "post": {
        "description": "<b>Nothing is billed by this call.</b> The response's `undoWindowEndsAt` is\r\n            when the seat change is actually applied; until then the delete below withdraws it\r\n            with no billing consequence at all.",
        "parameters": [
          {
            "description": "The organisation to reconcile.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CommitSeatResolutionRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CommitSeatResolutionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CommitSeatResolutionRequest"
              }
            }
          },
          "description": "The target seat count and which figure was believed."
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatResolutionDecisionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatResolutionDecisionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatResolutionDecisionDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Records a resolution to the organisation's open seat-drift episode and opens its\r\n24-hour undo window.",
        "tags": [
          "SeatReconciliation"
        ]
      }
    },
    "/api/v1/billing/seat-reconciliation/organizations/{organizationId}/resolutions/{decisionId}": {
      "delete": {
        "parameters": [
          {
            "description": "The organisation the decision belongs to.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The decision to withdraw.",
            "in": "path",
            "name": "decisionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatResolutionDecisionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatResolutionDecisionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatResolutionDecisionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Withdraws a recorded resolution inside its undo window. Because the seat change has\r\nnot been applied, this cancels rather than reverses — no credit note, no adjustment.",
        "tags": [
          "SeatReconciliation"
        ]
      }
    },
    "/api/v1/billing/seat-register/organizations/{organizationId}": {
      "get": {
        "description": "An unenrolled organisation is answered 200 with `enrolled: false` and a\r\nreason rather than 404: the surface must be able to say the figure is\r\nunavailable <i>and what to do about it</i>, which a 404 conveys neither of.",
        "parameters": [
          {
            "description": "The organisation.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgSeatRegisterDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgSeatRegisterDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgSeatRegisterDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the organisation's seat register, or the reason it has none.",
        "tags": [
          "OrgSeatRegister"
        ]
      }
    },
    "/api/v1/billing/seat-register/organizations/{organizationId}/enrol": {
      "post": {
        "parameters": [
          {
            "description": "The organisation.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.EnrolSeatRegisterRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.EnrolSeatRegisterRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.EnrolSeatRegisterRequest"
              }
            }
          },
          "description": "The seats to create at enrolment; may be empty."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgSeatRegisterDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgSeatRegisterDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgSeatRegisterDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Enrols the organisation into the seat register, optionally seeding it with the\r\nseats it already bills for.",
        "tags": [
          "OrgSeatRegister"
        ]
      }
    },
    "/api/v1/billing/seat-register/organizations/{organizationId}/seats": {
      "post": {
        "parameters": [
          {
            "description": "The organisation.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProvisionSeatRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProvisionSeatRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProvisionSeatRequest"
              }
            }
          },
          "description": "The seat to add."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RegisteredSeatDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RegisteredSeatDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RegisteredSeatDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Adds a seat to the register, unheld.",
        "tags": [
          "OrgSeatRegister"
        ]
      }
    },
    "/api/v1/billing/seat-register/organizations/{organizationId}/seats/{seatRef}/assign": {
      "post": {
        "parameters": [
          {
            "description": "The organisation.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The seat.",
            "in": "path",
            "name": "seatRef",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AssignSeatHolderRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AssignSeatHolderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AssignSeatHolderRequest"
              }
            }
          },
          "description": "The incoming holder."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RegisteredSeatDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RegisteredSeatDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RegisteredSeatDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Records that a holder now occupies a registered seat.",
        "tags": [
          "OrgSeatRegister"
        ]
      }
    },
    "/api/v1/billing/seat-register/organizations/{organizationId}/seats/{seatRef}/release": {
      "post": {
        "parameters": [
          {
            "description": "The organisation.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The seat.",
            "in": "path",
            "name": "seatRef",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RegisteredSeatDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RegisteredSeatDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RegisteredSeatDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Returns a registered seat to the organisation's unassigned pool.",
        "tags": [
          "OrgSeatRegister"
        ]
      }
    },
    "/api/v1/billing/seat-true-up/organizations/{organizationId}": {
      "get": {
        "parameters": [
          {
            "description": "The organisation to read.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The quarter as `yyyy-Qn`. Omitted means the most recently <i>closed</i> quarter\r\n— the one a true-up is actually due for.",
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RoutedSeatTrueUpDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RoutedSeatTrueUpDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RoutedSeatTrueUpDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads one period's true-up: what was metered, the derivation that turns it into\r\nmoney, the governance around the charge, and the per-seat evidence behind it.",
        "tags": [
          "SeatTrueUp"
        ]
      }
    },
    "/api/v1/billing/seat-true-up/organizations/{organizationId}/export": {
      "get": {
        "parameters": [
          {
            "description": "The organisation whose true-up to export.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The quarter as `yyyy-Qn`; omitted means the most recently closed one.",
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "content": {
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Downloads the reconciliation export: the period, the derivation line by line with its\r\ntax, the seat movements, the approval chain and the audit anchor.",
        "tags": [
          "SeatTrueUp"
        ]
      }
    },
    "/api/v1/billing/seat-true-up/organizations/{organizationId}/open": {
      "post": {
        "parameters": [
          {
            "description": "The organisation to true up.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.OpenSeatTrueUpRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.OpenSeatTrueUpRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.OpenSeatTrueUpRequest"
              }
            }
          },
          "description": "The period to open."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpPeriodDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpPeriodDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpPeriodDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Opens the review window for a metered period: strikes the derivation once, stores it,\r\nand fixes the review-close and charge dates the organisation is told about.",
        "tags": [
          "SeatTrueUp"
        ]
      }
    },
    "/api/v1/billing/seat-true-up/organizations/{organizationId}/runs/{runId}/approve": {
      "post": {
        "parameters": [
          {
            "description": "The organisation whose true-up it is.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The run being approved.",
            "in": "path",
            "name": "runId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApproveSeatTrueUpRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApproveSeatTrueUpRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApproveSeatTrueUpRequest"
              }
            }
          },
          "description": "The role the caller is approving in."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpPeriodDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpPeriodDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpPeriodDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Records one approval. When the chain satisfies the tier the amount requires, the run\r\nlocks and the adjustment is published for invoicing.",
        "tags": [
          "SeatTrueUp"
        ]
      }
    },
    "/api/v1/billing/seat-true-up/organizations/{organizationId}/runs/{runId}/holds": {
      "post": {
        "parameters": [
          {
            "description": "The organisation whose true-up it is.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The run to hold against.",
            "in": "path",
            "name": "runId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.HoldSeatTrueUpRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.HoldSeatTrueUpRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.HoldSeatTrueUpRequest"
              }
            }
          },
          "description": "The seat and the organisation's reason."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpPeriodDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpPeriodDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpPeriodDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Disputes one seat during the review window, holding its contribution out of the\r\ncharge until the dispute is resolved.",
        "tags": [
          "SeatTrueUp"
        ]
      }
    },
    "/api/v1/billing/seat-true-up/organizations/{organizationId}/runs/{runId}/holds/{seatRef}": {
      "put": {
        "parameters": [
          {
            "description": "The organisation whose true-up it is.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The run holding the seat.",
            "in": "path",
            "name": "runId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The disputed seat.",
            "in": "path",
            "name": "seatRef",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ResolveSeatTrueUpHoldRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ResolveSeatTrueUpHoldRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ResolveSeatTrueUpHoldRequest"
              }
            }
          },
          "description": "The resolution."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpPeriodDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpPeriodDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SeatTrueUpPeriodDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Resolves a seat dispute — upheld writes the held amount off, otherwise it returns to the charge.",
        "tags": [
          "SeatTrueUp"
        ]
      }
    },
    "/api/v1/billing/sla-credits/breaches/{breachId}": {
      "get": {
        "parameters": [
          {
            "description": "EPIC 70's breach (SlaRecord) id.",
            "in": "path",
            "name": "breachId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaBreachCreditDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaBreachCreditDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaBreachCreditDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "One breach, scoped to what the caller may see: the target missed, the uptime\r\nmeasured, the basis and window it was measured under, and the credit decision —\r\nincluding a not-eligible decision with its reason (journey Step 2 / branch B1).",
        "tags": [
          "SlaCredits"
        ]
      }
    },
    "/api/v1/billing/sla-credits/me": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaCreditRollupDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaCreditRollupDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaCreditRollupDto"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "summary": "The calling developer's SLA breaches and service credits (journey Step 5).",
        "tags": [
          "SlaCredits"
        ]
      }
    },
    "/api/v1/billing/sla-credits/organizations/{organizationId}": {
      "get": {
        "parameters": [
          {
            "description": "The organisation to report on.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Optional `yyyy-MM` reporting month.",
            "in": "query",
            "name": "month",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaCreditRollupDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaCreditRollupDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaCreditRollupDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The org-wide roll-up of breaches and credits across all the team's subscriptions\r\n(journey Step 5, org admin), optionally narrowed to a month.",
        "tags": [
          "SlaCredits"
        ]
      }
    },
    "/api/v1/billing/sla-credits/organizations/{organizationId}/reconciliation.csv": {
      "get": {
        "parameters": [
          {
            "description": "The organisation to report on.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Optional `yyyy-MM` reporting month.",
            "in": "query",
            "name": "month",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "content": {
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The exportable breach → credit reconciliation report for an organisation\r\n(debt-2026-06-04-769): one CSV line per breach decision, keyed on the breach id,\r\ncarrying measured-vs-target, the basis and window, the credit or the exception\r\nreason, and the ledger reference.",
        "tags": [
          "SlaCredits"
        ]
      }
    },
    "/api/v1/billing/sla-credits/terms": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaCreditTermsDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaCreditTermsDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SlaCreditTermsDto"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "The contracted service-credit terms a breach is reconciled against — the target\r\nbasis vocabulary, the credit ladder, and the recipient policy\r\n(debt-2026-06-05-802). Read-only: negotiating per-org targets is EPIC 8's\r\nterms contract (FR-08.054), not Billing's.",
        "tags": [
          "SlaCredits"
        ]
      }
    },
    "/api/v1/billing/subjects/{subjectType}/{subjectId}/entitlements/vault": {
      "get": {
        "description": "<b>Never 404 for an unknown subject.</b> A subject with no subscription is answered with\r\n            `entitlementActive: false` and the Free plan's figures, so a consumer can treat a 404\r\n            as what it is — a missing route — and fail rather than default.",
        "parameters": [
          {
            "in": "path",
            "name": "subjectType",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "subjectId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubjectVaultEntitlementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubjectVaultEntitlementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubjectVaultEntitlementDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The tier and storage allowance of the plan the subject is entitled under — their\r\nentitlement-active subscription's plan, else the no-charge Free plan.",
        "tags": [
          "SubjectVaultEntitlement"
        ]
      }
    },
    "/api/v1/billing/subjects/{subjectType}/{subjectId}/subscription": {
      "get": {
        "description": "<br>\r\n            Returns <b>200</b> with `entitlementActive: false` and a null subscription id for a\r\n            subject who holds nothing. Never 404 for an unknown subject: a subject with no plan\r\n            genuinely has none, and a 404 would make that indistinguishable from a missing route at\r\n            the consumer — which would turn \"this customer is on the free tier\" into \"billing is\r\n            down\".\r\n            \r\n<br>\r\n  <b>400, not a guess, on an unrecognised subject type.</b> The segment comes off the wire.\r\n            Defaulting it to `user` would answer a different question than the caller asked and\r\n            look like a plain answer while doing it.\r\n            ",
        "parameters": [
          {
            "in": "path",
            "name": "subjectType",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "subjectId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubjectSubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubjectSubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubjectSubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The subject's metering position: which subscription, and is it entitlement-active.",
        "tags": [
          "SubjectSubscription"
        ]
      }
    },
    "/api/v1/billing/subscription": {
      "get": {
        "parameters": [
          {
            "description": "The active organisation, sent by the portal as `X-Organization-Id` and\r\nverified against the caller's own org claim.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgSubscriptionSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgSubscriptionSummaryDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgSubscriptionSummaryDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the calling organisation's subscription position: its plan-level\r\nsubscriptions (each with its own billing period and renewal), its module\r\ninstalls, and its seat figures with their provenance.",
        "tags": [
          "OrgBillingSubscription"
        ]
      }
    },
    "/api/v1/billing/subscription/modules/{offeringId}/cancel": {
      "post": {
        "description": "<br>\r\n  <b>This is a deprovision, not an uninstall.</b> Entitlement is retained to the\r\n            period end with no renewal and no refund. The immediate revocation on\r\n            `ModuleSubscriptionsController.{id}/cancel` is the <i>uninstall</i> path — the\r\n            aggregate's own documentation scopes `Cancel()` to that — and binding a\r\n            customer's cancel to it would cut access they have already paid for.\r\n            \r\n<br>\r\n  <b>Keyed by offering, org bound by the guard.</b> The route names the offering the\r\n            page displays; the tenant comes from `X-Organization-Id` and is bound by\r\n            M:Essence.Payment.Billing.Api.Authorization.OrgScopeGuard.RequireOrgBillingAdmin(Microsoft.AspNetCore.Mvc.ControllerBase,System.Guid). A write needs that binding more\r\n            than the reads do — the gateway forwards `billing` with\r\n            `AuthorizationPolicy: None`, so without it any authenticated user could cancel\r\n            another tenant's modules by changing one header. It needs the <i>role</i> half at\r\n            least as much: this cancellation changes what the organisation is billed, so an\r\n            ordinary member of it must not be able to reach the lookup at all (issue #8523).\r\n            ",
        "parameters": [
          {
            "description": "The marketplace offering whose install is being cancelled.",
            "in": "path",
            "name": "offeringId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The active organisation, sent as `X-Organization-Id`.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgSubscriptionSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgSubscriptionSummaryDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrgSubscriptionSummaryDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Cancels one of the organisation's module installs at the end of its current billing\r\nperiod (AC-07.060 module change; FR-14.052a / AC-14.007).",
        "tags": [
          "OrgBillingSubscription"
        ]
      }
    },
    "/api/v1/chain-participants": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ChainParticipants.RegisterChainParticipantCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ChainParticipants.RegisterChainParticipantCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ChainParticipants.RegisterChainParticipantCommand"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChainParticipantDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChainParticipantDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChainParticipantDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Registers an organisation's position in a distribution chain.",
        "tags": [
          "ChainParticipants"
        ]
      }
    },
    "/api/v1/chain-participants/by-org/{orgId}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "orgId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChainParticipantDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChainParticipantDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChainParticipantDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "An organisation's active chain position, or 404 if it is in no chain.",
        "tags": [
          "ChainParticipants"
        ]
      }
    },
    "/api/v1/chain-participants/{participantId}/commercial-contact": {
      "put": {
        "parameters": [
          {
            "in": "path",
            "name": "participantId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ChainParticipants.SetChainParticipantCommercialContactCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ChainParticipants.SetChainParticipantCommercialContactCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ChainParticipants.SetChainParticipantCommercialContactCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChainParticipantDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChainParticipantDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChainParticipantDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Records the invoicing party and relationship manager shown on a channel\r\ncustomer's invoice ledger (AC-07.067).",
        "tags": [
          "ChainParticipants"
        ]
      }
    },
    "/api/v1/channel-commissions": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "dateFrom",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dateTo",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelCommissionDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelCommissionDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelCommissionDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "List channel commissions for the authenticated partner.",
        "tags": [
          "ChannelBilling"
        ]
      }
    },
    "/api/v1/channel-commissions/queries": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PartnerCommissionLineQueriesDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The caller's queries, newest first, each with both numbers, its age and its trail, and how\r\nmany are open.",
        "tags": [
          "ChannelCommissionQueries"
        ]
      }
    },
    "/api/v1/channel-commissions/queries/{queryId}/withdraw": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "queryId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CommissionLineQueryDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Withdraws one of the caller's open queries. Any hold is released.",
        "tags": [
          "ChannelCommissionQueries"
        ]
      }
    },
    "/api/v1/channel-commissions/statement": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "periodStart",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodEnd",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelCommissionStatementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelCommissionStatementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelCommissionStatementDto"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get a monthly commission statement for the authenticated partner.",
        "tags": [
          "ChannelBilling"
        ]
      }
    },
    "/api/v1/channel-commissions/true-up": {
      "get": {
        "parameters": [
          {
            "description": "The quarter, `yyyy-Qn` (e.g. `2026-Q2`); anything else is 400\r\n            `INVALID_CHANNEL_TRUE_UP_PERIOD`.",
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelTrueUpPeriodDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The caller's true-up for one quarter.",
        "tags": [
          "PartnerChannelTrueUp"
        ]
      }
    },
    "/api/v1/channel-commissions/{commissionId}/queries": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "commissionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RaiseCommissionLineQueryRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RaiseCommissionLineQueryRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RaiseCommissionLineQueryRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CommissionLineQueryDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Raises a query on one of the caller's commission lines, with the figure it expected and a\r\nreason. A queried clawback line is held out of the payout run until the query closes.",
        "tags": [
          "ChannelCommissionQueries"
        ]
      }
    },
    "/api/v1/channel-orders": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "dateFrom",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dateTo",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelOrderDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelOrderDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelOrderDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "List channel orders for the authenticated partner.",
        "tags": [
          "ChannelBilling"
        ]
      }
    },
    "/api/v1/channel-orders/receivables": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.ChannelReceivables.PartnerReceivablesPosition"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "What the caller's partner owes, per currency and aged on the platform definition, with the\r\nopen invoices behind it, any written-off value, and how many Buy-Sell orders carry no invoice.",
        "tags": [
          "ChannelReceivables"
        ]
      }
    },
    "/api/v1/channel-orders/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Channel order identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelOrderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelOrderDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelOrderDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get detail for a single channel order.",
        "tags": [
          "ChannelBilling"
        ]
      }
    },
    "/api/v1/channel-orders/{id}/invoices": {
      "get": {
        "parameters": [
          {
            "description": "Channel order identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoiceDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "List invoices for a channel order.",
        "tags": [
          "ChannelBilling"
        ]
      }
    },
    "/api/v1/channel-payouts/reconciliation": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "periodStart",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodEnd",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutStreamReconciliationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutStreamReconciliationDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutStreamReconciliationDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "FR-14.090..096 / F6-T09: returns the two-stream (Marketplace +\r\nChannel) payout reconciliation report for the authenticated\r\npartner over the requested period. Per PRD v2.0 §3.10 the\r\nidentity `commissions == payouts + tax + pending` must hold\r\nfor each stream; any drift surfaces on Essence.Payment.Billing.Application.DTOs.PayoutStreamReconciliationDto.Gaps.",
        "tags": [
          "ChannelBilling"
        ]
      }
    },
    "/api/v1/commission-queries": {
      "get": {
        "parameters": [
          {
            "description": "Optional: `Open`, `Withdrawn` or `Upheld`.",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 to 200 (default 100).",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CommissionLineQueryDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Every partner's queries: open first, oldest first. Each has both numbers, the difference,\r\nthe reason, the age and the trail.",
        "tags": [
          "CommissionQueryAdjudication"
        ]
      }
    },
    "/api/v1/commission-queries/{id}/uphold": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.UpholdCommissionLineQueryRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.UpholdCommissionLineQueryRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.UpholdCommissionLineQueryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CommissionLineQueryDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Upholds the ledger figure. A reason is required, because the partner reads it. Releases any\r\nhold. A query that is already closed is 409, and the first outcome stands.",
        "tags": [
          "CommissionQueryAdjudication"
        ]
      }
    },
    "/api/v1/commissions/partner/{partnerId}": {
      "get": {
        "description": "Sample request:\r\n            \r\n    GET /api/v1/commissions/partner/3fa85f64-5717-4562-b3fc-2c963f66afa6?startDate=2024-01-01&status=Pending\r\n            \r\nReturns all pending commissions for the partner since January 1, 2024.",
        "parameters": [
          {
            "description": "Partner ID (GUID)",
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Optional start date filter (ISO 8601 format)",
            "in": "query",
            "name": "startDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Optional end date filter (ISO 8601 format)",
            "in": "query",
            "name": "endDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Optional status filter. Valid values: Pending, Paid, Voided, Reversed",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Commissions.CommissionDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Commissions.CommissionDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Commissions.CommissionDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Returns the list of commissions"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Invalid filter parameters"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized - JWT token missing or invalid"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Gets commissions for a partner with optional filtering.",
        "tags": [
          "Commissions"
        ]
      }
    },
    "/api/v1/commissions/partner/{partnerId}/pending-balance": {
      "get": {
        "description": "Sample request:\r\n            \r\n    GET /api/v1/commissions/partner/3fa85f64-5717-4562-b3fc-2c963f66afa6/pending-balance\r\n            \r\nReturns the total pending (unpaid) commission amount and count for the partner.\r\nThis is useful for partners to see their current earnings awaiting payout.",
        "parameters": [
          {
            "description": "Partner ID (GUID)",
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Commissions.PendingBalanceDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Commissions.PendingBalanceDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Commissions.PendingBalanceDto"
                }
              }
            },
            "description": "Returns the pending balance summary"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized - JWT token missing or invalid"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Partner not found"
          }
        },
        "summary": "Gets the pending commission balance for a partner.",
        "tags": [
          "Commissions"
        ]
      }
    },
    "/api/v1/commissions/{id}": {
      "get": {
        "description": "A non-admin caller may read only their own partner's commissions. A\r\ncommission belonging to another partner answers 404 rather than 403: the\r\ncaller supplies no partner id here, so 403 would confirm that a given\r\ncommission id exists and merely belongs to somebody else, turning the\r\nendpoint into an id oracle. The route-scoped endpoints above can safely\r\nanswer 403 because the caller named the partner in the request.",
        "parameters": [
          {
            "description": "Commission ID (GUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Commissions.CommissionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Commissions.CommissionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Commissions.CommissionDto"
                }
              }
            },
            "description": "Returns the commission"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized - JWT token missing or invalid"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "No commission with that id is visible to the caller"
          }
        },
        "summary": "Gets commission by ID.",
        "tags": [
          "Commissions"
        ]
      }
    },
    "/api/v1/consumer-remedies": {
      "post": {
        "description": "Self-scoped: a non-admin caller always records a claim for THEMSELVES. The\r\nbody's `ClaimantUserId` and `OrganizationId` are overwritten from\r\nthe token, so a consumer cannot open a settlement in someone else's name or\r\nattribute their personal claim to an organisation.",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ConsumerRemedies.RecordConsumerRemedyCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ConsumerRemedies.RecordConsumerRemedyCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ConsumerRemedies.RecordConsumerRemedyCommand"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "FR-14.210 — records a claim outcome. Idempotent on `claimReference`.",
        "tags": [
          "ConsumerRemedies"
        ]
      }
    },
    "/api/v1/consumer-remedies/mine": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Lists the calling consumer's own claim outcomes.",
        "tags": [
          "ConsumerRemedies"
        ]
      }
    },
    "/api/v1/consumer-remedies/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Reads a claim outcome, including the deduction and the current release\r\nblockers. Readable by the claimant or a billing admin.",
        "tags": [
          "ConsumerRemedies"
        ]
      }
    },
    "/api/v1/consumer-remedies/{id}/deduction": {
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "FR-14.224 — the seller withdraws the deduction, conceding the full gross\r\nagreed remedy.",
        "tags": [
          "ConsumerRemedies"
        ]
      },
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ConsumerRemedies.ApplyUseWearDeductionCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ConsumerRemedies.ApplyUseWearDeductionCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ConsumerRemedies.ApplyUseWearDeductionCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "FR-14.224 — records the seller's use/wear deduction against the gross agreed\r\nremedy. The settlement cannot release money until the consumer accepts it.",
        "tags": [
          "ConsumerRemedies"
        ]
      }
    },
    "/api/v1/consumer-remedies/{id}/deduction/review": {
      "post": {
        "description": "Self-scoped rather than admin-gated: the deduction is the seller's assertion\r\nabout this consumer's payout, so only that consumer can answer it. The check\r\nis against the settlement's own claimant, not a caller-supplied id.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ConsumerRemedies.ReviewUseWearDeductionCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ConsumerRemedies.ReviewUseWearDeductionCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ConsumerRemedies.ReviewUseWearDeductionCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "FR-14.224 — the consumer's answer to the deduction. Accepting unblocks\r\nrelease of the net amount; disputing keeps the money frozen.",
        "tags": [
          "ConsumerRemedies"
        ]
      }
    },
    "/api/v1/consumer-remedies/{id}/reconcile-ownership": {
      "post": {
        "description": "Self-scoped. A non-admin caller may not nominate a rightful holder: the only\r\nself-declaration we accept is `PriorTransferFound=false`, which\r\nreconciles the item to the caller. `PriorTransferFound=true` is refused\r\nwith 409 — see the class remarks.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ConsumerRemedies.ReconcileRemedyOwnershipCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ConsumerRemedies.ReconcileRemedyOwnershipCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.ConsumerRemedies.ReconcileRemedyOwnershipCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "FR-14.211 — reconciles ownership/transfer history. Either advances the\r\nsettlement to `OwnershipReconciled` or holds it for review.",
        "tags": [
          "ConsumerRemedies"
        ]
      }
    },
    "/api/v1/consumer-remedies/{id}/settle": {
      "post": {
        "description": "Self-scoped. Both gates are domain invariants, so a claimant settling their\r\nown claim gets the same 409 an operator would: unreconciled or wrong-party\r\nownership, or a deduction they have not answered.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ConsumerRemedySettlementDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "FR-14.211 / FR-14.224 — settles the claim outcome. Returns 409 when either\r\nmoney-movement gate refuses: ownership unreconciled / wrong party, or a\r\ndeduction the consumer has not accepted.",
        "tags": [
          "ConsumerRemedies"
        ]
      }
    },
    "/api/v1/credit-notes": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CreditNoteDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CreditNoteDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CreditNoteDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "The caller's credit notes (addressed to them, or to their organisation when it may see figures).",
        "tags": [
          "CreditNotes"
        ]
      }
    },
    "/api/v1/credit-notes/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CreditNoteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CreditNoteDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CreditNoteDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "One credit note.",
        "tags": [
          "CreditNotes"
        ]
      }
    },
    "/api/v1/credit-notes/{id}/pdf": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "A credit note's PDF.",
        "tags": [
          "CreditNotes"
        ]
      }
    },
    "/api/v1/csp-report": {
      "post": {
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "summary": "Receives a CSP violation report. Returns 204 on success so\r\nbrowsers do not retry (RFC 7234 idempotency on unsupported\r\nstatus codes is gateway-dependent). A malformed report is refused by throwing, so it is a\r\n400 RFC 7807 ProblemDetails like every other error on this service (API-003, #18049).",
        "tags": [
          "CspReport"
        ]
      }
    },
    "/api/v1/deal-terms/by-subscription/{subscriptionId}": {
      "get": {
        "parameters": [
          {
            "description": "The subscription.",
            "in": "path",
            "name": "subscriptionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ApprovedDealTermsDto"
                }
              }
            },
            "description": "The approval that authorised this subscription's non-standard terms."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The subscription redeemed no deal-desk approval — it is standard-priced."
          }
        },
        "summary": "The approval a subscription redeemed, if any.",
        "tags": [
          "DealTerms"
        ]
      }
    },
    "/api/v1/deal-terms/{authorisationReference}": {
      "get": {
        "parameters": [
          {
            "description": "The opaque redemption token.",
            "in": "path",
            "name": "authorisationReference",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ApprovedDealTermsDto"
                }
              }
            },
            "description": "The landed approval, and whether a subscription has redeemed it."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "No approval carries that reference."
          }
        },
        "summary": "Resolve an authorisation reference to the approval behind it.",
        "tags": [
          "DealTerms"
        ]
      }
    },
    "/api/v1/disbursements/cis": {
      "post": {
        "description": "<br>\r\n            Retrying is safe: a repeat release for the same pay run and subcontractor returns the\r\n            payment that was already made. Paying a subcontractor twice and reporting both on the\r\n            CIS300 is the worst outcome this surface has, and network retries are ordinary.\r\n            \r\n<br>\r\n            A 422 carries a machine-readable `reasonCode` — `verification-absent`,\r\n            `verification-expired`, `stale-blocked-by-policy`,\r\n            `override-reason-required`, `rate-disagreement`,\r\n            `subcontractor-mismatch` or `organization-mismatch` — so the surface can\r\n            branch without parsing prose.\r\n            ",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReleaseCisPaymentRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReleaseCisPaymentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReleaseCisPaymentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDisbursementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDisbursementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDisbursementDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Releases a CIS payment, binding the named verification to it.",
        "tags": [
          "CisDisbursements"
        ]
      }
    },
    "/api/v1/disbursements/cis/organizations/{organizationId}/policy": {
      "get": {
        "description": "Never 404s. An organisation that has configured nothing is governed by the statutory\r\ndefault, which is returned with `isStatutoryDefault` set — so the surface can say\r\n\"you have not configured this\" rather than presenting defaults as deliberate choices.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisContractorPolicyDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisContractorPolicyDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisContractorPolicyDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads an organisation's CIS settings.",
        "tags": [
          "CisDisbursements"
        ]
      },
      "put": {
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SaveCisContractorPolicyRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SaveCisContractorPolicyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SaveCisContractorPolicyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisContractorPolicyDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisContractorPolicyDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisContractorPolicyDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Stores or replaces an organisation's CIS settings.",
        "tags": [
          "CisDisbursements"
        ]
      }
    },
    "/api/v1/disbursements/cis/pay-runs/{payRunId}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "payRunId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDisbursementDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDisbursementDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDisbursementDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads every CIS payment released on one pay run.",
        "tags": [
          "CisDisbursements"
        ]
      }
    },
    "/api/v1/disbursements/cis/verifications": {
      "post": {
        "description": "<b>Service authority only.</b> This is the front door through which the rate a payment\r\n            may be released on enters EPIC 14. Exposing it to a contractor's own token would let\r\n            them assert their subcontractor's HMRC status — the exact assertion the binding exists\r\n            to make un-assertable. Idempotent on the verification id.",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordCisVerificationRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordCisVerificationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordCisVerificationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisVerificationRecordDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisVerificationRecordDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisVerificationRecordDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Takes delivery of a CIS status check from the verification service.",
        "tags": [
          "CisDisbursements"
        ]
      }
    },
    "/api/v1/disbursements/cis/verifications/{verificationId}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "verificationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisVerificationRecordDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisVerificationRecordDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisVerificationRecordDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Reads a CIS check EPIC 14 holds, or 404 when it holds none under that id.",
        "tags": [
          "CisDisbursements"
        ]
      }
    },
    "/api/v1/disbursements/cis/{paymentId}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "paymentId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDisbursementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDisbursementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDisbursementDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Reads one released CIS payment, with its binding and deduction statement.",
        "tags": [
          "CisDisbursements"
        ]
      }
    },
    "/api/v1/disbursements/cis/{paymentId}/anchor": {
      "post": {
        "description": "Service authority only, and set-once. The contractor's surface reads the authoritative\r\nanchoring state from EPIC 4's own `GET /api/v1/anchor-receipts/{entityId}`; this\r\nrecords EPIC 14's local copy so the reference lives in the payment's own history. A\r\nsecond, different reference is refused rather than overwritten.",
        "parameters": [
          {
            "in": "path",
            "name": "paymentId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordCisAnchorRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordCisAnchorRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordCisAnchorRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDisbursementDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDisbursementDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CisDisbursementDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Records EPIC 4's anchor reference against a bound payment.",
        "tags": [
          "CisDisbursements"
        ]
      }
    },
    "/api/v1/enterprise-contracts": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Enterprise.CreateEnterpriseContractCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Enterprise.CreateEnterpriseContractCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Enterprise.CreateEnterpriseContractCommand"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Originate a draft Enterprise contract (FR-14.195b). The terms become the\r\nauthoritative source FR-14.189..193 read; nothing is invoiced until activation.",
        "tags": [
          "EnterpriseContracts"
        ]
      }
    },
    "/api/v1/enterprise-contracts/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Read an Enterprise contract by id (FR-14.195). 404 if none exists.",
        "tags": [
          "EnterpriseContracts"
        ]
      }
    },
    "/api/v1/enterprise-contracts/{id}/activate": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Enterprise.ActivateEnterpriseContractCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Enterprise.ActivateEnterpriseContractCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Enterprise.ActivateEnterpriseContractCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Activate a draft contract (FR-14.195d). Replaces the trial, issues the first\r\nFR-14.189 invoice, and grants the committed entitlement. A dual-auth contract\r\n(FR-14.195c) must carry a distinct `secondApproverId`; otherwise the\r\nactivation returns HTTP 409 (`enterprise-contract-not-activatable`).",
        "tags": [
          "EnterpriseContracts"
        ]
      }
    },
    "/api/v1/enterprise-contracts/{id}/amend": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Enterprise.AmendEnterpriseContractCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Enterprise.AmendEnterpriseContractCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Enterprise.AmendEnterpriseContractCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Amend an active contract mid-term (FR-14.192): a committed-seat increase\r\n(`additionalSeats ≥ 1`) or a tier/feature add-on. The negotiated additional\r\ncommitment grows the committed contract total and its remaining-term share is\r\ninvoiced immediately (FR-14.003 / FR-14.180) via `EnterpriseContractAmendedEvent`.\r\nMid-term reductions are rejected (HTTP 400/409); they take effect at renewal.\r\nReturns the amended contract.",
        "tags": [
          "EnterpriseContracts"
        ]
      }
    },
    "/api/v1/enterprise-contracts/{id}/dunning/advance": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Enterprise.AdvanceEnterpriseDunningCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Enterprise.AdvanceEnterpriseDunningCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Enterprise.AdvanceEnterpriseDunningCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Advance the net-terms invoice-level dunning for an unpaid Enterprise invoice\r\n(FR-14.193). Reminds at `due+7`, `due+14`, `due+30` and suspends the\r\ncontract at `due+30` (no card-retry — Enterprise invoices settle on negotiated\r\nnet terms). Idempotent per (contract, invoice); intended to be driven by a daily\r\ndunning sweep. Returns the contract with its advanced dunning state.",
        "tags": [
          "EnterpriseContracts"
        ]
      }
    },
    "/api/v1/enterprise-contracts/{id}/dunning/cure": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.EnterpriseContractDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Cure the net-terms arrears on a contract (FR-14.193) — the overdue invoice was paid.\r\nClears any in-progress dunning and reinstates a suspended contract to `active`,\r\nrestoring entitlements. Idempotent. Returns the cured contract.",
        "tags": [
          "EnterpriseContracts"
        ]
      }
    },
    "/api/v1/family-memberships": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Family.OpenFamilyRosterCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Family.OpenFamilyRosterCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Family.OpenFamilyRosterCommand"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Open the membership roster for a Family subscription (FR-14.185 / FR-14.187).\r\nThe owner is fixed to the subscriber. Idempotent: re-opening returns the\r\nexisting roster.",
        "tags": [
          "FamilyMemberships"
        ]
      }
    },
    "/api/v1/family-memberships/for-user/{userId}": {
      "get": {
        "description": "<br>\r\n  <b>Why this endpoint exists.</b> Every other route on this controller is keyed by\r\n            `subscriptionId` — an identifier a user has no way to obtain and which the product\r\n            never shows them. So none of them can answer the only question a plan owner actually asks,\r\n            and the family console was reachable only by pasting an internal id. This route is keyed on\r\n            the subject instead.\r\n            \r\n<br>\r\n  <b>Authorized explicitly, not by being unrouted.</b> Neither gateway routes\r\n            `/api/v1/family-memberships/for-user/**`, and it must stay that way — the Global gateway\r\n            routes the sibling actions (#9560) by explicit path, never by a catch-all that would take this\r\n            one too. But a roster read is not safe merely because it is hard to reach, so this action\r\n            requires the caller to <i>be</i> the subject, or to hold\r\n            Essence.Payment.Billing.Api.Authorization.BillingPolicies.FamilyRosterReadPermission (the family module's service\r\n            principal), or to be a billing admin. Anything else is refused. A user's own read at the edge\r\n            is M:Essence.Payment.Billing.Api.Controllers.FamilyMembershipsController.GetMine(System.Threading.CancellationToken).\r\n            \r\n<br>\r\n  <b>Service-only at the endpoint (ADR-021 5h-A, #13630).</b> The route is gated on\r\n            Essence.Payment.Billing.Api.Authorization.BillingPolicies.FamilyRosterRead, a `ServicePrincipal.Is` policy: only a\r\n            service subject holding the roster-read scope reaches the action, so the subject and\r\n            billing-admin branches below are defence in depth, not live audiences. Its one caller is the\r\n            family module, which resolves the subject from the end user's own token and then asks here\r\n            with its minted `service:family` token.\r\n            \r\n<br>\r\n  <b>Always 200, never 404.</b> \"On no family plan\" is a real answer (`found: false`) and\r\n            must stay distinguishable from \"that route does not exist\" at the consumer — the same reason\r\n            the erasure-obligation summary never 404s. It is also not an existence oracle: the answer is\r\n            only ever about the caller's own membership, and a caller who is neither the subject nor an\r\n            authorised principal is refused before anything is read.\r\n            ",
        "parameters": [
          {
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyRosterForUserDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyRosterForUserDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyRosterForUserDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "\"Which Family roster is this user on?\" — the read that makes a family plan DISCOVERABLE\r\n(#6290). Consumed service-to-service by the EPIC 30 family module behind\r\n`GET /api/v1/family-plan/mine`.",
        "tags": [
          "FamilyMemberships"
        ]
      }
    },
    "/api/v1/family-memberships/mine": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MyFamilyMembershipDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MyFamilyMembershipDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MyFamilyMembershipDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The caller's own family position (#9560): the roster they own or hold a seat on, and the\r\ninvitations addressed to their verified email — every id the family console needs, from the\r\ntoken alone. Always 200; \"on no plan\" is `roster.found: false`, never a 404.",
        "tags": [
          "FamilyMemberships"
        ]
      }
    },
    "/api/v1/family-memberships/{subscriptionId}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "subscriptionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Fetch the Family roster for a subscription (FR-14.185) — for its owner, an accepted member or\r\na billing admin. 404 if none is open, and the same 404 for a caller who is not on it (#9560).",
        "tags": [
          "FamilyMemberships"
        ]
      }
    },
    "/api/v1/family-memberships/{subscriptionId}/members": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "subscriptionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Family.InviteFamilyMemberCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Family.InviteFamilyMemberCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Family.InviteFamilyMemberCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Invite an additional member by email (FR-14.185). A pending invite occupies a\r\nseat; an invite that would exceed the 6-seat cap returns HTTP 409\r\n(`family-seat-cap-exceeded`) after the owner is notified.",
        "tags": [
          "FamilyMemberships"
        ]
      }
    },
    "/api/v1/family-memberships/{subscriptionId}/members/{memberId}": {
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "subscriptionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "memberId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Remove an accepted member or revoke a pending invite (FR-14.187), freeing the\r\nseat back to the cap. The owner removes anyone; an accepted member may remove only their\r\nown seat — leaving (#9560).",
        "tags": [
          "FamilyMemberships"
        ]
      }
    },
    "/api/v1/family-memberships/{subscriptionId}/members/{memberId}/accept": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "subscriptionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "memberId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Family.AcceptFamilyInviteCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Family.AcceptFamilyInviteCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Family.AcceptFamilyInviteCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.FamilyMembershipDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Accept a pending invitation (FR-14.185), linking the seat to the CALLER — who must be the\r\ninvitation's addressee by verified token email (#9560). No body is needed; any accepting\r\nuser id a body carries is ignored.",
        "tags": [
          "FamilyMemberships"
        ]
      }
    },
    "/api/v1/internal/billing-documents/{kind}/{id}/pdf": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "recipientUserId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "No such document, or the recipient is not in its payer audience."
          },
          "503": {
            "description": "The organisation directory could not be read; retry."
          }
        },
        "summary": "The PDF of an invoice or credit note, for recipientUserId only if they are its payer.",
        "tags": [
          "InternalBillingDocuments"
        ]
      }
    },
    "/api/v1/internal/capacity/check": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.CapacityCheckRequestDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.CapacityCheckRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.CapacityCheckRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.CapacityCheckResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.CapacityCheckResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.Entitlements.CapacityCheckResponseDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Answers whether the subject may hold `currentCount + requested` of the capacity\r\nfeature. A refusal of the allowance is a 200 with `allowed=false`; only a malformed\r\nrequest is a 400.",
        "tags": [
          "Capacity"
        ]
      }
    },
    "/api/v1/invoices/{invoiceId}/credit-notes": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "invoiceId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CreditNoteDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CreditNoteDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CreditNoteDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "The credit notes issued against an invoice the caller may read.",
        "tags": [
          "CreditNotes"
        ]
      }
    },
    "/api/v1/levy-accounts/approved-providers": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.LevyAccount.ApprovedProviderDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.LevyAccount.ApprovedProviderDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.LevyAccount.ApprovedProviderDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The approved providers an allocation may name, for the form's picker.",
        "tags": [
          "LevyAccounts"
        ]
      },
      "post": {
        "description": "<b>Service authority only.</b> Levy funds may only be drawn against training delivered by an\r\n            approved provider, so approval is a precondition of a commitment rather than a check made\r\n            later — and an employer able to add a provider could approve their own.",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RegisterApprovedProviderRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RegisterApprovedProviderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RegisterApprovedProviderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.LevyAccount.ApprovedProviderDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.LevyAccount.ApprovedProviderDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.LevyAccount.ApprovedProviderDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Registers or amends an approved training provider.",
        "tags": [
          "LevyAccounts"
        ]
      }
    },
    "/api/v1/levy-accounts/funded-standards": {
      "get": {
        "description": "Withdrawn standards are included, carrying their withdrawal instant, so the form can explain\r\nwhy a standard an employer allocated to last year can no longer be chosen. Omitting them\r\nwould make it look as though it never existed.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.LevyAccount.FundedStandardDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.LevyAccount.FundedStandardDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.LevyAccount.FundedStandardDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The funded standards an allocation may be made against, for the form's picker.",
        "tags": [
          "LevyAccounts"
        ]
      },
      "post": {
        "description": "<b>Service authority only.</b> The band cap and the co-investment percentage decide how much\r\n            public money one apprentice place may consume; an employer that could write them would be\r\n            setting their own funding. Amending a cap affects only commitments made from now on —\r\n            allocations already made carry the cap they were made under.",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RegisterFundedStandardRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RegisterFundedStandardRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RegisterFundedStandardRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.LevyAccount.FundedStandardDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.LevyAccount.FundedStandardDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.LevyAccount.FundedStandardDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Registers or amends a funded apprenticeship standard and its band cap.",
        "tags": [
          "LevyAccounts"
        ]
      }
    },
    "/api/v1/levy-accounts/mine": {
      "get": {
        "parameters": [
          {
            "description": "The active organisation, sent by the portal as `X-Organization-Id` and verified against\r\nthe caller's own org claim.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.LevyAccountDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.LevyAccountDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.LevyAccountDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads the calling organisation's levy account: balances, ledger and allocations.",
        "tags": [
          "LevyAccounts"
        ]
      }
    },
    "/api/v1/levy-accounts/mine/allocations": {
      "post": {
        "description": "<br>\r\n            Retrying is safe. A repeat of the same commitment — the same organisation, standard, provider\r\n            and place count — returns the allocation already made rather than reserving the pot twice.\r\n            Funds reserved against places that do not exist still expire while reserved, so a\r\n            double-clicked form is not a harmless duplicate.\r\n            \r\n<br>\r\n            A 422 carries a machine-readable `reasonCode` in the RFC 7807 body —\r\n            `account-absent`, `standard-not-funded`, `standard-withdrawn`,\r\n            `provider-not-approved`, `provider-withdrawn`, `places-invalid` or\r\n            `insufficient-available-funds` — so the employer console can branch without parsing\r\n            prose. Every one of those names something the employer can act on.\r\n            ",
        "parameters": [
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.LevyAllocationRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.LevyAllocationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.LevyAllocationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.LevyAllocationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.LevyAllocationDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.LevyAllocationDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Commits part of the pot to one standard with one approved provider.",
        "tags": [
          "LevyAccounts"
        ]
      }
    },
    "/api/v1/levy-accounts/mine/completion-audits": {
      "get": {
        "description": "<b>Ids only, never content.</b> The credential id, the reconciliation line ids and the\r\n            evidence entry ids. An auditor joins qualification → spend → milestone → evidence without\r\n            this API ever carrying the evidence itself, which is what keeps a funding surface out of the\r\n            apprentice's own training record and out of their vault.",
        "parameters": [
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CompletionAuditJoinDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CompletionAuditJoinDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CompletionAuditJoinDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The completion audit joins for apprentices who have finished — qualification against the\r\nreconciled spend that funded it.",
        "tags": [
          "LevyAccounts"
        ]
      }
    },
    "/api/v1/levy-accounts/mine/reconciliation": {
      "get": {
        "description": "<br>\r\n            Apprenticeship funding is released as milestones are evidenced, not paid up front. Each line\r\n            is one milestone's money, carrying the ids that join it back to the training record so an\r\n            auditor can walk from a payment to the evidence that earned it.\r\n            \r\n<br>\r\n  <b>Three money figures per line, and they are allowed to disagree.</b>\r\n  `plannedPence` is\r\n            what the schedule promises, `drawnPence` what left the levy pot, and\r\n            `paidToProviderPence` what reached the provider. The gaps are the reconciliation.\r\n            \r\n<br>\r\n            An organisation with no funded apprenticeships gets a <b>200 with an empty reconciliation</b>\r\n            and a real `computedAtIso`, never a 404 — the client's vocabulary maps a 404 to\r\n            `failed`, whose message tells the employer to treat the figures as unknown.\r\n            ",
        "parameters": [
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The milestone-keyed spend reconciliation for the calling organisation's funded cohort.",
        "tags": [
          "LevyAccounts"
        ]
      }
    },
    "/api/v1/levy-accounts/{organizationId}/apprenticeships/{apprenticeshipId}/completion": {
      "post": {
        "description": "<br>\r\n  <b>The `QualificationIssued` landing point.</b> EPIC 29 has no producer for that event\r\n            yet, so no consumer is bound to it here — a consumer wired to a message nothing publishes\r\n            reads as a delivered seam. This is the endpoint that consumer will call.\r\n            \r\n<br>\r\n  <b>It evidences the completion payment; it does not release it.</b> The qualification is what\r\n            earns the final rung, so it marks that rung achieved with the credential as its evidence.\r\n            Releasing here would mint a drawdown with no attributed actor, and an event cannot be asked at\r\n            audit who authorised a payment.\r\n            ",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "apprenticeshipId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApprenticeshipCompletionRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApprenticeshipCompletionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApprenticeshipCompletionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CompletionAuditJoinDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CompletionAuditJoinDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CompletionAuditJoinDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Records the qualification EPIC 29 issued and returns the completion audit join — service\r\nauthority only.",
        "tags": [
          "LevyAccounts"
        ]
      }
    },
    "/api/v1/levy-accounts/{organizationId}/apprenticeships/{apprenticeshipId}/early-leaver": {
      "post": {
        "description": "Closes the funding line to further releases and puts the apprentice on the early-leaver list\r\nthe employer works through. It does not itself reverse anything: the clawback is a deliberate\r\nledger movement against the milestones that were not in fact earned, because automating it\r\nwould reverse payments for milestones the apprentice <i>had</i> earned before leaving.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "apprenticeshipId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.EarlyLeaverRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.EarlyLeaverRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.EarlyLeaverRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Records that an apprentice left before completing — service authority only.",
        "tags": [
          "LevyAccounts"
        ]
      }
    },
    "/api/v1/levy-accounts/{organizationId}/apprenticeships/{apprenticeshipId}/milestones": {
      "post": {
        "description": "<b>The schedule is not the employer's to write.</b> What each milestone is worth is set by the\r\n            funding rules and the provider agreement; an employer able to schedule their own milestone\r\n            values would be deciding how much public funding each rung of their own apprenticeship\r\n            releases. Idempotent on the apprenticeship and on each milestone code, and it does not amend a\r\n            rung already drawn against.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "apprenticeshipId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ScheduleMilestonesRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ScheduleMilestonesRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ScheduleMilestonesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Opens or extends one apprentice's funding schedule — service authority only.",
        "tags": [
          "LevyAccounts"
        ]
      }
    },
    "/api/v1/levy-accounts/{organizationId}/apprenticeships/{apprenticeshipId}/milestones/{milestoneCode}/achievement": {
      "post": {
        "description": "<b>This is the gate every release depends on,</b> which is exactly why the employer cannot\r\n            write it. A party able to record their own achievements could make any milestone releasable,\r\n            and the evidence requirement would be decorative.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "apprenticeshipId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "milestoneCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.MilestoneAchievementRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.MilestoneAchievementRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.MilestoneAchievementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Records that EPIC 29 has evidenced a milestone as achieved — service authority only.",
        "tags": [
          "LevyAccounts"
        ]
      }
    },
    "/api/v1/levy-accounts/{organizationId}/apprenticeships/{apprenticeshipId}/milestones/{milestoneCode}/drawdowns": {
      "post": {
        "description": "<br>\r\n            Writes the milestone rung, the ledger drawdown and the outbox notification in one\r\n            transaction. A 422 carries a machine-readable `reasonCode`: `milestone-not-achieved`\r\n            when EPIC 29 has recorded no evidence for it, `attribution-required` when no actor was\r\n            named, `apprentice-has-left`, or `drawdown-exceeds-milestone`.\r\n            \r\n<br>\r\n  <b>The actor is part of what is being recorded, not a header we infer.</b> Every release names\r\n            the person whose sign-off moved public money, because an unattributed drawdown is one nobody\r\n            can be asked about at audit.\r\n            ",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "apprenticeshipId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "milestoneCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.MilestoneDrawdownRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.MilestoneDrawdownRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.MilestoneDrawdownRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Releases levy funds against an evidenced milestone — service authority only.",
        "tags": [
          "LevyAccounts"
        ]
      }
    },
    "/api/v1/levy-accounts/{organizationId}/apprenticeships/{apprenticeshipId}/milestones/{milestoneCode}/provider-payments": {
      "post": {
        "description": "Deliberately separate from the release: funds leave the levy pot when the milestone is\r\nreleased and reach the provider when the payment run settles. Collapsing the two would make\r\nthe gap between drawn and paid — one of the two discrepancies this reconciliation exists to\r\nsurface — impossible to represent.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "apprenticeshipId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "milestoneCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProviderPaymentRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProviderPaymentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProviderPaymentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SpendReconciliationDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Records that drawn funds for a milestone have reached the provider — service authority only.",
        "tags": [
          "LevyAccounts"
        ]
      }
    },
    "/api/v1/levy-accounts/{organizationId}/ledger-entries": {
      "post": {
        "description": "<b>Service authority only.</b> This is the front door through which money enters and leaves a\r\n            levy pot: payroll accruals from HMRC's declaration, top-ups from the scheme, drawdowns for\r\n            delivered training, expiries and clawbacks. An employer able to write their own accrual would\r\n            be crediting themselves public funds. Idempotent on the caller's own\r\n            `sourceReference` — a retried March payroll returns the movement already recorded rather\r\n            than crediting the month twice.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.LevyMovementRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.LevyMovementRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.LevyMovementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.LevyAccountDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.LevyAccountDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.LevyAccountDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Records a movement on an organisation's levy ledger.",
        "tags": [
          "LevyAccounts"
        ]
      }
    },
    "/api/v1/marketplace-fulfilment/{marketplaceCode}/activations": {
      "post": {
        "description": "The buyer and the organisation are the token's, never the body's, and only an administrator of\r\nthat organisation may activate — a marketplace-bound licence is a purchase the organisation is\r\nbilled for, by the marketplace.",
        "parameters": [
          {
            "in": "path",
            "name": "marketplaceCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.MarketplaceFulfilmentController.ActivateMarketplacePurchaseRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.MarketplaceFulfilmentController.ActivateMarketplacePurchaseRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.MarketplaceFulfilmentController.ActivateMarketplacePurchaseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.MarketplaceActivationResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.MarketplaceActivationResultDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.MarketplaceActivationResultDto"
                }
              }
            },
            "description": "Success"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.MarketplaceActivationResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.MarketplaceActivationResultDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.MarketplaceActivationResultDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Resolves marketplaceCode's purchase token, mints (or replays) the caller's\r\norganisation's marketplace-bound licence, and tells the marketplace it is fulfilled. Idempotent on\r\nthe marketplace's entitlement id: a retried or refreshed activation answers 200 with the same\r\nlicence; a first activation answers 201.",
        "tags": [
          "MarketplaceFulfilment"
        ]
      }
    },
    "/api/v1/marketplace-fulfilment/{marketplaceCode}/lifecycle-notifications": {
      "post": {
        "description": "200 for every notification that is now in effect — applied, already in effect, superseded by the\r\nlicence's end, or a replay — so the marketplace stops redelivering. Every refusal is non-2xx so it\r\nredelivers: 401 not authentic, 404 no adapter or no bound licence, 422 a change that cannot be applied (a pushed\r\nactivation, a plan with no mapping or no plan selling it, a missing seat count or plan id), 413 too large.",
        "parameters": [
          {
            "in": "path",
            "name": "marketplaceCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.MarketplaceLifecycleResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.MarketplaceLifecycleResultDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.MarketplaceLifecycleResultDto"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Receives one lifecycle notification from marketplaceCode, has its adapter\r\nauthenticate and read it, and applies it to the bound licence — idempotent on the marketplace's event id.",
        "tags": [
          "MarketplaceLifecycleNotifications"
        ]
      }
    },
    "/api/v1/marketplace-fulfilment/{marketplaceCode}/settlements/exceptions": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "marketplaceCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 200,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Marketplace.CloudMarketplaceSettlementExceptionsDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "The break list for marketplaceCode: every settlement line that did not tie, with\r\nits reason, owner and age, oldest first.",
        "tags": [
          "CloudMarketplaceSettlements"
        ]
      }
    },
    "/api/v1/marketplace-fulfilment/{marketplaceCode}/settlements/import": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "marketplaceCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CloudMarketplaceSettlementsController.ImportSettlementRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CloudMarketplaceSettlementsController.ImportSettlementRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CloudMarketplaceSettlementsController.ImportSettlementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.CloudMarketplaceSettlementImportDto"
                }
              }
            },
            "description": "The outcome, the counts (matched + exceptions = lines) and every line."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "No adapter for the marketplace is registered on this instance."
          }
        },
        "summary": "Reads marketplaceCode's settlement report for the period through its adapter,\r\nties every line, and records it. A second import of the same report changes nothing and answers\r\n`already_imported`; a period the marketplace has not settled answers `no_report`.",
        "tags": [
          "CloudMarketplaceSettlements"
        ]
      }
    },
    "/api/v1/marketplace-fulfilment/{marketplaceCode}/settlements/lines/{lineId}/disposition": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "marketplaceCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "lineId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CloudMarketplaceSettlementsController.DispositionRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CloudMarketplaceSettlementsController.DispositionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CloudMarketplaceSettlementsController.DispositionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.CloudMarketplaceSettlementLineDto"
                }
              }
            },
            "description": "The line, with its disposition and trail."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "No such line for the marketplace, or a re-tie names no existing subscription."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The line tied at import, is already dispositioned, or another operator saved first."
          }
        },
        "summary": "#22582 — closes a break with a disposition. The line's figures are never edited; the decision, its\r\nreason, the caller and the time are appended to the line's trail and the line leaves the break list.",
        "tags": [
          "CloudMarketplaceSettlements"
        ]
      }
    },
    "/api/v1/marketplace-fulfilment/{marketplaceCode}/settlements/lines/{lineId}/owner": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "marketplaceCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "lineId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CloudMarketplaceSettlementsController.ReassignOwnerRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CloudMarketplaceSettlementsController.ReassignOwnerRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.CloudMarketplaceSettlementsController.ReassignOwnerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.CloudMarketplaceSettlementLineDto"
                }
              }
            },
            "description": "The line, with its new owner and trail."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "No such line for the marketplace."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The line is not an open break, already has that owner, or another operator saved first."
          }
        },
        "summary": "#22582 — hands an open break to another owner. The break stays open; the change is on its trail.",
        "tags": [
          "CloudMarketplaceSettlements"
        ]
      }
    },
    "/api/v1/marketplace-fulfilment/{marketplaceCode}/settlements/period-close": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "marketplaceCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodStartUtc",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodEndUtc",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Marketplace.CloudMarketplaceSettlementPeriodCloseDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "#22582 / NFR-CMC.006 — whether the settlement period can close: `closed` only when a report for it\r\nis on file and every line is matched or dispositioned; `open_breaks` or `no_report` otherwise.",
        "tags": [
          "CloudMarketplaceSettlements"
        ]
      }
    },
    "/api/v1/marketplace-fulfilment/{marketplaceCode}/settlements/{reportReference}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "marketplaceCode",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "reportReference",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Marketplace.CloudMarketplaceSettlementImportDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "No report with that reference has been imported from the marketplace."
          }
        },
        "summary": "One imported report with every line and its disposition.",
        "tags": [
          "CloudMarketplaceSettlements"
        ]
      }
    },
    "/api/v1/module-subscriptions": {
      "get": {
        "description": "Requires a member of the organisation named by `X-Organization-Id` (or a platform billing\r\nadmin). Returns all module subscriptions (active and cancelled) for the org.",
        "parameters": [
          {
            "description": "The active organisation, sent as `X-Organization-Id`.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ModuleSubscriptionSummaryDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ModuleSubscriptionSummaryDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ModuleSubscriptionSummaryDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "List all module subscriptions for the active organisation.",
        "tags": [
          "ModuleSubscriptions"
        ]
      }
    },
    "/api/v1/module-subscriptions/quote": {
      "post": {
        "description": "Returns the recurring total for the requested seats, what is charged today (prorated when\r\nthe module aligns to the organisation's existing billing period), the next billing date,\r\nand the cancellation terms. Read-only: it creates no subscription and reserves nothing, so\r\na checkout screen may call it on every seat-count change.\r\n            \r\nThe organisation is the `X-Organization-Id` header bound to the caller's own claim, never\r\nthe request body — a quote priced against another tenant's billing period would leak that\r\ntenant's renewal date. Quoting is the first step of a purchase, so it needs an organisation\r\nadministrator (#17832).",
        "parameters": [
          {
            "description": "The active organisation, sent as `X-Organization-Id`.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ModuleSubscriptionQuoteRequestDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ModuleSubscriptionQuoteRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ModuleSubscriptionQuoteRequestDto"
              }
            }
          },
          "description": "Offering and seat count to quote."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModuleSubscriptionQuoteDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModuleSubscriptionQuoteDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ModuleSubscriptionQuoteDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "FR-14.050a — quote a module purchase <b>before</b> the organisation commits to it.",
        "tags": [
          "ModuleSubscriptions"
        ]
      }
    },
    "/api/v1/module-subscriptions/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Module subscription identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The active organisation, sent as `X-Organization-Id`.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ModuleSubscriptionSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ModuleSubscriptionSummaryDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ModuleSubscriptionSummaryDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get a specific module subscription by ID.",
        "tags": [
          "ModuleSubscriptions"
        ]
      }
    },
    "/api/v1/module-subscriptions/{id}/cancel": {
      "post": {
        "description": "Stopping billing is an administrator's decision, so this needs an organisation administrator of the\r\norganisation named by `X-Organization-Id` (or a platform billing admin), not merely a member (#17832).",
        "parameters": [
          {
            "description": "Module subscription identifier to cancel.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "The active organisation, sent as `X-Organization-Id`.",
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Cancel a module subscription, stopping future billing for the module.",
        "tags": [
          "ModuleSubscriptions"
        ]
      }
    },
    "/api/v1/organizations/{organizationId}/modules/{moduleId}/wholesale-rate": {
      "get": {
        "description": "Answers 200 whether or not an arrangement exists: no arrangement yields\r\n`isAuthoritative=false` with a null `perSeatPrice`, which is the answer\r\nthe console needs in order to keep labelling its own list-price figure an estimate.\r\nA 404 would be indistinguishable from \"module does not exist\" and would also leak\r\nwhich modules a tenant holds arrangements for.",
        "parameters": [
          {
            "description": "The sponsoring organisation. Must match the caller's tenant.",
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Module identifier (resolves against the arrangement's feature set).",
            "in": "path",
            "name": "moduleId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganizationWholesaleRateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganizationWholesaleRateDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OrganizationWholesaleRateDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Returns the organisation's authoritative wholesale per-seat rate for a module.",
        "tags": [
          "OrganizationWholesaleRates"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/access-to-work/awards": {
      "post": {
        "description": "<b>Service authority only.</b> This is the front door through which the amount a\r\n            reimbursement may be paid up to enters EPIC 14. Exposing it to an employer's own token\r\n            would let them assert their own award — the exact assertion the ceiling exists to make\r\n            un-assertable. Idempotent on the scheme's award id.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordAccessToWorkAwardRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordAccessToWorkAwardRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordAccessToWorkAwardRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.AccessToWorkAwardDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.AccessToWorkAwardDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.AccessToWorkAwardDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Takes delivery of an approved award, or of its withdrawal, from the scheme.",
        "tags": [
          "AccessToWorkReimbursements"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/access-to-work/awards/{adjustmentId}": {
      "get": {
        "description": "Returned to the employer so their console can show the ceiling it is claiming against\r\nwithout a round-trip to the scheme. Carries the coarse funding category and nothing\r\nfiner — that category is the whole of what the employer is permitted to learn about\r\nwhat was funded.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "adjustmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.AccessToWorkAwardDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.AccessToWorkAwardDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.AccessToWorkAwardDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Reads the award funding one adjustment, or 404 when the scheme has issued none.",
        "tags": [
          "AccessToWorkReimbursements"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/access-to-work/reimbursement-claims": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads every reimbursement claim this organisation has made, most recent first.",
        "tags": [
          "AccessToWorkReimbursements"
        ]
      },
      "post": {
        "description": "<br>\r\n            Retrying is safe: a repeat claim for the same adjustment returns the claim already\r\n            made. Reimbursing the same spend twice is the worst outcome this surface has, and\r\n            network retries are ordinary.\r\n            \r\n<br>\r\n            A 422 carries a machine-readable `reasonCode` in the RFC 7807 body —\r\n            `award-absent`, `organization-mismatch`, `award-withdrawn`,\r\n            `claim-exceeds-award`, `currency-mismatch`,\r\n            `employer-reference-invalid`, `incurred-on-invalid`,\r\n            `incurred-before-eligibility`, `claim-amount-invalid` or\r\n            `transition-not-allowed` — so the employer console can branch without parsing\r\n            prose.\r\n            ",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SubmitReimbursementClaimRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SubmitReimbursementClaimRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SubmitReimbursementClaimRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Submits a reimbursement claim against an approved award.",
        "tags": [
          "AccessToWorkReimbursements"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/access-to-work/reimbursement-claims/{adjustmentId}": {
      "get": {
        "description": "404 when they have not claimed. The `not-claimed` token in the employer console's\r\nvocabulary describes an <i>adjustment</i> with no claim against it — a queue-row\r\nproperty — not a state a claim can be in. Synthesising a claim id and a submission\r\ninstant for a claim nobody made would put a fabricated record in front of the\r\nemployer, so the absence is reported as an absence.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "adjustmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Reads the claim this organisation made against one adjustment.",
        "tags": [
          "AccessToWorkReimbursements"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/access-to-work/reimbursement-claims/{claimId}/decision": {
      "post": {
        "description": "<b>Service authority only.</b> The scheme rules on the claim; an employer does not rule\r\n            on its own. A rejection must carry a reason the employer can act on — a refusal they\r\n            cannot act on is indistinguishable from the claim having disappeared, and they have\r\n            already spent the money.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "claimId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordReimbursementDecisionRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordReimbursementDecisionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordReimbursementDecisionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Records the scheme's ruling on a submitted claim.",
        "tags": [
          "AccessToWorkReimbursements"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/access-to-work/reimbursement-claims/{claimId}/disbursement": {
      "post": {
        "description": "<b>Service authority only, and only from an approved claim.</b> Paying a claim the\r\n            scheme has not approved would move public money on the claimant's say-so. Set-once on\r\n            the reference: a second, different reference is refused rather than overwritten,\r\n            because one of the two would then describe a payment this claim did not make.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "claimId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordReimbursementDisbursementRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordReimbursementDisbursementRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordReimbursementDisbursementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ReimbursementClaimStatusDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Records that the reimbursement has been disbursed to the employer.",
        "tags": [
          "AccessToWorkReimbursements"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/group-premium/schemes/{schemeId}/accruals": {
      "get": {
        "description": "<b>404 means Billing holds nothing for this scheme</b> — the premium is on no bill —\r\n            never \"nothing is owed\". A known scheme with no line in the window answers 200 with a\r\n            zero total.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "schemeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupPremiumSchemeLedgerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupPremiumSchemeLedgerDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupPremiumSchemeLedgerDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "The scheme's premium ledger: every line (accrued and voided), every stop, and the\r\naccrued total — optionally only lines sharing a day with `from`..`to`.",
        "tags": [
          "GroupSchemePremium"
        ]
      },
      "post": {
        "description": "Idempotent per (member, period): a redelivery is `unchanged`, a recomputed line is\r\n`revised`. All-or-nothing: a 422 names the reason and the member, and nothing of\r\nthe posting is kept.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "schemeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PostGroupPremiumAccrualsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PostGroupPremiumAccrualsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PostGroupPremiumAccrualsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupPremiumPostingResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupPremiumPostingResultDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupPremiumPostingResultDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Post the scheme's premium accruals — `IGroupPremiumPort.postAccruals`.",
        "tags": [
          "GroupSchemePremium"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/group-premium/schemes/{schemeId}/members/{memberRef}/stop-accrual": {
      "post": {
        "description": "Voids, in the same commit, every posted line that charges a day on or after\r\n`effectiveFrom`, and refuses any later line that would. Re-asserting the same date\r\nis a no-op; moving it earlier voids more; moving it later is refused (422\r\n`stop-cannot-move-later`).",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "schemeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "memberRef",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.StopGroupPremiumAccrualRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.StopGroupPremiumAccrualRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.StopGroupPremiumAccrualRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupPremiumStopDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupPremiumStopDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.GroupPremiumStopDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Stop one member's premium from `effectiveFrom` (the first day not covered) —\r\n`IGroupPremiumPort.stopAccrual`.",
        "tags": [
          "GroupSchemePremium"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/premium-finance/plans": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePositionDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePositionDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePositionDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Every premium-finance plan this insurer holds, most recently changed first.",
        "tags": [
          "PremiumFinancePlans"
        ]
      },
      "post": {
        "description": "<br>\r\n            Retrying is safe: a repeat open for the same agreement returns the plan already\r\n            held rather than a second schedule, which would double the policyholder's\r\n            apparent liability.\r\n            \r\n<br>\r\n            A 422 carries a machine-readable `reasonCode` in the RFC 7807 body —\r\n            `plan-already-open`, `insurer-mismatch`, `schedule-invalid`,\r\n            `currency-invalid` or `plan-details-invalid` — so the seam can branch\r\n            without parsing prose.\r\n            ",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.OpenPremiumFinancePlanRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.OpenPremiumFinancePlanRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.OpenPremiumFinancePlanRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePlanDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePlanDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePlanDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Opens the EPIC 14 record of a premium-finance agreement and its instalment schedule.",
        "tags": [
          "PremiumFinancePlans"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/premium-finance/plans/{agreementId}": {
      "get": {
        "description": "The oversight view behind the position. The attempt history is what a lender's\r\ndefault notice and an insurer's cancellation are defended against, so it is\r\nreadable rather than collapsed to a status.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agreementId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePlanDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePlanDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePlanDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "The full plan — schedule, attempt history and arrears episodes.",
        "tags": [
          "PremiumFinancePlans"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/premium-finance/plans/{agreementId}/arrears-payments": {
      "post": {
        "description": "<br>\r\n            Applied oldest instalment first, which is what the lender's own ledger does, so a\r\n            plan paid down here reconciles against it without a rule about which instalment a\r\n            part-payment settled.\r\n            \r\n<br>\r\n            Clearing the arrears closes the arrears episode and publishes\r\n            `PremiumFinanceArrearsClearedIntegrationEvent` — the signal the insurer's\r\n            cascade needs to stand a default down before a cancellation already in flight\r\n            proceeds against someone who has paid.\r\n            \r\n<br>\r\n            A 422 carries `reasonCode` — `plan-absent`, `plan-not-active`,\r\n            `currency-mismatch`, `amount-invalid`, `no-arrears-outstanding` or\r\n            `payment-exceeds-arrears`. An overpayment is refused rather than held: this\r\n            is a record of a credit agreement, not a wallet, and quietly keeping a\r\n            policyholder's money with no surface that shows or returns it would be worse than\r\n            refusing it.\r\n            ",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agreementId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PayArrearsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PayArrearsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PayArrearsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ArrearsPaymentResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ArrearsPaymentResultDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ArrearsPaymentResultDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Takes an arrears payment against a plan — the cure path.",
        "tags": [
          "PremiumFinancePlans"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/premium-finance/plans/{agreementId}/cancellation": {
      "post": {
        "description": "Outstanding instalments are written off so the arrears position falls to zero. A\r\ncancelled plan that kept reporting arrears would leave the policyholder's\r\ncover-status surface asking them for money against an agreement that no longer\r\nexists.",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agreementId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePlanDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePlanDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePlanDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Terminates a plan — the cascade reached cancellation of cover, or the agreement\r\nwas settled off-platform.",
        "tags": [
          "PremiumFinancePlans"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/premium-finance/plans/{agreementId}/instalments/{sequence}/collection-attempts": {
      "post": {
        "description": "<br>\r\n            A refusal publishes `PremiumFinanceInstalmentFailedIntegrationEvent` on the\r\n            outbox in the same unit of work as the attempt row (EVT-003) — never\r\n            `SubscriptionPastDue`, which would have EPIC 39 restrict the policyholder's\r\n            vault for an insurance instalment they did not pay to Essence.\r\n            \r\n<br>\r\n            Attempts are append-only: a retry records a further attempt rather than\r\n            overwriting the last refusal, because the attempt history is what the lender's\r\n            default notice is defensible against.\r\n            \r\n<br>\r\n            A 422 carries `reasonCode` — `plan-absent`, `plan-not-active`,\r\n            `instalment-absent` or `instalment-not-collectable`.\r\n            ",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agreementId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "sequence",
            "required": true,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordCollectionAttemptRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordCollectionAttemptRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RecordCollectionAttemptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePositionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePositionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePositionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Records the outcome of one attempt to collect an instalment from the mandate.",
        "tags": [
          "PremiumFinancePlans"
        ]
      }
    },
    "/api/v1/orgs/{organizationId}/premium-finance/plans/{agreementId}/position": {
      "get": {
        "description": "<br>\r\n  <b>404 means \"we hold no plan\", never \"you owe nothing\".</b> The seam\r\n            distinguishes an unavailable ledger from a clear one, and a zero position\r\n            returned for an unknown agreement would collapse the two into the single most\r\n            dangerous sentence this journey can show a policyholder who is a day from losing\r\n            cover.\r\n            \r\n<br>\r\n  `asOf` is always present so the surface can say when the figure was true.\r\n            ",
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "agreementId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePositionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePositionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PremiumFinancePositionDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Billing's position on one premium-finance agreement — the read model the\r\ninsurer's seam queries.",
        "tags": [
          "PremiumFinancePlans"
        ]
      }
    },
    "/api/v1/partners/{partnerId}/commission-summary": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.CommissionSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.CommissionSummaryDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.CommissionSummaryDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Gets commission summary for a partner.",
        "tags": [
          "PartnerReports"
        ]
      }
    },
    "/api/v1/partners/{partnerId}/financial-report": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.PartnerFinancialReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.PartnerFinancialReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.PartnerFinancialReportDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Gets comprehensive financial report for a partner.",
        "tags": [
          "PartnerReports"
        ]
      }
    },
    "/api/v1/partners/{partnerId}/financial-report/export": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "403": {
            "content": {
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Exports financial report as CSV.",
        "tags": [
          "PartnerReports"
        ]
      }
    },
    "/api/v1/partners/{partnerId}/monthly-trends": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.MonthlyTrendDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.MonthlyTrendDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.MonthlyTrendDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Gets monthly trends for commissions and payouts.",
        "tags": [
          "PartnerReports"
        ]
      }
    },
    "/api/v1/partners/{partnerId}/payout-summary": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.PayoutSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.PayoutSummaryDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.PayoutSummaryDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Gets payout summary for a partner.",
        "tags": [
          "PartnerReports"
        ]
      }
    },
    "/api/v1/partners/{partnerId}/revenue-breakdown": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.RevenueShareBreakdownDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.RevenueShareBreakdownDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Partners.RevenueShareBreakdownDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Gets revenue share breakdown by product type and tier.",
        "tags": [
          "PartnerReports"
        ]
      }
    },
    "/api/v1/partners/{partnerId}/routed-organisations": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Platform.Contracts.Pagination.CursorResult`1[[Essence.Payment.Billing.Application.Queries.Channel.RoutedOrganisationDto, Essence.Payment.Billing.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Platform.Contracts.Pagination.CursorResult`1[[Essence.Payment.Billing.Application.Queries.Channel.RoutedOrganisationDto, Essence.Payment.Billing.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Platform.Contracts.Pagination.CursorResult`1[[Essence.Payment.Billing.Application.Queries.Channel.RoutedOrganisationDto, Essence.Payment.Billing.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "One page of the organisations partnerId pays for (`{ items, nextCursor }`).",
        "tags": [
          "ChannelRoutedOrganisations"
        ]
      }
    },
    "/api/v1/payment-methods": {
      "get": {
        "description": "Returns all stored (tokenised) payment methods associated with the user identified\r\nby the `sub` JWT claim. Methods are sorted with the default method first.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentMethodDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentMethodDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentMethodDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "summary": "List payment methods for the authenticated user.",
        "tags": [
          "PaymentMethods"
        ]
      },
      "post": {
        "description": "Accepts a payment method token from the client-side Stripe.js or Adyen SDK.\r\nRaw card data (PAN, CVC) must NEVER be sent to this endpoint.\r\n            \r\nTypical workflow:\r\n1. Client collects card details using Stripe.js / Adyen SDK.\r\n2. SDK tokenises the card and returns a PaymentMethod ID / token.\r\n3. Client sends that token to this endpoint.\r\n4. Server stores the token reference — no card data touches our backend.\r\n            \r\nIdempotency (AC-14.003): send an `Idempotency-Key` header. A retry with the same key\r\nand the same registration returns the method the first request created (200, with\r\n`Idempotent-Replayed: true`) and registers nothing; the same key with a different\r\nregistration is 409.",
        "parameters": [
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AddPaymentMethodRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AddPaymentMethodRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AddPaymentMethodRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentMethodDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentMethodDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentMethodDto"
                }
              }
            },
            "description": "Success"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentMethodDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentMethodDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentMethodDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Add a new payment method using a gateway token.",
        "tags": [
          "PaymentMethods"
        ]
      }
    },
    "/api/v1/payment-methods/setup-intent": {
      "post": {
        "description": "Provisions (or reuses) the caller's gateway customer, opens a SetupIntent\r\nagainst it, and returns the intent's client secret plus the publishable key\r\nand SDK URL.\r\n            \r\nThe response carries NO secret: a client secret authorises attaching one\r\npayment method to one customer and nothing else. The card itself is posted\r\nby the browser straight to the gateway — it never reaches this API, which is\r\nwhat keeps the integration inside PCI SAQ-A.\r\n            \r\nReturns 503 when this deployment has no real gateway credentials, so a\r\nplaceholder environment fails loudly instead of collecting a card that can\r\nnever be charged.",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.StartPaymentMethodSetupRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.StartPaymentMethodSetupRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.StartPaymentMethodSetupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentMethodSetupDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentMethodSetupDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentMethodSetupDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "502": {
            "description": "Server Error"
          },
          "503": {
            "description": "Server Error"
          }
        },
        "summary": "Start a PCI-safe card-collection flow and return what the browser needs to\r\nmount the gateway's hosted card element.",
        "tags": [
          "PaymentMethods"
        ]
      }
    },
    "/api/v1/payment-methods/{id}": {
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Remove a stored payment method.",
        "tags": [
          "PaymentMethods"
        ]
      }
    },
    "/api/v1/payment-methods/{id}/default": {
      "put": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Organization-Id",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SetDefaultPaymentMethodResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SetDefaultPaymentMethodResultDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SetDefaultPaymentMethodResultDto"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Set a payment method as the default for the authenticated user. Commercial Licence P6-R26: the overdue invoices of\r\nthe caller's PastDue or Suspended licences — or, with `X-Organization-Id`, of that organisation's — are charged\r\nto it once (at most once an hour per invoice and card), a settled one reinstates its licence, and the answer says\r\n`overdueSettlement`: `none`, `settled` or `declined`.",
        "tags": [
          "PaymentMethods"
        ]
      }
    },
    "/api/v1/payment-page-script-registers/{environmentKey}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "environmentKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentPageScriptRegisterDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Reads an environment's register: every entry (removed ones included) and its full history.\r\n404 when no register has been started for the environment.",
        "tags": [
          "PaymentPageScriptRegister"
        ]
      }
    },
    "/api/v1/payment-page-script-registers/{environmentKey}/scripts": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "environmentKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AddPaymentPageScriptRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AddPaymentPageScriptRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.AddPaymentPageScriptRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentPageScriptDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Proposes a script for the environment's register. It enters `Pending` and is not\r\nauthorised until `authorise` is called. 409 when the URL already has a live entry.",
        "tags": [
          "PaymentPageScriptRegister"
        ]
      }
    },
    "/api/v1/payment-page-script-registers/{environmentKey}/scripts/{scriptId}/authorise": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "environmentKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "scriptId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PaymentPageScriptChangeRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PaymentPageScriptChangeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PaymentPageScriptChangeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentPageScriptDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Authorises a Pending or Suspended entry. 409 for a removed one.",
        "tags": [
          "PaymentPageScriptRegister"
        ]
      }
    },
    "/api/v1/payment-page-script-registers/{environmentKey}/scripts/{scriptId}/remove": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "environmentKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "scriptId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PaymentPageScriptChangeRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PaymentPageScriptChangeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PaymentPageScriptChangeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentPageScriptDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Removes an entry. Terminal: the entry stays in the register as evidence.",
        "tags": [
          "PaymentPageScriptRegister"
        ]
      }
    },
    "/api/v1/payment-page-script-registers/{environmentKey}/scripts/{scriptId}/suspend": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "environmentKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "scriptId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PaymentPageScriptChangeRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PaymentPageScriptChangeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PaymentPageScriptChangeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PaymentPageScriptDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Suspends an Authorised entry. 409 for any other status.",
        "tags": [
          "PaymentPageScriptRegister"
        ]
      }
    },
    "/api/v1/payouts": {
      "get": {
        "parameters": [
          {
            "description": "Optional status name, e.g. `Pending`.",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `nextCursor` of the previous page.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size, 1 to 200 (default 25).",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 25,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Platform.Contracts.Pagination.CursorResult`1[[Essence.Payment.Billing.Application.DTOs.PayoutDto, Essence.Payment.Billing.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Lists payouts newest first, a keyset page at a time.",
        "tags": [
          "PayoutApprovals"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payouts.CreatePayoutCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payouts.CreatePayoutCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payouts.CreatePayoutCommand"
              }
            }
          },
          "description": "Payout details"
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Creates a new payout for a partner.",
        "tags": [
          "Payouts"
        ]
      }
    },
    "/api/v1/payouts/manual-reissue-tasks": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "includeResolved",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 200,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutManualReissueTaskDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "FR-14.097(b): finance's manual-reissue tasks, oldest first — one per payout that fell back to\r\nmanual bank transfer, naming the partner, the amount owed and the failure that sent it there.\r\nOpen tasks only unless includeResolved.",
        "tags": [
          "PayoutRetry"
        ]
      }
    },
    "/api/v1/payouts/mine": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The caller's payouts, each with its `statement` block.",
        "tags": [
          "PartnerPayouts"
        ]
      }
    },
    "/api/v1/payouts/partner/{partnerId}": {
      "get": {
        "parameters": [
          {
            "description": "Partner identifier",
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Optional start date filter",
            "in": "query",
            "name": "startDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Optional end date filter",
            "in": "query",
            "name": "endDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "Gets all payouts for a partner.",
        "tags": [
          "Payouts"
        ]
      }
    },
    "/api/v1/payouts/partner/{partnerId}/statistics": {
      "get": {
        "parameters": [
          {
            "description": "Partner identifier",
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              },
              "text/plain": {
                "schema": {}
              }
            },
            "description": "Success"
          }
        },
        "summary": "Gets payout statistics for a partner.",
        "tags": [
          "Payouts"
        ]
      }
    },
    "/api/v1/payouts/partners/{partnerId}/marketplace-settlements": {
      "get": {
        "parameters": [
          {
            "description": "The Billing partner id the payouts were made to.",
            "in": "path",
            "name": "partnerId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Start of the window (UTC, inclusive). Defaults to 365 days before to.",
            "in": "query",
            "name": "from",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "End of the window (UTC, exclusive). Defaults to now.",
            "in": "query",
            "name": "to",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MarketplacePayoutSettlementsDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Lists the partner's completed marketplace payouts created in `[from, to)`, most\r\nrecently paid first, each with the marketplace transactions it settled and whether its\r\nlines add up to its amount.",
        "tags": [
          "MarketplacePayoutSettlements"
        ]
      }
    },
    "/api/v1/payouts/settings": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PartnerPayoutSettingsDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The caller's payout destination (masked) and its current withholding declaration.",
        "tags": [
          "PartnerPayoutSettings"
        ]
      }
    },
    "/api/v1/payouts/settings/withholding": {
      "put": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.DeclarePartnerWithholdingRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.DeclarePartnerWithholdingRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.DeclarePartnerWithholdingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PartnerWithholdingDeclarationDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Records a withholding declaration. It replaces the current one, which is kept as history.",
        "tags": [
          "PartnerPayoutSettings"
        ]
      }
    },
    "/api/v1/payouts/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Gets one payout, including whether it is awaiting approval.",
        "tags": [
          "PayoutApprovals"
        ]
      }
    },
    "/api/v1/payouts/{id}/approve": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Approves a pending payout above the FR-14.095 threshold so it can be processed. The approver\r\nis taken from the token and must not be the administrator who created the payout.",
        "tags": [
          "PayoutApprovals"
        ]
      }
    },
    "/api/v1/payouts/{id}/disbursement-failures": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payouts.RecordPayoutDisbursementFailureCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payouts.RecordPayoutDisbursementFailureCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payouts.RecordPayoutDisbursementFailureCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Records that an attempt to disburse a released payout failed. The payout is retried at day\r\n1, 3 and 7 after its first failure; after the day-7 failure, or at once on\r\n`account_closed` or `payout_method_invalid`, it falls back to manual handling.",
        "tags": [
          "PayoutRetry"
        ]
      }
    },
    "/api/v1/payouts/{id}/manual-reissue": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payouts.ReissuePayoutManuallyCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payouts.ReissuePayoutManuallyCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payouts.ReissuePayoutManuallyCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Completes a payout awaiting manual handling, recording the bank transfer's reference. Resolves\r\nthe payout's manual-reissue task.",
        "tags": [
          "PayoutRetry"
        ]
      }
    },
    "/api/v1/payouts/{id}/process": {
      "post": {
        "parameters": [
          {
            "description": "Payout identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payouts.ProcessPayoutCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payouts.ProcessPayoutCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Payouts.ProcessPayoutCommand"
              }
            }
          },
          "description": "Processing details"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.PayoutDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Processes a pending payout.",
        "tags": [
          "Payouts"
        ]
      }
    },
    "/api/v1/payouts/{id}/statement": {
      "get": {
        "description": "404 for a payout that is not the caller's, exactly as for one that does not exist. 409\r\n`PAYOUT_STATEMENT_NOT_AVAILABLE` while the payout has no outcome yet.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "The statement PDF for one of the caller's payouts.",
        "tags": [
          "PartnerPayouts"
        ]
      }
    },
    "/api/v1/plugin-purchases": {
      "get": {
        "description": "Returns all purchases (active and cancelled) in descending purchase date order.\r\nThe user identity is derived from the JWT 'sub' claim.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PluginPurchaseSummaryDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PluginPurchaseSummaryDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PluginPurchaseSummaryDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          }
        },
        "summary": "List all plugin purchases for the authenticated user.",
        "tags": [
          "PluginPurchases"
        ]
      }
    },
    "/api/v1/plugin-purchases/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Plugin purchase identifier.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PluginPurchaseSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PluginPurchaseSummaryDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PluginPurchaseSummaryDto"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get a specific plugin purchase by ID.",
        "tags": [
          "PluginPurchases"
        ]
      }
    },
    "/api/v1/price-book-states/{organizationId}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PriceBook.OrganizationPriceBookStateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PriceBook.OrganizationPriceBookStateDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PriceBook.OrganizationPriceBookStateDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "tags": [
          "PriceBookStates"
        ]
      },
      "put": {
        "parameters": [
          {
            "in": "path",
            "name": "organizationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SetPriceBookStateRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SetPriceBookStateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SetPriceBookStateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PriceBook.OrganizationPriceBookStateDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PriceBook.OrganizationPriceBookStateDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.PriceBook.OrganizationPriceBookStateDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "tags": [
          "PriceBookStates"
        ]
      }
    },
    "/api/v1/quota/check": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaCheckRequestDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaCheckRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaCheckRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaCheckResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaCheckResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaCheckResponseDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Answers whether the named subject may draw the requested units of a metric.",
        "tags": [
          "Quota"
        ]
      }
    },
    "/api/v1/receivables/accounts/{accountKey}": {
      "get": {
        "parameters": [
          {
            "description": "The account, as `org:{guid}` or `user:{guid}`.",
            "in": "path",
            "name": "accountKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Segment label selecting the ageing bands to apply.",
            "in": "query",
            "name": "segment",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Receivables.AccountCollectionsDetailDto"
                }
              }
            },
            "description": "The record."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The account has no open receivable."
          }
        },
        "summary": "One account's whole record — the rolled-up position, every unpaid object behind it,\r\nthe full escalation history across every ladder, and any write-off proposals.",
        "tags": [
          "Receivables"
        ]
      }
    },
    "/api/v1/receivables/accounts/{accountKey}/hold": {
      "delete": {
        "parameters": [
          {
            "description": "The account.",
            "in": "path",
            "name": "accountKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReasonOnlyRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReasonOnlyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReasonOnlyRequest"
              }
            }
          },
          "description": "Why."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.AccountCollectionsStateDto"
                }
              }
            },
            "description": "The arbiter record as it now stands."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "No hold is in force, or the reason is missing."
          }
        },
        "summary": "Release a live hold early, returning the account to the ladder at the stage it left.",
        "tags": [
          "Receivables"
        ]
      },
      "post": {
        "parameters": [
          {
            "description": "The account.",
            "in": "path",
            "name": "accountKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PlaceHoldRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PlaceHoldRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.PlaceHoldRequest"
              }
            }
          },
          "description": "Reason, mandatory expiry, resume stage and any arrangement."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.AccountCollectionsStateDto"
                }
              }
            },
            "description": "The arbiter record as it now stands."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The expiry is in the past or beyond the configured maximum."
          }
        },
        "summary": "Place a bounded collections hold. Suppresses every automatic notice for this account,\r\nincluding the FR-14.014c day-44 auto-cancel, until it expires.",
        "tags": [
          "Receivables"
        ]
      }
    },
    "/api/v1/receivables/accounts/{accountKey}/ownership": {
      "delete": {
        "parameters": [
          {
            "description": "The account.",
            "in": "path",
            "name": "accountKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReasonOnlyRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReasonOnlyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReasonOnlyRequest"
              }
            }
          },
          "description": "Why."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.AccountCollectionsStateDto"
                }
              }
            },
            "description": "The arbiter record as it now stands."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The account key or the reason is malformed."
          }
        },
        "summary": "Hand an account back to the automatic dunning engine, releasing any hold with it.",
        "tags": [
          "Receivables"
        ]
      },
      "post": {
        "parameters": [
          {
            "description": "The account.",
            "in": "path",
            "name": "accountKey",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.TakeOwnershipRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.TakeOwnershipRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.TakeOwnershipRequest"
              }
            }
          },
          "description": "The state claimed and why."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.AccountCollectionsStateDto"
                }
              }
            },
            "description": "The arbiter record as it now stands."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The account key or the reason is malformed."
          }
        },
        "summary": "Take an account off the automatic dunning engine and onto a named owner.",
        "tags": [
          "Receivables"
        ]
      }
    },
    "/api/v1/receivables/ageing": {
      "get": {
        "parameters": [
          {
            "description": "Restrict to one band.",
            "in": "query",
            "name": "bucket",
            "schema": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.ReceivablesAgeingBucket"
            }
          },
          {
            "description": "Restrict to one ISO 4217 currency.",
            "in": "query",
            "name": "currency",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to organisations or individuals.",
            "in": "query",
            "name": "accountKind",
            "schema": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.CollectionsAccountKind"
            }
          },
          {
            "description": "Restrict to one ladder-ownership state.",
            "in": "query",
            "name": "ownership",
            "schema": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.CollectionsLadderOwnership"
            }
          },
          {
            "description": "Restrict to one named owner.",
            "in": "query",
            "name": "ownerRef",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only accounts with a live collections hold.",
            "in": "query",
            "name": "heldOnly",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Only positions past the FR-14.197(c) AR window.",
            "in": "query",
            "name": "pastEscalationWindowOnly",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Only positions at or above this value.",
            "in": "query",
            "name": "minimumOutstanding",
            "schema": {
              "format": "double",
              "type": "number"
            }
          },
          {
            "description": "Segment label selecting the ageing bands to apply.",
            "in": "query",
            "name": "segment",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Receivables.ReceivablesAgeingSummary"
                }
              }
            },
            "description": "The book. Check `truncated` before treating the totals as complete."
          }
        },
        "summary": "The aged-receivables book: every open position banded by age, per currency, with the\r\nbucketing basis stated on the response.",
        "tags": [
          "Receivables"
        ]
      }
    },
    "/api/v1/receivables/performance": {
      "get": {
        "parameters": [
          {
            "description": "Inclusive window start. Defaults to 90 days ago.",
            "in": "query",
            "name": "from",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Exclusive window end. Defaults to now.",
            "in": "query",
            "name": "to",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Receivables.CollectionsPerformance"
                  },
                  "type": "array"
                }
              }
            },
            "description": "The figures. Ratios are null rather than zero when their base is zero."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The window ends before it starts."
          }
        },
        "summary": "Collections performance per currency: DSO, recovery rate, write-off rate, the\r\nover-90 provision proxy, and the value sitting unposted in the approval queue.",
        "tags": [
          "Receivables"
        ]
      }
    },
    "/api/v1/receivables/worklist": {
      "get": {
        "parameters": [
          {
            "description": "Restrict to one band.",
            "in": "query",
            "name": "bucket",
            "schema": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.ReceivablesAgeingBucket"
            }
          },
          {
            "description": "Restrict to one ISO 4217 currency.",
            "in": "query",
            "name": "currency",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to organisations or individuals.",
            "in": "query",
            "name": "accountKind",
            "schema": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.CollectionsAccountKind"
            }
          },
          {
            "description": "Restrict to one ladder-ownership state.",
            "in": "query",
            "name": "ownership",
            "schema": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.CollectionsLadderOwnership"
            }
          },
          {
            "description": "Restrict to one named owner.",
            "in": "query",
            "name": "ownerRef",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only accounts with a live collections hold.",
            "in": "query",
            "name": "heldOnly",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Only positions past the FR-14.197(c) AR window.",
            "in": "query",
            "name": "pastEscalationWindowOnly",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Only positions at or above this value.",
            "in": "query",
            "name": "minimumOutstanding",
            "schema": {
              "format": "double",
              "type": "number"
            }
          },
          {
            "description": "Segment label selecting the ageing bands to apply.",
            "in": "query",
            "name": "segment",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Offset into the matching set.",
            "in": "query",
            "name": "skip",
            "schema": {
              "default": 0,
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "description": "Page size, 1..500.",
            "in": "query",
            "name": "take",
            "schema": {
              "default": 50,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Receivables.CollectionsWorklistPage"
                }
              }
            },
            "description": "The page."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The page bounds are out of range."
          }
        },
        "summary": "One page of the collections worklist, oldest-late first, with per-currency subtotals\r\nover the whole matching set rather than the page.",
        "tags": [
          "Receivables"
        ]
      }
    },
    "/api/v1/receivables/write-offs": {
      "get": {
        "parameters": [
          {
            "description": "Statuses to include. Repeatable. Omitted means pending and approved.",
            "in": "query",
            "name": "status",
            "schema": {
              "items": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.Collections.WriteOffProposalStatus"
              },
              "type": "array"
            }
          },
          {
            "description": "Page size, 1..500.",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.WriteOffProposalDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "The queue."
          }
        },
        "summary": "The write-off approval queue, oldest-requested first.",
        "tags": [
          "Receivables"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProposeWriteOffRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProposeWriteOffRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ProposeWriteOffRequest"
              }
            }
          },
          "description": "Account, invoices, reason code and justification."
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.WriteOffProposalDto"
                }
              }
            },
            "description": "The proposal, awaiting approval."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The invoices span accounts or currencies, or carry no balance."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "One of the invoices does not exist."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "An invoice is already inside an open proposal."
          }
        },
        "summary": "Propose a write-off. This raises a request; it does not remove anything from the\r\nledger. The value determines how many signatures the proposal needs.",
        "tags": [
          "Receivables"
        ]
      }
    },
    "/api/v1/receivables/write-offs/{proposalId}/approve": {
      "post": {
        "parameters": [
          {
            "description": "The proposal.",
            "in": "path",
            "name": "proposalId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApproveWriteOffRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApproveWriteOffRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ApproveWriteOffRequest"
              }
            }
          },
          "description": "The standing signed in."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.WriteOffProposalDto"
                }
              }
            },
            "description": "The proposal and its chain so far."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The caller is the proposer, has already signed, or the proposal is not pending."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The caller does not hold the write-off approval grant."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "No such proposal."
          }
        },
        "summary": "Sign a pending proposal. Refused when the caller is the proposer, or has already\r\nsigned — holding the grant is necessary and not sufficient.",
        "tags": [
          "Receivables"
        ]
      }
    },
    "/api/v1/receivables/write-offs/{proposalId}/execute": {
      "post": {
        "parameters": [
          {
            "description": "The proposal.",
            "in": "path",
            "name": "proposalId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.WriteOffProposalDto"
                }
              }
            },
            "description": "The posted write-off."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The proposal is not fully approved."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The caller does not hold the write-off approval grant."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "No such proposal."
          }
        },
        "summary": "Post a fully approved proposal. The named invoices become uncollectible and the\r\ndecision record is emitted for EPIC 4 to anchor and EPIC 84 to dispose of.",
        "tags": [
          "Receivables"
        ]
      }
    },
    "/api/v1/receivables/write-offs/{proposalId}/reject": {
      "post": {
        "parameters": [
          {
            "description": "The proposal.",
            "in": "path",
            "name": "proposalId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReasonOnlyRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReasonOnlyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ReasonOnlyRequest"
              }
            }
          },
          "description": "Why."
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.WriteOffProposalDto"
                }
              }
            },
            "description": "The refused proposal."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The caller is the proposer, or the proposal is already disposed of."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "The caller does not hold the write-off approval grant."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "No such proposal."
          }
        },
        "summary": "Refuse a proposal. The balance stays on the book and stays chaseable.",
        "tags": [
          "Receivables"
        ]
      }
    },
    "/api/v1/reports/activation-attribution": {
      "get": {
        "description": "The query, DTO, record, repository and migration have existed since\r\ndebt-2026-07-03-236, but no action sent the query, so the linkage was\r\nrecorded and unreadable (debt-2026-08-11-049, journey\r\nonboarding-abandoned-reengagement-to-activation). The CSV form of the\r\nsame report is `GET export?type=activation-attribution`.",
        "parameters": [
          {
            "in": "query",
            "name": "dateFrom",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dateTo",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ActivationAttributionReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ActivationAttributionReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ActivationAttributionReportDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "FR-14.063 — re-engagement-touch → activation attribution for a period:\r\nthe funnel roll-up (activations per touch) plus the per-activation\r\nlinkage rows the consent audit reads. Carries ids, an opaque touch\r\ntoken and billing metadata only — never PII.",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/reports/channel": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "dateFrom",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dateTo",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChannelReportDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Get channel partner revenue attribution — aggregate partner-level data only.",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/reports/churn": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "dateFrom",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dateTo",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChurnReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChurnReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ChurnReportDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Get churn analysis — voluntary vs involuntary churn for a period.",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/reports/credit-liability": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CreditLiabilityReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CreditLiabilityReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CreditLiabilityReportDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "FR-14.172 — platform-wide outstanding credit liability: active + deferred\r\nbalance, 30/60/90-day projected burn, and forward expiry buckets.",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/reports/executive-dashboard": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "periodStart",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodEnd",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "topCustomers",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ExecutiveDashboardDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ExecutiveDashboardDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.ExecutiveDashboardDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "FR-14.105..106 — executive dashboard summary combining MRR/ARR,\r\ncurrent-period revenue, top-N customer concentration, and gross margin\r\n(revenue − channel commissions).",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/reports/export": {
      "get": {
        "parameters": [
          {
            "description": "Report type: mrr | revenue | churn | channel | sponsored | activation-attribution",
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Period start (optional)",
            "in": "query",
            "name": "dateFrom",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Period end (optional)",
            "in": "query",
            "name": "dateTo",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "content": {
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "text/csv": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Export a financial report as a CSV file download.",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/reports/involuntary-churn": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "dateFrom",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dateTo",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoluntaryChurnReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoluntaryChurnReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.InvoluntaryChurnReportDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Get the finance-facing involuntary-churn / degradation report —\r\nbilling-caused degradation only (payment failures, currently-degraded\r\nsubscriptions, involuntary cancellations, time-in-dunning) for the\r\nfailed-payment-dunning-to-reinstatement journey (debt-2026-06-11-071).",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/reports/metered-sku-revenue": {
      "get": {
        "description": "The sibling reads answer adjacent questions and not this one:\r\n`usage/summary` is per-subscription and `revenue-by-stream` is by commercial\r\nstream, so a consumer asking \"what did SKU X bill this period\" would have to aggregate\r\nbilling data it does not own. Rows cover the `USG-*` family; billed revenue that\r\nresolves to no metered SKU, and lines carrying no GBP figure, are reported in their own\r\nfields rather than folded in or dropped.",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MeteredSkuRevenueReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MeteredSkuRevenueReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MeteredSkuRevenueReportDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Per-metered-SKU billed revenue for one calendar month, platform-wide (journey\r\n`commercial-manager-metered-sku-margin-review` step 2; debt-2026-08-18-125).",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/reports/mrr": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "asOf",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MrrReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MrrReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MrrReportDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Get MRR/ARR breakdown across all active subscriptions.",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/reports/mrr-by-stream": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "asOf",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MrrByStreamReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MrrByStreamReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MrrByStreamReportDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "FR-14.104 — MRR / ARR across every recurring revenue stream: self-pay\r\nsubscriptions, module subscriptions, agency-model channel orders, and\r\nsponsored subscriptions. One-shot revenue is excluded by definition.",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/reports/mrr-history": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "months",
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MrrHistoryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MrrHistoryDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.MrrHistoryDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "FR-14.104 (financial-dashboard MRR trend) — monthly self-pay MRR/ARR series\r\nover the last months calendar months (default 8).",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/reports/revenue": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "dateFrom",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dateTo",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueReportDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Get revenue by tier, currency, and acquisition source for a period.",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/reports/revenue-by-stream": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "periodStart",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodEnd",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueByStreamReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueByStreamReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueByStreamReportDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "FR-14.100 / FR-14.102 / FR-14.103 — revenue partitioned across all five\r\ncommercial streams (self-pay subscription, module subscription, plugin\r\npurchase, sponsored invoice, channel partner order). Period defaults\r\nto the current calendar month if omitted.",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/reports/sponsored": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "dateFrom",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dateTo",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsoredReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsoredReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsoredReportDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Get sponsored entitlement revenue — aggregate counts only, no user identities.",
        "tags": [
          "Reports"
        ]
      }
    },
    "/api/v1/revenue-classifications/exceptions": {
      "get": {
        "description": "This is the work list that makes the refusal actionable rather than merely\r\nsafe: each entry names a tenant and counts the billing events already held out\r\nof revenue waiting on an answer.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueClassificationExceptionDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueClassificationExceptionDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RevenueClassificationExceptionDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The open exception queue — tenants whose billing events are being refused into\r\nthe revenue population because they have no classification.",
        "tags": [
          "RevenueClassifications"
        ]
      }
    },
    "/api/v1/revenue-classifications/{tenantType}/{tenantId}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "tenantType",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.RevenueClassification.RevenueTenantType"
            }
          },
          {
            "in": "path",
            "name": "tenantId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "asOf",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.TenantRevenueClassificationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.TenantRevenueClassificationDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.TenantRevenueClassificationDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "The tenant's classification history and the class in force as at a date.",
        "tags": [
          "RevenueClassifications"
        ]
      },
      "put": {
        "description": "<br>\r\n            Appends to the tenant's history; nothing is overwritten. Backdating\r\n            `effectiveFrom` is how an already-reported period is corrected, and how a\r\n            tenant that pre-dates the register is brought into it without restating\r\n            periods it was correctly reported in.\r\n            \r\n<br>\r\n            The classifying actor is taken from the bearer token, never from the request\r\n            body: an attributable record that the caller can forge is not attributable.\r\n            ",
        "parameters": [
          {
            "in": "path",
            "name": "tenantType",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Contracts.RevenueClassification.RevenueTenantType"
            }
          },
          {
            "in": "path",
            "name": "tenantId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ClassifyTenantRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ClassifyTenantRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ClassifyTenantRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.TenantRevenueClassificationDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.TenantRevenueClassificationDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.TenantRevenueClassificationDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Records how a tenant's money relates to group revenue, effective from a date.",
        "tags": [
          "RevenueClassifications"
        ]
      }
    },
    "/api/v1/sponsored-billing": {
      "get": {
        "description": "Org-scoped: the sponsor is the caller's organisation, resolved by\r\nM:Essence.Payment.Billing.Api.Authorization.BillingPrincipalExtensions.GetOrganizationId(System.Security.Claims.ClaimsPrincipal) from the validated\r\nJWT (`org_id` / `organization_id` / `orgId`). Platform tokens\r\ncarry `organization_id`; reading `orgId` alone 403'd every real\r\nsponsor (#9012).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsoredBillingSummaryDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsoredBillingSummaryDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsoredBillingSummaryDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "List all sponsorships for the authenticated sponsoring organisation.",
        "tags": [
          "SponsoredBilling"
        ]
      }
    },
    "/api/v1/sponsored-billing/report": {
      "get": {
        "description": "The period is validated by `GetSponsorReportQueryValidator` in the MediatR\r\npipeline, never here: a missing bound is reported as required and a reversed one\r\nnames `PeriodEnd`, both as a 400 ProblemDetails (API-002 / API-003). The bounds\r\nbind as nullable so that a missing one is not mistaken for System.DateTime.MinValue\r\nand reported as a reversal the caller never sent (#13250).",
        "parameters": [
          {
            "in": "query",
            "name": "periodStart",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodEnd",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorReportDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorReportDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorReportDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "FR-14.065 / F5-T06: anonymous-aggregate sponsor report for the given\r\n[periodStart, periodEnd] window. Returns only aggregate counts and\r\ntotals; never exposes sponsored-user identities (FR-14.064 / SR-1).",
        "tags": [
          "SponsoredBilling"
        ]
      }
    },
    "/api/v1/sponsored-billing/sponsorships/{sponsoredEntitlementId}/convert": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "sponsoredEntitlementId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.SponsoredBilling.ConvertSponsoredEntitlementToSelfPayCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.SponsoredBilling.ConvertSponsoredEntitlementToSelfPayCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.SponsoredBilling.ConvertSponsoredEntitlementToSelfPayCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "FR-14.046 / FR-14.063 / F5-T04: convert the authenticated user from a\r\nEssence.Payment.Billing.Domain.Aggregates.SponsoredEntitlement.SponsoredEntitlement\r\nenrolment into a self-paid subscription. Transactional: sponsorship\r\ndetach + new subscription creation + outbox event commit together.\r\nThis is the single canonical convert-to-self-pay endpoint (per\r\ndocs/delivery/state/decisions/14/D-8.md — debt-2026-05-11-265 + 268).",
        "tags": [
          "SponsoredBilling"
        ]
      }
    },
    "/api/v1/sponsored-billing/{sponsorshipId}": {
      "get": {
        "parameters": [
          {
            "description": "Sponsorship identifier",
            "in": "path",
            "name": "sponsorshipId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsoredBillingSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsoredBillingSummaryDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsoredBillingSummaryDto"
                }
              }
            },
            "description": "Success"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get billing detail for a single sponsorship.",
        "tags": [
          "SponsoredBilling"
        ]
      }
    },
    "/api/v1/sponsored-billing/{sponsorshipId}/invoices": {
      "get": {
        "parameters": [
          {
            "description": "Sponsorship identifier",
            "in": "path",
            "name": "sponsorshipId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipInvoiceDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipInvoiceDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipInvoiceDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "List invoices issued to the sponsoring organisation for a sponsorship.",
        "tags": [
          "SponsoredBilling"
        ]
      }
    },
    "/api/v1/sponsored-billing/{sponsorshipId}/users": {
      "get": {
        "parameters": [
          {
            "description": "Sponsorship identifier",
            "in": "path",
            "name": "sponsorshipId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              },
              "text/json": {
                "schema": {}
              },
              "text/plain": {
                "schema": {}
              }
            },
            "description": "Success"
          }
        },
        "summary": "Get the active sponsored user COUNT for a sponsorship.\r\nCRITICAL: Returns only an aggregate integer — no user identities are exposed.",
        "tags": [
          "SponsoredBilling"
        ]
      }
    },
    "/api/v1/sponsorships": {
      "get": {
        "description": "The `orgId` arrives as a query parameter, so it is guarded — never\r\ntrusted — before anything is read. Registered with an EMPTY template so\r\nthe collection root `/api/v1/sponsorships` itself resolves.",
        "parameters": [
          {
            "in": "query",
            "name": "orgId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Lists the sponsorship campaigns belonging to one organisation.",
        "tags": [
          "Sponsorships"
        ]
      },
      "post": {
        "description": "Registered with an EMPTY template so `POST /api/v1/sponsorships`\r\nresolves. The sponsoring organisation comes from the caller's JWT claim\r\nand is `[JsonIgnore]` on the command — a body-supplied sponsor org\r\nwould be a direct IDOR.",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.CreateSponsorshipCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.CreateSponsorshipCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.CreateSponsorshipCommand"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Opens a sponsorship campaign for the caller's own organisation.",
        "tags": [
          "Sponsorships"
        ]
      }
    },
    "/api/v1/sponsorships/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Reads one sponsorship campaign.",
        "tags": [
          "Sponsorships"
        ]
      }
    },
    "/api/v1/sponsorships/{id}/audience": {
      "patch": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.UpdateSponsorshipAudienceCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.UpdateSponsorshipAudienceCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.UpdateSponsorshipAudienceCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Re-targets a live campaign's audience.",
        "tags": [
          "Sponsorships"
        ]
      }
    },
    "/api/v1/sponsorships/{id}/audit": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "schema": {
              "default": 50,
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "eventType",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipLifecyclePageDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipLifecyclePageDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipLifecyclePageDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "The identity-redacted lifecycle audit. Member-level rows are withheld\r\nwhile that cohort is below the k-anonymity floor, and an explicit request\r\nto enumerate them (eventType naming a member-level\r\nevent) is refused with 403.",
        "tags": [
          "Sponsorships"
        ]
      }
    },
    "/api/v1/sponsorships/{id}/cancel": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.CancelSponsorshipCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.CancelSponsorshipCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.CancelSponsorshipCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Winds a campaign down and settles the real pro-rata.",
        "tags": [
          "Sponsorships"
        ]
      }
    },
    "/api/v1/sponsorships/{id}/cancellation-preview": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CancellationPreviewDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CancellationPreviewDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.CancellationPreviewDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Previews the financial and privacy consequences of cancelling, so the\r\nwind-down is never a blind action.",
        "tags": [
          "Sponsorships"
        ]
      }
    },
    "/api/v1/sponsorships/{id}/dispatch": {
      "post": {
        "description": "<br>\r\n  <b>Idempotent per recipient.</b> A retried or replayed request re-reports\r\n            rather than re-sends: the campaign holds one dispatch record per contact\r\n            hash, enforced by a unique index. That property is why a large list is\r\n            safely paged through this endpoint.\r\n            \r\n<br>\r\n  <b>409 over-cap (FR-14.060a).</b> A request whose dispatchable rows would\r\n            take the campaign past its sponsor-confirmed population is refused\r\n            whole — never partially sent, never queued for later — because an\r\n            invitation cannot be recalled.\r\n            \r\n<br>\r\n  <b>Volume is bounded by the campaign, not by a rate-limit policy.</b> This\r\n            is the only action here that contacts people outside the platform, so a\r\n            stricter limiter would be natural — but the platform currently defines a\r\n            single policy (`essence-default`, which SEC-004 already applies), and\r\n            naming a policy that is not registered fails the endpoint at startup. The\r\n            real bound is the FR-14.060a cap: a campaign can never dispatch beyond the\r\n            population its sponsor confirmed and priced, whatever the request rate.\r\n            ",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.DispatchSponsorshipInvitesCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.DispatchSponsorshipInvitesCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Sponsorships.DispatchSponsorshipInvitesCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDispatchReceiptDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDispatchReceiptDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipDispatchReceiptDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Dispatches invitations to the recipients of a confirmed cold-outreach\r\ncampaign (debt-2026-08-10-027, journey `wholesale-premium-invitation`).",
        "tags": [
          "Sponsorships"
        ]
      }
    },
    "/api/v1/sponsorships/{id}/uptake": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipUptakeDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipUptakeDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SponsorshipUptakeDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Privacy-preserving uptake aggregates. Every count is k-anonymous\r\n(floor 5) and derived from the campaign's own persisted lifecycle ledger.",
        "tags": [
          "Sponsorships"
        ]
      }
    },
    "/api/v1/subscriptions/developer-api/tiers": {
      "get": {
        "description": "<br>\r\n            Carries no quota figure — those are EPIC 25's, at\r\n            `GET /api/v1/developer/api-quota/tiers`. What this adds is\r\n            `isSellableNow`: whether the rung's SKU is registered and `Active`, and so\r\n            whether a checkout would succeed. A console that greys out an unsellable rung is\r\n            telling the truth; one that offers it and then 422s is not.\r\n            ",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.DeveloperApiPlanTierDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.DeveloperApiPlanTierDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.DeveloperApiPlanTierDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          }
        },
        "summary": "The sold ladder as EPIC 14 can currently sell it.",
        "tags": [
          "DeveloperApiPlans"
        ]
      }
    },
    "/api/v1/subscriptions/developer-api/upgrade": {
      "post": {
        "description": "<br>\r\n            The returned `correlationId` is what the console hands to EPIC 39's propagation\r\n            view, so it follows <i>this</i> purchase rather than the account's latest entitlement.\r\n            \r\n<br>\r\n            A 422 carries a machine-readable `reasonCode` in the RFC 7807 body —\r\n            `unknown-tier`, `requires-sales-contact`, `plan-not-ratified`,\r\n            `already-on-tier` or `no-billing-account` — so the console can branch to the\r\n            right remediation instead of parsing prose at the moment the developer is already\r\n            throttled.\r\n            ",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.UpgradeDeveloperApiPlanRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.UpgradeDeveloperApiPlanRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.UpgradeDeveloperApiPlanRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.DeveloperApiPlanCheckoutDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.DeveloperApiPlanCheckoutDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.DeveloperApiPlanCheckoutDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Buys a rung of the developer-API ladder and returns the charge ↔ entitlement linkage.",
        "tags": [
          "DeveloperApiPlans"
        ]
      }
    },
    "/api/v1/subscriptions/developer-api/upgrade-requests": {
      "post": {
        "description": "Idempotent per (developer, tier): clicking twice returns the request the approver has\r\nalready been told about rather than raising a second one for the same purchase.\r\n`approverEmail` is `null` when Billing holds no billing account for this\r\ndeveloper — an admitted absence, so the console can ask who to route to instead of\r\nshowing an address nobody reads.",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RequestDeveloperApiPlanUpgradeRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RequestDeveloperApiPlanUpgradeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RequestDeveloperApiPlanUpgradeRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.DeveloperApiUpgradeRequestDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.DeveloperApiUpgradeRequestDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.DeveloperApiUpgradeRequestDto"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Asks an approver for the upgrade instead of buying it — the governed path for an actor\r\nwho holds no billing authority (journey open decision OD-2).",
        "tags": [
          "DeveloperApiPlans"
        ]
      }
    },
    "/api/v1/subscriptions/developer-api/upgrade-requests/{requestId}/decision": {
      "post": {
        "description": "Billing-admin authority. The approver decides whether the money may be spent; approval\r\ndoes not itself charge, because the purchase then runs through\r\nM:Essence.Payment.Billing.Api.Controllers.DeveloperApiPlansController.Upgrade(Essence.Payment.Billing.Api.Controllers.UpgradeDeveloperApiPlanRequest,System.Threading.CancellationToken) — one code path between rungs, one place a charge can be raised.",
        "parameters": [
          {
            "in": "path",
            "name": "requestId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.DecideDeveloperApiPlanUpgradeRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.DecideDeveloperApiPlanUpgradeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.DecideDeveloperApiPlanUpgradeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.DeveloperApiUpgradeRequestDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.DeveloperApiUpgradeRequestDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.DeveloperApiUpgradeRequestDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Records an approver's decision on a governed upgrade request.",
        "tags": [
          "DeveloperApiPlans"
        ]
      }
    },
    "/api/v1/subscriptions/{id}/seats": {
      "put": {
        "description": "Authorised as every subscription change is (#11443): for an organisation's licence, its billing administrators (or a\r\nplatform billing admin). Anyone who cannot see the licence gets 404.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ChangeLicensedSeatsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ChangeLicensedSeatsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.ChangeLicensedSeatsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Change how many seats the licence bills for.",
        "tags": [
          "SubscriptionSeats"
        ]
      }
    },
    "/api/v1/subscriptions/{id}/switch": {
      "post": {
        "description": "Authorised as every subscription change is (#11443): the owner of a personal licence; for an organisation's,\r\nits billing administrators (or a platform billing admin). Anyone else who cannot see it gets 404.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SwitchSubscriptionLicenceRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SwitchSubscriptionLicenceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.SwitchSubscriptionLicenceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.SubscriptionDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Switch the licence to another plan of the same tier and cadence.",
        "tags": [
          "SubscriptionLicenceSwitch"
        ]
      }
    },
    "/api/v1/subscriptions/{subscriptionRef}/renewal-outcome": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "subscriptionRef",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RenewalOutcomeRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RenewalOutcomeRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Api.Controllers.RenewalOutcomeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.RenewalOutcomes.RenewalOutcomeResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.RenewalOutcomes.RenewalOutcomeResponse"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.RenewalOutcomes.RenewalOutcomeResponse"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Execute EPIC 85's concluded renewal request on subscriptionRef.",
        "tags": [
          "RenewalOutcome"
        ]
      }
    },
    "/api/v1/usage/alerts": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "subscriptionId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodStart",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodEnd",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "warningThreshold",
            "schema": {
              "default": 80,
              "format": "double",
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OverageDetectionResultDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OverageDetectionResultDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.OverageDetectionResultDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get active threshold alerts: overages plus warning-level approach (default 80%).",
        "tags": [
          "Usage"
        ]
      }
    },
    "/api/v1/usage/cost-disclosure": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "pricingPlanId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "metricType",
            "schema": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.UsageRecord.UsageMetricType"
            }
          },
          {
            "in": "query",
            "name": "projectedQuantity",
            "schema": {
              "format": "double",
              "type": "number"
            }
          },
          {
            "in": "query",
            "name": "includedQuantity",
            "schema": {
              "default": 0,
              "format": "double",
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageCostDisclosureDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageCostDisclosureDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageCostDisclosureDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Upfront cost disclosure for a prospective metered operation. Given a\r\npricing plan, a usage metric and a projected quantity, returns what the\r\noperation would cost <em>before</em> it is incurred so a caller can show\r\nthe user the cost up-front; the actual operation is then metered\r\nper-event via `POST /api/v1/usage/record` (EVT-003 usage path).\r\n            \r\nThis is plan-level pricing information (it discloses what a metered SKU\r\ncosts under a plan and reads no tenant usage), so it is gated by the\r\nstandard `[Authorize]` on the controller — no per-subscription\r\nresource-owner scope is required.",
        "tags": [
          "Usage"
        ]
      }
    },
    "/api/v1/usage/events": {
      "post": {
        "description": "<br>\r\n  <b>Effectively once.</b> A device retries a meter whose acknowledgement it lost, so the\r\n            `X-Idempotency-Key` (or `Idempotency-Key`) header is required and is recorded in\r\n            Billing's processed-events ledger scoped to the caller: a retry answers 200 with\r\n            `replayed=true` and meters nothing. Plain `usage/record` has no such key, which\r\n            is why it is not the client meter. Two copies of one key arriving concurrently can both\r\n            pass the ledger read; the second mark then fails on the ledger's key and surfaces as an\r\n            error the client retries into a replay.\r\n            \r\n<br>\r\n  <b>422 for a metric Billing does not meter.</b> A code outside `UsageMetricCatalog`\r\n            has nothing to be recorded against, and no retry will change that, so it is answered with\r\n            a non-retryable 422 (`reasonCode: metric-not-metered`) the client can stop re-queueing\r\n            on — never a 5xx it would back off and retry forever.\r\n            ",
        "parameters": [
          {
            "in": "header",
            "name": "X-Idempotency-Key",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RecordUsageEventRequestDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RecordUsageEventRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RecordUsageEventRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RecordUsageEventResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RecordUsageEventResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RecordUsageEventResponseDto"
                }
              }
            },
            "description": "Success"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RecordUsageEventResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RecordUsageEventResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.RecordUsageEventResponseDto"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          }
        },
        "summary": "Record one metered operation against the CALLER's own subscription — the first-party\r\nclient meter. Nothing on the request names a subscription or a principal: both are\r\nresolved from the bearer JWT (the person first, then their organisation), so a tampered\r\nrequest cannot meter another account (debt-2026-06-03-1312).",
        "tags": [
          "Usage"
        ]
      }
    },
    "/api/v1/usage/history": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "subscriptionId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "startDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "endDate",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageRecordDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageRecordDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageRecordDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get historical usage records for a subscription, optionally filtered by date range.",
        "tags": [
          "Usage"
        ]
      }
    },
    "/api/v1/usage/quota/check": {
      "post": {
        "description": "Distinct from `GET quotas`, which reports a subscription's standing headroom for a\r\ndashboard. This answers a decision about one prospective operation, in the request and\r\nresponse shapes the consuming services already speak, and carries a machine-readable\r\n`reasonCode` so a refusal can be routed to the party who can act on it.\r\nAdmits the subscription's owner (Essence.Payment.Billing.Api.Authorization.BillingPolicies.ResourceOwner) or an\r\nallowlisted metering service for a SKU it may meter (Essence.Payment.Billing.Api.Authorization.BillingPolicies.QuotaMeteringGrant\r\n— the IdP's OpenID4VCI issuance metering), as does `quota/reserve`.",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaCheckRequestDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaCheckRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaCheckRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaCheckResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaCheckResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaCheckResponseDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          }
        },
        "summary": "Answers whether the named subject may draw the requested units of a metric — the\r\ncross-service quota check `docs/epics/integration-registry.md` registers to EPIC 14\r\nand that EPIC 90 (OpenID4VCI issuance) and EPIC 54 (signature envelopes) gate on.",
        "tags": [
          "Usage"
        ]
      }
    },
    "/api/v1/usage/quota/lease": {
      "post": {
        "description": "An exhausted allowance is a 200 with `allowed=false` and `grantedUnits=0`, as for\r\nthe check. A missing idempotency key is a 400 and a key reused for a different block a 409\r\n(RFC 7807 ProblemDetails). An expired lease that is never settled keeps holding what was\r\nnot recorded under it until the billing period ends — it never over-grants.",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaLeaseRequestDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaLeaseRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaLeaseRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaLeaseResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaLeaseResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaLeaseResponseDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Draws a lease: at most `blockUnits` (≤ 1,000), never more than the allowance has left\r\nafter recorded usage, outstanding reservations and outstanding leases.",
        "tags": [
          "QuotaLease"
        ]
      }
    },
    "/api/v1/usage/quota/lease/{leaseId}/settle": {
      "post": {
        "parameters": [
          {
            "in": "path",
            "name": "leaseId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaLeaseSettleRequestDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaLeaseSettleRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaLeaseSettleRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaLeaseSettleResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaLeaseSettleResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaLeaseSettleResponseDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Settles a lease: reports the units used; the rest return to the allowance. Idempotent by\r\n(lease, `sequence`): a retry is answered as a replay, a different settlement is a 409.\r\nAccepted after the lease's TTL — a late settlement only ever returns units.",
        "tags": [
          "QuotaLease"
        ]
      }
    },
    "/api/v1/usage/quota/release": {
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaReservationReleaseRequestDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaReservationReleaseRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaReservationReleaseRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Usage.QuotaReservationReleaseResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Usage.QuotaReservationReleaseResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Usage.QuotaReservationReleaseResponseDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Returns a reservation's held units before it expires (WS-E): the caller reserved and then\r\ndid not perform the operation. Conditional on the reservation still being held, so it never\r\nundoes a recorded usage, and a second release changes nothing. The key is the body's\r\n`idempotencyKey` or the `Idempotency-Key` header, as for the reservation.",
        "tags": [
          "Usage"
        ]
      }
    },
    "/api/v1/usage/quota/reserve": {
      "post": {
        "description": "`quota/check` is unchanged and still answers without holding anything; it cannot stop\r\n            N concurrent callers that all check before any records. A caller that must not overspend a\r\n            hard-capped allowance reserves instead. Refusals are 200s with `allowed=false`, as for\r\n            the check; a missing key is a 400 and a key reused for a different operation a 409\r\n            (RFC 7807 ProblemDetails).",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaReservationRequestDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaReservationRequestDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaReservationRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaReservationResponseDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaReservationResponseDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaReservationResponseDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Reserve-at-check (WS-E E4): answers as `quota/check` does and, when allowed, HOLDS\r\nthe requested units until usage is recorded under the same idempotency key (sent as the\r\nusage event's `QuotaReservationKey`) or the reservation expires.",
        "tags": [
          "Usage"
        ]
      }
    },
    "/api/v1/usage/quotas": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "subscriptionId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "metricType",
            "schema": {
              "$ref": "#/components/schemas/Essence.Payment.Billing.Domain.Aggregates.UsageRecord.UsageMetricType"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaInfoDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaInfoDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.QuotaInfoDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get current quota status and remaining headroom for a subscription.",
        "tags": [
          "Usage"
        ]
      }
    },
    "/api/v1/usage/record": {
      "post": {
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Usage.CreateUsageRecordCommand"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Usage.CreateUsageRecordCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Usage.CreateUsageRecordCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageRecordDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageRecordDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageRecordDto"
                }
              }
            },
            "description": "Success"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageRecordDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageRecordDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageRecordDto"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Record a single usage event. With a `quotaReservationKey` (WS-E) the usage is recorded\r\nsynchronously as the exercise of that reservation — once — and a key that holds no live\r\nreservation for this act is a 409 with nothing recorded; a retry of an already-recorded\r\nreservation is a 200 carrying the original row. Without one, returns 202 Accepted: the handler\r\nenqueues the record onto the in-process hot buffer and a\r\nbackground drainer persists batches asynchronously (FR-14.030 hot\r\npath — see debt-2026-05-11-280). The body still carries the\r\ncanonical Essence.Payment.Billing.Application.DTOs.UsageRecordDto with the assigned Id so\r\ncallers can read-back via `GET /api/v1/usage/history` once\r\nthe drainer has flushed (typically < 1 s). A code Billing does not meter records nothing\r\nand answers 200 with `notMetered=true`, `reason=metric-not-catalogued` (#19797); a\r\nnear miss of a metered code is a 400 naming the code it was probably meant to be.",
        "tags": [
          "Usage"
        ]
      }
    },
    "/api/v1/usage/record/bulk": {
      "post": {
        "description": "<br>\r\n  <b>Service-only (ADR-021 5h-R2, #13630):</b>\r\n  Essence.Payment.Billing.Api.Authorization.BillingPolicies.UsageBulkRecord.\r\n            The subscriptions in the batch are the platform's own attribution (the gateway's configured\r\n            API-key → subscription map), never the caller's, so the per-subscription resource-owner\r\n            check that a person's token needed does not apply — and a person's token is refused.\r\n            \r\n<br>\r\n            Every subscription named is resolved before anything is written: an unknown one rejects the\r\n            whole batch with 404, so a partially-metered batch never leaves the ledger disagreeing with\r\n            the request that produced it.\r\n            ",
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "items": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Usage.CreateUsageRecordCommand"
                },
                "type": "array"
              }
            },
            "application/json": {
              "schema": {
                "items": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Usage.CreateUsageRecordCommand"
                },
                "type": "array"
              }
            },
            "text/json": {
              "schema": {
                "items": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Commands.Usage.CreateUsageRecordCommand"
                },
                "type": "array"
              }
            }
          }
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageRecordDto"
                  },
                  "type": "array"
                }
              },
              "text/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageRecordDto"
                  },
                  "type": "array"
                }
              },
              "text/plain": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageRecordDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Client Error"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Bulk record multiple usage events in a single call — the API gateway's Enterprise\r\nAPI-overage flush (FR-08.062).",
        "tags": [
          "Usage"
        ]
      }
    },
    "/api/v1/usage/summary": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "subscriptionId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodStart",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "periodEnd",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageSummaryDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageSummaryDto"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.DTOs.UsageSummaryDto"
                }
              }
            },
            "description": "Success"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Get usage summary for a subscription. Defaults to the subscription's current period\r\nwhen periodStart / periodEnd are omitted.",
        "tags": [
          "Usage"
        ]
      }
    },
    "/api/v1/usage/verification-checks": {
      "get": {
        "parameters": [
          {
            "description": "The request id the metering module put in `metadata.requestId`.",
            "in": "query",
            "name": "requestId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Instead of requestId: the property id the metering module put in\r\n`metadata.propertyId` (#15016) — a letting agent's per-property reconciliation of the\r\nchecks that succeeded against the checks it is billed for.",
            "in": "query",
            "name": "propertyId",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional: a subscription the caller administers; the caller's own when omitted.",
            "in": "query",
            "name": "subscriptionId",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essence.Payment.Billing.Application.Queries.Usage.VerificationCheckUsageDto"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "The verification checks metered for one request or one property, in the order they ran.",
        "tags": [
          "VerificationCheckUsage"
        ]
      }
    },
    "/api/v1/webhooks/adyen": {
      "post": {
        "description": "Configure this URL in your Adyen Customer Area: Developers → Webhooks\r\n            \r\nEvents to listen for:\r\n- AUTHORISATION (payment authorized)\r\n- AUTHORISATION_ADJUSTMENT (authorization amount changed)\r\n- CAPTURE (payment captured)\r\n- CAPTURE_FAILED (capture failed)\r\n- REFUND (payment refunded)\r\n- REFUND_FAILED (refund failed)\r\n- CANCELLATION (payment cancelled)\r\n- CHARGEBACK (chargeback initiated)\r\n- CHARGEBACK_REVERSED (dispute won)\r\n- SECOND_CHARGEBACK (dispute lost after defence)",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Adyen webhook endpoint",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/v1/webhooks/stripe": {
      "post": {
        "description": "Configure this URL in your Stripe Dashboard: Developers → Webhooks\r\n            \r\nEvents to listen for:\r\n- payment_intent.succeeded\r\n- payment_intent.payment_failed\r\n- payment_intent.canceled\r\n- charge.refunded\r\n- customer.subscription.created\r\n- customer.subscription.updated\r\n- customer.subscription.deleted\r\n- invoice.paid\r\n- invoice.payment_failed\r\n- charge.dispute.created\r\n- charge.dispute.closed",
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "summary": "Stripe webhook endpoint",
        "tags": [
          "Webhooks"
        ]
      }
    }
  },
  "security": [
    {
      "Bearer": []
    }
  ],
  "tags": [
    {
      "description": "Employer reimbursement against an approved Access to Work award — journey\r\n`access-to-work-workplace-adjustment-funding`, the employer's side of step 4b\r\n(debt-2026-08-16-207, blocking journey gap debt-2026-06-06-460).",
      "name": "AccessToWorkReimbursements"
    },
    {
      "description": "The EPIC 14 side of the EPIC 85 account-health seam: an organisation's billing-derived health\r\nsignals, read by the go-to-market service when it scores a customer account (FR-85.005, #12575).",
      "name": "AccountHealthSignals"
    },
    {
      "description": "FR-14.015g — Essence finance refunds a paid net-terms (bank-transfer) invoice. A net-terms invoice has no card to\r\nreverse and is often settled with no payment Billing holds, so the payment refund route cannot reach it; this one\r\nrefunds the invoice as an `ESS-CN` credit note held on the organisation's credit ledger as `refund_credit`.",
      "name": "AdminNetTermsRefunds"
    },
    {
      "description": "ESS-5C9C-9708 recovery — releases organisation onboarding sessions stranded on a never-paid\r\npre-claim `PendingPayment` licence, so the applicant's retry mints the R3-2 trial pair.\r\nPlatform-admin only; one operator console capability for the whole controller.",
      "name": "AdminOnboardingRecovery"
    },
    {
      "description": "A billing admin reads an organisation's commercial profile, sets its payment terms with a recorded\r\nreason (Commercial Licence P5, Task 3b-ii), and approves or revokes invoice collection (#10555). Route and payer are facts of sale (I10): not writable here.",
      "name": "AdminOrganisationCommercialProfile"
    },
    {
      "description": "#20316 (FR-43.006(b), PRD §6.4) — Essence finance's refund queue: every invoice on which money was taken that is owed\r\nback (`RefundRequired` — a rolled-back onboarding licence, a duplicate or post-void payment, an over-payment …),\r\nwith the onboarding application reference when an onboarding session minted the licence, and a way to record how\r\neach was settled. Recording a settlement moves no money; it is the operator task's audit.",
      "name": "AdminRefundQueue"
    },
    {
      "description": "Admin-only subscription seeding surface (§9a — provisioning entry point\r\n#4: \"Seed subscription/entitlement for a subject, no payment\"). The\r\nself-service `POST /api/v1/subscriptions` always stamps\r\n`UserId` from the caller's own JWT (debt-2026-05-11-163, A07), so a\r\nplatform-admin cannot use it to seed a subscription for another\r\n(QA-fixture) subject. This controller is a thin dispatch wrapper around\r\nthe SAME Essence.Payment.Billing.Application.Commands.Subscriptions.CreateSubscriptionCommand/handler — no new\r\ndomain logic — that lets a platform-admin explicitly target any\r\n`TargetUserId`. Activation is payment-independent (trial /\r\nzero-charge subscription-create, per `CreateSubscriptionCommandHandler`),\r\nso this never touches a payment gateway.",
      "name": "AdminSubscriptions"
    },
    {
      "description": "FR-14.023a — Essence finance's tax-pending queue: every invoice held because the tax service could not\r\ndetermine its tax (unissued, uncharged), and a way to determine the tax of one the 24 h retry window has\r\nfailed on. This is the requirement's escalation: past 24 h a held invoice goes to a person rather than\r\nauto-issuing at any assumed rate.",
      "name": "AdminTaxPendingQueue"
    },
    {
      "description": "API controller for partner analytics and reporting.",
      "name": "Analytics"
    },
    {
      "description": "The in-place payout/billing reassignment that lets a published app change hands without a\r\nrevenue gap — journey `developer-app-ownership-transfer-between-orgs`, step 4\r\n(gap G7, debt-2026-06-07-050).",
      "name": "AppRevenueReassignments"
    },
    {
      "description": "Read-only API for an organisation's realised billing actuals — the\r\nversioned consumer contract for which EPIC 14 is the authoritative\r\nsource. Consumed by the enterprise bid-model builder (journey\r\n`essence-enterprise-bid-model-with-billing-actuals`) to ground a\r\nbid in what has actually been billed, with an explicit as-of /\r\nstaleness indicator so a cached figure is never silently treated as\r\nlive.",
      "name": "BillingActuals"
    },
    {
      "description": "The platform's capacity check: may a subject hold one more of something it holds a COUNT of —\r\nsigned-in devices (`device.count`, 2026-10-01 ruling) today, any capacity feature\r\ntomorrow — against the allowance its subscriptions grant.",
      "name": "Capacity"
    },
    {
      "description": "Administration of commercial distribution chains (FR-14.140) — who resells\r\nEssence to whom, under what trading name, and who manages each relationship.",
      "name": "ChainParticipants"
    },
    {
      "description": "Controller for channel partner billing — orders, commissions, and statements.\r\nAll endpoints are scoped to the partner the caller acts for (Essence.Payment.Billing.Api.Authorization.ChannelPartnerCaller).",
      "name": "ChannelBilling"
    },
    {
      "description": "FR-14.237 (#4990): a channel partner queries a commission line it disagrees with, reads its\r\nqueries and their trails, and withdraws one.",
      "name": "ChannelCommissionQueries"
    },
    {
      "description": "FR-14.070a (#14495): a channel partner reads what it owes Essence for its Buy-Sell orders.",
      "name": "ChannelReceivables"
    },
    {
      "description": "Commercial Licence P3, Task 5 (OQ21, P3-R7) — the organisations a partner or service provider pays\r\nfor and what it will be invoiced next: the only Billing read carrying a buy amount.",
      "name": "ChannelRoutedOrganisations"
    },
    {
      "description": "Paying a construction subcontractor net of the CIS deduction their verification\r\nauthorised — journey `cis-subcontractor-verification-to-payment`\r\n(debt-2026-08-17-071 / debt-2026-08-17-072).",
      "name": "CisDisbursements"
    },
    {
      "description": "FR-14.317 \"import settlement\" / EPIC 111 FR-CMC.008 — Essence finance imports a CLOUD marketplace's\r\nsettlement (payout) report, sees what each line tied to, works the break list — dispositions and owner\r\nchanges, each on the line's append-only trail (#22582) — and reads whether a period can close.",
      "name": "CloudMarketplaceSettlements"
    },
    {
      "description": "FR-14.237 (#4990): Essence staff read every partner's commission-line queries and uphold the\r\nledger figure with a reason. A partner can never reach these, whatever its role (AC-16).",
      "name": "CommissionQueryAdjudication"
    },
    {
      "description": "Commission tracking and management endpoints.",
      "name": "Commissions"
    },
    {
      "description": "Consumer-goods statutory-guarantee claim outcomes (FR-14.210, FR-14.211 and FR-14.224, journey\r\n`consumer-statutory-guarantee-claim`).",
      "name": "ConsumerRemedies"
    },
    {
      "description": "FR-14.217 (#23321): a consumer's statutory cooling-off cancellation and the refund it settles. The refund is\r\nthe price less a pro-rata deduction for service already provided. A notice received after the window is a 409\r\n`COOLING_OFF_WINDOW_EXPIRED`, and that cancellation belongs on the FR-14.005a voluntary path.",
      "name": "CoolingOffSettlements"
    },
    {
      "description": "The consolidated billing roll-up of a corporate group (#14763, debt-2026-08-17-118; journey\r\n`corporate-group-multi-entity-hierarchy-onboarding` Step 6). It totals what was invoiced\r\nto the parent and every active subsidiary in a month, entity by entity, per currency.",
      "name": "CorporateGroupBilling"
    },
    {
      "description": "Commercial Licence P6-R43c — credit notes, read by their addressee (the invoice's addressee: for a routed licence,\r\nits payer). Essence.Payment.Billing.Api.Authorization.BillingPolicies.ResourceOwner decides who owns one; a routed organisation's member, and\r\nthe member who holds the licence a payer's note was raised on, are answered a bare 404 (R3-4) — not that the note\r\nis withheld, only that there is nothing to see.",
      "name": "CreditNotes"
    },
    {
      "description": "PCI DSS v4.0.1 Req 11.6.1 — receives browser\r\n`Content-Security-Policy-Report-Only` / `Content-Security-Policy`\r\nreports posted to the configured `report-uri` on the hosted\r\npayment page. Anonymous by design (browsers do not authenticate\r\nCSP reports), but accepts only the standard\r\n`application/csp-report` or `application/json` content\r\ntypes and shape-validates the standard reporting payload before\r\nrecording the violation.",
      "name": "CspReport"
    },
    {
      "description": "The read side of the deal-desk approvals Billing redeems (journey\r\n`internal-deal-desk-exception-approval`, step 5; gap G3).",
      "name": "DealTerms"
    },
    {
      "description": "Checkout for the sold developer-API request-quota ladder — journey\r\n`api-rate-limit-quota-upgrade-self-service`, step 3a → 4\r\n(debt-2026-08-14-290, blocking journey gap debt-2026-06-04-702).",
      "name": "DeveloperApiPlans"
    },
    {
      "description": "Enterprise annual-contract surface (FR-14.189..195): originate a draft contract,\r\nactivate it (replacing the FR-14.181 trial and issuing the first FR-14.189 invoice),\r\nand read it. Origination/activation are sales/finance operations gated by the\r\n`billing.enterprise.contract.price` permission; a contract priced below the\r\nconfigured floor requires a distinct second approver at activation (FR-14.195c).\r\nDomain-rule failures (not-Draft, missing approval) surface as RFC 7807 ProblemDetails\r\nwith code `enterprise-contract-not-activatable` (HTTP 409) via the foundation\r\npipeline (API-003).",
      "name": "EnterpriseContracts"
    },
    {
      "description": "Provisioning/quota entitlement authority (ADR-018). Only the Instance\r\nservice's org-provisioning gate calls this; feature entitlement lives on\r\nthe EntitlementEngine. See\r\n`docs/architecture/ADR-018-billing-entitlement-boundary.md` and the\r\nPhase-1 keystone plan.",
      "name": "Entitlements"
    },
    {
      "description": "Family-plan billing surface for the `family-plan-member-shared-documents` journey\r\n(debt-2026-07-05-023). Exposes the departing-member billing re-home the EPIC 30\r\natomic-departure flow (its `IBillingRehomePort`) calls to move a departing member\r\nonto their own self-pay subscription with a mid-cycle proration credit.",
      "name": "FamilyBilling"
    },
    {
      "description": "Family-roster surface (FR-14.185..188): open a roster for a flat-priced Family\r\nsubscription, invite/accept/remove member seats against the 6-seat hard cap, and\r\nread the roster. An over-cap invite returns HTTP 409\r\n(`family-seat-cap-exceeded`); seat changes never alter the invoice (flat\r\nprice, FR-14.186). Validation and domain-rule failures surface as RFC 7807\r\nProblemDetails via the foundation pipeline (API-003).",
      "name": "FamilyMemberships"
    },
    {
      "description": "FR-14.215 (#23328) — the grandfathered-cohort finance report: what holding active subscribers on\r\ntheir locked price after a list-price increase has cost so far, what it will cost over the rest of\r\neach lock window, and what comes back when the locks end.",
      "name": "GrandfatheredCohortReport"
    },
    {
      "description": "FR-14.214 / FR-14.220 (#23327) — the grandfathering seam: which subscribers are held below the\r\ncurrent list price after an increase, until when, and the audited renewal-price re-resolutions\r\nthat prove the protection was honoured.",
      "name": "GrandfatherPriceLocks"
    },
    {
      "description": "FR-14.219 (#23323) — group-scheme billing: who owes a corporate scheme's premiums, and the\r\nsingle aggregated invoice issued to the administering organisation when it is the organisation.",
      "name": "GroupSchemeBilling"
    },
    {
      "description": "The group-insurance scheme premium line — EPIC 14's half of the journey\r\n`group-corporate-insurance-scheme-admin` (debt-2026-08-21-042, blocking journey gap\r\ndebt-2026-06-11-350).",
      "name": "GroupSchemePremium"
    },
    {
      "description": "Commercial Licence P6-R43a — the one way an Essence-issued invoice or credit-note PDF leaves Billing for an email:\r\nNotifications fetches it just before it builds a payer's message. Service-only — the scope\r\n`billing:documents:read` on a service subject (Essence.Payment.Billing.Api.Authorization.BillingPolicies.BillingDocumentsRead) AND exactly\r\nNotifications' subject (Essence.Payment.Billing.Api.Authorization.BillingPolicies.BillingDocumentsCaller).",
      "name": "InternalBillingDocuments"
    },
    {
      "description": "API controller for invoice management.",
      "name": "Invoices"
    },
    {
      "description": "The employer's apprenticeship levy account — journey\r\n`apprenticeship-levy-employer-funded-training-to-completion`, steps 1-2\r\n(debt-2026-08-14-137, blocking journey gap debt-2026-06-04-813).",
      "name": "LevyAccounts"
    },
    {
      "description": "FR-14.317 — the cloud-marketplace purchase seam. The landing page a marketplace sends its buyer to\r\n(EPIC 111 FR-CMC.002) posts the purchase token here once the buyer has signed in, and gets back the\r\nmarketplace-bound licence it became.",
      "name": "MarketplaceFulfilment"
    },
    {
      "description": "FR-14.317 / EPIC 111 FR-CMC.006 — where a cloud marketplace tells Essence it suspended, reinstated,\r\ncancelled, re-seated, re-planned or renewed an entitlement. The inbound half of the marketplace lifecycle.",
      "name": "MarketplaceLifecycleNotifications"
    },
    {
      "description": "FR-14.096 / debt-2026-08-13-159 (#14954): a marketplace partner's completed payouts, each with\r\nthe EPIC 13 transaction ids it settled, for payout-to-transaction reconciliation.",
      "name": "MarketplacePayoutSettlements"
    },
    {
      "description": "Account-merge billing surface for the `merge-two-user-accounts-into-one` journey\r\n(debt-2026-07-03-225). Exposes the survivor-scoped merge-disposition endpoint the\r\nmerge confirm UI (the SubscriptionDispositionPanel) drives.",
      "name": "Merge"
    },
    {
      "description": "API controller for marketplace module subscriptions.\r\nAllows organisations to view and manage their installed module billing records.",
      "name": "ModuleSubscriptions"
    },
    {
      "description": "What an organisation holds — route, highest instance tier, partner standing, held licences — for\r\nCommercialManager's quote validator and billing admins (Commercial Licence P5, Task 3b-i).",
      "name": "OrganisationLicenceContext"
    },
    {
      "description": "Commercial Licence P6-R9 — an organisation's licence posture (Full / ReadOnly): read by the organisation's members,\r\nbilling admins, and the gateway's and Vault's read-only gates.",
      "name": "OrganisationLicencePosture"
    },
    {
      "description": "The billing address and VAT number an organisation's billing administrator records for the organisation's\r\ninvoices (#20292; FR-14.024 / FR-14.113). Every invoice addressed to the organisation afterwards carries them\r\nin its Bill To (`IBillToSnapshotStamper`); invoices already issued keep what they were raised with.",
      "name": "OrganizationBillingDetails"
    },
    {
      "description": "Pre-create wholesale-rate lookup for the sponsorship-campaign console\r\n(FR-14.060, debt-2026-08-10-030, journey `wholesale-premium-invitation`).",
      "name": "OrganizationWholesaleRates"
    },
    {
      "description": "The org portal's module-catalogue pricing read (EPIC 7 / AC-07.064; debt-2026-08-14-329\r\nrow 7).\r\n            \r\nEPIC 7 owns no pricing store: the Module Catalogue's pricing panel is a view over EPIC\r\n14's SKU registry. Before this controller existed the client called\r\n`/api/v1/billing/catalogue/{moduleId}/pricing` and no service declared that path, so\r\nthe panel's only possible outcome — in every environment — was its \"pricing unavailable\"\r\nbranch.",
      "name": "OrgBillingCatalogue"
    },
    {
      "description": "The org portal's consumption-dashboard read (EPIC 7 / AC-07.063;\r\ndebt-2026-08-14-329).\r\n            \r\nEPIC 7 owns no usage store: its consumption meters are a view over EPIC 14's\r\nusage records and the organisation's own pricing plans. Before this controller\r\nexisted the client called `/api/v1/billing/consumption/meters` and no\r\nservice declared that path, so the dashboard's only possible outcome was a\r\nload error.",
      "name": "OrgBillingConsumption"
    },
    {
      "description": "The org portal's credit-position read (EPIC 7 / AC-07.061; debt-2026-08-14-329).\r\n            \r\nEPIC 7 owns no billing store: its credit widget is a view over EPIC 14's ledger.\r\nBefore this controller existed the client called `/api/v1/billing/credits/balance`\r\nand no service declared that path, so the widget's only possible outcome was a\r\nload error.",
      "name": "OrgBillingCredits"
    },
    {
      "description": "The organisation's involuntary-dunning position — the read behind the EPIC 7 org-admin\r\ndunning surface (journey:failed-payment-dunning-to-reinstatement steps 3 and 5).",
      "name": "OrgBillingDunning"
    },
    {
      "description": "The org portal's Enterprise-Agreement overview read (EPIC 7 / AC-07.065;\r\ndebt-2026-08-14-329 row 8).\r\n            \r\nEPIC 7 owns no EA store — the agreement lives in EPIC 14's\r\n`EnterpriseContract` aggregate. Before this controller existed the client\r\ncalled `/api/v1/billing/enterprise-agreement/overview` and no service declared\r\nthat path, so in every environment the page's only reachable outcome was its\r\n\"temporarily unavailable\" branch. AC-07.065 was ticked in run-4070 against that\r\nendpoint.",
      "name": "OrgBillingEnterpriseAgreement"
    },
    {
      "description": "One invoice of the caller's organisation (Commercial Licence P5, P5-R14).",
      "name": "OrgBillingInvoiceDetail"
    },
    {
      "description": "The org portal's invoice ledger (EPIC 7 / AC-07.067; debt-2026-08-14-329 row 4).\r\n            \r\nEPIC 7 owns no invoice store: its invoices page is a view over EPIC 14's ledger.\r\nBefore this controller existed the client called\r\n`/api/v1/billing/invoices` and no service declared that path, so the page's\r\nonly possible outcome was its \"unavailable\" state.",
      "name": "OrgBillingInvoices"
    },
    {
      "description": "The org portal's subscription position (EPIC 7 / AC-07.060; debt-2026-08-14-329 row 5).\r\n            \r\nEPIC 7 owns no subscription store: its subscription & SKU page is a view over\r\nEPIC 14's. Before this controller existed the client called\r\n`/api/v1/billing/subscription` and no service declared that path, so the page's\r\nonly possible outcome was its \"unavailable\" state.",
      "name": "OrgBillingSubscription"
    },
    {
      "description": "The seat reclaim → reassign surface's API — journey\r\n`b2b-seat-reassignment-on-staff-change`.",
      "name": "OrgSeatLifecycle"
    },
    {
      "description": "The organisation seat register — which person holds which billed seat.",
      "name": "OrgSeatRegister"
    },
    {
      "description": "FR-14.218 (#23322): the billing delta a commercial package's move to a new version produces. A pro-rated\r\ncredit for the unused remainder of the current version's period, netted against the charge for the new\r\nversion over that same remainder, from the migration's effective date — becoming a `charge-adjustment`\r\nline when positive, a `credit-note` line when negative, and nothing at all when the versions cost the\r\nsame.",
      "name": "PackageVersionMigrations"
    },
    {
      "description": "#14822 (FR-14.075, FR-55.051): a channel partner reads its quarterly true-up — the figure the\r\nsettlement workspace shows beside `accrued` and `paid`.",
      "name": "PartnerChannelTrueUp"
    },
    {
      "description": "FR-14.313 — where a BUILDER registers the consumption metrics of a metered marketplace\r\nlisting, and where its publication turns them on (programme DX-2026, R-09).",
      "name": "PartnerMetrics"
    },
    {
      "description": "#14823 (FR-14.093): a channel partner lists the payouts it has been paid and downloads the\r\nstatement for each one.",
      "name": "PartnerPayouts"
    },
    {
      "description": "#14824 (FR-14.092 / FR-14.094): a channel partner reads where its payouts go and the tax\r\nposition it has declared, and records a new withholding declaration.",
      "name": "PartnerPayoutSettings"
    },
    {
      "description": "Partner financial reporting and analytics endpoints.",
      "name": "PartnerReports"
    },
    {
      "description": "API controller for stored payment method management.\r\nAll card data must be tokenised client-side before any token\r\nreaches this API (PCI DSS Level 1 — no raw card data accepted).",
      "name": "PaymentMethods"
    },
    {
      "description": "FR-14.017 (PCI DSS v4.0.1 Req 6.4.3) — the payment-page script register: every script that\r\nloads on, or is loaded by, the hosted payment page, per environment, with its authorisation\r\nstatus and the append-only history of every change (#17833).",
      "name": "PaymentPageScriptRegister"
    },
    {
      "description": "API controller for payment management.",
      "name": "Payments"
    },
    {
      "description": "FR-14.095 payout approval, and the admin reads it needs: every payout (the approval queue is\r\n`status=Pending`), one payout, and approving one above the threshold (#6334).",
      "name": "PayoutApprovals"
    },
    {
      "description": "FR-14.097 payout failure and manual reissue: recording that a disbursement attempt failed,\r\nwhich schedules the day-1/3/7 retry (or falls back to manual handling), and completing a payout\r\nthat fell back to manual handling once finance has paid it by bank transfer.",
      "name": "PayoutRetry"
    },
    {
      "description": "Controller for managing partner payouts.",
      "name": "Payouts"
    },
    {
      "description": "API controller for individual user plugin purchases.\r\nProvides a read-only view of the authenticated user's plugin purchase history.",
      "name": "PluginPurchases"
    },
    {
      "description": "The premium-finance instalment ledger — EPIC 14's half of the journey\r\n`insurance-premium-finance-instalment-default-cancellation`\r\n(debt-2026-08-21-066, blocking journey gap debt-2026-06-11-791).",
      "name": "PremiumFinancePlans"
    },
    {
      "description": "EPIC 103 FR-PBP.060/061/063 — an organisation's price-book state: Authority zero-rating,\r\nthe public-sector variant, a 90-day pilot. Set by a platform admin (the commercial\r\nfunction) or by the public-body verification seam; readable by the organisation.",
      "name": "PriceBookStates"
    },
    {
      "description": "API controller for pricing plan management.",
      "name": "PricingPlans"
    },
    {
      "description": "The `/api/v1/quota` spelling of the cross-service quota check.",
      "name": "Quota"
    },
    {
      "description": "Quota leases (EPIC 90 FR-OVC.292 / NFR-OVC.018, ADR-021 Phase 5c): a host draws a bounded\r\nblock of a subscription's allowance, decrements it locally per operation, and settles what it\r\ndid not use — so the per-operation hot path makes no synchronous call to Billing, and Billing\r\nremains the only party that decides quota (ADR-018).",
      "name": "QuotaLease"
    },
    {
      "description": "The Commercial Administrator's collections desk — journey\r\n`internal-ar-ageing-to-collections-escalation`.",
      "name": "Receivables"
    },
    {
      "description": "The EPIC 14 side of EPIC 85's renewal execution seam: execute a concluded renewal on the subscription, and\r\nreturn the reference that proves it, before EPIC 85 records the conclusion (FR-85.007, #17796).",
      "name": "RenewalOutcome"
    },
    {
      "description": "Financial reports controller — admin-only access.",
      "name": "Reports"
    },
    {
      "description": "FR-14.212/213 (#11993) — a client funds a legal retainer into a law firm's client trust account against a\r\nnamed matter and fee basis; the firm releases the cleared funds to the matter or refunds them to the client.\r\nClient money: it has no path to revenue recognition (the aggregate's rule).",
      "name": "RetainerTrustFundings"
    },
    {
      "description": "The revenue-classification register and its exception queue — which tenants'\r\nmoney is group revenue, and which tenants nobody has answered for yet\r\n(debt-2026-08-26-195).",
      "name": "RevenueClassifications"
    },
    {
      "description": "Commercial Licence P4 — the sandbox-licence facade: what an organisation may buy as a sandbox, at what\r\nprice (or that the price is not its to see), and the ONE door a sandbox licence is minted through.",
      "name": "SandboxLicences"
    },
    {
      "description": "The seat-drift exposure report of journey `b2b-subscription-sync-conflict-reconciliation`\r\n(debt-2026-08-13-187, finding F9): the divergence the drift sweep observed on each day and\r\nwhat it accrued toward the quarterly true-up, so the cadence gap between the sweep and the\r\ntrue-up is reviewable rather than discovered on an invoice.",
      "name": "SeatDriftExposure"
    },
    {
      "description": "The reconciliation surface's read API — the \"missing middle\" of journey\r\n`b2b-subscription-sync-conflict-reconciliation`.\r\n            \r\nAn org's IdP/HR sync (EPIC 50 / 10) and its billed seat quota (EPIC 14) can\r\ndisagree; until now nothing put the two figures — and the assigned-seat figure —\r\nin one place, so an admin could neither see the divergence nor cost it. These two\r\nreads compose and price; the writes below record, withdraw and acknowledge.\r\n            \r\n<br><b>The write path is a two-step by design</b> (debt-2026-08-13-186). Committing a\r\nresolution records a durable decision and opens a 24-hour undo window — it does\r\n<i>not</i> change the organisation's billed seats. The change is applied afterwards by\r\nthe effectuator, once the window closes. So the commit returns a decision in\r\n`pending-undo-window`, and the surface must present it as \"takes effect at\r\n<undoWindowEndsAt>, undo until then\" rather than as a completed change. The read\r\nmodel's `canCommitResolution` reports up front whether the commit is available at\r\nall, so it is disabled rather than attempted and refused.\r\n",
      "name": "SeatReconciliation"
    },
    {
      "description": "The periodic seat true-up surface's API — journey\r\n`b2b-subscription-seat-true-up-billing-reconciliation`.",
      "name": "SeatTrueUp"
    },
    {
      "description": "SKU Registry CRUD + lifecycle surface (FR-14.130..136). Create persists a\r\nSKU in `status=draft`; the transition endpoint drives the FR-14.136\r\nstate machine. Mutations are Admin-only; reads require an authenticated\r\ncaller. Validation and domain-rule failures surface as RFC 7807\r\nProblemDetails via the foundation pipeline (API-003).",
      "name": "Skus"
    },
    {
      "description": "The customer-facing SLA & service-credit surface for the journey\r\n`app-outage-sla-breach-to-service-credit` (resolves debt-2026-06-04-765,\r\ndebt-2026-06-04-769, debt-2026-06-05-797, debt-2026-06-05-799, debt-2026-06-05-800,\r\ndebt-2026-06-05-802).\r\n            \r\n<br>\r\nThe SLA dashboards that existed before this were platform-admin only: a developer\r\ncould not see the SLA they were owed, whether it had been breached, or whether a\r\ncredit had been issued for it. These endpoints are the account-scoped counterpart —\r\nwhat happened, against which target, over which window, and what landed.\r\n<br><b>Scoping.</b> A breach is a platform-wide event, but a credit is not. Every read\r\nhere is narrowed to the caller: `/me` resolves the user from the token and never\r\ntakes a user id from the client, and the org routes go through\r\nM:Essence.Payment.Billing.Api.Authorization.OrgScopeGuard.RequireOrgBillingAdmin(Microsoft.AspNetCore.Mvc.ControllerBase,System.Guid), which checks <b>role</b> as well as\r\ntenancy: only the organisation's administrators (or a platform billing admin) read its\r\nbreach history, credit amounts and ledger references. The per-breach detail is filtered\r\ninside the query handler rather than the controller so no future caller can accidentally\r\nbypass it, and is handed the organisation only when the caller administers it.\r\n<br><b>Why not M:Essence.Payment.Billing.Api.Authorization.OrgScopeGuard.RequireOrgScope(Microsoft.AspNetCore.Mvc.ControllerBase,System.Guid) (issue #14308).</b> That guard is\r\ntenancy only — it admits any member whose organisation claim matches and never reads\r\n`org_role`. These routes carried it, so an ordinary `OrgUser` could read the\r\norganisation's roll-up and download its reconciliation CSV by calling the API directly:\r\n#7962 again, on a surface added after it. \"A non-admin can only read their own\r\norganisation\" was true about tenancy and was read as if it were about role.\r\n",
      "name": "SlaCredits"
    },
    {
      "description": "Controller for sponsored billing — sponsoring-org views and user self-pay conversion.\r\nCRITICAL: The /users endpoint returns only anonymous aggregate counts, never user identities.",
      "name": "SponsoredBilling"
    },
    {
      "description": "EPIC 7 organisation-dashboard surface for sponsorship <b>campaigns</b>: an\r\norganisation pays for a module entitlement on behalf of a targeted audience,\r\nand oversees uptake without ever learning who took it up.",
      "name": "Sponsorships"
    },
    {
      "description": "The on-behalf-of subscription read a calling MODULE uses to complete the mandatory\r\nverify-subscription → check-entitlement → check-quota → record-usage sequence (#9535).",
      "name": "SubjectSubscription"
    },
    {
      "description": "The FR-44.062 vault-entitlement read a calling SERVICE makes on a subject's behalf before it\r\nprovisions their vault (#15485, #7684).",
      "name": "SubjectVaultEntitlement"
    },
    {
      "description": "Read-only billing-subledger seam consumed by EPIC 84's period-close controls\r\n(FR-84.006..009).",
      "name": "Subledger"
    },
    {
      "description": "Commercial Licence P6-R10 (R6) — a same-tier switch: a licence moves, now, to another plan of the same family, tier\r\nand cadence. A lower price is credited to the ledger; a higher one is charged prorated and applies on payment.\r\nBound to ONE capability, at class level only (P6-R23: an action-level binding would be ANDed with it).",
      "name": "SubscriptionLicenceSwitch"
    },
    {
      "description": "API controller for subscription management.",
      "name": "Subscriptions"
    },
    {
      "description": "Commercial Licence P6 Task 6 — seats: change how many seats an organisation's licence bills for\r\n(`PUT api/v1/subscriptions/{id}/seats`, body `{seats}`). An increase applies now and raises a proration\r\ninvoice at the in-force per-seat price for the rest of the period (P6-R11). A decrease is scheduled and applied at\r\nrenewal, before the renewal price is resolved. It is refused below the floor, which is an Active EA's committed\r\nseats or the seats in use (409 `licence.below_committed_seats` / `licence.seats_in_use`). A licence that\r\nis not per-seat (`licence.seats_not_applicable`), a routed licence and a read-only organisation\r\n(`licence.organisation_read_only`) are refused too.\r\nBound to ONE capability, at class level only (P6-R23: an action-level binding would be ANDed with it).",
      "name": "SubscriptionSeats"
    },
    {
      "description": "Canonical Usage Metering endpoints for the Billing Service.\r\n            \r\nRoutes are PRD-aligned (see `docs/epics/epic-14-payment-billing/api-contracts.md`\r\n§ Usage Metering Service):\r\n<list type=\"bullet\"><item><description>POST /api/v1/usage/record — record one usage event (< 50ms hot path)</description></item><item><description>POST /api/v1/usage/record/bulk — bulk-record many usage events in one call</description></item><item><description>POST /api/v1/usage/events — the caller meters one operation against their OWN subscription (JWT-resolved, idempotent)</description></item><item><description>GET  /api/v1/usage/summary — usage summary for the current/specified period</description></item><item><description>GET  /api/v1/usage/history — historical usage records for a subscription</description></item><item><description>GET  /api/v1/usage/quotas — quota status and remaining headroom</description></item><item><description>POST /api/v1/usage/quota/check — may this subject draw N of a metric now?</description></item><item><description>POST /api/v1/usage/quota/reserve — decide AND hold N of a metric (WS-E)</description></item><item><description>POST /api/v1/usage/quota/release — return a hold that will not be used (WS-E)</description></item><item><description>GET  /api/v1/usage/alerts — active threshold alerts and overages</description></item></list>\r\n            \r\nAll endpoints that read or write usage for a subscription gate access\r\nbehind Essence.Payment.Billing.Api.Authorization.BillingPolicies.ResourceOwner (closes\r\ndebt-2026-05-18-655 / OWASP A01 + A04). Only the subscription owner\r\n(matching JWT `sub` / `org_id`) or a BillingAdmin\r\nservice-principal can read or write usage records.",
      "name": "Usage"
    },
    {
      "description": "The per-check verification fees of one business request (#14576; journey\r\n`dental-treatment-plan-to-insurance-preauth` leg 9) or of one property (#15016; journey\r\n`tenant-references-a-new-flat-to-a-lettin`): every `USG-ESS-VER-*` check metered with\r\nthat `requestId` / `propertyId`, its SKU, its per-check list price and how the invoice\r\nwill price it, with the recorded count.",
      "name": "VerificationCheckUsage"
    },
    {
      "description": "Handles webhooks from payment gateways (Stripe, Adyen, etc.)",
      "name": "Webhooks"
    }
  ]
}
