@fleetless/contracts 15.6.0 → 16.0.0-next.2
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/CHANGELOG.md +62 -0
- package/artifacts/openapi.json +5501 -90
- package/artifacts/routes.json +30 -7
- package/artifacts/schema/billing-change-response.schema.json +1 -57
- package/artifacts/schema/billing-decision-display-response.schema.json +465 -9
- package/artifacts/schema/billing-decision-snapshot.schema.json +465 -9
- package/artifacts/schema/checkout-draft-response.schema.json +384 -0
- package/artifacts/schema/checkout-open-details.schema.json +46 -0
- package/artifacts/schema/checkout-response.schema.json +1 -4
- package/artifacts/schema/checkout-start-response.schema.json +4141 -0
- package/artifacts/schema/plan-change-prepare-response.schema.json +465 -9
- package/artifacts/schema/purchase-conflict-details.schema.json +20 -4
- package/artifacts/schema/purchase-hold-reason.schema.json +1 -4
- package/artifacts/schema/purchase-intent-draft.schema.json +1 -4
- package/artifacts/schema/purchase-intent-response.schema.json +1 -4
- package/artifacts/schema/vies-unavailable-details.schema.json +28 -0
- package/dist/billing.d.ts +4675 -1146
- package/dist/billing.js +278 -21
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/org-roles.d.ts +4 -4
- package/dist/routes.js +55 -8
- package/package.json +1 -1
package/artifacts/routes.json
CHANGED
|
@@ -6846,7 +6846,7 @@
|
|
|
6846
6846
|
"method": "POST",
|
|
6847
6847
|
"path": "/api/billing/checkout",
|
|
6848
6848
|
"section": "billing",
|
|
6849
|
-
"summary": "
|
|
6849
|
+
"summary": "Decides a company's first paid plan and returns its order summary to confirm.",
|
|
6850
6850
|
"audience": "developer",
|
|
6851
6851
|
"auth": "developer",
|
|
6852
6852
|
"rateLimited": true,
|
|
@@ -6855,7 +6855,7 @@
|
|
|
6855
6855
|
"params": [],
|
|
6856
6856
|
"query": null,
|
|
6857
6857
|
"request": "checkout-request",
|
|
6858
|
-
"response": "checkout-response",
|
|
6858
|
+
"response": "checkout-start-response",
|
|
6859
6859
|
"errors": [
|
|
6860
6860
|
"unauthorized",
|
|
6861
6861
|
"token_expired",
|
|
@@ -6870,7 +6870,30 @@
|
|
|
6870
6870
|
"payment_provider_unavailable"
|
|
6871
6871
|
],
|
|
6872
6872
|
"transport": "http",
|
|
6873
|
-
"notes": "Basic stays free for every payer.
|
|
6873
|
+
"notes": "Basic stays free for every payer. The start decides in this request, VIES included: a busy VIES is retried for up to 15 seconds before the answer. The body is first saved as the org's checkout draft (`GET /api/billing/checkout-draft`), whatever the answer. `eligible` (201) records the pending billing account and a checkout intent, freezes the EUR quote and carries its C.4 display, Cache-Control: no-store: show `display.snapshot.declaration.text` directly above one button labelled `action_label`; that one click is `POST /api/billing/intents/:id/confirm` with the display's `confirmation_proof`. `vies_unavailable`, `invalid_vat_id` and `refused` answer 200 and nothing is stored but the draft: no intent, no account, no retry in the background; check again. `held` (`issuer_cutover_in_progress`) only while an issuer cutover runs, for minutes; try again. Lexware never holds a checkout: its contact and invoice follow the payment. Use a fresh operation_key per press; the same key and input answer 200 with the same intent (`payment_started` with its hosted checkout once confirmed), without another Mollie payment; changed input conflicts. While another first payment of the org is open, 409 target_state_conflict with `checkoutOpenDetails` (rule `checkout_open`): continue it at `checkout_url`. No payment or acceptance occurs at start, and the deprecated `accept_terms` confirms nothing. Hosted payment offers card, PayPal or Apple Pay; its return is <console>/settings/billing?checkout=<checkout_id>. Rate limited on billing.checkout_start. An active/past_due account uses billing/change."
|
|
6874
|
+
},
|
|
6875
|
+
{
|
|
6876
|
+
"method": "GET",
|
|
6877
|
+
"path": "/api/billing/checkout-draft",
|
|
6878
|
+
"section": "billing",
|
|
6879
|
+
"summary": "Reads the checkout draft, or the org's earlier billing details, to fill the checkout page.",
|
|
6880
|
+
"audience": "developer",
|
|
6881
|
+
"auth": "developer",
|
|
6882
|
+
"rateLimited": false,
|
|
6883
|
+
"ownerTier": true,
|
|
6884
|
+
"status": 200,
|
|
6885
|
+
"params": [],
|
|
6886
|
+
"query": null,
|
|
6887
|
+
"request": null,
|
|
6888
|
+
"response": "checkout-draft-response",
|
|
6889
|
+
"errors": [
|
|
6890
|
+
"unauthorized",
|
|
6891
|
+
"token_expired",
|
|
6892
|
+
"token_revoked",
|
|
6893
|
+
"tier_required"
|
|
6894
|
+
],
|
|
6895
|
+
"transport": "http",
|
|
6896
|
+
"notes": "`draft` is what the last `POST /api/billing/checkout` received, saved whatever it decided, and deleted once the checkout is paid. Without one, `prefill` carries the org's earlier billing details; both are `null` for a first purchase, never both set. A reload, a new tab or a return from Mollie fills the form from here. Reading changes nothing."
|
|
6874
6897
|
},
|
|
6875
6898
|
{
|
|
6876
6899
|
"method": "GET",
|
|
@@ -6927,7 +6950,7 @@
|
|
|
6927
6950
|
"plan_purchase_closed"
|
|
6928
6951
|
],
|
|
6929
6952
|
"transport": "http",
|
|
6930
|
-
"notes": "Owner only, Cache-Control: no-store. Cloud persists the snapshot and proof hash for an eligible current checkout or paid-change intent of this Owner and org. Pending, held, refused or accepted intents cannot mint a new proof. The proof never appears in lookup, billing views or logs."
|
|
6953
|
+
"notes": "Owner only, Cache-Control: no-store. Cloud persists the snapshot and proof hash for an eligible current checkout or paid-change intent of this Owner and org. A checkout start already returns its display; this route issues one for a paid change, and a fresh one for an intent that is still eligible. `snapshot.declaration` carries the approved sentence of the decision's action (`text_id`, `text`) and the label of its one button (`action_label`): `Pay 34,51 € with Mollie`, `Pay 95 € and switch`, `Switch to Pro`, `Switch to monthly at period end`, `Schedule downgrade to Plus` or `Cancel at period end`. Render both as sent. Pending, held, refused or accepted intents cannot mint a new proof. The proof never appears in lookup, billing views or logs."
|
|
6931
6954
|
},
|
|
6932
6955
|
{
|
|
6933
6956
|
"method": "POST",
|
|
@@ -6963,7 +6986,7 @@
|
|
|
6963
6986
|
"payment_provider_unavailable"
|
|
6964
6987
|
],
|
|
6965
6988
|
"transport": "http",
|
|
6966
|
-
"notes": "Checkout and paid-change decisions require confirmation_proof along with the operation key, quote revision and buyer fingerprint shown in the persisted C.4 display. Cloud rechecks buyer, quote, selection, legal references, period and current state under the org lock
|
|
6989
|
+
"notes": "Checkout and paid-change decisions require confirmation_proof along with the operation key, quote revision and buyer fingerprint shown in the persisted C.4 display. Cloud rechecks buyer, quote, selection, legal references, period and current state under the org lock. A spent, expired or stale proof answers 409 target_state_conflict with `{ field: confirmation_proof, rule: display_stale }` and changes nothing: fetch a fresh display (for a checkout, a new start with a new key) and press again; never resend the click. One decision, one legal acceptance and, for a charge, the hosted payment commit in this one request. An exact same-key replay returns the original result without another payment or acceptance. After 502 payment_provider_unavailable the same key and proof may be sent again: the payment is created with the same idempotency key, so at most one exists. While another first payment of the org is open, a checkout answers 409 target_state_conflict with `checkoutOpenDetails` (rule `checkout_open`): continue it at `checkout_url`. A paid change can return 409 target_state_conflict with field billing and rule charge_in_progress while an earlier charge is unresolved; it does not start another charge. Foreign ownership answers 404 without disclosure; held cannot charge."
|
|
6967
6990
|
},
|
|
6968
6991
|
{
|
|
6969
6992
|
"method": "GET",
|
|
@@ -6978,7 +7001,7 @@
|
|
|
6978
7001
|
"params": [
|
|
6979
7002
|
{
|
|
6980
7003
|
"name": "id",
|
|
6981
|
-
"description": "The checkout id from `
|
|
7004
|
+
"description": "The checkout id from a started payment's `payment.checkout_id`, carried on the return URL."
|
|
6982
7005
|
}
|
|
6983
7006
|
],
|
|
6984
7007
|
"query": null,
|
|
@@ -7071,7 +7094,7 @@
|
|
|
7071
7094
|
"payment_provider_unavailable"
|
|
7072
7095
|
],
|
|
7073
7096
|
"transport": "http",
|
|
7074
|
-
"notes": "The request names an absolute plan/cycle/add-on target and a
|
|
7097
|
+
"notes": "The request names an absolute plan/cycle/add-on target and a fresh operation_key per selection. Start is nonbinding for every change, including zero-charge, scheduled and formerly immediate decreases: it neither changes the plan nor writes legal acceptance. The change is decided in the request and never waits: no `awaiting_vies`, and Lexware never holds it; `held` (`issuer_cutover_in_progress`) only while an issuer cutover runs. VIES runs only when the billing details changed since the last decision or the recorded VAT treatment is blocked, and a change that charges nothing never calls it. When VIES does not answer: 409 target_state_conflict with `viesUnavailableDetails` (`field: billing.vat_id`, `rule: vies_unavailable`), nothing stored. A change charging nothing while the recorded VAT treatment is unresolved: 409 target_state_conflict with `{ field: billing.vat_id, rule: purchase_eligibility_pending }`. An eligible Owner obtains a C.4 display (`POST /api/billing/intents/:id/display`) and confirms with one click on its `action_label`. Confirmation may return accepted_no_payment with charged: null and no provider payment or redirect, or payment_started for a charged change. Exact-key lookup recovers the accepted result. Existing no_account, past_due, no_valid_mandate and plan_limit conflicts remain. A later paid-change confirmation can return 409 target_state_conflict with field billing and rule charge_in_progress while an earlier charge is unresolved; no second charge starts."
|
|
7075
7098
|
},
|
|
7076
7099
|
{
|
|
7077
7100
|
"method": "POST",
|
|
@@ -6,59 +6,6 @@
|
|
|
6
6
|
"properties": {
|
|
7
7
|
"intent": {
|
|
8
8
|
"oneOf": [
|
|
9
|
-
{
|
|
10
|
-
"type": "object",
|
|
11
|
-
"properties": {
|
|
12
|
-
"intent_id": {
|
|
13
|
-
"type": "string",
|
|
14
|
-
"format": "uuid",
|
|
15
|
-
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
|
|
16
|
-
"description": "Opaque persisted purchase intent identity."
|
|
17
|
-
},
|
|
18
|
-
"operation_key": {
|
|
19
|
-
"type": "string",
|
|
20
|
-
"format": "uuid",
|
|
21
|
-
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
|
|
22
|
-
"description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
|
|
23
|
-
},
|
|
24
|
-
"operation": {
|
|
25
|
-
"type": "string",
|
|
26
|
-
"const": "paid_change"
|
|
27
|
-
},
|
|
28
|
-
"invoice_id": {
|
|
29
|
-
"description": "For an invoice-paying operation, the due charge or issued invoice being paid. For a confirmed paid_change with payment_started, the charge or invoice created for that decision; when the charge was issued through Lexware (`charged` is `null`), it identifies the matching billing.charges[].id. Absent on a paid_change in any other state.",
|
|
30
|
-
"type": "string",
|
|
31
|
-
"format": "uuid",
|
|
32
|
-
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
|
33
|
-
},
|
|
34
|
-
"state": {
|
|
35
|
-
"type": "string",
|
|
36
|
-
"const": "awaiting_vies"
|
|
37
|
-
},
|
|
38
|
-
"reason": {
|
|
39
|
-
"type": "string",
|
|
40
|
-
"enum": [
|
|
41
|
-
"vies_unavailable",
|
|
42
|
-
"vies_unverified",
|
|
43
|
-
"vies_identifier_missing"
|
|
44
|
-
]
|
|
45
|
-
},
|
|
46
|
-
"next_attempt_at": {
|
|
47
|
-
"type": "string",
|
|
48
|
-
"format": "date-time",
|
|
49
|
-
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"required": [
|
|
53
|
-
"intent_id",
|
|
54
|
-
"operation_key",
|
|
55
|
-
"operation",
|
|
56
|
-
"state",
|
|
57
|
-
"reason",
|
|
58
|
-
"next_attempt_at"
|
|
59
|
-
],
|
|
60
|
-
"additionalProperties": false
|
|
61
|
-
},
|
|
62
9
|
{
|
|
63
10
|
"type": "object",
|
|
64
11
|
"properties": {
|
|
@@ -189,10 +136,7 @@
|
|
|
189
136
|
"legacy_usd_invoice",
|
|
190
137
|
"legacy_payer_unresolved",
|
|
191
138
|
"mandate_policy_unresolved",
|
|
192
|
-
"
|
|
193
|
-
"lexware_contact_changed",
|
|
194
|
-
"issuer_cutover_in_progress",
|
|
195
|
-
"lexware_issuance_paused"
|
|
139
|
+
"issuer_cutover_in_progress"
|
|
196
140
|
]
|
|
197
141
|
},
|
|
198
142
|
"original_amount": {
|