@fleetless/contracts 7.1.0 → 8.1.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 +33 -0
- package/artifacts/openapi.json +1013 -27
- package/artifacts/routes.json +80 -3
- package/artifacts/schema/billing-change-response.schema.json +469 -7
- package/artifacts/schema/billing-charge-invoice.schema.json +54 -0
- package/artifacts/schema/billing-charge.schema.json +216 -0
- package/artifacts/schema/billing-issuer.schema.json +8 -0
- package/artifacts/schema/billing-view.schema.json +232 -3
- package/artifacts/schema/checkout-response.schema.json +5 -1
- package/artifacts/schema/purchase-conflict-details.schema.json +5 -1
- package/artifacts/schema/purchase-hold-reason.schema.json +5 -1
- package/artifacts/schema/purchase-intent-response.schema.json +237 -4
- package/artifacts/schema/support-session-info.schema.json +39 -0
- package/artifacts/schema/support-token-request.schema.json +21 -0
- package/artifacts/schema/support-token-response.schema.json +75 -0
- package/dist/billing.d.ts +229 -0
- package/dist/billing.js +88 -4
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +32 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +5 -1
- package/dist/routes.js +51 -4
- package/dist/support.d.ts +126 -0
- package/dist/support.js +109 -0
- package/package.json +1 -1
package/artifacts/routes.json
CHANGED
|
@@ -168,6 +168,29 @@
|
|
|
168
168
|
"transport": "http",
|
|
169
169
|
"notes": "No Owner tier: this can only ever touch the caller's own row, so there is nothing for a tier check to gate. Saving the name already held writes nothing and records no audit event — the org activity stream reaches every developer with the console open, and an event for a no-op would misreport that something changed."
|
|
170
170
|
},
|
|
171
|
+
{
|
|
172
|
+
"method": "POST",
|
|
173
|
+
"path": "/api/auth/support/end",
|
|
174
|
+
"section": "developer-auth",
|
|
175
|
+
"summary": "Ends the calling support session immediately, from the console side.",
|
|
176
|
+
"audience": "internal",
|
|
177
|
+
"auth": "developer",
|
|
178
|
+
"rateLimited": false,
|
|
179
|
+
"ownerTier": false,
|
|
180
|
+
"status": 204,
|
|
181
|
+
"params": [],
|
|
182
|
+
"query": null,
|
|
183
|
+
"request": null,
|
|
184
|
+
"response": null,
|
|
185
|
+
"errors": [
|
|
186
|
+
"unauthorized",
|
|
187
|
+
"token_expired",
|
|
188
|
+
"token_revoked",
|
|
189
|
+
"forbidden"
|
|
190
|
+
],
|
|
191
|
+
"transport": "http",
|
|
192
|
+
"notes": "Internal: the console calls this so the person a support session is driving can end it themselves — the counterpart to the operator side's `support_session_end` command, each ending the same session through its own path. The bearer must be a support token (`kind: 'support'`, `aud: 'console'`, minted by `POST /console/support/token`); any other token, including an ordinary developer session, answers `403 forbidden`. The session row behind the token is re-read on every request rather than trusted from its own claims, so a session already ended elsewhere is reflected here immediately."
|
|
193
|
+
},
|
|
171
194
|
{
|
|
172
195
|
"method": "GET",
|
|
173
196
|
"path": "/api/auth/two-factor",
|
|
@@ -3326,6 +3349,26 @@
|
|
|
3326
3349
|
"transport": "http",
|
|
3327
3350
|
"notes": "Called by the console's own server, never by a browser. Refusals use RFC 6749 §5.2's flat `oauthError` shape — it is a token endpoint, and that is the dialect a caller of one expects — so it emits none of the codes in this reference. Proof of possession is checked before the replay check, and the single-use consume is atomic, so exactly one caller ever mints. The Org Admins membership is re-read here: the code was minted earlier, and a user moved out in between must not get a console session."
|
|
3328
3351
|
},
|
|
3352
|
+
{
|
|
3353
|
+
"method": "POST",
|
|
3354
|
+
"path": "/console/support/token",
|
|
3355
|
+
"section": "developer-auth",
|
|
3356
|
+
"summary": "Exchanges an operator's one-time support grant for a console session scoped to one org.",
|
|
3357
|
+
"audience": "internal",
|
|
3358
|
+
"auth": "none",
|
|
3359
|
+
"rateLimited": true,
|
|
3360
|
+
"ownerTier": false,
|
|
3361
|
+
"status": 200,
|
|
3362
|
+
"params": [],
|
|
3363
|
+
"query": null,
|
|
3364
|
+
"request": "support-token-request",
|
|
3365
|
+
"response": "support-token-response",
|
|
3366
|
+
"errors": [
|
|
3367
|
+
"rate_limited"
|
|
3368
|
+
],
|
|
3369
|
+
"transport": "http",
|
|
3370
|
+
"notes": "Called by the console's own server, never by a browser — server to server only, exactly like `/console/oauth/token` beside it, but rate-limited where that one is not: the grant this exchanges is short-lived and worth guessing at, which a replay of the code exchange is not. `rate_limited` is the one code in this reference it can still answer, from the limiter itself, before the route's own dialect applies. Every other refusal uses the same RFC 6749 §5.2 flat `oauthError` shape, so this emits no other code in this reference: `invalid_grant` for a grant that is unknown, already used or expired, or for a verifier that does not match. Proof of possession is checked before the replay check, and the single-use consume is atomic, so exactly one caller ever mints from a given grant. The minted access token carries `kind: 'support'` and `aud: 'console'`, lives at most sixty minutes with no extension, and carries **no refresh token**: a support session that outlives its ceiling is a new grant and a new exchange, not a renewal. The session starts in `read` mode; switching one to `edit` is the operator side's `support_session_edit` command, not anything this route does."
|
|
3371
|
+
},
|
|
3329
3372
|
{
|
|
3330
3373
|
"method": "GET",
|
|
3331
3374
|
"path": "/app/:appIdentifier/logo",
|
|
@@ -6827,7 +6870,7 @@
|
|
|
6827
6870
|
"not_found"
|
|
6828
6871
|
],
|
|
6829
6872
|
"transport": "http",
|
|
6830
|
-
"notes": "Rendered once, with `pdfkit`, when the invoice is issued, and stored as bytes — an issued invoice never changes, so this always answers the same PDF for the same id. `404 not_found` for an unknown id or one from another org."
|
|
6873
|
+
"notes": "Rendered once, with `pdfkit`, when the invoice is issued, and stored as bytes — an issued invoice never changes, so this always answers the same PDF for the same id. `404 not_found` for an unknown id or one from another org. This reads historical Cloud invoices only: a due charge has no PDF of its own here — its eventual Lexware invoice is a document, read through `GET /api/billing/documents/:id/file`."
|
|
6831
6874
|
},
|
|
6832
6875
|
{
|
|
6833
6876
|
"method": "GET",
|
|
@@ -6931,7 +6974,41 @@
|
|
|
6931
6974
|
"params": [
|
|
6932
6975
|
{
|
|
6933
6976
|
"name": "id",
|
|
6934
|
-
"description": "The invoice id, from `billingInvoice.id`, of the open invoice to pay — or a due charge's id, from `dunning.invoice_id`."
|
|
6977
|
+
"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`."
|
|
6978
|
+
}
|
|
6979
|
+
],
|
|
6980
|
+
"query": null,
|
|
6981
|
+
"request": "invoice-pay-request",
|
|
6982
|
+
"response": "checkout-response",
|
|
6983
|
+
"errors": [
|
|
6984
|
+
"validation_error",
|
|
6985
|
+
"unauthorized",
|
|
6986
|
+
"token_expired",
|
|
6987
|
+
"token_revoked",
|
|
6988
|
+
"tier_required",
|
|
6989
|
+
"not_found",
|
|
6990
|
+
"target_state_conflict",
|
|
6991
|
+
"rate_limited",
|
|
6992
|
+
"billing_unavailable",
|
|
6993
|
+
"payment_provider_unavailable"
|
|
6994
|
+
],
|
|
6995
|
+
"transport": "http",
|
|
6996
|
+
"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."
|
|
6997
|
+
},
|
|
6998
|
+
{
|
|
6999
|
+
"method": "POST",
|
|
7000
|
+
"path": "/api/billing/charges/:id/pay",
|
|
7001
|
+
"section": "billing",
|
|
7002
|
+
"summary": "Records an owner-confirmed payment intent for a due Lexware-issuer charge.",
|
|
7003
|
+
"audience": "developer",
|
|
7004
|
+
"auth": "developer",
|
|
7005
|
+
"rateLimited": true,
|
|
7006
|
+
"ownerTier": true,
|
|
7007
|
+
"status": 201,
|
|
7008
|
+
"params": [
|
|
7009
|
+
{
|
|
7010
|
+
"name": "id",
|
|
7011
|
+
"description": "The due charge id, from `billingCharge.id` in `GET /api/billing`'s `charges`."
|
|
6935
7012
|
}
|
|
6936
7013
|
],
|
|
6937
7014
|
"query": null,
|
|
@@ -6950,7 +7027,7 @@
|
|
|
6950
7027
|
"payment_provider_unavailable"
|
|
6951
7028
|
],
|
|
6952
7029
|
"transport": "http",
|
|
6953
|
-
"notes": "The required operation_key binds the org,
|
|
7030
|
+
"notes": "The required operation_key binds the org, charge and request, exactly like POST /api/billing/invoices/:id/pay; reuse with changed input is 409 target_state_conflict (purchaseConflictDetails). :id is a due charge's own id (billingCharge.id) — never a historical Cloud invoice; an invoice id, an unknown id or one from another org all answer 404 not_found alike. Recheck current buyer eligibility, the charge's own status and the owed amount before every new provider call: a charge already paid, cancelled or uncollectible is invoice_not_open, a typed 409 conflict. Pending/eligible/held has no redirect; after recovery the owner must confirm the current quote. Already-created payments retain their 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."
|
|
6954
7031
|
},
|
|
6955
7032
|
{
|
|
6956
7033
|
"method": "POST",
|
|
@@ -448,7 +448,7 @@
|
|
|
448
448
|
"type": "string",
|
|
449
449
|
"format": "uuid",
|
|
450
450
|
"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)$",
|
|
451
|
-
"description": "
|
|
451
|
+
"description": "What dunning is chasing: a historical open `FL-…` invoice, or a due charge. Before the issuer cutover a due charge appears here only while the payer's VAT ID is unsettled; it has no number yet, is not in `invoices`, and `POST /api/billing/invoices/:id/pay` takes either. After the cutover this is always a due charge (in `charges`): pay it with `POST /api/billing/charges/:id/pay`."
|
|
452
452
|
},
|
|
453
453
|
"gross_cents": {
|
|
454
454
|
"type": "integer",
|
|
@@ -651,6 +651,14 @@
|
|
|
651
651
|
},
|
|
652
652
|
"description": "What a payment-method change may offer right now, so a client offers exactly what the cloud accepts. `applepay` is absent when it needs an open invoice and none is open; `[]` when the org has no billing account."
|
|
653
653
|
},
|
|
654
|
+
"issuer": {
|
|
655
|
+
"type": "string",
|
|
656
|
+
"enum": [
|
|
657
|
+
"cloud",
|
|
658
|
+
"lexware"
|
|
659
|
+
],
|
|
660
|
+
"description": "Which system issues this org's charges: `cloud` before the issuer cutover, or `lexware` after it."
|
|
661
|
+
},
|
|
654
662
|
"invoices": {
|
|
655
663
|
"type": "array",
|
|
656
664
|
"items": {
|
|
@@ -728,7 +736,226 @@
|
|
|
728
736
|
],
|
|
729
737
|
"additionalProperties": false
|
|
730
738
|
},
|
|
731
|
-
"description": "Newest first, at most 24."
|
|
739
|
+
"description": "Cloud-issued invoices from before the issuer cutover; read-only, never grows after it. Newest first, at most 24."
|
|
740
|
+
},
|
|
741
|
+
"charges": {
|
|
742
|
+
"type": "array",
|
|
743
|
+
"items": {
|
|
744
|
+
"type": "object",
|
|
745
|
+
"properties": {
|
|
746
|
+
"id": {
|
|
747
|
+
"type": "string",
|
|
748
|
+
"format": "uuid",
|
|
749
|
+
"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)$",
|
|
750
|
+
"description": "The due charge's id — never a Cloud invoice number. Pay it with `POST /api/billing/charges/:id/pay`."
|
|
751
|
+
},
|
|
752
|
+
"kind": {
|
|
753
|
+
"type": "string",
|
|
754
|
+
"enum": [
|
|
755
|
+
"first",
|
|
756
|
+
"renewal",
|
|
757
|
+
"change"
|
|
758
|
+
],
|
|
759
|
+
"description": "What caused the charge: the first charge after checkout, a scheduled renewal, or a mid-period plan change."
|
|
760
|
+
},
|
|
761
|
+
"status": {
|
|
762
|
+
"type": "string",
|
|
763
|
+
"enum": [
|
|
764
|
+
"due",
|
|
765
|
+
"paid",
|
|
766
|
+
"uncollectible",
|
|
767
|
+
"cancelled"
|
|
768
|
+
],
|
|
769
|
+
"description": "The charge's own status. A charged back or manually refunded charge stays `paid` — refunds and chargebacks are handled in Mollie or Lexware by hand; this status and the invoice it names are unchanged, and the resulting Lexware credit note appears under `GET /api/billing/documents` instead."
|
|
770
|
+
},
|
|
771
|
+
"currency": {
|
|
772
|
+
"type": "string",
|
|
773
|
+
"const": "eur",
|
|
774
|
+
"description": "Every charge billed through Lexware is EUR."
|
|
775
|
+
},
|
|
776
|
+
"net_cents": {
|
|
777
|
+
"type": "integer",
|
|
778
|
+
"minimum": 0,
|
|
779
|
+
"maximum": 9007199254740991,
|
|
780
|
+
"description": "The charge, excluding VAT, in integer cents."
|
|
781
|
+
},
|
|
782
|
+
"vat_rate_percent": {
|
|
783
|
+
"type": "integer",
|
|
784
|
+
"minimum": 0,
|
|
785
|
+
"maximum": 100,
|
|
786
|
+
"description": "The VAT rate applied, in whole percent."
|
|
787
|
+
},
|
|
788
|
+
"vat_cents": {
|
|
789
|
+
"type": "integer",
|
|
790
|
+
"minimum": 0,
|
|
791
|
+
"maximum": 9007199254740991,
|
|
792
|
+
"description": "VAT, in integer cents (`vatCents`)."
|
|
793
|
+
},
|
|
794
|
+
"gross_cents": {
|
|
795
|
+
"type": "integer",
|
|
796
|
+
"minimum": 0,
|
|
797
|
+
"maximum": 9007199254740991,
|
|
798
|
+
"description": "Net plus VAT, in integer cents."
|
|
799
|
+
},
|
|
800
|
+
"period_start": {
|
|
801
|
+
"type": "string",
|
|
802
|
+
"format": "date-time",
|
|
803
|
+
"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))$",
|
|
804
|
+
"description": "The covered period's start."
|
|
805
|
+
},
|
|
806
|
+
"period_end": {
|
|
807
|
+
"type": "string",
|
|
808
|
+
"format": "date-time",
|
|
809
|
+
"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))$",
|
|
810
|
+
"description": "The covered period's end."
|
|
811
|
+
},
|
|
812
|
+
"due_at": {
|
|
813
|
+
"type": "string",
|
|
814
|
+
"format": "date-time",
|
|
815
|
+
"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))$",
|
|
816
|
+
"description": "When this charge is due."
|
|
817
|
+
},
|
|
818
|
+
"paid_at": {
|
|
819
|
+
"anyOf": [
|
|
820
|
+
{
|
|
821
|
+
"type": "string",
|
|
822
|
+
"format": "date-time",
|
|
823
|
+
"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))$"
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
"type": "null"
|
|
827
|
+
}
|
|
828
|
+
],
|
|
829
|
+
"description": "When this charge was paid, or `null` while unpaid."
|
|
830
|
+
},
|
|
831
|
+
"invoice": {
|
|
832
|
+
"oneOf": [
|
|
833
|
+
{
|
|
834
|
+
"type": "object",
|
|
835
|
+
"properties": {
|
|
836
|
+
"state": {
|
|
837
|
+
"type": "string",
|
|
838
|
+
"const": "not_issued",
|
|
839
|
+
"description": "Not collected (due, a failed retry, or uncollectible): no invoice exists."
|
|
840
|
+
}
|
|
841
|
+
},
|
|
842
|
+
"required": [
|
|
843
|
+
"state"
|
|
844
|
+
],
|
|
845
|
+
"additionalProperties": false
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"type": "object",
|
|
849
|
+
"properties": {
|
|
850
|
+
"state": {
|
|
851
|
+
"type": "string",
|
|
852
|
+
"const": "pending",
|
|
853
|
+
"description": "Collected; the Lexware invoice is not yet confirmed."
|
|
854
|
+
}
|
|
855
|
+
},
|
|
856
|
+
"required": [
|
|
857
|
+
"state"
|
|
858
|
+
],
|
|
859
|
+
"additionalProperties": false
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
"type": "object",
|
|
863
|
+
"properties": {
|
|
864
|
+
"state": {
|
|
865
|
+
"type": "string",
|
|
866
|
+
"const": "issued",
|
|
867
|
+
"description": "Lexware has confirmed the invoice."
|
|
868
|
+
},
|
|
869
|
+
"document_id": {
|
|
870
|
+
"type": "string",
|
|
871
|
+
"format": "uuid",
|
|
872
|
+
"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)$",
|
|
873
|
+
"description": "The Lexware document's id — read it with `GET /api/billing/documents/:id`."
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
"required": [
|
|
877
|
+
"state",
|
|
878
|
+
"document_id"
|
|
879
|
+
],
|
|
880
|
+
"additionalProperties": false
|
|
881
|
+
}
|
|
882
|
+
],
|
|
883
|
+
"description": "Whether a Lexware invoice exists for this charge yet, and which document it names once it does."
|
|
884
|
+
}
|
|
885
|
+
},
|
|
886
|
+
"required": [
|
|
887
|
+
"id",
|
|
888
|
+
"kind",
|
|
889
|
+
"status",
|
|
890
|
+
"currency",
|
|
891
|
+
"net_cents",
|
|
892
|
+
"vat_rate_percent",
|
|
893
|
+
"vat_cents",
|
|
894
|
+
"gross_cents",
|
|
895
|
+
"period_start",
|
|
896
|
+
"period_end",
|
|
897
|
+
"due_at",
|
|
898
|
+
"paid_at",
|
|
899
|
+
"invoice"
|
|
900
|
+
],
|
|
901
|
+
"additionalProperties": false,
|
|
902
|
+
"allOf": [
|
|
903
|
+
{
|
|
904
|
+
"if": {
|
|
905
|
+
"properties": {
|
|
906
|
+
"status": {
|
|
907
|
+
"const": "paid"
|
|
908
|
+
}
|
|
909
|
+
},
|
|
910
|
+
"required": [
|
|
911
|
+
"status"
|
|
912
|
+
]
|
|
913
|
+
},
|
|
914
|
+
"then": {
|
|
915
|
+
"properties": {
|
|
916
|
+
"invoice": {
|
|
917
|
+
"properties": {
|
|
918
|
+
"state": {
|
|
919
|
+
"enum": [
|
|
920
|
+
"pending",
|
|
921
|
+
"issued"
|
|
922
|
+
]
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
"if": {
|
|
931
|
+
"properties": {
|
|
932
|
+
"status": {
|
|
933
|
+
"enum": [
|
|
934
|
+
"due",
|
|
935
|
+
"uncollectible",
|
|
936
|
+
"cancelled"
|
|
937
|
+
]
|
|
938
|
+
}
|
|
939
|
+
},
|
|
940
|
+
"required": [
|
|
941
|
+
"status"
|
|
942
|
+
]
|
|
943
|
+
},
|
|
944
|
+
"then": {
|
|
945
|
+
"properties": {
|
|
946
|
+
"invoice": {
|
|
947
|
+
"properties": {
|
|
948
|
+
"state": {
|
|
949
|
+
"const": "not_issued"
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
]
|
|
957
|
+
},
|
|
958
|
+
"description": "Newest first, at most 24. Lists only due charges with issuer `lexware` — never a pre-cutover charge, a legacy payment (legacy_issued/legacy_held/legacy_person/legacy_usd) or a late USD collection: none of those carry a Lexware intent, and they stay in `invoices` or nowhere. `[]` while `issuer` is `cloud`."
|
|
732
959
|
}
|
|
733
960
|
},
|
|
734
961
|
"required": [
|
|
@@ -736,7 +963,9 @@
|
|
|
736
963
|
"account",
|
|
737
964
|
"payment_method",
|
|
738
965
|
"payment_method_options",
|
|
739
|
-
"
|
|
966
|
+
"issuer",
|
|
967
|
+
"invoices",
|
|
968
|
+
"charges"
|
|
740
969
|
],
|
|
741
970
|
"additionalProperties": false,
|
|
742
971
|
"description": "The billing view after the change."
|
|
@@ -1034,7 +1263,11 @@
|
|
|
1034
1263
|
"enum": [
|
|
1035
1264
|
"legacy_usd_invoice",
|
|
1036
1265
|
"legacy_payer_unresolved",
|
|
1037
|
-
"mandate_policy_unresolved"
|
|
1266
|
+
"mandate_policy_unresolved",
|
|
1267
|
+
"lexware_contact_pending",
|
|
1268
|
+
"lexware_contact_changed",
|
|
1269
|
+
"issuer_cutover_in_progress",
|
|
1270
|
+
"lexware_issuance_paused"
|
|
1038
1271
|
]
|
|
1039
1272
|
},
|
|
1040
1273
|
"original_amount": {
|
|
@@ -1822,7 +2055,7 @@
|
|
|
1822
2055
|
"type": "string",
|
|
1823
2056
|
"format": "uuid",
|
|
1824
2057
|
"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)$",
|
|
1825
|
-
"description": "
|
|
2058
|
+
"description": "What dunning is chasing: a historical open `FL-…` invoice, or a due charge. Before the issuer cutover a due charge appears here only while the payer's VAT ID is unsettled; it has no number yet, is not in `invoices`, and `POST /api/billing/invoices/:id/pay` takes either. After the cutover this is always a due charge (in `charges`): pay it with `POST /api/billing/charges/:id/pay`."
|
|
1826
2059
|
},
|
|
1827
2060
|
"gross_cents": {
|
|
1828
2061
|
"type": "integer",
|
|
@@ -2025,6 +2258,14 @@
|
|
|
2025
2258
|
},
|
|
2026
2259
|
"description": "What a payment-method change may offer right now, so a client offers exactly what the cloud accepts. `applepay` is absent when it needs an open invoice and none is open; `[]` when the org has no billing account."
|
|
2027
2260
|
},
|
|
2261
|
+
"issuer": {
|
|
2262
|
+
"type": "string",
|
|
2263
|
+
"enum": [
|
|
2264
|
+
"cloud",
|
|
2265
|
+
"lexware"
|
|
2266
|
+
],
|
|
2267
|
+
"description": "Which system issues this org's charges: `cloud` before the issuer cutover, or `lexware` after it."
|
|
2268
|
+
},
|
|
2028
2269
|
"invoices": {
|
|
2029
2270
|
"type": "array",
|
|
2030
2271
|
"items": {
|
|
@@ -2102,7 +2343,226 @@
|
|
|
2102
2343
|
],
|
|
2103
2344
|
"additionalProperties": false
|
|
2104
2345
|
},
|
|
2105
|
-
"description": "Newest first, at most 24."
|
|
2346
|
+
"description": "Cloud-issued invoices from before the issuer cutover; read-only, never grows after it. Newest first, at most 24."
|
|
2347
|
+
},
|
|
2348
|
+
"charges": {
|
|
2349
|
+
"type": "array",
|
|
2350
|
+
"items": {
|
|
2351
|
+
"type": "object",
|
|
2352
|
+
"properties": {
|
|
2353
|
+
"id": {
|
|
2354
|
+
"type": "string",
|
|
2355
|
+
"format": "uuid",
|
|
2356
|
+
"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)$",
|
|
2357
|
+
"description": "The due charge's id — never a Cloud invoice number. Pay it with `POST /api/billing/charges/:id/pay`."
|
|
2358
|
+
},
|
|
2359
|
+
"kind": {
|
|
2360
|
+
"type": "string",
|
|
2361
|
+
"enum": [
|
|
2362
|
+
"first",
|
|
2363
|
+
"renewal",
|
|
2364
|
+
"change"
|
|
2365
|
+
],
|
|
2366
|
+
"description": "What caused the charge: the first charge after checkout, a scheduled renewal, or a mid-period plan change."
|
|
2367
|
+
},
|
|
2368
|
+
"status": {
|
|
2369
|
+
"type": "string",
|
|
2370
|
+
"enum": [
|
|
2371
|
+
"due",
|
|
2372
|
+
"paid",
|
|
2373
|
+
"uncollectible",
|
|
2374
|
+
"cancelled"
|
|
2375
|
+
],
|
|
2376
|
+
"description": "The charge's own status. A charged back or manually refunded charge stays `paid` — refunds and chargebacks are handled in Mollie or Lexware by hand; this status and the invoice it names are unchanged, and the resulting Lexware credit note appears under `GET /api/billing/documents` instead."
|
|
2377
|
+
},
|
|
2378
|
+
"currency": {
|
|
2379
|
+
"type": "string",
|
|
2380
|
+
"const": "eur",
|
|
2381
|
+
"description": "Every charge billed through Lexware is EUR."
|
|
2382
|
+
},
|
|
2383
|
+
"net_cents": {
|
|
2384
|
+
"type": "integer",
|
|
2385
|
+
"minimum": 0,
|
|
2386
|
+
"maximum": 9007199254740991,
|
|
2387
|
+
"description": "The charge, excluding VAT, in integer cents."
|
|
2388
|
+
},
|
|
2389
|
+
"vat_rate_percent": {
|
|
2390
|
+
"type": "integer",
|
|
2391
|
+
"minimum": 0,
|
|
2392
|
+
"maximum": 100,
|
|
2393
|
+
"description": "The VAT rate applied, in whole percent."
|
|
2394
|
+
},
|
|
2395
|
+
"vat_cents": {
|
|
2396
|
+
"type": "integer",
|
|
2397
|
+
"minimum": 0,
|
|
2398
|
+
"maximum": 9007199254740991,
|
|
2399
|
+
"description": "VAT, in integer cents (`vatCents`)."
|
|
2400
|
+
},
|
|
2401
|
+
"gross_cents": {
|
|
2402
|
+
"type": "integer",
|
|
2403
|
+
"minimum": 0,
|
|
2404
|
+
"maximum": 9007199254740991,
|
|
2405
|
+
"description": "Net plus VAT, in integer cents."
|
|
2406
|
+
},
|
|
2407
|
+
"period_start": {
|
|
2408
|
+
"type": "string",
|
|
2409
|
+
"format": "date-time",
|
|
2410
|
+
"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))$",
|
|
2411
|
+
"description": "The covered period's start."
|
|
2412
|
+
},
|
|
2413
|
+
"period_end": {
|
|
2414
|
+
"type": "string",
|
|
2415
|
+
"format": "date-time",
|
|
2416
|
+
"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))$",
|
|
2417
|
+
"description": "The covered period's end."
|
|
2418
|
+
},
|
|
2419
|
+
"due_at": {
|
|
2420
|
+
"type": "string",
|
|
2421
|
+
"format": "date-time",
|
|
2422
|
+
"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))$",
|
|
2423
|
+
"description": "When this charge is due."
|
|
2424
|
+
},
|
|
2425
|
+
"paid_at": {
|
|
2426
|
+
"anyOf": [
|
|
2427
|
+
{
|
|
2428
|
+
"type": "string",
|
|
2429
|
+
"format": "date-time",
|
|
2430
|
+
"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))$"
|
|
2431
|
+
},
|
|
2432
|
+
{
|
|
2433
|
+
"type": "null"
|
|
2434
|
+
}
|
|
2435
|
+
],
|
|
2436
|
+
"description": "When this charge was paid, or `null` while unpaid."
|
|
2437
|
+
},
|
|
2438
|
+
"invoice": {
|
|
2439
|
+
"oneOf": [
|
|
2440
|
+
{
|
|
2441
|
+
"type": "object",
|
|
2442
|
+
"properties": {
|
|
2443
|
+
"state": {
|
|
2444
|
+
"type": "string",
|
|
2445
|
+
"const": "not_issued",
|
|
2446
|
+
"description": "Not collected (due, a failed retry, or uncollectible): no invoice exists."
|
|
2447
|
+
}
|
|
2448
|
+
},
|
|
2449
|
+
"required": [
|
|
2450
|
+
"state"
|
|
2451
|
+
],
|
|
2452
|
+
"additionalProperties": false
|
|
2453
|
+
},
|
|
2454
|
+
{
|
|
2455
|
+
"type": "object",
|
|
2456
|
+
"properties": {
|
|
2457
|
+
"state": {
|
|
2458
|
+
"type": "string",
|
|
2459
|
+
"const": "pending",
|
|
2460
|
+
"description": "Collected; the Lexware invoice is not yet confirmed."
|
|
2461
|
+
}
|
|
2462
|
+
},
|
|
2463
|
+
"required": [
|
|
2464
|
+
"state"
|
|
2465
|
+
],
|
|
2466
|
+
"additionalProperties": false
|
|
2467
|
+
},
|
|
2468
|
+
{
|
|
2469
|
+
"type": "object",
|
|
2470
|
+
"properties": {
|
|
2471
|
+
"state": {
|
|
2472
|
+
"type": "string",
|
|
2473
|
+
"const": "issued",
|
|
2474
|
+
"description": "Lexware has confirmed the invoice."
|
|
2475
|
+
},
|
|
2476
|
+
"document_id": {
|
|
2477
|
+
"type": "string",
|
|
2478
|
+
"format": "uuid",
|
|
2479
|
+
"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)$",
|
|
2480
|
+
"description": "The Lexware document's id — read it with `GET /api/billing/documents/:id`."
|
|
2481
|
+
}
|
|
2482
|
+
},
|
|
2483
|
+
"required": [
|
|
2484
|
+
"state",
|
|
2485
|
+
"document_id"
|
|
2486
|
+
],
|
|
2487
|
+
"additionalProperties": false
|
|
2488
|
+
}
|
|
2489
|
+
],
|
|
2490
|
+
"description": "Whether a Lexware invoice exists for this charge yet, and which document it names once it does."
|
|
2491
|
+
}
|
|
2492
|
+
},
|
|
2493
|
+
"required": [
|
|
2494
|
+
"id",
|
|
2495
|
+
"kind",
|
|
2496
|
+
"status",
|
|
2497
|
+
"currency",
|
|
2498
|
+
"net_cents",
|
|
2499
|
+
"vat_rate_percent",
|
|
2500
|
+
"vat_cents",
|
|
2501
|
+
"gross_cents",
|
|
2502
|
+
"period_start",
|
|
2503
|
+
"period_end",
|
|
2504
|
+
"due_at",
|
|
2505
|
+
"paid_at",
|
|
2506
|
+
"invoice"
|
|
2507
|
+
],
|
|
2508
|
+
"additionalProperties": false,
|
|
2509
|
+
"allOf": [
|
|
2510
|
+
{
|
|
2511
|
+
"if": {
|
|
2512
|
+
"properties": {
|
|
2513
|
+
"status": {
|
|
2514
|
+
"const": "paid"
|
|
2515
|
+
}
|
|
2516
|
+
},
|
|
2517
|
+
"required": [
|
|
2518
|
+
"status"
|
|
2519
|
+
]
|
|
2520
|
+
},
|
|
2521
|
+
"then": {
|
|
2522
|
+
"properties": {
|
|
2523
|
+
"invoice": {
|
|
2524
|
+
"properties": {
|
|
2525
|
+
"state": {
|
|
2526
|
+
"enum": [
|
|
2527
|
+
"pending",
|
|
2528
|
+
"issued"
|
|
2529
|
+
]
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
},
|
|
2536
|
+
{
|
|
2537
|
+
"if": {
|
|
2538
|
+
"properties": {
|
|
2539
|
+
"status": {
|
|
2540
|
+
"enum": [
|
|
2541
|
+
"due",
|
|
2542
|
+
"uncollectible",
|
|
2543
|
+
"cancelled"
|
|
2544
|
+
]
|
|
2545
|
+
}
|
|
2546
|
+
},
|
|
2547
|
+
"required": [
|
|
2548
|
+
"status"
|
|
2549
|
+
]
|
|
2550
|
+
},
|
|
2551
|
+
"then": {
|
|
2552
|
+
"properties": {
|
|
2553
|
+
"invoice": {
|
|
2554
|
+
"properties": {
|
|
2555
|
+
"state": {
|
|
2556
|
+
"const": "not_issued"
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
]
|
|
2564
|
+
},
|
|
2565
|
+
"description": "Newest first, at most 24. Lists only due charges with issuer `lexware` — never a pre-cutover charge, a legacy payment (legacy_issued/legacy_held/legacy_person/legacy_usd) or a late USD collection: none of those carry a Lexware intent, and they stay in `invoices` or nowhere. `[]` while `issuer` is `cloud`."
|
|
2106
2566
|
}
|
|
2107
2567
|
},
|
|
2108
2568
|
"required": [
|
|
@@ -2110,7 +2570,9 @@
|
|
|
2110
2570
|
"account",
|
|
2111
2571
|
"payment_method",
|
|
2112
2572
|
"payment_method_options",
|
|
2113
|
-
"
|
|
2573
|
+
"issuer",
|
|
2574
|
+
"invoices",
|
|
2575
|
+
"charges"
|
|
2114
2576
|
],
|
|
2115
2577
|
"additionalProperties": false,
|
|
2116
2578
|
"description": "The billing view after the change."
|