@fleetless/contracts 7.1.0-next.1 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/billing.js CHANGED
@@ -328,7 +328,13 @@ const quoteIdentity = {
328
328
  quote_revision: z.string().trim().min(1).max(200).meta({ description: 'Opaque revision of the displayed quote; echo it when confirming.' }),
329
329
  buyer_fingerprint: z.string().trim().min(1).max(200).meta({ description: 'Opaque revision of buyer details and email policy; never full VIES evidence.' }),
330
330
  };
331
- export const purchaseHoldReason = z.enum(['legacy_usd_invoice', 'legacy_payer_unresolved', 'mandate_policy_unresolved']);
331
+ export const purchaseHoldReason = z.enum([
332
+ 'legacy_usd_invoice', 'legacy_payer_unresolved', 'mandate_policy_unresolved',
333
+ // The Lexware issuer cutover (2026-10-19, fleetless/fleetless#327): holds
334
+ // during and after the move from Cloud-issued invoices to charges billed
335
+ // through Lexware.
336
+ 'lexware_contact_pending', 'lexware_contact_changed', 'issuer_cutover_in_progress', 'lexware_issuance_paused',
337
+ ]);
332
338
  export const purchaseRefusalRule = z.enum(['company_required', 'vat_id_required', 'vat_id_invalid', 'tax_id_required', 'us_state_required', 'public_email_domain', 'invoice_not_open']);
333
339
  // Cross-field invariants also travel in JSON Schema so non-TypeScript callers
334
340
  // cannot treat an invoice payment as an unbound checkout or a held setup as a charge.
@@ -530,8 +536,10 @@ export const billingAccount = z.object({
530
536
  }).meta({ description: "What takes effect at the period's end." }),
531
537
  dunning: z.object({
532
538
  invoice_id: z.uuid().meta({
533
- description: 'The open invoice dunning is chasing — or, while the payer\'s VAT ID is unsettled, the due charge that becomes one: it has ' +
534
- 'no number yet and is not in `invoices`. `POST /api/billing/invoices/:id/pay` takes either.',
539
+ description: 'What dunning is chasing: a historical open `FL-…` invoice, or a due charge. Before the issuer cutover a due charge appears ' +
540
+ 'here only while the payer\'s VAT ID is unsettled; it has no number yet, is not in `invoices`, and ' +
541
+ '`POST /api/billing/invoices/:id/pay` takes either. After the cutover this is always a due charge (in `charges`): pay it with ' +
542
+ '`POST /api/billing/charges/:id/pay`.',
535
543
  }),
536
544
  gross_cents: z.number().int().meta({
537
545
  description: 'The amount owed, in integer cents — after a partial chargeback only the charged-back part.',
@@ -548,6 +556,76 @@ export const billingAccount = z.object({
548
556
  }),
549
557
  }).nullable().meta({ description: '`null` while nothing is overdue. During a VAT-ID hold the charge is due but not yet invoiced.' }),
550
558
  });
