@leaflow/sdk 0.50.0 → 0.52.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/v1/index.d.ts +3 -17
- package/dist/billing/v1/schema.d.ts +162 -367
- package/package.json +1 -1
|
@@ -56,12 +56,10 @@ export type CancelSubscriptionResult = operations["cancel-subscription"]["respon
|
|
|
56
56
|
export type CancelSubscriptionQuery = operations["cancel-subscription"]["parameters"]["query"];
|
|
57
57
|
/** `GET /account/v1/billing-accounts/{accountKey}/top-ups/{paymentId}` 成功时的响应体。 */
|
|
58
58
|
export type ReadTopUpResult = operations["read-top-up"]["responses"][200]["content"]["application/json"];
|
|
59
|
-
/** `GET /account/v1/billing-accounts/{accountKey}/payment-
|
|
60
|
-
export type
|
|
61
|
-
/** `POST /account/v1/billing-accounts/{accountKey}/payment-
|
|
59
|
+
/** `GET /account/v1/billing-accounts/{accountKey}/payment-methods` 成功时的响应体。 */
|
|
60
|
+
export type ListPaymentMethodsResult = operations["list-payment-methods"]["responses"][200]["content"]["application/json"];
|
|
61
|
+
/** `POST /account/v1/billing-accounts/{accountKey}/payment-methods` 成功时的响应体。 */
|
|
62
62
|
export type StartPaymentMethodSetupResult = operations["start-payment-method-setup"]["responses"][200]["content"]["application/json"];
|
|
63
|
-
/** `POST /account/v1/billing-accounts/{accountKey}/billing-portal` 成功时的响应体。 */
|
|
64
|
-
export type StartBillingPortalResult = operations["start-billing-portal"]["responses"][200]["content"]["application/json"];
|
|
65
63
|
/** `GET /account/v1/billing-accounts/{accountKey}/offers` 成功时的响应体。 */
|
|
66
64
|
export type ListOffersResult = operations["list-offers"]["responses"][200]["content"]["application/json"];
|
|
67
65
|
/** `POST /account/v1/billing-accounts/{accountKey}/offers/{offerKey}/purchase` 成功时的响应体。 */
|
|
@@ -70,15 +68,3 @@ export type PurchaseOfferResult = operations["purchase-offer"]["responses"][200]
|
|
|
70
68
|
export type PurchaseOfferQuery = operations["purchase-offer"]["parameters"]["query"];
|
|
71
69
|
/** `GET /account/v1/billing-accounts/{accountKey}/prepaid-assets` 成功时的响应体。 */
|
|
72
70
|
export type ListPrepaidAssetsResult = operations["list-prepaid-assets"]["responses"][200]["content"]["application/json"];
|
|
73
|
-
/** `PUT /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal` 成功时的响应体。 */
|
|
74
|
-
export type SetRenewalStatusResult = operations["set-renewal-status"]["responses"][200]["content"]["application/json"];
|
|
75
|
-
/** `PUT /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal` 的请求体。 */
|
|
76
|
-
export type SetRenewalStatusBody = NonNullable<operations["set-renewal-status"]["requestBody"]>["content"]["application/json"];
|
|
77
|
-
/** `GET /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal-quote` 成功时的响应体。 */
|
|
78
|
-
export type QuoteRenewalResult = operations["quote-renewal"]["responses"][200]["content"]["application/json"];
|
|
79
|
-
/** `GET /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal-quote` 的查询参数。 */
|
|
80
|
-
export type QuoteRenewalQuery = operations["quote-renewal"]["parameters"]["query"];
|
|
81
|
-
/** `POST /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renew` 成功时的响应体。 */
|
|
82
|
-
export type RenewPrepaidAssetResult = operations["renew-prepaid-asset"]["responses"][200]["content"]["application/json"];
|
|
83
|
-
/** `POST /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renew` 的请求体。 */
|
|
84
|
-
export type RenewPrepaidAssetBody = NonNullable<operations["renew-prepaid-asset"]["requestBody"]>["content"]["application/json"];
|
|
@@ -598,7 +598,7 @@ export interface paths {
|
|
|
598
598
|
patch?: never;
|
|
599
599
|
trace?: never;
|
|
600
600
|
};
|
|
601
|
-
"/account/v1/billing-accounts/{accountKey}/payment-
|
|
601
|
+
"/account/v1/billing-accounts/{accountKey}/payment-methods": {
|
|
602
602
|
parameters: {
|
|
603
603
|
query?: never;
|
|
604
604
|
header?: never;
|
|
@@ -606,57 +606,50 @@ export interface paths {
|
|
|
606
606
|
cookie?: never;
|
|
607
607
|
};
|
|
608
608
|
/**
|
|
609
|
-
*
|
|
610
|
-
* @description
|
|
609
|
+
* The payment methods on file
|
|
610
|
+
* @description Every method saved against this account, and which one an invoice will be charged to.
|
|
611
611
|
*
|
|
612
|
-
* ##
|
|
612
|
+
* ## Why the brand, last four and expiry are here
|
|
613
613
|
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
*
|
|
617
|
-
*
|
|
614
|
+
* They were deliberately absent while the billing engine held the card, because the answer
|
|
615
|
+
* that mattered — can money be collected — came from the engine, and a page built on the
|
|
616
|
+
* provider's answer could show a method the engine had not recorded. Collection now runs from
|
|
617
|
+
* this service against the provider directly, so there is one answer, and it is the one shown.
|
|
618
618
|
*
|
|
619
|
-
*
|
|
619
|
+
* Expiry is the reason this is worth showing at all: a card expires, the invoice then fails,
|
|
620
|
+
* dunning runs out, and the project stops — with the account holder watching it happen and no
|
|
621
|
+
* indication that a card was the cause.
|
|
620
622
|
*
|
|
621
|
-
*
|
|
622
|
-
*
|
|
623
|
-
* exactly the state in which money cannot be collected — while a page built on the provider's
|
|
624
|
-
* answer would be showing one. What matters here is whether the party that will run the
|
|
625
|
-
* charge believes it can, so the answer comes from that party alone.
|
|
623
|
+
* No other card data exists here. The number, the expiry entered by the holder and the CVC go
|
|
624
|
+
* from the browser to the provider and never reach this platform.
|
|
626
625
|
*
|
|
627
|
-
*
|
|
628
|
-
*
|
|
629
|
-
* ## Read this before offering a paid plan, not after
|
|
630
|
-
*
|
|
631
|
-
* `ready` being false is why the engine refuses to start a paid subscription. Discovering it
|
|
632
|
-
* at purchase time turns a missing payment method into a rejection whose wording is about
|
|
633
|
-
* something else entirely.
|
|
634
|
-
*
|
|
635
|
-
* An account that has never had one returns `ready: false`. That is the normal state of a
|
|
636
|
-
* new account, not an error.
|
|
626
|
+
* An account that has never added one returns an empty list. That is the normal state of a new
|
|
627
|
+
* account, not an error.
|
|
637
628
|
*/
|
|
638
|
-
get: operations["
|
|
629
|
+
get: operations["list-payment-methods"];
|
|
639
630
|
put?: never;
|
|
640
631
|
/**
|
|
641
|
-
*
|
|
642
|
-
* @description
|
|
643
|
-
*
|
|
644
|
-
*
|
|
632
|
+
* Begin adding a payment method
|
|
633
|
+
* @description Starts a session for adding a method, and returns the secret the browser needs to mount the
|
|
634
|
+
* provider's own form.
|
|
635
|
+
*
|
|
636
|
+
* ## The form is embedded, not a redirect
|
|
645
637
|
*
|
|
646
|
-
*
|
|
647
|
-
*
|
|
648
|
-
* the
|
|
638
|
+
* The returned `client_secret` initialises the provider's JavaScript, which renders its form
|
|
639
|
+
* inside an iframe on this platform's own page. **No card data reaches this platform** — the
|
|
640
|
+
* number goes from the browser straight to the provider, exactly as it would on a redirect —
|
|
641
|
+
* but the account holder never leaves the console.
|
|
642
|
+
*
|
|
643
|
+
* A redirect would take them to a page with someone else's branding in the middle of adding a
|
|
644
|
+
* payment method, which is the moment they are most likely to abandon it.
|
|
649
645
|
*
|
|
650
646
|
* ## This is a prerequisite for buying a plan, not a convenience
|
|
651
647
|
*
|
|
652
|
-
* A plan is charged by invoice, and the invoice is collected from
|
|
653
|
-
*
|
|
654
|
-
*
|
|
648
|
+
* A plan is charged by invoice, and the invoice is collected from a method on file. Discovering
|
|
649
|
+
* that none exists at purchase time turns a missing payment method into a rejection whose
|
|
650
|
+
* wording is about something else entirely.
|
|
655
651
|
*
|
|
656
652
|
* It is *not* a prerequisite for topping up: a top-up collects the money there and then.
|
|
657
|
-
*
|
|
658
|
-
* Replacing uses the same operation. The new method becomes the default and the old one stops
|
|
659
|
-
* being used; nothing else about the account changes.
|
|
660
653
|
*/
|
|
661
654
|
post: operations["start-payment-method-setup"];
|
|
662
655
|
delete?: never;
|
|
@@ -665,7 +658,7 @@ export interface paths {
|
|
|
665
658
|
patch?: never;
|
|
666
659
|
trace?: never;
|
|
667
660
|
};
|
|
668
|
-
"/account/v1/billing-accounts/{accountKey}/
|
|
661
|
+
"/account/v1/billing-accounts/{accountKey}/payment-methods/{paymentMethodId}": {
|
|
669
662
|
parameters: {
|
|
670
663
|
query?: never;
|
|
671
664
|
header?: never;
|
|
@@ -674,26 +667,43 @@ export interface paths {
|
|
|
674
667
|
};
|
|
675
668
|
get?: never;
|
|
676
669
|
put?: never;
|
|
670
|
+
post?: never;
|
|
677
671
|
/**
|
|
678
|
-
*
|
|
679
|
-
* @description
|
|
680
|
-
* removed, the billing address changed, and past invoices downloaded.
|
|
681
|
-
*
|
|
682
|
-
* ## Why replacing a card is not a form on this platform
|
|
672
|
+
* Remove a payment method
|
|
673
|
+
* @description Detaches it from this account. Removing the last one is allowed.
|
|
683
674
|
*
|
|
684
|
-
*
|
|
685
|
-
* portal moves the whole interaction to the provider; only a session URL comes back.
|
|
675
|
+
* ## Why removing the last one is not blocked
|
|
686
676
|
*
|
|
687
|
-
*
|
|
677
|
+
* Blocking it leaves an account holder who wants to stop paying with no way out. The cost of
|
|
678
|
+
* allowing it is that later invoices cannot be collected — and that path has notice, a grace
|
|
679
|
+
* period and a way back. A card that cannot be removed is a dead end.
|
|
680
|
+
*/
|
|
681
|
+
delete: operations["remove-payment-method"];
|
|
682
|
+
options?: never;
|
|
683
|
+
head?: never;
|
|
684
|
+
patch?: never;
|
|
685
|
+
trace?: never;
|
|
686
|
+
};
|
|
687
|
+
"/account/v1/billing-accounts/{accountKey}/payment-methods/{paymentMethodId}/default": {
|
|
688
|
+
parameters: {
|
|
689
|
+
query?: never;
|
|
690
|
+
header?: never;
|
|
691
|
+
path?: never;
|
|
692
|
+
cookie?: never;
|
|
693
|
+
};
|
|
694
|
+
get?: never;
|
|
695
|
+
/**
|
|
696
|
+
* Charge invoices to this one
|
|
697
|
+
* @description Makes this the method an invoice is collected from.
|
|
688
698
|
*
|
|
689
|
-
*
|
|
690
|
-
* out, and the projects paid for by this account are suspended for non-payment. Without this
|
|
691
|
-
* operation the account holder watches that happen with nowhere to fix it — adding a card
|
|
692
|
-
* does not help, since that operation only makes sense when there is none.
|
|
699
|
+
* ## It is stored at the provider, not here
|
|
693
700
|
*
|
|
694
|
-
* The
|
|
701
|
+
* The charge itself reads that setting from the provider, so keeping a second copy here would
|
|
702
|
+
* create two answers to the same question. When they disagree the visible symptom is that the
|
|
703
|
+
* account holder changed the default and the charge still went to the old one.
|
|
695
704
|
*/
|
|
696
|
-
|
|
705
|
+
put: operations["set-default-payment-method"];
|
|
706
|
+
post?: never;
|
|
697
707
|
delete?: never;
|
|
698
708
|
options?: never;
|
|
699
709
|
head?: never;
|
|
@@ -783,26 +793,30 @@ export interface paths {
|
|
|
783
793
|
cookie?: never;
|
|
784
794
|
};
|
|
785
795
|
/**
|
|
786
|
-
* What I bought outright
|
|
787
|
-
* @description Everything this account
|
|
796
|
+
* What I bought outright
|
|
797
|
+
* @description Everything this account holds on a term, across every product.
|
|
798
|
+
*
|
|
799
|
+
* ## Nothing here expires on its own
|
|
788
800
|
*
|
|
789
|
-
*
|
|
801
|
+
* A term renews for as long as the seat is held: the engine charges the next period, prorates
|
|
802
|
+
* any change to the second, and stops the moment the seat is given up. So there is no renewal
|
|
803
|
+
* to remember and no expiry to warn about — giving it up means deleting the resource, in the
|
|
804
|
+
* console that owns it.
|
|
790
805
|
*
|
|
791
|
-
*
|
|
792
|
-
*
|
|
793
|
-
*
|
|
794
|
-
* the same reason: the row that matters is the one at the top.
|
|
806
|
+
* What the next period costs and when it falls due is on the charges route. That is read
|
|
807
|
+
* straight from the engine rather than copied here, because a copy is a second answer that
|
|
808
|
+
* drifts without saying so.
|
|
795
809
|
*
|
|
796
810
|
* ## Metered resources are not here
|
|
797
811
|
*
|
|
798
|
-
*
|
|
799
|
-
*
|
|
812
|
+
* They have no term. Listing them would invite renewing something that is already billed by
|
|
813
|
+
* the hour until it is deleted.
|
|
800
814
|
*
|
|
801
815
|
* ## `state` and `desired_state` are both reported
|
|
802
816
|
*
|
|
803
|
-
* A machine stopped
|
|
804
|
-
*
|
|
805
|
-
*
|
|
817
|
+
* A machine stopped for arrears reads `suspended` for both. One being brought back reads
|
|
818
|
+
* `suspended` and `active` — it is on its way. Without the second field those look identical,
|
|
819
|
+
* and a customer who just paid concludes it did not work and pays again.
|
|
806
820
|
*/
|
|
807
821
|
get: operations["list-prepaid-assets"];
|
|
808
822
|
put?: never;
|
|
@@ -813,127 +827,6 @@ export interface paths {
|
|
|
813
827
|
patch?: never;
|
|
814
828
|
trace?: never;
|
|
815
829
|
};
|
|
816
|
-
"/account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal": {
|
|
817
|
-
parameters: {
|
|
818
|
-
query?: never;
|
|
819
|
-
header?: never;
|
|
820
|
-
path?: never;
|
|
821
|
-
cookie?: never;
|
|
822
|
-
};
|
|
823
|
-
get?: never;
|
|
824
|
-
/**
|
|
825
|
-
* Choose what happens when it expires
|
|
826
|
-
* @description Three choices, not two.
|
|
827
|
-
*
|
|
828
|
-
* ## Why automatic renewal has to be opted into
|
|
829
|
-
*
|
|
830
|
-
* Charging someone automatically has to be something they chose. Defaulting to it means a
|
|
831
|
-
* person who wanted to try one month is charged for a second they never agreed to — and that
|
|
832
|
-
* is where chargebacks come from. So a resource bought outright starts on `manual`.
|
|
833
|
-
*
|
|
834
|
-
* ## And why "let it expire" is its own choice, not just "not automatic"
|
|
835
|
-
*
|
|
836
|
-
* `manual` keeps reminding: the notice before expiry is mandatory, because expiry stops the
|
|
837
|
-
* resource. Someone who has decided to let it go does not want those, and the cost of sending
|
|
838
|
-
* them anyway is not annoyance — it is that the reminders get filtered away, taking the ones
|
|
839
|
-
* that mattered with them.
|
|
840
|
-
*
|
|
841
|
-
* ## Turning it on needs a known cycle
|
|
842
|
-
*
|
|
843
|
-
* Renewing automatically has to know for how long, which comes from the last purchase or
|
|
844
|
-
* renewal. A resource adopted into billing, or bought before this was recorded, has no cycle
|
|
845
|
-
* yet: renew it manually once and the cycle is written down.
|
|
846
|
-
*/
|
|
847
|
-
put: operations["set-renewal-status"];
|
|
848
|
-
post?: never;
|
|
849
|
-
delete?: never;
|
|
850
|
-
options?: never;
|
|
851
|
-
head?: never;
|
|
852
|
-
patch?: never;
|
|
853
|
-
trace?: never;
|
|
854
|
-
};
|
|
855
|
-
"/account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal-quote": {
|
|
856
|
-
parameters: {
|
|
857
|
-
query?: never;
|
|
858
|
-
header?: never;
|
|
859
|
-
path?: never;
|
|
860
|
-
cookie?: never;
|
|
861
|
-
};
|
|
862
|
-
/**
|
|
863
|
-
* What renewing this would cost
|
|
864
|
-
* @description Priced the same way the charge is, from the same table, so the number shown is the number
|
|
865
|
-
* taken. Quoting separately from charging is what lets a customer see the price before
|
|
866
|
-
* committing; computing it twice in two places is what makes the two disagree, and a bill that
|
|
867
|
-
* disagrees with the page that sold it is a complaint rather than a bug report.
|
|
868
|
-
*
|
|
869
|
-
* ## Both the current and the resulting expiry are returned
|
|
870
|
-
*
|
|
871
|
-
* Renewing early adds the term to what is left, not to today — otherwise renewing a month
|
|
872
|
-
* ahead throws that month away, and everyone learns to wait until the last moment. Something
|
|
873
|
-
* that lapsed long ago is counted from now instead, because adding to a date in the past
|
|
874
|
-
* produces an expiry that is still in the past.
|
|
875
|
-
*
|
|
876
|
-
* Reporting only the new date leaves the customer unable to tell which of those happened.
|
|
877
|
-
*
|
|
878
|
-
* ## A withdrawn price still quotes
|
|
879
|
-
*
|
|
880
|
-
* Taking a product off sale means stop selling new ones. Refusing renewals as well would stop
|
|
881
|
-
* a batch of existing machines on their expiry date, which is not what the operator pressed
|
|
882
|
-
* that button for.
|
|
883
|
-
*/
|
|
884
|
-
get: operations["quote-renewal"];
|
|
885
|
-
put?: never;
|
|
886
|
-
post?: never;
|
|
887
|
-
delete?: never;
|
|
888
|
-
options?: never;
|
|
889
|
-
head?: never;
|
|
890
|
-
patch?: never;
|
|
891
|
-
trace?: never;
|
|
892
|
-
};
|
|
893
|
-
"/account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renew": {
|
|
894
|
-
parameters: {
|
|
895
|
-
query?: never;
|
|
896
|
-
header?: never;
|
|
897
|
-
path?: never;
|
|
898
|
-
cookie?: never;
|
|
899
|
-
};
|
|
900
|
-
get?: never;
|
|
901
|
-
put?: never;
|
|
902
|
-
/**
|
|
903
|
-
* Renew it
|
|
904
|
-
* @description Takes the money from the balance and pushes the expiry out. The resource itself is not
|
|
905
|
-
* touched — nothing is rebuilt, nothing restarts, the id stays the same.
|
|
906
|
-
*
|
|
907
|
-
* ## An idempotency key is required, not optional
|
|
908
|
-
*
|
|
909
|
-
* Renewal is a pure charge. Unlike creating something, there is no resource whose uniqueness
|
|
910
|
-
* catches a repeat, so a double click is two charges and twice the term — and both calls
|
|
911
|
-
* return success. Letting the field be omitted would mean losing that protection silently, in
|
|
912
|
-
* the one case that looks completely normal until the books are reconciled.
|
|
913
|
-
*
|
|
914
|
-
* Sending the same key again returns the order that was already placed. It does not charge
|
|
915
|
-
* again, and it is not an error: reporting a repeat as a failure makes the caller retry
|
|
916
|
-
* forever, and makes the customer press the button a second time with a fresh key.
|
|
917
|
-
*
|
|
918
|
-
* ## What happens if the balance is short
|
|
919
|
-
*
|
|
920
|
-
* The order is recorded as failed and nothing else changes: no money moves, the expiry stays
|
|
921
|
-
* where it was, and the resource keeps running until its existing term ends. Retrying with the
|
|
922
|
-
* same key after topping up goes through.
|
|
923
|
-
*
|
|
924
|
-
* ## Renewing something that already lapsed brings it back
|
|
925
|
-
*
|
|
926
|
-
* Its term is counted from now, and it is asked to start again. Coming back is the
|
|
927
|
-
* reconciliation loop's job, so it is not instant — which is what `desired_state` on the asset
|
|
928
|
-
* list is for.
|
|
929
|
-
*/
|
|
930
|
-
post: operations["renew-prepaid-asset"];
|
|
931
|
-
delete?: never;
|
|
932
|
-
options?: never;
|
|
933
|
-
head?: never;
|
|
934
|
-
patch?: never;
|
|
935
|
-
trace?: never;
|
|
936
|
-
};
|
|
937
830
|
}
|
|
938
831
|
export type webhooks = Record<string, never>;
|
|
939
832
|
export interface components {
|
|
@@ -1162,7 +1055,6 @@ export interface components {
|
|
|
1162
1055
|
quantity: number;
|
|
1163
1056
|
};
|
|
1164
1057
|
PrepaidAsset: {
|
|
1165
|
-
/** @description Use this to quote and to renew. */
|
|
1166
1058
|
id: string;
|
|
1167
1059
|
project_id: string;
|
|
1168
1060
|
/** @description Which service holds it. Also which console it is managed from. */
|
|
@@ -1180,60 +1072,26 @@ export interface components {
|
|
|
1180
1072
|
*/
|
|
1181
1073
|
quantity: number;
|
|
1182
1074
|
/**
|
|
1183
|
-
*
|
|
1184
|
-
*
|
|
1075
|
+
* @description How long one period buys, as an ISO 8601 duration (P1M, P1Y).
|
|
1076
|
+
*
|
|
1077
|
+
* There is no expiry to report. The engine keeps renewing this for as long as the seat is
|
|
1078
|
+
* held, so what runs out is not the term but the customer's decision to keep it. What the
|
|
1079
|
+
* next period costs, and when it is charged, is on the charges route — that is the engine's
|
|
1080
|
+
* own answer rather than a copy of it.
|
|
1185
1081
|
*/
|
|
1186
|
-
|
|
1082
|
+
term: string;
|
|
1187
1083
|
/** @enum {string} */
|
|
1188
1084
|
state: "pending" | "active" | "suspended" | "terminated";
|
|
1189
1085
|
/**
|
|
1190
|
-
* @description What it is being moved to. Differs from `state` while a change is still being applied
|
|
1191
|
-
*
|
|
1192
|
-
* conclude that nothing happened.
|
|
1086
|
+
* @description What it is being moved to. Differs from `state` while a change is still being applied,
|
|
1087
|
+
* which is the moment a customer is most likely to conclude that nothing happened.
|
|
1193
1088
|
* @enum {string}
|
|
1194
1089
|
*/
|
|
1195
1090
|
desired_state: "active" | "suspended" | "terminated";
|
|
1196
|
-
/**
|
|
1197
|
-
* @description How long one renewal buys, as an ISO 8601 duration (P1M, P1Y). Empty on something adopted
|
|
1198
|
-
* into billing rather than bought through it — automatic renewal cannot be turned on until
|
|
1199
|
-
* one manual renewal records it.
|
|
1200
|
-
*/
|
|
1201
|
-
billing_cycle?: string;
|
|
1202
|
-
/**
|
|
1203
|
-
* @description What happens at expiry. `manual` is where everything starts: charging automatically has
|
|
1204
|
-
* to be chosen. `none` also stops the reminders, which is a different thing from `manual`
|
|
1205
|
-
* — see the route that sets it.
|
|
1206
|
-
* @enum {string}
|
|
1207
|
-
*/
|
|
1208
|
-
renewal_status: "manual" | "auto" | "none";
|
|
1209
1091
|
};
|
|
1210
1092
|
PrepaidAssetList: {
|
|
1211
1093
|
assets: components["schemas"]["PrepaidAsset"][];
|
|
1212
1094
|
};
|
|
1213
|
-
RenewalQuote: {
|
|
1214
|
-
provision_id: string;
|
|
1215
|
-
term: string;
|
|
1216
|
-
/**
|
|
1217
|
-
* @description A decimal string, not a float. Money that survives a round trip through binary floating
|
|
1218
|
-
* point is money that stops adding up.
|
|
1219
|
-
*/
|
|
1220
|
-
amount: string;
|
|
1221
|
-
currency: string;
|
|
1222
|
-
/**
|
|
1223
|
-
* Format: date-time
|
|
1224
|
-
* @description What it is paid up to now.
|
|
1225
|
-
*/
|
|
1226
|
-
current_term_end: string;
|
|
1227
|
-
/**
|
|
1228
|
-
* Format: date-time
|
|
1229
|
-
* @description What it would be paid up to after renewing.
|
|
1230
|
-
*/
|
|
1231
|
-
term_end: string;
|
|
1232
|
-
};
|
|
1233
|
-
SetRenewalStatusRequestBody: {
|
|
1234
|
-
/** @enum {string} */
|
|
1235
|
-
status: "manual" | "auto" | "none";
|
|
1236
|
-
};
|
|
1237
1095
|
RenewRequestBody: {
|
|
1238
1096
|
/**
|
|
1239
1097
|
* @description How long to renew for, as an ISO 8601 duration (P1M, P1Y). It does not have to match the
|
|
@@ -1428,40 +1286,69 @@ export interface components {
|
|
|
1428
1286
|
};
|
|
1429
1287
|
PaymentMethodSetupSession: {
|
|
1430
1288
|
/**
|
|
1431
|
-
*
|
|
1432
|
-
*
|
|
1289
|
+
* @description Initialises the provider's JavaScript, which mounts its form in an iframe on this page.
|
|
1290
|
+
*
|
|
1291
|
+
* Not a URL: the form is embedded rather than redirected to, so the account holder stays
|
|
1292
|
+
* on the console. It expires, so fetch it when the form is about to be shown rather than
|
|
1293
|
+
* when the page loads.
|
|
1433
1294
|
*/
|
|
1434
|
-
|
|
1435
|
-
};
|
|
1436
|
-
BillingPortalSession: {
|
|
1295
|
+
client_secret: string;
|
|
1437
1296
|
/**
|
|
1438
|
-
*
|
|
1439
|
-
*
|
|
1297
|
+
* @description Identifies this platform to the provider's JavaScript. Public by design.
|
|
1298
|
+
*
|
|
1299
|
+
* It comes from here rather than from the browser bundle because it has to match the
|
|
1300
|
+
* account and the mode of the key the session was created with. Baking it into the build
|
|
1301
|
+
* makes one image unusable against the other mode, and the mismatch shows up as a form
|
|
1302
|
+
* that never loads.
|
|
1440
1303
|
*/
|
|
1441
|
-
|
|
1304
|
+
publishable_key: string;
|
|
1305
|
+
/**
|
|
1306
|
+
* @description The provider's id for this attempt.
|
|
1307
|
+
*
|
|
1308
|
+
* The browser does not need it — the callback carries the same id and is what actually
|
|
1309
|
+
* records the method. It is here so that a support conversation about one failed attempt
|
|
1310
|
+
* has something to look it up by.
|
|
1311
|
+
*/
|
|
1312
|
+
session_id?: string;
|
|
1442
1313
|
};
|
|
1443
1314
|
/**
|
|
1444
|
-
* @description
|
|
1315
|
+
* @description One saved way of collecting money later, without the account holder present.
|
|
1445
1316
|
*
|
|
1446
|
-
* Deliberately not called a card: a card is one kind
|
|
1447
|
-
*
|
|
1317
|
+
* Deliberately not called a card: a card is one kind, and direct debit and the recurring
|
|
1318
|
+
* mandates offered by regional wallets occupy the same slot.
|
|
1448
1319
|
*/
|
|
1449
1320
|
PaymentMethod: {
|
|
1321
|
+
/** @description The provider's id for it. Used to remove it or make it the default */
|
|
1322
|
+
id: string;
|
|
1323
|
+
/** @description Visa, Mastercard, and so on. Empty for kinds that have no brand */
|
|
1324
|
+
brand?: string;
|
|
1450
1325
|
/**
|
|
1451
|
-
* @description
|
|
1452
|
-
* therefore collect an invoice.
|
|
1326
|
+
* @description The last four digits, for telling two saved methods apart.
|
|
1453
1327
|
*
|
|
1454
|
-
* This
|
|
1455
|
-
*
|
|
1456
|
-
|
|
1328
|
+
* This and the expiry are the only parts of the instrument that exist here. The number,
|
|
1329
|
+
* the expiry the holder typed and the CVC never reach this platform.
|
|
1330
|
+
*/
|
|
1331
|
+
last4?: string;
|
|
1332
|
+
/** Format: int32 */
|
|
1333
|
+
exp_month?: number;
|
|
1334
|
+
/**
|
|
1335
|
+
* Format: int32
|
|
1336
|
+
* @description Together with `exp_month`, when this stops working.
|
|
1457
1337
|
*
|
|
1458
|
-
*
|
|
1459
|
-
*
|
|
1338
|
+
* Worth showing because the failure is otherwise invisible: the card expires, the invoice
|
|
1339
|
+
* fails, dunning runs out, and the project stops — with nothing pointing at the card.
|
|
1340
|
+
*/
|
|
1341
|
+
exp_year?: number;
|
|
1342
|
+
/**
|
|
1343
|
+
* @description True for the one an invoice is collected from.
|
|
1460
1344
|
*
|
|
1461
|
-
*
|
|
1462
|
-
*
|
|
1345
|
+
* Exactly one is the default while any exist. An account whose only method was removed
|
|
1346
|
+
* has none, and its next invoice cannot be collected.
|
|
1463
1347
|
*/
|
|
1464
|
-
|
|
1348
|
+
default: boolean;
|
|
1349
|
+
};
|
|
1350
|
+
PaymentMethodList: {
|
|
1351
|
+
payment_methods: components["schemas"]["PaymentMethod"][];
|
|
1465
1352
|
};
|
|
1466
1353
|
TopUpSession: {
|
|
1467
1354
|
/**
|
|
@@ -2519,7 +2406,7 @@ export interface operations {
|
|
|
2519
2406
|
};
|
|
2520
2407
|
};
|
|
2521
2408
|
};
|
|
2522
|
-
"
|
|
2409
|
+
"list-payment-methods": {
|
|
2523
2410
|
parameters: {
|
|
2524
2411
|
query?: never;
|
|
2525
2412
|
header?: never;
|
|
@@ -2540,7 +2427,7 @@ export interface operations {
|
|
|
2540
2427
|
[name: string]: unknown;
|
|
2541
2428
|
};
|
|
2542
2429
|
content: {
|
|
2543
|
-
"application/json": components["schemas"]["
|
|
2430
|
+
"application/json": components["schemas"]["PaymentMethodList"];
|
|
2544
2431
|
};
|
|
2545
2432
|
};
|
|
2546
2433
|
/** @description Error */
|
|
@@ -2589,7 +2476,7 @@ export interface operations {
|
|
|
2589
2476
|
};
|
|
2590
2477
|
};
|
|
2591
2478
|
};
|
|
2592
|
-
"
|
|
2479
|
+
"remove-payment-method": {
|
|
2593
2480
|
parameters: {
|
|
2594
2481
|
query?: never;
|
|
2595
2482
|
header?: never;
|
|
@@ -2599,19 +2486,18 @@ export interface operations {
|
|
|
2599
2486
|
* which is why the key is what addresses the account.
|
|
2600
2487
|
*/
|
|
2601
2488
|
accountKey: components["parameters"]["AccountKey"];
|
|
2489
|
+
paymentMethodId: string;
|
|
2602
2490
|
};
|
|
2603
2491
|
cookie?: never;
|
|
2604
2492
|
};
|
|
2605
2493
|
requestBody?: never;
|
|
2606
2494
|
responses: {
|
|
2607
|
-
/** @description
|
|
2608
|
-
|
|
2495
|
+
/** @description Removed */
|
|
2496
|
+
204: {
|
|
2609
2497
|
headers: {
|
|
2610
2498
|
[name: string]: unknown;
|
|
2611
2499
|
};
|
|
2612
|
-
content
|
|
2613
|
-
"application/json": components["schemas"]["BillingPortalSession"];
|
|
2614
|
-
};
|
|
2500
|
+
content?: never;
|
|
2615
2501
|
};
|
|
2616
2502
|
/** @description Error */
|
|
2617
2503
|
default: {
|
|
@@ -2624,7 +2510,7 @@ export interface operations {
|
|
|
2624
2510
|
};
|
|
2625
2511
|
};
|
|
2626
2512
|
};
|
|
2627
|
-
"
|
|
2513
|
+
"set-default-payment-method": {
|
|
2628
2514
|
parameters: {
|
|
2629
2515
|
query?: never;
|
|
2630
2516
|
header?: never;
|
|
@@ -2634,59 +2520,18 @@ export interface operations {
|
|
|
2634
2520
|
* which is why the key is what addresses the account.
|
|
2635
2521
|
*/
|
|
2636
2522
|
accountKey: components["parameters"]["AccountKey"];
|
|
2523
|
+
paymentMethodId: string;
|
|
2637
2524
|
};
|
|
2638
2525
|
cookie?: never;
|
|
2639
2526
|
};
|
|
2640
2527
|
requestBody?: never;
|
|
2641
2528
|
responses: {
|
|
2642
|
-
/** @description
|
|
2643
|
-
|
|
2644
|
-
headers: {
|
|
2645
|
-
[name: string]: unknown;
|
|
2646
|
-
};
|
|
2647
|
-
content: {
|
|
2648
|
-
"application/json": components["schemas"]["OfferList"];
|
|
2649
|
-
};
|
|
2650
|
-
};
|
|
2651
|
-
/** @description Error */
|
|
2652
|
-
default: {
|
|
2653
|
-
headers: {
|
|
2654
|
-
[name: string]: unknown;
|
|
2655
|
-
};
|
|
2656
|
-
content: {
|
|
2657
|
-
"application/json": components["schemas"]["Error"];
|
|
2658
|
-
};
|
|
2659
|
-
};
|
|
2660
|
-
};
|
|
2661
|
-
};
|
|
2662
|
-
"purchase-offer": {
|
|
2663
|
-
parameters: {
|
|
2664
|
-
query?: {
|
|
2665
|
-
/** @description When the switch takes effect. Required if the account already has a plan, ignored otherwise */
|
|
2666
|
-
timing?: components["schemas"]["PlanChangeTiming"];
|
|
2667
|
-
};
|
|
2668
|
-
header?: never;
|
|
2669
|
-
path: {
|
|
2670
|
-
/**
|
|
2671
|
-
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
2672
|
-
* which is why the key is what addresses the account.
|
|
2673
|
-
*/
|
|
2674
|
-
accountKey: components["parameters"]["AccountKey"];
|
|
2675
|
-
/** @description Which offer */
|
|
2676
|
-
offerKey: string;
|
|
2677
|
-
};
|
|
2678
|
-
cookie?: never;
|
|
2679
|
-
};
|
|
2680
|
-
requestBody?: never;
|
|
2681
|
-
responses: {
|
|
2682
|
-
/** @description OK */
|
|
2683
|
-
200: {
|
|
2529
|
+
/** @description Updated */
|
|
2530
|
+
204: {
|
|
2684
2531
|
headers: {
|
|
2685
2532
|
[name: string]: unknown;
|
|
2686
2533
|
};
|
|
2687
|
-
content
|
|
2688
|
-
"application/json": components["schemas"]["Purchase"];
|
|
2689
|
-
};
|
|
2534
|
+
content?: never;
|
|
2690
2535
|
};
|
|
2691
2536
|
/** @description Error */
|
|
2692
2537
|
default: {
|
|
@@ -2699,7 +2544,7 @@ export interface operations {
|
|
|
2699
2544
|
};
|
|
2700
2545
|
};
|
|
2701
2546
|
};
|
|
2702
|
-
"list-
|
|
2547
|
+
"list-offers": {
|
|
2703
2548
|
parameters: {
|
|
2704
2549
|
query?: never;
|
|
2705
2550
|
header?: never;
|
|
@@ -2720,48 +2565,7 @@ export interface operations {
|
|
|
2720
2565
|
[name: string]: unknown;
|
|
2721
2566
|
};
|
|
2722
2567
|
content: {
|
|
2723
|
-
"application/json": components["schemas"]["
|
|
2724
|
-
};
|
|
2725
|
-
};
|
|
2726
|
-
/** @description Error */
|
|
2727
|
-
default: {
|
|
2728
|
-
headers: {
|
|
2729
|
-
[name: string]: unknown;
|
|
2730
|
-
};
|
|
2731
|
-
content: {
|
|
2732
|
-
"application/json": components["schemas"]["Error"];
|
|
2733
|
-
};
|
|
2734
|
-
};
|
|
2735
|
-
};
|
|
2736
|
-
};
|
|
2737
|
-
"set-renewal-status": {
|
|
2738
|
-
parameters: {
|
|
2739
|
-
query?: never;
|
|
2740
|
-
header?: never;
|
|
2741
|
-
path: {
|
|
2742
|
-
/**
|
|
2743
|
-
* @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
|
|
2744
|
-
* which is why the key is what addresses the account.
|
|
2745
|
-
*/
|
|
2746
|
-
accountKey: components["parameters"]["AccountKey"];
|
|
2747
|
-
/** @description Which asset, from the prepaid list */
|
|
2748
|
-
provisionId: components["parameters"]["ProvisionId"];
|
|
2749
|
-
};
|
|
2750
|
-
cookie?: never;
|
|
2751
|
-
};
|
|
2752
|
-
requestBody: {
|
|
2753
|
-
content: {
|
|
2754
|
-
"application/json": components["schemas"]["SetRenewalStatusRequestBody"];
|
|
2755
|
-
};
|
|
2756
|
-
};
|
|
2757
|
-
responses: {
|
|
2758
|
-
/** @description OK */
|
|
2759
|
-
200: {
|
|
2760
|
-
headers: {
|
|
2761
|
-
[name: string]: unknown;
|
|
2762
|
-
};
|
|
2763
|
-
content: {
|
|
2764
|
-
"application/json": components["schemas"]["PrepaidAsset"];
|
|
2568
|
+
"application/json": components["schemas"]["OfferList"];
|
|
2765
2569
|
};
|
|
2766
2570
|
};
|
|
2767
2571
|
/** @description Error */
|
|
@@ -2775,14 +2579,11 @@ export interface operations {
|
|
|
2775
2579
|
};
|
|
2776
2580
|
};
|
|
2777
2581
|
};
|
|
2778
|
-
"
|
|
2582
|
+
"purchase-offer": {
|
|
2779
2583
|
parameters: {
|
|
2780
|
-
query
|
|
2781
|
-
/**
|
|
2782
|
-
|
|
2783
|
-
* number of months: months are not the same length.
|
|
2784
|
-
*/
|
|
2785
|
-
term: string;
|
|
2584
|
+
query?: {
|
|
2585
|
+
/** @description When the switch takes effect. Required if the account already has a plan, ignored otherwise */
|
|
2586
|
+
timing?: components["schemas"]["PlanChangeTiming"];
|
|
2786
2587
|
};
|
|
2787
2588
|
header?: never;
|
|
2788
2589
|
path: {
|
|
@@ -2791,8 +2592,8 @@ export interface operations {
|
|
|
2791
2592
|
* which is why the key is what addresses the account.
|
|
2792
2593
|
*/
|
|
2793
2594
|
accountKey: components["parameters"]["AccountKey"];
|
|
2794
|
-
/** @description Which
|
|
2795
|
-
|
|
2595
|
+
/** @description Which offer */
|
|
2596
|
+
offerKey: string;
|
|
2796
2597
|
};
|
|
2797
2598
|
cookie?: never;
|
|
2798
2599
|
};
|
|
@@ -2804,7 +2605,7 @@ export interface operations {
|
|
|
2804
2605
|
[name: string]: unknown;
|
|
2805
2606
|
};
|
|
2806
2607
|
content: {
|
|
2807
|
-
"application/json": components["schemas"]["
|
|
2608
|
+
"application/json": components["schemas"]["Purchase"];
|
|
2808
2609
|
};
|
|
2809
2610
|
};
|
|
2810
2611
|
/** @description Error */
|
|
@@ -2818,7 +2619,7 @@ export interface operations {
|
|
|
2818
2619
|
};
|
|
2819
2620
|
};
|
|
2820
2621
|
};
|
|
2821
|
-
"
|
|
2622
|
+
"list-prepaid-assets": {
|
|
2822
2623
|
parameters: {
|
|
2823
2624
|
query?: never;
|
|
2824
2625
|
header?: never;
|
|
@@ -2828,16 +2629,10 @@ export interface operations {
|
|
|
2828
2629
|
* which is why the key is what addresses the account.
|
|
2829
2630
|
*/
|
|
2830
2631
|
accountKey: components["parameters"]["AccountKey"];
|
|
2831
|
-
/** @description Which asset, from the prepaid list */
|
|
2832
|
-
provisionId: components["parameters"]["ProvisionId"];
|
|
2833
2632
|
};
|
|
2834
2633
|
cookie?: never;
|
|
2835
2634
|
};
|
|
2836
|
-
requestBody
|
|
2837
|
-
content: {
|
|
2838
|
-
"application/json": components["schemas"]["RenewRequestBody"];
|
|
2839
|
-
};
|
|
2840
|
-
};
|
|
2635
|
+
requestBody?: never;
|
|
2841
2636
|
responses: {
|
|
2842
2637
|
/** @description OK */
|
|
2843
2638
|
200: {
|
|
@@ -2845,7 +2640,7 @@ export interface operations {
|
|
|
2845
2640
|
[name: string]: unknown;
|
|
2846
2641
|
};
|
|
2847
2642
|
content: {
|
|
2848
|
-
"application/json": components["schemas"]["
|
|
2643
|
+
"application/json": components["schemas"]["PrepaidAssetList"];
|
|
2849
2644
|
};
|
|
2850
2645
|
};
|
|
2851
2646
|
/** @description Error */
|