@fleetless/contracts 16.1.0-next.2 → 17.0.0-next.1
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 +30 -24
- package/artifacts/openapi.json +131 -134
- package/artifacts/routes.json +10 -7
- package/artifacts/schema/billing-change-response.schema.json +24 -49
- package/artifacts/schema/billing-details-conflict-details.schema.json +78 -0
- package/artifacts/schema/billing-view.schema.json +0 -24
- package/artifacts/schema/checkout-response.schema.json +50 -3
- package/artifacts/schema/purchase-conflict-details.schema.json +26 -2
- package/artifacts/schema/purchase-intent-draft.schema.json +24 -1
- package/artifacts/schema/purchase-intent-payment-started.schema.json +26 -2
- package/artifacts/schema/purchase-intent-response.schema.json +50 -51
- package/dist/billing.d.ts +63 -38
- package/dist/billing.js +44 -18
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/plans.d.ts +2 -15
- package/dist/plans.js +14 -27
- package/dist/routes.js +38 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,33 +9,39 @@ version.
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
-
###
|
|
12
|
+
### Changed
|
|
13
13
|
|
|
14
|
-
-
|
|
15
|
-
fleetless/fleetless#
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
`
|
|
20
|
-
|
|
14
|
+
- **BREAKING: a payment-method change starts a payment**
|
|
15
|
+
(fleetless/fleetless#1185). `POST /api/billing/payment-method` answers
|
|
16
|
+
operation `mandate_setup` in `payment_started` with a hosted payment of
|
|
17
|
+
0.00: redirect to its `checkout_url`. `checkoutResponse`, `purchaseIntent`,
|
|
18
|
+
`purchaseIntentPaymentStarted` and `purchaseIntentResponse` admit
|
|
19
|
+
`mandate_setup` there, hosted only; an older schema rejects that answer. The
|
|
20
|
+
rule "`mandate_setup` if and only if `mandate_policy_unresolved`" is one-way
|
|
21
|
+
now: the hold reason still names only a mandate setup (a change stored while
|
|
22
|
+
changes were on hold), and a held mandate setup has only that reason, but a
|
|
23
|
+
new change is never held. A mandate setup is never `eligible`,
|
|
24
|
+
`awaiting_vies`, `invalid_vat_id` or `refused`: nothing is quoted and VIES is
|
|
25
|
+
not asked. The same key again answers the same payment; `502
|
|
26
|
+
payment_provider_unavailable` resumes under the same key; `409
|
|
27
|
+
target_state_conflict` with `{ field: billing, rule: checkout_not_open }`
|
|
28
|
+
means the key's payment is finished.
|
|
29
|
+
- **`PATCH /api/billing/details` saves only what a purchase would accept.** The
|
|
30
|
+
route lists `409 target_state_conflict`; its notes name the refusals, when
|
|
31
|
+
VIES is asked and what a saved edit does.
|
|
32
|
+
- **`GET /api/billing/intents` lists `409 target_state_conflict` and `502
|
|
33
|
+
payment_provider_unavailable`**, which it has answered for a hosted payment
|
|
34
|
+
read at the provider. A mandate setup the provider never answered reads as
|
|
35
|
+
that `502`.
|
|
21
36
|
|
|
22
|
-
###
|
|
37
|
+
### Added
|
|
23
38
|
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
organization (`require_two_factor`) stays with Pro. Prices: Plus
|
|
31
|
-
`eur_month` 3000 and `eur_year` 30600, Pro 15000 and 153000. Both yearly
|
|
32
|
-
prices divide by twelve to the cent.
|
|
33
|
-
- **`asset_bytes_per_robot` is 1,000,000,000 on Basic, Plus and Pro.** Asset
|
|
34
|
-
storage is no plan differentiator any more. No plan below Enterprise
|
|
35
|
-
raises it; an organization that needs more gets an override
|
|
36
|
-
(`planOverrides.asset_bytes_per_robot`). A consumer that names the way up
|
|
37
|
-
from this limit must not read it off `nextPlanRaising`, which answers
|
|
38
|
-
`enterprise`.
|
|
39
|
+
- **`billingDetailsConflictDetails`**: the `409` details of
|
|
40
|
+
`PATCH /api/billing/details`. `{ field, rule }` with a
|
|
41
|
+
`purchaseRefusalRule` for a field a purchase would refuse,
|
|
42
|
+
`viesUnavailableDetails` when VIES did not answer, and
|
|
43
|
+
`{ field: billing, rule: buyer_changed }` when the details changed
|
|
44
|
+
meanwhile. Nothing is saved in any of them.
|
|
39
45
|
|
|
40
46
|
## [16.0.0] — 2026-11-19
|
|
41
47
|
|
package/artifacts/openapi.json
CHANGED
|
@@ -10294,7 +10294,7 @@
|
|
|
10294
10294
|
}
|
|
10295
10295
|
},
|
|
10296
10296
|
"default": {
|
|
10297
|
-
"description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `tier_required`, `validation_error`, `not_found`.",
|
|
10297
|
+
"description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `tier_required`, `validation_error`, `not_found`, `target_state_conflict`, `payment_provider_unavailable`.",
|
|
10298
10298
|
"content": {
|
|
10299
10299
|
"application/json": {
|
|
10300
10300
|
"schema": {
|
|
@@ -10304,7 +10304,7 @@
|
|
|
10304
10304
|
}
|
|
10305
10305
|
}
|
|
10306
10306
|
},
|
|
10307
|
-
"description": "Supply exactly one of operation_key or intent_id and the expected operation. Scope lookup to the authenticated owner and org; unknown, foreign-org or mismatched-operation intents return 404 without disclosure. Repeating a lookup after restart or lost response returns the same intent/payment identity and, for a paid change, its billing result. A proof is never returned here; a still-eligible decision needs a fresh C.4 display and explicit Owner click."
|
|
10307
|
+
"description": "Supply exactly one of operation_key or intent_id and the expected operation. Scope lookup to the authenticated owner and org; unknown, foreign-org or mismatched-operation intents return 404 without disclosure. Repeating a lookup after restart or lost response returns the same intent/payment identity and, for a paid change, its billing result. A proof is never returned here; a still-eligible decision needs a fresh C.4 display and explicit Owner click. A started hosted payment is read at the provider first: 409 target_state_conflict with `{ field: billing, rule: checkout_not_open }` when it is no longer open there (paid, canceled, expired or failed), and 502 payment_provider_unavailable when the provider does not answer. A `mandate_setup` whose payment the provider never answered also answers that 502: send its `POST /api/billing/payment-method` again with the same key."
|
|
10308
10308
|
}
|
|
10309
10309
|
},
|
|
10310
10310
|
"/api/billing/intents/{id}/display": {
|
|
@@ -10522,7 +10522,7 @@
|
|
|
10522
10522
|
"/api/billing/details": {
|
|
10523
10523
|
"patch": {
|
|
10524
10524
|
"operationId": "patch_api_billing_details",
|
|
10525
|
-
"summary": "Edits company billing details
|
|
10525
|
+
"summary": "Edits the company's billing details; details a purchase would refuse are not saved.",
|
|
10526
10526
|
"tags": [
|
|
10527
10527
|
"billing"
|
|
10528
10528
|
],
|
|
@@ -10544,7 +10544,7 @@
|
|
|
10544
10544
|
}
|
|
10545
10545
|
},
|
|
10546
10546
|
"default": {
|
|
10547
|
-
"description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `tier_required`, `validation_error`, `not_found`.",
|
|
10547
|
+
"description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `tier_required`, `validation_error`, `not_found`, `target_state_conflict`.",
|
|
10548
10548
|
"content": {
|
|
10549
10549
|
"application/json": {
|
|
10550
10550
|
"schema": {
|
|
@@ -10554,7 +10554,7 @@
|
|
|
10554
10554
|
}
|
|
10555
10555
|
}
|
|
10556
10556
|
},
|
|
10557
|
-
"description": "404 not_found when no billing account exists.
|
|
10557
|
+
"description": "404 not_found when no billing account exists. Send only the fields that change: company name, full address with state, Tax ID, VAT ID, invoice email. The merged company is decided as a checkout decides its buyer, and saved only when a purchase would accept it. Every refusal is 409 target_state_conflict with `billingDetailsConflictDetails` and saves nothing: `{ field, rule }` for a field a purchase refuses (`rule` a `purchaseRefusalRule`; `field` one of `billing.kind`, `billing.vat_id`, `billing.tax_id`, `billing.address.state`, `billing.invoice_email`), `vat_id_invalid` at `billing.vat_id` when VIES does not know the VAT ID; `viesUnavailableDetails` (`field: billing.vat_id`, `rule: vies_unavailable`) when VIES did not answer within its 15 seconds: send the same edit again; `{ field: billing, rule: buyer_changed }` when the details changed while the edit was decided: read `GET /api/billing` and send it again. VIES is asked only when the country or the VAT ID changes, in another EU country; any other edit keeps the recorded VIES answer and needs none. A saved edit re-prices open due charges, updates the invoicing contact and invalidates quotes made for the old details. An issued invoice keeps the details it was issued with. An edit creates no payment, activates no plan, pays no invoice, clears no dunning and lifts no lock. A person account from before company-only purchases is saved without these checks; it cannot buy.",
|
|
10558
10558
|
"requestBody": {
|
|
10559
10559
|
"required": true,
|
|
10560
10560
|
"content": {
|
|
@@ -10618,7 +10618,7 @@
|
|
|
10618
10618
|
"/api/billing/payment-method": {
|
|
10619
10619
|
"post": {
|
|
10620
10620
|
"operationId": "post_api_billing_payment_method",
|
|
10621
|
-
"summary": "
|
|
10621
|
+
"summary": "Starts a payment-method change: a hosted payment of 0.00 for a new mandate.",
|
|
10622
10622
|
"tags": [
|
|
10623
10623
|
"billing"
|
|
10624
10624
|
],
|
|
@@ -10650,7 +10650,7 @@
|
|
|
10650
10650
|
}
|
|
10651
10651
|
}
|
|
10652
10652
|
},
|
|
10653
|
-
"description": "
|
|
10653
|
+
"description": "Offer `payment_method_options`. A change is a 0.00 `first` payment on the provider's hosted page, restricted to the chosen method: the answer is operation `mandate_setup` in `payment_started` with `payment.kind` hosted at once; redirect to its `checkout_url`. Nothing is quoted, so there is no `eligible` step, no confirmation and no VIES. It pays no invoice and clears no dunning or lock: open invoices stay open. When the provider reports it paid, the new mandate is the account's and every other valid mandate of the customer is revoked; canceled, expired or failed, nothing changes. `GET /api/billing/checkout/:id` with the `checkout_id` reads the outcome (`purpose: payment_method`). Use one operation_key per method until its payment is finished. The same key again answers 200 with the same `payment_started` while the payment is open. 502 payment_provider_unavailable when the provider did not answer: the same key again resumes, and sends the same payment again under the same idempotency key. 409 target_state_conflict with `{ field: billing, rule: checkout_not_open }` when the key's payment is finished or can no longer be sent: start again with a new key. Same key with another method is a typed operation_key_reused conflict. A change stored while changes were on hold reads `held` with `mandate_policy_unresolved`; start again with a new key. Apple Pay with zero-amount changes disabled pays an open invoice through operation payment_method_invoice, with the buyer/VIES gate, current-amount reconfirmation and USD legacy hold of invoices/:id/pay; without an open invoice, 400 validation_error has field method and rule applepay_needs_open_invoice. An invoice charged back is never retried automatically. 404 not_found when no billing account is active or past due.",
|
|
10654
10654
|
"requestBody": {
|
|
10655
10655
|
"required": true,
|
|
10656
10656
|
"content": {
|
|
@@ -16610,8 +16610,31 @@
|
|
|
16610
16610
|
"then": {
|
|
16611
16611
|
"properties": {
|
|
16612
16612
|
"state": {
|
|
16613
|
-
"
|
|
16613
|
+
"enum": [
|
|
16614
|
+
"held",
|
|
16615
|
+
"payment_started"
|
|
16616
|
+
]
|
|
16617
|
+
}
|
|
16618
|
+
}
|
|
16619
|
+
}
|
|
16620
|
+
},
|
|
16621
|
+
{
|
|
16622
|
+
"if": {
|
|
16623
|
+
"properties": {
|
|
16624
|
+
"operation": {
|
|
16625
|
+
"const": "mandate_setup"
|
|
16614
16626
|
},
|
|
16627
|
+
"state": {
|
|
16628
|
+
"const": "held"
|
|
16629
|
+
}
|
|
16630
|
+
},
|
|
16631
|
+
"required": [
|
|
16632
|
+
"operation",
|
|
16633
|
+
"state"
|
|
16634
|
+
]
|
|
16635
|
+
},
|
|
16636
|
+
"then": {
|
|
16637
|
+
"properties": {
|
|
16615
16638
|
"reason": {
|
|
16616
16639
|
"const": "mandate_policy_unresolved"
|
|
16617
16640
|
}
|
|
@@ -17035,29 +17058,6 @@
|
|
|
17035
17058
|
],
|
|
17036
17059
|
"description": "`null` while a cancel is pending or nothing else renews."
|
|
17037
17060
|
},
|
|
17038
|
-
"current_price": {
|
|
17039
|
-
"anyOf": [
|
|
17040
|
-
{
|
|
17041
|
-
"type": "object",
|
|
17042
|
-
"properties": {
|
|
17043
|
-
"net_cents": {
|
|
17044
|
-
"type": "integer",
|
|
17045
|
-
"minimum": -9007199254740991,
|
|
17046
|
-
"maximum": 9007199254740991,
|
|
17047
|
-
"description": "One period of the current plan, cycle and add-ons at the agreed price, excluding VAT, in integer cents."
|
|
17048
|
-
}
|
|
17049
|
-
},
|
|
17050
|
-
"required": [
|
|
17051
|
-
"net_cents"
|
|
17052
|
-
],
|
|
17053
|
-
"additionalProperties": false
|
|
17054
|
-
},
|
|
17055
|
-
{
|
|
17056
|
-
"type": "null"
|
|
17057
|
-
}
|
|
17058
|
-
],
|
|
17059
|
-
"description": "What one period (`cycle`) of the current plan costs this organization: the price it agreed, which stays when the catalogue changes. Show this, not the catalogue price, as the price of a billed organization. `null` when no agreed price is recorded for the current plan, cycle and add-ons."
|
|
17060
|
-
},
|
|
17061
17061
|
"scheduled": {
|
|
17062
17062
|
"type": "object",
|
|
17063
17063
|
"properties": {
|
|
@@ -17216,7 +17216,6 @@
|
|
|
17216
17216
|
"period_starts_at",
|
|
17217
17217
|
"period_ends_at",
|
|
17218
17218
|
"next_charge",
|
|
17219
|
-
"current_price",
|
|
17220
17219
|
"scheduled",
|
|
17221
17220
|
"dunning"
|
|
17222
17221
|
],
|
|
@@ -18231,29 +18230,6 @@
|
|
|
18231
18230
|
],
|
|
18232
18231
|
"description": "`null` while a cancel is pending or nothing else renews."
|
|
18233
18232
|
},
|
|
18234
|
-
"current_price": {
|
|
18235
|
-
"anyOf": [
|
|
18236
|
-
{
|
|
18237
|
-
"type": "object",
|
|
18238
|
-
"properties": {
|
|
18239
|
-
"net_cents": {
|
|
18240
|
-
"type": "integer",
|
|
18241
|
-
"minimum": -9007199254740991,
|
|
18242
|
-
"maximum": 9007199254740991,
|
|
18243
|
-
"description": "One period of the current plan, cycle and add-ons at the agreed price, excluding VAT, in integer cents."
|
|
18244
|
-
}
|
|
18245
|
-
},
|
|
18246
|
-
"required": [
|
|
18247
|
-
"net_cents"
|
|
18248
|
-
],
|
|
18249
|
-
"additionalProperties": false
|
|
18250
|
-
},
|
|
18251
|
-
{
|
|
18252
|
-
"type": "null"
|
|
18253
|
-
}
|
|
18254
|
-
],
|
|
18255
|
-
"description": "What one period (`cycle`) of the current plan costs this organization: the price it agreed, which stays when the catalogue changes. Show this, not the catalogue price, as the price of a billed organization. `null` when no agreed price is recorded for the current plan, cycle and add-ons."
|
|
18256
|
-
},
|
|
18257
18233
|
"scheduled": {
|
|
18258
18234
|
"type": "object",
|
|
18259
18235
|
"properties": {
|
|
@@ -18412,7 +18388,6 @@
|
|
|
18412
18388
|
"period_starts_at",
|
|
18413
18389
|
"period_ends_at",
|
|
18414
18390
|
"next_charge",
|
|
18415
|
-
"current_price",
|
|
18416
18391
|
"scheduled",
|
|
18417
18392
|
"dunning"
|
|
18418
18393
|
],
|
|
@@ -23529,29 +23504,6 @@
|
|
|
23529
23504
|
],
|
|
23530
23505
|
"description": "`null` while a cancel is pending or nothing else renews."
|
|
23531
23506
|
},
|
|
23532
|
-
"current_price": {
|
|
23533
|
-
"anyOf": [
|
|
23534
|
-
{
|
|
23535
|
-
"type": "object",
|
|
23536
|
-
"properties": {
|
|
23537
|
-
"net_cents": {
|
|
23538
|
-
"type": "integer",
|
|
23539
|
-
"minimum": -9007199254740991,
|
|
23540
|
-
"maximum": 9007199254740991,
|
|
23541
|
-
"description": "One period of the current plan, cycle and add-ons at the agreed price, excluding VAT, in integer cents."
|
|
23542
|
-
}
|
|
23543
|
-
},
|
|
23544
|
-
"required": [
|
|
23545
|
-
"net_cents"
|
|
23546
|
-
],
|
|
23547
|
-
"additionalProperties": false
|
|
23548
|
-
},
|
|
23549
|
-
{
|
|
23550
|
-
"type": "null"
|
|
23551
|
-
}
|
|
23552
|
-
],
|
|
23553
|
-
"description": "What one period (`cycle`) of the current plan costs this organization: the price it agreed, which stays when the catalogue changes. Show this, not the catalogue price, as the price of a billed organization. `null` when no agreed price is recorded for the current plan, cycle and add-ons."
|
|
23554
|
-
},
|
|
23555
23507
|
"scheduled": {
|
|
23556
23508
|
"type": "object",
|
|
23557
23509
|
"properties": {
|
|
@@ -23710,7 +23662,6 @@
|
|
|
23710
23662
|
"period_starts_at",
|
|
23711
23663
|
"period_ends_at",
|
|
23712
23664
|
"next_charge",
|
|
23713
|
-
"current_price",
|
|
23714
23665
|
"scheduled",
|
|
23715
23666
|
"dunning"
|
|
23716
23667
|
],
|
|
@@ -25202,8 +25153,31 @@
|
|
|
25202
25153
|
"then": {
|
|
25203
25154
|
"properties": {
|
|
25204
25155
|
"state": {
|
|
25205
|
-
"
|
|
25156
|
+
"enum": [
|
|
25157
|
+
"held",
|
|
25158
|
+
"payment_started"
|
|
25159
|
+
]
|
|
25160
|
+
}
|
|
25161
|
+
}
|
|
25162
|
+
}
|
|
25163
|
+
},
|
|
25164
|
+
{
|
|
25165
|
+
"if": {
|
|
25166
|
+
"properties": {
|
|
25167
|
+
"operation": {
|
|
25168
|
+
"const": "mandate_setup"
|
|
25206
25169
|
},
|
|
25170
|
+
"state": {
|
|
25171
|
+
"const": "held"
|
|
25172
|
+
}
|
|
25173
|
+
},
|
|
25174
|
+
"required": [
|
|
25175
|
+
"operation",
|
|
25176
|
+
"state"
|
|
25177
|
+
]
|
|
25178
|
+
},
|
|
25179
|
+
"then": {
|
|
25180
|
+
"properties": {
|
|
25207
25181
|
"reason": {
|
|
25208
25182
|
"const": "mandate_policy_unresolved"
|
|
25209
25183
|
}
|
|
@@ -25280,7 +25254,8 @@
|
|
|
25280
25254
|
"enum": [
|
|
25281
25255
|
"checkout",
|
|
25282
25256
|
"invoice_payment",
|
|
25283
|
-
"payment_method_invoice"
|
|
25257
|
+
"payment_method_invoice",
|
|
25258
|
+
"mandate_setup"
|
|
25284
25259
|
]
|
|
25285
25260
|
},
|
|
25286
25261
|
"invoice_id": {
|
|
@@ -25384,8 +25359,31 @@
|
|
|
25384
25359
|
"then": {
|
|
25385
25360
|
"properties": {
|
|
25386
25361
|
"state": {
|
|
25387
|
-
"
|
|
25362
|
+
"enum": [
|
|
25363
|
+
"held",
|
|
25364
|
+
"payment_started"
|
|
25365
|
+
]
|
|
25366
|
+
}
|
|
25367
|
+
}
|
|
25368
|
+
}
|
|
25369
|
+
},
|
|
25370
|
+
{
|
|
25371
|
+
"if": {
|
|
25372
|
+
"properties": {
|
|
25373
|
+
"operation": {
|
|
25374
|
+
"const": "mandate_setup"
|
|
25388
25375
|
},
|
|
25376
|
+
"state": {
|
|
25377
|
+
"const": "held"
|
|
25378
|
+
}
|
|
25379
|
+
},
|
|
25380
|
+
"required": [
|
|
25381
|
+
"operation",
|
|
25382
|
+
"state"
|
|
25383
|
+
]
|
|
25384
|
+
},
|
|
25385
|
+
"then": {
|
|
25386
|
+
"properties": {
|
|
25389
25387
|
"reason": {
|
|
25390
25388
|
"const": "mandate_policy_unresolved"
|
|
25391
25389
|
}
|
|
@@ -51242,8 +51240,31 @@
|
|
|
51242
51240
|
"then": {
|
|
51243
51241
|
"properties": {
|
|
51244
51242
|
"state": {
|
|
51245
|
-
"
|
|
51243
|
+
"enum": [
|
|
51244
|
+
"held",
|
|
51245
|
+
"payment_started"
|
|
51246
|
+
]
|
|
51247
|
+
}
|
|
51248
|
+
}
|
|
51249
|
+
}
|
|
51250
|
+
},
|
|
51251
|
+
{
|
|
51252
|
+
"if": {
|
|
51253
|
+
"properties": {
|
|
51254
|
+
"operation": {
|
|
51255
|
+
"const": "mandate_setup"
|
|
51246
51256
|
},
|
|
51257
|
+
"state": {
|
|
51258
|
+
"const": "held"
|
|
51259
|
+
}
|
|
51260
|
+
},
|
|
51261
|
+
"required": [
|
|
51262
|
+
"operation",
|
|
51263
|
+
"state"
|
|
51264
|
+
]
|
|
51265
|
+
},
|
|
51266
|
+
"then": {
|
|
51267
|
+
"properties": {
|
|
51247
51268
|
"reason": {
|
|
51248
51269
|
"const": "mandate_policy_unresolved"
|
|
51249
51270
|
}
|
|
@@ -51320,7 +51341,8 @@
|
|
|
51320
51341
|
"enum": [
|
|
51321
51342
|
"checkout",
|
|
51322
51343
|
"invoice_payment",
|
|
51323
|
-
"payment_method_invoice"
|
|
51344
|
+
"payment_method_invoice",
|
|
51345
|
+
"mandate_setup"
|
|
51324
51346
|
]
|
|
51325
51347
|
},
|
|
51326
51348
|
"invoice_id": {
|
|
@@ -51424,8 +51446,31 @@
|
|
|
51424
51446
|
"then": {
|
|
51425
51447
|
"properties": {
|
|
51426
51448
|
"state": {
|
|
51427
|
-
"
|
|
51449
|
+
"enum": [
|
|
51450
|
+
"held",
|
|
51451
|
+
"payment_started"
|
|
51452
|
+
]
|
|
51453
|
+
}
|
|
51454
|
+
}
|
|
51455
|
+
}
|
|
51456
|
+
},
|
|
51457
|
+
{
|
|
51458
|
+
"if": {
|
|
51459
|
+
"properties": {
|
|
51460
|
+
"operation": {
|
|
51461
|
+
"const": "mandate_setup"
|
|
51428
51462
|
},
|
|
51463
|
+
"state": {
|
|
51464
|
+
"const": "held"
|
|
51465
|
+
}
|
|
51466
|
+
},
|
|
51467
|
+
"required": [
|
|
51468
|
+
"operation",
|
|
51469
|
+
"state"
|
|
51470
|
+
]
|
|
51471
|
+
},
|
|
51472
|
+
"then": {
|
|
51473
|
+
"properties": {
|
|
51429
51474
|
"reason": {
|
|
51430
51475
|
"const": "mandate_policy_unresolved"
|
|
51431
51476
|
}
|
|
@@ -51843,29 +51888,6 @@
|
|
|
51843
51888
|
],
|
|
51844
51889
|
"description": "`null` while a cancel is pending or nothing else renews."
|
|
51845
51890
|
},
|
|
51846
|
-
"current_price": {
|
|
51847
|
-
"anyOf": [
|
|
51848
|
-
{
|
|
51849
|
-
"type": "object",
|
|
51850
|
-
"properties": {
|
|
51851
|
-
"net_cents": {
|
|
51852
|
-
"type": "integer",
|
|
51853
|
-
"minimum": -9007199254740991,
|
|
51854
|
-
"maximum": 9007199254740991,
|
|
51855
|
-
"description": "One period of the current plan, cycle and add-ons at the agreed price, excluding VAT, in integer cents."
|
|
51856
|
-
}
|
|
51857
|
-
},
|
|
51858
|
-
"required": [
|
|
51859
|
-
"net_cents"
|
|
51860
|
-
],
|
|
51861
|
-
"additionalProperties": false
|
|
51862
|
-
},
|
|
51863
|
-
{
|
|
51864
|
-
"type": "null"
|
|
51865
|
-
}
|
|
51866
|
-
],
|
|
51867
|
-
"description": "What one period (`cycle`) of the current plan costs this organization: the price it agreed, which stays when the catalogue changes. Show this, not the catalogue price, as the price of a billed organization. `null` when no agreed price is recorded for the current plan, cycle and add-ons."
|
|
51868
|
-
},
|
|
51869
51891
|
"scheduled": {
|
|
51870
51892
|
"type": "object",
|
|
51871
51893
|
"properties": {
|
|
@@ -52024,7 +52046,6 @@
|
|
|
52024
52046
|
"period_starts_at",
|
|
52025
52047
|
"period_ends_at",
|
|
52026
52048
|
"next_charge",
|
|
52027
|
-
"current_price",
|
|
52028
52049
|
"scheduled",
|
|
52029
52050
|
"dunning"
|
|
52030
52051
|
],
|
|
@@ -53039,29 +53060,6 @@
|
|
|
53039
53060
|
],
|
|
53040
53061
|
"description": "`null` while a cancel is pending or nothing else renews."
|
|
53041
53062
|
},
|
|
53042
|
-
"current_price": {
|
|
53043
|
-
"anyOf": [
|
|
53044
|
-
{
|
|
53045
|
-
"type": "object",
|
|
53046
|
-
"properties": {
|
|
53047
|
-
"net_cents": {
|
|
53048
|
-
"type": "integer",
|
|
53049
|
-
"minimum": -9007199254740991,
|
|
53050
|
-
"maximum": 9007199254740991,
|
|
53051
|
-
"description": "One period of the current plan, cycle and add-ons at the agreed price, excluding VAT, in integer cents."
|
|
53052
|
-
}
|
|
53053
|
-
},
|
|
53054
|
-
"required": [
|
|
53055
|
-
"net_cents"
|
|
53056
|
-
],
|
|
53057
|
-
"additionalProperties": false
|
|
53058
|
-
},
|
|
53059
|
-
{
|
|
53060
|
-
"type": "null"
|
|
53061
|
-
}
|
|
53062
|
-
],
|
|
53063
|
-
"description": "What one period (`cycle`) of the current plan costs this organization: the price it agreed, which stays when the catalogue changes. Show this, not the catalogue price, as the price of a billed organization. `null` when no agreed price is recorded for the current plan, cycle and add-ons."
|
|
53064
|
-
},
|
|
53065
53063
|
"scheduled": {
|
|
53066
53064
|
"type": "object",
|
|
53067
53065
|
"properties": {
|
|
@@ -53220,7 +53218,6 @@
|
|
|
53220
53218
|
"period_starts_at",
|
|
53221
53219
|
"period_ends_at",
|
|
53222
53220
|
"next_charge",
|
|
53223
|
-
"current_price",
|
|
53224
53221
|
"scheduled",
|
|
53225
53222
|
"dunning"
|
|
53226
53223
|
],
|
package/artifacts/routes.json
CHANGED
|
@@ -6915,10 +6915,12 @@
|
|
|
6915
6915
|
"token_revoked",
|
|
6916
6916
|
"tier_required",
|
|
6917
6917
|
"validation_error",
|
|
6918
|
-
"not_found"
|
|
6918
|
+
"not_found",
|
|
6919
|
+
"target_state_conflict",
|
|
6920
|
+
"payment_provider_unavailable"
|
|
6919
6921
|
],
|
|
6920
6922
|
"transport": "http",
|
|
6921
|
-
"notes": "Supply exactly one of operation_key or intent_id and the expected operation. Scope lookup to the authenticated owner and org; unknown, foreign-org or mismatched-operation intents return 404 without disclosure. Repeating a lookup after restart or lost response returns the same intent/payment identity and, for a paid change, its billing result. A proof is never returned here; a still-eligible decision needs a fresh C.4 display and explicit Owner click."
|
|
6923
|
+
"notes": "Supply exactly one of operation_key or intent_id and the expected operation. Scope lookup to the authenticated owner and org; unknown, foreign-org or mismatched-operation intents return 404 without disclosure. Repeating a lookup after restart or lost response returns the same intent/payment identity and, for a paid change, its billing result. A proof is never returned here; a still-eligible decision needs a fresh C.4 display and explicit Owner click. A started hosted payment is read at the provider first: 409 target_state_conflict with `{ field: billing, rule: checkout_not_open }` when it is no longer open there (paid, canceled, expired or failed), and 502 payment_provider_unavailable when the provider does not answer. A `mandate_setup` whose payment the provider never answered also answers that 502: send its `POST /api/billing/payment-method` again with the same key."
|
|
6922
6924
|
},
|
|
6923
6925
|
{
|
|
6924
6926
|
"method": "POST",
|
|
@@ -7046,7 +7048,7 @@
|
|
|
7046
7048
|
"method": "PATCH",
|
|
7047
7049
|
"path": "/api/billing/details",
|
|
7048
7050
|
"section": "billing",
|
|
7049
|
-
"summary": "Edits company billing details
|
|
7051
|
+
"summary": "Edits the company's billing details; details a purchase would refuse are not saved.",
|
|
7050
7052
|
"audience": "developer",
|
|
7051
7053
|
"auth": "developer",
|
|
7052
7054
|
"rateLimited": false,
|
|
@@ -7062,10 +7064,11 @@
|
|
|
7062
7064
|
"token_revoked",
|
|
7063
7065
|
"tier_required",
|
|
7064
7066
|
"validation_error",
|
|
7065
|
-
"not_found"
|
|
7067
|
+
"not_found",
|
|
7068
|
+
"target_state_conflict"
|
|
7066
7069
|
],
|
|
7067
7070
|
"transport": "http",
|
|
7068
|
-
"notes": "404 not_found when no billing account exists.
|
|
7071
|
+
"notes": "404 not_found when no billing account exists. Send only the fields that change: company name, full address with state, Tax ID, VAT ID, invoice email. The merged company is decided as a checkout decides its buyer, and saved only when a purchase would accept it. Every refusal is 409 target_state_conflict with `billingDetailsConflictDetails` and saves nothing: `{ field, rule }` for a field a purchase refuses (`rule` a `purchaseRefusalRule`; `field` one of `billing.kind`, `billing.vat_id`, `billing.tax_id`, `billing.address.state`, `billing.invoice_email`), `vat_id_invalid` at `billing.vat_id` when VIES does not know the VAT ID; `viesUnavailableDetails` (`field: billing.vat_id`, `rule: vies_unavailable`) when VIES did not answer within its 15 seconds: send the same edit again; `{ field: billing, rule: buyer_changed }` when the details changed while the edit was decided: read `GET /api/billing` and send it again. VIES is asked only when the country or the VAT ID changes, in another EU country; any other edit keeps the recorded VIES answer and needs none. A saved edit re-prices open due charges, updates the invoicing contact and invalidates quotes made for the old details. An issued invoice keeps the details it was issued with. An edit creates no payment, activates no plan, pays no invoice, clears no dunning and lifts no lock. A person account from before company-only purchases is saved without these checks; it cannot buy."
|
|
7069
7072
|
},
|
|
7070
7073
|
{
|
|
7071
7074
|
"method": "POST",
|
|
@@ -7100,7 +7103,7 @@
|
|
|
7100
7103
|
"method": "POST",
|
|
7101
7104
|
"path": "/api/billing/payment-method",
|
|
7102
7105
|
"section": "billing",
|
|
7103
|
-
"summary": "
|
|
7106
|
+
"summary": "Starts a payment-method change: a hosted payment of 0.00 for a new mandate.",
|
|
7104
7107
|
"audience": "developer",
|
|
7105
7108
|
"auth": "developer",
|
|
7106
7109
|
"rateLimited": true,
|
|
@@ -7123,7 +7126,7 @@
|
|
|
7123
7126
|
"payment_provider_unavailable"
|
|
7124
7127
|
],
|
|
7125
7128
|
"transport": "http",
|
|
7126
|
-
"notes": "
|
|
7129
|
+
"notes": "Offer `payment_method_options`. A change is a 0.00 `first` payment on the provider's hosted page, restricted to the chosen method: the answer is operation `mandate_setup` in `payment_started` with `payment.kind` hosted at once; redirect to its `checkout_url`. Nothing is quoted, so there is no `eligible` step, no confirmation and no VIES. It pays no invoice and clears no dunning or lock: open invoices stay open. When the provider reports it paid, the new mandate is the account's and every other valid mandate of the customer is revoked; canceled, expired or failed, nothing changes. `GET /api/billing/checkout/:id` with the `checkout_id` reads the outcome (`purpose: payment_method`). Use one operation_key per method until its payment is finished. The same key again answers 200 with the same `payment_started` while the payment is open. 502 payment_provider_unavailable when the provider did not answer: the same key again resumes, and sends the same payment again under the same idempotency key. 409 target_state_conflict with `{ field: billing, rule: checkout_not_open }` when the key's payment is finished or can no longer be sent: start again with a new key. Same key with another method is a typed operation_key_reused conflict. A change stored while changes were on hold reads `held` with `mandate_policy_unresolved`; start again with a new key. Apple Pay with zero-amount changes disabled pays an open invoice through operation payment_method_invoice, with the buyer/VIES gate, current-amount reconfirmation and USD legacy hold of invoices/:id/pay; without an open invoice, 400 validation_error has field method and rule applepay_needs_open_invoice. An invoice charged back is never retried automatically. 404 not_found when no billing account is active or past due."
|
|
7127
7130
|
},
|
|
7128
7131
|
{
|
|
7129
7132
|
"method": "POST",
|