559
+ /*
560
+ * ---------------------------------------------------------------------------
561
+ * The Lexware issuer cutover: due charges billed and paid individually
562
+ * through Lexware, taking over from the Cloud-issued invoice for every new
563
+ * charge (2026-10-19, fleetless/fleetless#327).
564
+ *
565
+ * `billingAccount.dunning.invoice_id` and `invoicePayRequest`/
566
+ * `checkoutResponse` already describe a due charge with no number of its
567
+ * own; `billingCharge` is the shape of that charge, read in
568
+ * `billingView.charges`, with its own Lexware invoice link
569
+ * (`billingChargeInvoice`) and its own pay route
570
+ * (`POST /api/billing/charges/:id/pay`, `chargePayRequest`).
571
+ * ---------------------------------------------------------------------------
572
+ */
573
+ /** Which system issues an org's charges: `cloud` before the issuer cutover (invoices only, in `invoices`) or `lexware` after it (due charges, in `charges`). */
574
+ export const billingIssuer = z.enum(['cloud', 'lexware']);
575
+ /**
576
+ * Whether a due charge already has a confirmed Lexware invoice: `not_issued`
577
+ * while the charge is not collected (`due`, a failed retry, or
578
+ * `uncollectible` — there is nothing to invoice yet); `pending` once
579
+ * collected but before Lexware confirms the invoice, in any intent state
580
+ * short of a linked document; `issued` once Lexware's invoice is linked,
581
+ * naming the document `GET /api/billing/documents/:id` reads.
582
+ */
583
+ export const billingChargeInvoice = z.discriminatedUnion('state', [
584
+ z.object({ state: z.literal('not_issued').meta({ description: 'Not collected (due, a failed retry, or uncollectible): no invoice exists.' }) }).strict(),
585
+ z.object({ state: z.literal('pending').meta({ description: 'Collected; the Lexware invoice is not yet confirmed.' }) }).strict(),
586
+ z.object({
587
+ state: z.literal('issued').meta({ description: 'Lexware has confirmed the invoice.' }),
588
+ document_id: z.uuid().meta({ description: "The Lexware document's id — read it with `GET /api/billing/documents/:id`." }),
589
+ }).strict(),
590
+ ]);
591
+ // The same invariant in JSON Schema, so non-TypeScript callers see it too.
592
+ const chargeInvoiceRules = [
593
+ { if: { properties: { status: { const: 'paid' } }, required: ['status'] }, then: { properties: { invoice: { properties: { state: { enum: ['pending', 'issued'] } } } } } },
594
+ { if: { properties: { status: { enum: ['due', 'uncollectible', 'cancelled'] } }, required: ['status'] }, then: { properties: { invoice: { properties: { state: { const: 'not_issued' } } } } } },
595
+ ];
596
+ /** Refused when `status` and `invoice.state` disagree: a paid charge has an invoice (pending or issued); every other status has none yet. */
597
+ function refuseChargeInvoiceMismatch(charge, ctx) {
598
+ const notIssued = charge.invoice.state === 'not_issued';
599
+ if ((charge.status === 'paid') === notIssued) {
600
+ ctx.addIssue({ code: 'custom', path: ['invoice'], message: 'A paid charge has an invoice (pending or issued); every other status has none yet.' });
601
+ }
602
+ }
603
+ /**
604
+ * One due charge billed through Lexware after the issuer cutover, read in
605
+ * `billingView.charges`. `id` is the charge's own id — never a Cloud
606
+ * invoice number — and the one `POST /api/billing/charges/:id/pay` takes.
607
+ */
608
+ export const billingCharge = z.object({
609
+ id: z.uuid().meta({ description: "The due charge's id — never a Cloud invoice number. Pay it with `POST /api/billing/charges/:id/pay`." }),
610
+ kind: z.enum(['first', 'renewal', 'change']).meta({ description: 'What caused the charge: the first charge after checkout, a scheduled renewal, or a mid-period plan change.' }),
611
+ status: z.enum(['due', 'paid', 'uncollectible', 'cancelled']).meta({
612
+ description: "The charge's own status. A charged back or manually refunded charge stays `paid` — refunds and chargebacks are handled in " +
613
+ "Mollie or Lexware by hand; this status and the invoice it names are unchanged, and the resulting Lexware credit note appears " +
614
+ 'under `GET /api/billing/documents` instead.',
615
+ }),
616
+ currency: z.literal('eur').meta({ description: 'Every charge billed through Lexware is EUR.' }),
617
+ net_cents: z.number().int().nonnegative().meta({ description: 'The charge, excluding VAT, in integer cents.' }),
618
+ vat_rate_percent: z.number().int().min(0).max(100).meta({ description: 'The VAT rate applied, in whole percent.' }),
619
+ vat_cents: z.number().int().nonnegative().meta({ description: 'VAT, in integer cents (`vatCents`).' }),
620
+ gross_cents: z.number().int().nonnegative().meta({ description: 'Net plus VAT, in integer cents.' }),
621
+ period_start: z.iso.datetime().meta({ description: "The covered period's start." }),
622
+ period_end: z.iso.datetime().meta({ description: "The covered period's end." }),
623
+ due_at: z.iso.datetime().meta({ description: 'When this charge is due.' }),
624
+ paid_at: z.iso.datetime().nullable().meta({ description: 'When this charge was paid, or `null` while unpaid.' }),
625
+ invoice: billingChargeInvoice.meta({ description: 'Whether a Lexware invoice exists for this charge yet, and which document it names once it does.' }),
626
+ }).strict().superRefine(refuseChargeInvoiceMismatch).meta({ allOf: chargeInvoiceRules });
627
+ /** `POST /api/billing/charges/:id/pay`'s body — the same shape as `invoicePayRequest`: a stable `operation_key`. */
628
+ export const chargePayRequest = invoicePayRequest;
551
629
  /** `GET /api/billing`'s answer, and what every other billing route hands back after a change. */
552
630
  export const billingView = z.object({
553
631
  available: z.boolean().meta({ description: 'Whether this cloud takes payments at all — `false` when no Mollie key is configured.' }),
@@ -560,7 +638,13 @@ export const billingView = z.object({
560
638
  description: 'What a payment-method change may offer right now, so a client offers exactly what the cloud accepts. `applepay` is absent when ' +
561
639
  'it needs an open invoice and none is open; `[]` when the org has no billing account.',
562
640
  }),
563
- invoices: z.array(billingInvoice).meta({ description: 'Newest first, at most 24.' }),
641
+ issuer: billingIssuer.meta({ description: "Which system issues this org's charges: `cloud` before the issuer cutover, or `lexware` after it." }),
642
+ invoices: z.array(billingInvoice).meta({ description: 'Cloud-issued invoices from before the issuer cutover; read-only, never grows after it. Newest first, at most 24.' }),
643
+ charges: z.array(billingCharge).meta({
644
+ description: 'Newest first, at most 24. Lists only due charges with issuer `lexware` — never a pre-cutover charge, a legacy payment ' +
645
+ '(legacy_issued/legacy_held/legacy_person/legacy_usd) or a late USD collection: none of those carry a Lexware intent, and they ' +
646
+ 'stay in `invoices` or nowhere. `[]` while `issuer` is `cloud`.',
647
+ }),
564
648
  });
565
649
  /*
566
650
  * ---------------------------------------------------------------------------
package/dist/index.d.ts CHANGED
@@ -57,7 +57,7 @@ export { planId, PLAN_ORDER, planLimitKey, planLimits, planFeature, planFeatures
57
57
  export type { PlanId, PlanLimitKey, PlanLimits, PlanFeature, PlanFeatures, PlanPrices, PlanSupport, PlanCatalogueEntry, AddonKey, AddonCatalogueEntry, } from './plans.js';
58
58
  export { planCurrency, orgAddons, orgPlanUsage, planChangeKeep, planChangeReason, pendingPlanChange, orgLock, orgPlan, planChangeRequest, planOverrides, adminPlanChangeRequest, } from './plans.js';
59
59
  export type { PlanCurrency, OrgAddons, OrgPlanUsage, PlanChangeKeep, PlanChangeReason, PendingPlanChange, OrgLock, OrgPlan, PlanChangeRequest, PlanOverrides, AdminPlanChangeRequest, } from './plans.js';
60
- export { countryCode, EU_COUNTRIES, SELLER_COUNTRY, DE_VAT_RATE_PERCENT, isEuCountry, currencyForCountry, payerKind, billingCycle, vatTreatment, payerRefusalRule, vatFor, viesCountry, normalizeVatId, periodNetCents, prorateCents, vatCents, chargeAmounts, DAY_MS, periodDays, remainingDays, changeNetCents, checkoutQuote, BILLING_RETRY_DAYS, BILLING_LOCK_DAY, billingAddress, billingDetails, checkoutRequest, checkoutResponse, checkoutStatus, vatIdStatus, vatIdCheckRequest, vatIdCheckResponse, billingChangeRequest, billingCancelRequest, billingDetailsUpdate, paymentMethodKind, paymentMethodChangeRequest, billingAccountStatus, paymentMethod, invoiceStatus, billingInvoice, billingAccount, billingView, billingChangeResponse, billingDocumentKind, billingDocumentStatus, billingDocumentProfile, billingDocumentFormat, billingDocument, billingDocumentList, billingDocumentFileRole, billingDocumentDetail, billingDocumentFileQuery, } from './billing.js';
61
- export type { PayerKind, BillingCycle, VatTreatment, PayerRefusalRule, VatDecision, ChargeAmounts, BillingState, QuoteLine, CheckoutQuote, BillingAddress, BillingDetails, CheckoutRequest, CheckoutResponse, CheckoutStatus, VatIdStatus, VatIdCheckRequest, VatIdCheckResponse, BillingChangeRequest, BillingCancelRequest, BillingDetailsUpdate, PaymentMethodKind, PaymentMethodChangeRequest, BillingAccountStatus, PaymentMethod, InvoiceStatus, BillingInvoice, BillingAccount, BillingView, BillingChangeResponse, BillingDocumentKind, BillingDocumentStatus, BillingDocumentProfile, BillingDocumentFormat, BillingDocument, BillingDocumentList, BillingDocumentFileRole, BillingDocumentDetail, BillingDocumentFileQuery, } from './billing.js';
60
+ export { countryCode, EU_COUNTRIES, SELLER_COUNTRY, DE_VAT_RATE_PERCENT, isEuCountry, currencyForCountry, payerKind, billingCycle, vatTreatment, payerRefusalRule, vatFor, viesCountry, normalizeVatId, periodNetCents, prorateCents, vatCents, chargeAmounts, DAY_MS, periodDays, remainingDays, changeNetCents, checkoutQuote, BILLING_RETRY_DAYS, BILLING_LOCK_DAY, billingAddress, billingDetails, checkoutRequest, checkoutResponse, checkoutStatus, vatIdStatus, vatIdCheckRequest, vatIdCheckResponse, billingChangeRequest, billingCancelRequest, billingDetailsUpdate, paymentMethodKind, paymentMethodChangeRequest, billingAccountStatus, paymentMethod, invoiceStatus, billingInvoice, billingAccount, billingView, billingChangeResponse, billingDocumentKind, billingDocumentStatus, billingDocumentProfile, billingDocumentFormat, billingDocument, billingDocumentList, billingDocumentFileRole, billingDocumentDetail, billingDocumentFileQuery, billingIssuer, billingChargeInvoice, billingCharge, chargePayRequest, } from './billing.js';
61
+ export type { PayerKind, BillingCycle, VatTreatment, PayerRefusalRule, VatDecision, ChargeAmounts, BillingState, QuoteLine, CheckoutQuote, BillingAddress, BillingDetails, CheckoutRequest, CheckoutResponse, CheckoutStatus, VatIdStatus, VatIdCheckRequest, VatIdCheckResponse, BillingChangeRequest, BillingCancelRequest, BillingDetailsUpdate, PaymentMethodKind, PaymentMethodChangeRequest, BillingAccountStatus, PaymentMethod, InvoiceStatus, BillingInvoice, BillingAccount, BillingView, BillingChangeResponse, BillingDocumentKind, BillingDocumentStatus, BillingDocumentProfile, BillingDocumentFormat, BillingDocument, BillingDocumentList, BillingDocumentFileRole, BillingDocumentDetail, BillingDocumentFileQuery, BillingIssuer, BillingChargeInvoice, BillingCharge, ChargePayRequest, } from './billing.js';
62
62
  export { purchaseBillingDetails, purchaseOperationKey, purchaseOperation, purchaseQuote, purchaseHoldReason, purchaseRefusalRule, purchaseIntent, purchaseIntentLookupQuery, purchaseIntentConfirmRequest, purchaseConflictDetails, invoicePayRequest, purchaseIntentResponse, vatDecision, viesPendingReason, } from './billing.js';
63
63
  export type { PurchaseBillingDetails, PurchaseOperation, PurchaseQuote, PurchaseIntent, PurchaseIntentLookupQuery, PurchaseIntentConfirmRequest, PurchaseConflictDetails, InvoicePayRequest, PurchaseIntentResponse, ViesVerdict, ViesPendingReason, } from './billing.js';
package/dist/index.js CHANGED
@@ -74,5 +74,7 @@ export { planCurrency, orgAddons, orgPlanUsage, planChangeKeep, planChangeReason
74
74
  // 2026-10-04 — billing through Mollie (#104).
75
75
  export { countryCode, EU_COUNTRIES, SELLER_COUNTRY, DE_VAT_RATE_PERCENT, isEuCountry, currencyForCountry, payerKind, billingCycle, vatTreatment, payerRefusalRule, vatFor, viesCountry, normalizeVatId, periodNetCents, prorateCents, vatCents, chargeAmounts, DAY_MS, periodDays, remainingDays, changeNetCents, checkoutQuote, BILLING_RETRY_DAYS, BILLING_LOCK_DAY, billingAddress, billingDetails, checkoutRequest, checkoutResponse, checkoutStatus, vatIdStatus, vatIdCheckRequest, vatIdCheckResponse, billingChangeRequest, billingCancelRequest, billingDetailsUpdate, paymentMethodKind, paymentMethodChangeRequest, billingAccountStatus, paymentMethod, invoiceStatus, billingInvoice, billingAccount, billingView, billingChangeResponse,
76
76
  // 2026-10-19 — Lexware billing documents (fleetless/fleetless#544).
77
- billingDocumentKind, billingDocumentStatus, billingDocumentProfile, billingDocumentFormat, billingDocument, billingDocumentList, billingDocumentFileRole, billingDocumentDetail, billingDocumentFileQuery, } from './billing.js';
77
+ billingDocumentKind, billingDocumentStatus, billingDocumentProfile, billingDocumentFormat, billingDocument, billingDocumentList, billingDocumentFileRole, billingDocumentDetail, billingDocumentFileQuery,
78
+ // 2026-10-19 — the Lexware issuer cutover (fleetless/fleetless#327).
79
+ billingIssuer, billingChargeInvoice, billingCharge, chargePayRequest, } from './billing.js';
78
80
  export { purchaseBillingDetails, purchaseOperationKey, purchaseOperation, purchaseQuote, purchaseHoldReason, purchaseRefusalRule, purchaseIntent, purchaseIntentLookupQuery, purchaseIntentConfirmRequest, purchaseConflictDetails, invoicePayRequest, purchaseIntentResponse, vatDecision, viesPendingReason, } from './billing.js';
package/dist/routes.js CHANGED
@@ -12,7 +12,7 @@ import { jobRunListResponse, jobRunQuery, jobRunSummary, jobRunSummaryQuery } fr
12
12
  import { MCP_APP_PATHS, mcpRobotDatasheet, mcpRolePreviewResponse } from './mcp.js';
13
13
  import { authorizationServerMetadata, dynamicClientRegistrationRequest, dynamicClientRegistrationResponse, oauthAuthorizeQuery, oauthRedirectResponse, oauthTokenRequest, oauthTokenResponse, protectedResourceMetadata, } from './oauth.js';
14
14
  import { adminPlanChangeRequest, orgPlan, planChangeRequest } from './plans.js';
15
- import { purchaseIntentLookupQuery, purchaseIntentConfirmRequest, purchaseIntentResponse, invoicePayRequest, billingCancelRequest, billingChangeRequest, billingChangeResponse, billingDetailsUpdate, billingDocumentDetail, billingDocumentFileQuery, billingDocumentList, billingView, checkoutRequest, checkoutResponse, checkoutStatus, paymentMethodChangeRequest, vatIdCheckRequest, vatIdCheckResponse, } from './billing.js';
15
+ import { purchaseIntentLookupQuery, purchaseIntentConfirmRequest, purchaseIntentResponse, invoicePayRequest, billingCancelRequest, billingChangeRequest, billingChangeResponse, billingDetailsUpdate, billingDocumentDetail, billingDocumentFileQuery, billingDocumentList, billingView, chargePayRequest, checkoutRequest, checkoutResponse, checkoutStatus, paymentMethodChangeRequest, vatIdCheckRequest, vatIdCheckResponse, } from './billing.js';
16
16
  import { cameraListResponse, cancelRequest, configDraftResponse, configVersionResponse, configVersionsResponse, createRobotRequest, createRobotResponse, datapointListResponse, datapointValue, exposureListResponse, fetchTypesRequest, fetchTypesResponse, historyQuery, historyResponse, introspectionResponse, invokeOrServiceResponse, invokeRequest, jobResponse, liveSessionResponse, orgHealthQuery, orgLatencyQuery, orgLatencyResponse, orgQuotaUsage, orgUsageQuery, orgUsageResponse, patchRobotRequest, patchRobotResponse, publishConfigResponse, publishRequest, putConfigDraftRequest, putRobotDetailsRequest, putRobotDetailsResponse, robotTokenRotateResponse, jointStatePutRequest, jointStatePutResponse, releaseLiveQuery, renameSlugRequest, renameSlugResponse, robotDeleteQuery, resourceHealthListResponse, robotDeletionSummary, robotDetailResponse, robotJobsResponse, robotListResponse, slugUsageResponse, snapshotMetaResponse, typesResponse, } from './rest.js';
17
17
  export const ROUTE_SECTIONS = [
18
18
  { id: 'health', title: 'Health' },
@@ -3011,7 +3011,9 @@ export const ROUTES = [
3011
3011
  query: null, request: null, response: null, contentType: 'application/pdf',
3012
3012
  errors: [...DEVELOPER_GUARD, 'tier_required', 'not_found'], transport: 'http',
3013
3013
  notes: 'Rendered once, with `pdfkit`, when the invoice is issued, and stored as bytes — an issued invoice never changes, so this always ' +
3014
- 'answers the same PDF for the same id. `404 not_found` for an unknown id or one from another org.',
3014
+ 'answers the same PDF for the same id. `404 not_found` for an unknown id or one from another org. This reads historical Cloud ' +
3015
+ "invoices only: a due charge has no PDF of its own here — its eventual Lexware invoice is a document, read through " +
3016
+ '`GET /api/billing/documents/:id/file`.',
3015
3017
  },
3016
3018
  /* --- billing documents (2026-10-19, fleetless/fleetless#544) -------
3017
3019
  *
@@ -3062,11 +3064,28 @@ export const ROUTES = [
3062
3064
  method: 'POST', path: '/api/billing/invoices/:id/pay', section: 'billing',
3063
3065
  summary: "Records an owner-confirmed payment intent for an open invoice or due charge.",
3064
3066
  audience: 'developer', auth: 'developer', rateLimited: true, ownerTier: true, status: 201,
3065
- params: [{ name: 'id', description: 'The invoice id, from `billingInvoice.id`, of the open invoice to pay — or a due charge\'s id, from `dunning.invoice_id`.' }],
3067
+ params: [{ name: 'id', description: 'The invoice id, from `billingInvoice.id`, of the open invoice to pay — or, before the issuer cutover, a due charge\'s id, from `dunning.invoice_id`.' }],
3066
3068
  query: null, request: invoicePayRequest, response: checkoutResponse,
3067
3069
  errors: ['validation_error', ...DEVELOPER_GUARD, 'tier_required', 'not_found', 'target_state_conflict', 'rate_limited', ...BILLING_OFF, ...MOLLIE],
3068
3070
  transport: 'http',
3069
- notes: "The required operation_key binds the org, invoice and request; reuse with changed input is 409 target_state_conflict (purchaseConflictDetails). :id may be an issued invoice or a due charge with no number. Recheck current buyer eligibility, VIES, invoice status, owed amount and original currency before every new provider call. Invalid VAT is state invalid_vat_id with rule vat_id_invalid, without a payment. Pending/eligible/held has no redirect; after VIES recovers, the owner must confirm the current quote. An issued USD invoice remains held/legacy_usd_invoice: never convert it or call the provider anew until the integration decision resolves the conflict. Already-created payments retain recorded currency/amount and are looked up/reconciled, never replaced. Under the org lock, confirmation checks the current owed amount and returns the same payment identity on retries. invoice_not_open is a typed conflict; 404 not_found for unknown/foreign invoice. Pending itself never pays an invoice, lifts a lock or resets dunning.",
3071
+ notes: "The required operation_key binds the org, invoice and request; reuse with changed input is 409 target_state_conflict (purchaseConflictDetails). :id may be an issued invoice or a due charge with no number. Recheck current buyer eligibility, VIES, invoice status, owed amount and original currency before every new provider call. Invalid VAT is state invalid_vat_id with rule vat_id_invalid, without a payment. Pending/eligible/held has no redirect; after VIES recovers, the owner must confirm the current quote. An issued USD invoice remains held/legacy_usd_invoice: never convert it or call the provider anew until the integration decision resolves the conflict. Already-created payments retain recorded currency/amount and are looked up/reconciled, never replaced. Under the org lock, confirmation checks the current owed amount and returns the same payment identity on retries. invoice_not_open is a typed conflict; 404 not_found for unknown/foreign invoice. Pending itself never pays an invoice, lifts a lock or resets dunning. After the issuer cutover, :id names a historical open FL-… invoice only; a due charge after the cutover answers 404 not_found here — pay it with POST /api/billing/charges/:id/pay instead.",
3072
+ },
3073
+ {
3074
+ method: 'POST', path: '/api/billing/charges/:id/pay', section: 'billing',
3075
+ summary: 'Records an owner-confirmed payment intent for a due Lexware-issuer charge.',
3076
+ audience: 'developer', auth: 'developer', rateLimited: true, ownerTier: true, status: 201,
3077
+ params: [{ name: 'id', description: 'The due charge id, from `billingCharge.id` in `GET /api/billing`\'s `charges`.' }],
3078
+ query: null, request: chargePayRequest, response: checkoutResponse,
3079
+ errors: ['validation_error', ...DEVELOPER_GUARD, 'tier_required', 'not_found', 'target_state_conflict', 'rate_limited', ...BILLING_OFF, ...MOLLIE],
3080
+ transport: 'http',
3081
+ notes: 'The required operation_key binds the org, charge and request, exactly like POST /api/billing/invoices/:id/pay; reuse with ' +
3082
+ 'changed input is 409 target_state_conflict (purchaseConflictDetails). :id is a due charge\'s own id (billingCharge.id) — never ' +
3083
+ 'a historical Cloud invoice; an invoice id, an unknown id or one from another org all answer 404 not_found alike. Recheck ' +
3084
+ "current buyer eligibility, the charge's own status and the owed amount before every new provider call: a charge already paid, " +
3085
+ 'cancelled or uncollectible is invoice_not_open, a typed 409 conflict. Pending/eligible/held has no redirect; after recovery ' +
3086
+ 'the owner must confirm the current quote. Already-created payments retain their recorded currency/amount and are looked ' +
3087
+ 'up/reconciled, never replaced. Under the org lock, confirmation checks the current owed amount and returns the same payment ' +
3088
+ 'identity on retries.',
3070
3089
  },
3071
3090
  {
3072
3091
  method: 'POST', path: '/api/billing/mollie/webhook', section: 'billing',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetless/contracts",
3
- "version": "7.1.0-next.1",
3
+ "version": "8.0.0",
4
4
  "description": "Fleetless wire contracts: the bridge-cloud protocol, the REST API schemas and the error codes, as zod schemas with generated JSON Schema and OpenAPI artifacts.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Dehne Robotik GmbH",