@openrails/billing-ui 0.248.1 → 0.250.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.
Files changed (151) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +40 -35
  3. package/dist/account/account-billing.d.ts +2 -2
  4. package/dist/account/cancel-dialog.d.ts +2 -2
  5. package/dist/account/change-card-dialog.d.ts +2 -2
  6. package/dist/account/payment-history.d.ts +2 -2
  7. package/dist/account/payment-methods-panel.d.ts +2 -2
  8. package/dist/account/section.d.ts +2 -2
  9. package/dist/account/subscriptions-panel.d.ts +2 -2
  10. package/dist/admin/context.d.ts +2 -2
  11. package/dist/admin/lib/queries.d.ts +1 -1
  12. package/dist/admin/messages.d.ts +3 -3
  13. package/dist/admin/pages/catalog/psp-links.d.ts +1 -1
  14. package/dist/admin/theme.d.ts +2 -2
  15. package/dist/admin/types.d.ts +2 -2
  16. package/dist/{admin-attempts-lAoW-Urd.js → admin-attempts-DxRHTODq.js} +8 -8
  17. package/dist/{admin-attempts-lAoW-Urd.js.map → admin-attempts-DxRHTODq.js.map} +1 -1
  18. package/dist/{admin-auth-DQGHtt0j.js → admin-auth-CiuZ-Hlm.js} +2 -2
  19. package/dist/{admin-auth-DQGHtt0j.js.map → admin-auth-CiuZ-Hlm.js.map} +1 -1
  20. package/dist/{admin-badge-DR5-1qd8.js → admin-badge-VCGbnfiN.js} +2 -2
  21. package/dist/{admin-badge-DR5-1qd8.js.map → admin-badge-VCGbnfiN.js.map} +1 -1
  22. package/dist/{admin-button-CTL3DgOt.js → admin-button-Oip73Plq.js} +2 -2
  23. package/dist/{admin-button-CTL3DgOt.js.map → admin-button-Oip73Plq.js.map} +1 -1
  24. package/dist/{admin-capabilities-BuigAgtm.js → admin-capabilities-BGv7oG8v.js} +2 -2
  25. package/dist/{admin-capabilities-BuigAgtm.js.map → admin-capabilities-BGv7oG8v.js.map} +1 -1
  26. package/dist/{admin-card-bzAks3-3.js → admin-card-DGbi6ZHZ.js} +2 -2
  27. package/dist/{admin-card-bzAks3-3.js.map → admin-card-DGbi6ZHZ.js.map} +1 -1
  28. package/dist/{admin-catalog-CK6CM9I2.js → admin-catalog-3pPEAuDY.js} +19 -19
  29. package/dist/{admin-catalog-CK6CM9I2.js.map → admin-catalog-3pPEAuDY.js.map} +1 -1
  30. package/dist/{admin-customers-D8u5gq3M.js → admin-customers-cnKMEV4q.js} +6 -6
  31. package/dist/{admin-customers-D8u5gq3M.js.map → admin-customers-cnKMEV4q.js.map} +1 -1
  32. package/dist/{admin-dashboard-DqqFjOzq.js → admin-dashboard-DfSsUyo-.js} +14 -14
  33. package/dist/{admin-dashboard-DqqFjOzq.js.map → admin-dashboard-DfSsUyo-.js.map} +1 -1
  34. package/dist/{admin-data-table-qfXLOFmN.js → admin-data-table-CgeWv__T.js} +6 -6
  35. package/dist/{admin-data-table-qfXLOFmN.js.map → admin-data-table-CgeWv__T.js.map} +1 -1
  36. package/dist/{admin-detail-X82kR2f7.js → admin-detail-BATuJjVs.js} +12 -12
  37. package/dist/{admin-detail-X82kR2f7.js.map → admin-detail-BATuJjVs.js.map} +1 -1
  38. package/dist/{admin-detail-DUAJQg8G.js → admin-detail-Cq59e14B.js} +15 -15
  39. package/dist/{admin-detail-DUAJQg8G.js.map → admin-detail-Cq59e14B.js.map} +1 -1
  40. package/dist/{admin-detail-BHe51ma9.js → admin-detail-DG-YaHhS.js} +11 -11
  41. package/dist/{admin-detail-BHe51ma9.js.map → admin-detail-DG-YaHhS.js.map} +1 -1
  42. package/dist/{admin-detail-CGOyqs7s.js → admin-detail-Dc7rU4mM.js} +15 -15
  43. package/dist/{admin-detail-CGOyqs7s.js.map → admin-detail-Dc7rU4mM.js.map} +1 -1
  44. package/dist/{admin-dialog-BjuKI5Hp.js → admin-dialog-Ffx95AIT.js} +3 -3
  45. package/dist/{admin-dialog-BjuKI5Hp.js.map → admin-dialog-Ffx95AIT.js.map} +1 -1
  46. package/dist/{admin-dom-uMmZzRvU.js → admin-dom-lnNSQ7ke.js} +4 -4
  47. package/dist/{admin-dom-uMmZzRvU.js.map → admin-dom-lnNSQ7ke.js.map} +1 -1
  48. package/dist/{admin-dropdown-menu-BW1D_h6s.js → admin-dropdown-menu-CCiW4-oz.js} +2 -2
  49. package/dist/{admin-dropdown-menu-BW1D_h6s.js.map → admin-dropdown-menu-CCiW4-oz.js.map} +1 -1
  50. package/dist/{admin-fact-card-DO_fHosg.js → admin-fact-card-D6mZgxpN.js} +2 -2
  51. package/dist/{admin-fact-card-DO_fHosg.js.map → admin-fact-card-D6mZgxpN.js.map} +1 -1
  52. package/dist/{admin-health-B4jN2LwR.js → admin-health-CvJX9prw.js} +13 -13
  53. package/dist/{admin-health-B4jN2LwR.js.map → admin-health-CvJX9prw.js.map} +1 -1
  54. package/dist/{admin-input-CcfQfJFN.js → admin-input-DO5lvCLL.js} +2 -2
  55. package/dist/{admin-input-CcfQfJFN.js.map → admin-input-DO5lvCLL.js.map} +1 -1
  56. package/dist/{admin-label-BiEN5cjb.js → admin-label-BzJpr3lg.js} +2 -2
  57. package/dist/{admin-label-BiEN5cjb.js.map → admin-label-BzJpr3lg.js.map} +1 -1
  58. package/dist/{admin-linked-table-row-BsaUruCN.js → admin-linked-table-row-5vFb6rXY.js} +4 -4
  59. package/dist/{admin-linked-table-row-BsaUruCN.js.map → admin-linked-table-row-5vFb6rXY.js.map} +1 -1
  60. package/dist/{admin-metering-COFcSPQy.js → admin-metering-BksTFRRP.js} +14 -14
  61. package/dist/{admin-metering-COFcSPQy.js.map → admin-metering-BksTFRRP.js.map} +1 -1
  62. package/dist/{admin-ops-B3mcr76u.js → admin-ops-Ch2-BmUp.js} +11 -11
  63. package/dist/{admin-ops-B3mcr76u.js.map → admin-ops-Ch2-BmUp.js.map} +1 -1
  64. package/dist/{admin-orders-dxC99Idl.js → admin-orders-8XzHf7b-.js} +8 -8
  65. package/dist/{admin-orders-dxC99Idl.js.map → admin-orders-8XzHf7b-.js.map} +1 -1
  66. package/dist/{admin-payments-Bs7HSfP0.js → admin-payments-pNLNIU0X.js} +9 -9
  67. package/dist/{admin-payments-Bs7HSfP0.js.map → admin-payments-pNLNIU0X.js.map} +1 -1
  68. package/dist/{admin-price-detail-DRquxpA9.js → admin-price-detail-BeGDPxKX.js} +11 -11
  69. package/dist/admin-price-detail-BeGDPxKX.js.map +1 -0
  70. package/dist/{admin-price-wizard-CI7K-2Nz.js → admin-price-wizard-ferZSTfO.js} +7 -7
  71. package/dist/{admin-price-wizard-CI7K-2Nz.js.map → admin-price-wizard-ferZSTfO.js.map} +1 -1
  72. package/dist/{admin-range-picker-Dr2M1EZr.js → admin-range-picker-DaIvC1oC.js} +5 -5
  73. package/dist/{admin-range-picker-Dr2M1EZr.js.map → admin-range-picker-DaIvC1oC.js.map} +1 -1
  74. package/dist/{admin-reports-CywKLiSA.js → admin-reports-CA-cnNur.js} +8 -8
  75. package/dist/{admin-reports-CywKLiSA.js.map → admin-reports-CA-cnNur.js.map} +1 -1
  76. package/dist/{admin-select-DBgprVW6.js → admin-select-CUXvh6j1.js} +2 -2
  77. package/dist/{admin-select-DBgprVW6.js.map → admin-select-CUXvh6j1.js.map} +1 -1
  78. package/dist/{admin-settings-Bmoy95uO.js → admin-settings-C6eWFkDn.js} +16 -16
  79. package/dist/{admin-settings-Bmoy95uO.js.map → admin-settings-C6eWFkDn.js.map} +1 -1
  80. package/dist/{admin-skeleton-DsM7crYi.js → admin-skeleton-DEY3Q8Dg.js} +2 -2
  81. package/dist/{admin-skeleton-DsM7crYi.js.map → admin-skeleton-DEY3Q8Dg.js.map} +1 -1
  82. package/dist/{admin-status-badge-BFPgo71d.js → admin-status-badge-CwqIU8tK.js} +2 -2
  83. package/dist/{admin-status-badge-BFPgo71d.js.map → admin-status-badge-CwqIU8tK.js.map} +1 -1
  84. package/dist/{admin-subscriptions-CLYc_HEV.js → admin-subscriptions-lJG_EzMe.js} +9 -9
  85. package/dist/{admin-subscriptions-CLYc_HEV.js.map → admin-subscriptions-lJG_EzMe.js.map} +1 -1
  86. package/dist/{admin-switch-BJUxLCsa.js → admin-switch-S4g_ppaU.js} +2 -2
  87. package/dist/{admin-switch-BJUxLCsa.js.map → admin-switch-S4g_ppaU.js.map} +1 -1
  88. package/dist/{admin-table-CH9TrXJf.js → admin-table-CWhiCb9d.js} +2 -2
  89. package/dist/{admin-table-CH9TrXJf.js.map → admin-table-CWhiCb9d.js.map} +1 -1
  90. package/dist/{admin-tabs-528FJMjt.js → admin-tabs-Cjm5a6UJ.js} +2 -2
  91. package/dist/{admin-tabs-528FJMjt.js.map → admin-tabs-Cjm5a6UJ.js.map} +1 -1
  92. package/dist/{admin-textarea-DEz38RaI.js → admin-textarea-DK1Fq31x.js} +2 -2
  93. package/dist/{admin-textarea-DEz38RaI.js.map → admin-textarea-DK1Fq31x.js.map} +1 -1
  94. package/dist/{admin-typed-confirm-dialog-DU7m9-O7.js → admin-typed-confirm-dialog-BloZvFPA.js} +6 -6
  95. package/dist/{admin-typed-confirm-dialog-DU7m9-O7.js.map → admin-typed-confirm-dialog-BloZvFPA.js.map} +1 -1
  96. package/dist/{admin-utils-BK4Vh1o_.js → admin-utils-DnVY5fYd.js} +3 -3
  97. package/dist/admin-utils-DnVY5fYd.js.map +1 -0
  98. package/dist/{admin-widget-viz-Da48c-Zf.js → admin-widget-viz-RCkxUspL.js} +8 -8
  99. package/dist/{admin-widget-viz-Da48c-Zf.js.map → admin-widget-viz-RCkxUspL.js.map} +1 -1
  100. package/dist/admin.js +31 -31
  101. package/dist/admin.js.map +1 -1
  102. package/dist/appearance.d.ts +7 -7
  103. package/dist/buy-button.d.ts +12 -18
  104. package/dist/cart.d.ts +4 -4
  105. package/dist/client/client.d.ts +12 -20
  106. package/dist/client/generated/error-codes.d.ts +1 -1
  107. package/dist/client/generated/routes.d.ts +10 -24
  108. package/dist/client/generated/wire.d.ts +75 -37
  109. package/dist/client/index.d.ts +1 -1
  110. package/dist/client/types.d.ts +17 -18
  111. package/dist/{client-DoRYitD3.js → client-HWr09qpX.js} +216 -233
  112. package/dist/client-HWr09qpX.js.map +1 -0
  113. package/dist/client.js +1 -1
  114. package/dist/embedded-payment.d.ts +25 -0
  115. package/dist/{hooks-DCSelDIZ.js → hooks-D9MR20BY.js} +7 -20
  116. package/dist/hooks-D9MR20BY.js.map +1 -0
  117. package/dist/index.d.ts +5 -5
  118. package/dist/index.js +284 -272
  119. package/dist/index.js.map +1 -1
  120. package/dist/locales/de.js +1 -1
  121. package/dist/locales/de.js.map +1 -1
  122. package/dist/locales/en.d.ts +1 -1
  123. package/dist/locales/en.js +1 -1
  124. package/dist/locales/en.js.map +1 -1
  125. package/dist/locales/es.js +1 -1
  126. package/dist/locales/es.js.map +1 -1
  127. package/dist/locales/ja.js +1 -1
  128. package/dist/locales/ja.js.map +1 -1
  129. package/dist/locales/ko.js +1 -1
  130. package/dist/locales/ko.js.map +1 -1
  131. package/dist/locales/zh.js +1 -1
  132. package/dist/locales/zh.js.map +1 -1
  133. package/dist/modal.d.ts +12 -3
  134. package/dist/{order-checkout.d.ts → order-payment.d.ts} +4 -4
  135. package/dist/product-list.d.ts +10 -16
  136. package/dist/psp.d.ts +2 -2
  137. package/dist/react/hooks.d.ts +2 -15
  138. package/dist/react/index.d.ts +1 -1
  139. package/dist/react/provider.d.ts +3 -3
  140. package/dist/react.js +2 -2
  141. package/dist/save-payment-method.d.ts +2 -2
  142. package/dist/scope-context.d.ts +4 -4
  143. package/dist/scope.d.ts +2 -2
  144. package/dist/tokenized-card-form.d.ts +2 -2
  145. package/docs/payment-form-contract.md +3 -3
  146. package/package.json +2 -2
  147. package/dist/admin-price-detail-DRquxpA9.js.map +0 -1
  148. package/dist/admin-utils-BK4Vh1o_.js.map +0 -1
  149. package/dist/client-DoRYitD3.js.map +0 -1
  150. package/dist/embedded-checkout.d.ts +0 -22
  151. package/dist/hooks-DCSelDIZ.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties } from 'react';
2
- export type CheckoutTheme = "light" | "dark" | "auto" | "inherit";
3
- export interface CheckoutVariables {
2
+ export type BillingTheme = "light" | "dark" | "auto" | "inherit";
3
+ export interface BillingVariables {
4
4
  background?: string;
5
5
  foreground?: string;
6
6
  card?: string;
@@ -15,9 +15,9 @@ export interface CheckoutVariables {
15
15
  radius?: string;
16
16
  fontFamily?: string;
17
17
  }
18
- export interface CheckoutAppearance {
19
- theme?: CheckoutTheme;
20
- variables?: CheckoutVariables;
18
+ export interface BillingAppearance {
19
+ theme?: BillingTheme;
20
+ variables?: BillingVariables;
21
21
  }
22
- export declare function appearanceStyle(appearance: CheckoutAppearance | undefined, namespace?: "orck" | "orba"): CSSProperties | undefined;
23
- export declare function appearanceTheme(appearance: CheckoutAppearance | undefined): CheckoutTheme;
22
+ export declare function appearanceStyle(appearance: BillingAppearance | undefined, namespace?: "orck" | "orba"): CSSProperties | undefined;
23
+ export declare function appearanceTheme(appearance: BillingAppearance | undefined): BillingTheme;
@@ -1,14 +1,14 @@
1
- import { CheckoutAppearance } from './appearance';
2
- import { Order } from './client/types';
1
+ import { BillingAppearance } from './appearance';
2
+ import { Order, Price } from './client/types';
3
3
  import * as React from "react";
4
4
  export interface BuyButtonProps {
5
- /** The id of the merchant that sells the product. */
6
- merchant: string;
7
- /** The product's catalog key. */
8
- product: string;
9
- /** The price's key within the product. */
10
- price: string;
11
- /** The button's text; by default the price's amount and terms, from the catalog. */
5
+ /**
6
+ * The price to buy, from a product the host's server put in its page (the
7
+ * Go Client's ListProducts, its prices as a buyer sees them:
8
+ * `billing.BuyerPrices`). The browser never reads the catalog.
9
+ */
10
+ price: Price;
11
+ /** The button's text; by default the price's amount and terms. */
12
12
  label?: string;
13
13
  /**
14
14
  * A customer-chosen deposit, in the price currency's native units, for a
@@ -23,20 +23,14 @@ export interface BuyButtonProps {
23
23
  */
24
24
  onPaid: (order: Order) => void;
25
25
  /**
26
- * Buying needs a signed-in customer: called instead of the checkout when
26
+ * Buying needs a signed-in customer: called instead of paying when
27
27
  * `signedIn` is false or OpenRails answers 401.
28
28
  */
29
29
  onSignInRequired: () => void;
30
30
  /** false when the host knows the visitor is signed out. */
31
31
  signedIn?: boolean;
32
- appearance?: CheckoutAppearance;
32
+ appearance?: BillingAppearance;
33
33
  className?: string;
34
34
  }
35
- export declare function BuyButton({ merchant, product, price: priceKey, ...props }: BuyButtonProps): React.JSX.Element;
36
- export type PurchaseProps = Omit<BuyButtonProps, "merchant" | "product" | "price"> & {
37
- /** The price to buy; the button waits while it is unknown. */
38
- priceId?: string;
39
- label: string;
40
- };
41
35
  /** One price's button and its order. Requires `BillingProvider`. */
42
- export declare function Purchase({ priceId, label, amount, returnUrl, onPaid, onSignInRequired, signedIn, appearance, className, }: PurchaseProps): React.JSX.Element;
36
+ export declare function BuyButton({ price, label, amount, returnUrl, onPaid, onSignInRequired, signedIn, appearance, className, }: BuyButtonProps): React.JSX.Element;
package/dist/cart.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CheckoutAppearance } from './appearance';
1
+ import { BillingAppearance } from './appearance';
2
2
  import { BillingClient } from './client/client';
3
3
  import { Order } from './client/types';
4
4
  import * as React from "react";
@@ -6,12 +6,12 @@ export interface CartProps {
6
6
  /** The client to read and buy through; default: the provider's. */
7
7
  client?: BillingClient;
8
8
  /**
9
- * The order made from the cart. Default: pay it here with OrderCheckout.
9
+ * The order made from the cart. Default: pay it here with OrderPayment.
10
10
  */
11
11
  onOrder?: (order: Order) => void;
12
- /** Passed to OrderCheckout: the order is complete, or processing. */
12
+ /** Passed to OrderPayment: the order is complete, or processing. */
13
13
  onSettled?: (order: Order) => void;
14
- appearance?: CheckoutAppearance;
14
+ appearance?: BillingAppearance;
15
15
  className?: string;
16
16
  }
17
17
  /** The customer's cart. Requires `BillingProvider`. */
@@ -1,5 +1,6 @@
1
1
  import { BillingError } from './errors';
2
- import { Account, CustomerConfig, CustomerEntitlement, CustomerLink, LowBalanceLine, NetworkLinkChallenge, PublicConfig, CurrencyScales, ListPage, NewCard, CardCaptureReference, NextAction, Cart, Order, OrderPaymentInput, Page, Payment, PaymentMethod, Product, Subscription, SubscriptionChange, SubscriptionChangePreview, Usage } from './types';
2
+ import { Account, CustomerConfig, CustomerEntitlement, CustomerLink, LowBalanceLine, NetworkLinkChallenge, PublicConfig, CurrencyScales, ListPage, NewCard, CardCaptureReference, NextAction, Cart, Order, OrderPaymentInput, Payment, PaymentMethod, Subscription, SubscriptionChange, SubscriptionChangePreview, Usage } from './types';
3
+ import type * as wire from "./generated/wire";
3
4
  export interface BillingClientOptions {
4
5
  /** OpenRails embedded mount. Default "/billing/v1". */
5
6
  baseUrl?: string;
@@ -10,8 +11,8 @@ export interface BillingClientOptions {
10
11
  fetch?: (input: string, init: RequestInit) => Promise<Response>;
11
12
  /**
12
13
  * The customer's access token, sent as the bearer of every request but
13
- * the two public reads (`getConfig`, `listProducts`); omit when `fetch`
14
- * authenticates. A `tokenSource` keeps it fresh: a call answered 401
14
+ * the public read (`getConfig`); omit when `fetch` authenticates. A
15
+ * `tokenSource` keeps it fresh: a call answered 401
15
16
  * `credential_expired` is then retried once with a new token.
16
17
  */
17
18
  getToken?: () => string | null | undefined | Promise<string | null | undefined>;
@@ -23,15 +24,6 @@ export interface BillingClientOptions {
23
24
  */
24
25
  currencies?: CurrencyScales;
25
26
  }
26
- /**
27
- * A public catalog lookup: the products of `merchant` (its id) named by
28
- * `keys` (at most 100 product keys), in one page.
29
- */
30
- export interface ProductListOptions {
31
- merchant: string;
32
- keys: string[];
33
- signal?: AbortSignal;
34
- }
35
27
  export interface ListOptions {
36
28
  limit?: number;
37
29
  offset?: number;
@@ -161,7 +153,12 @@ export declare function createBillingClient(options?: BillingClientOptions): {
161
153
  /**
162
154
  * Creates an order from `lines` or the cart (`cart: true`), and with
163
155
  * `payment` pays it in the same call; `expectedTotal` is the total the
164
- * customer saw. A failed payment resolves as payOrder's does.
156
+ * customer saw; `idempotencyKey`, required with `payment`, names the
157
+ * payment attempt. A failed payment resolves as payOrder's does. Without
158
+ * `payment` the customer's open order of the same lines is answered when
159
+ * there is one. With `payUrl` the order answers its embedded pay URL,
160
+ * `order.pay_url` on the payment origin, for `<EmbeddedPayment>`, fresh
161
+ * on every answer: the merchant's own signed-in person only.
165
162
  */
166
163
  createOrder(input: {
167
164
  lines?: {
@@ -173,7 +170,8 @@ export declare function createBillingClient(options?: BillingClientOptions): {
173
170
  expectedTotal?: string;
174
171
  payment?: OrderPaymentInput;
175
172
  reusable?: boolean;
176
- idempotencyKey: string;
173
+ payUrl?: wire.MyOrderPayURLParams;
174
+ idempotencyKey?: string;
177
175
  }): Promise<OrderResult>;
178
176
  /**
179
177
  * The customer's orders, newest first: `origin: "usage"` their usage
@@ -257,12 +255,6 @@ export declare function createBillingClient(options?: BillingClientOptions): {
257
255
  * first. Pass the answer's `next_cursor` as `cursor` for the next page.
258
256
  */
259
257
  getUsage(opts: UsageOptions): Promise<Usage>;
260
- /**
261
- * The products `merchant` has on sale named by `keys`, each with its
262
- * current prices: a public read, the same signed in or out. No keys
263
- * name no products: nothing is fetched.
264
- */
265
- listProducts(opts: ProductListOptions): Promise<Page<Product>>;
266
258
  /**
267
259
  * A challenge to link the customer to an openrails.dev account: its
268
260
  * `nonce` goes in the network sign-in's authorization request.
@@ -1,4 +1,4 @@
1
- export type OpenRailsErrorCode = "admission_captured" | "admission_not_found" | "already_owned" | "application_required" | "as_of_required" | "authentication_required" | "authentication_unavailable" | "authorization_unavailable" | "billing_archive_integrity" | "billing_archive_invalid_artifact" | "billing_archive_merchant_mismatch" | "billing_archive_not_empty" | "billing_archive_unavailable" | "billing_archive_unsupported_state" | "billing_policy_not_found" | "cancel_unsupported_on_rail" | "captcha_invalid" | "captcha_required" | "card_attempts_blocked" | "card_declined" | "card_not_saved" | "card_requires_https" | "catalog_benefit_overlap" | "catalog_revision_conflict" | "checkout_attempt_closed" | "checkout_attempt_expired" | "checkout_attempts_exhausted" | "checkout_embed_origins_required" | "checkout_expired" | "checkout_not_found" | "credential_expired" | "credential_revoked" | "credit_grant_held" | "credit_grant_not_found" | "credit_grant_unavailable" | "csrf_origin_denied" | "currency_unsupported" | "custodian_capture_unavailable" | "customer_action_required" | "customer_email_required" | "customer_issuer_mismatch" | "customer_not_found" | "customer_payment_unsupported" | "customer_session_required" | "dashboard_invalid" | "database_busy" | "default_payment_method_invalid" | "default_payment_method_required" | "default_rate_card_not_found" | "destructive_actions_held" | "finding_action_failed" | "finding_not_actionable" | "finding_requires_merchant_config" | "hold_not_found" | "host_event_not_found" | "host_principal_invalid" | "hosted_checkout_unavailable" | "idempotency_key_in_use" | "idempotency_key_required" | "idempotency_key_reused" | "insufficient_credits" | "insufficient_funds" | "internal_error" | "invalid_cursor" | "invalid_customer_id" | "invalid_host_event_request" | "invalid_param" | "invalid_payment_method" | "invalid_psp_reference" | "invalid_query" | "invalid_request_body" | "invalid_settlement_status_request" | "invoker_scoped_principal" | "merchant_config_read_only" | "merchant_mismatch" | "merchant_unresolved" | "meter_in_use" | "meter_rate_card_conflict" | "method_not_allowed" | "metrics_query_invalid" | "model_unavailable" | "network_account_linked" | "network_link_challenge_invalid" | "network_link_conflict" | "network_link_in_use" | "network_terms_required" | "order_action_not_allowed" | "order_has_recurring_line" | "order_line_unavailable" | "order_not_cancelable" | "order_not_payable" | "order_payment_in_progress" | "order_total_changed" | "payment_duplicate_refused" | "payment_exceeds_due" | "payment_failed" | "payment_idempotency_conflict" | "payment_in_progress" | "payment_method_delete_failed" | "payment_method_delete_unsupported" | "payment_method_not_psp_vaulted" | "payment_method_not_usable" | "payment_method_psp_mismatch" | "payment_method_required" | "payment_method_same_vault" | "payment_method_stale" | "payment_method_update_failed" | "payment_method_update_unsupported" | "payment_not_found" | "payment_not_refundable" | "payment_not_retryable" | "payment_option_unavailable" | "payment_provider_rejected" | "permission_required" | "price_change_currency_mismatch" | "price_change_target_archived" | "price_increase_notice_too_short" | "price_key_cadence_conflict" | "price_key_not_found" | "price_migration_not_found" | "price_not_found" | "price_not_sellable" | "product_in_use" | "product_not_found" | "product_tier_group_conflict" | "product_tier_group_in_use" | "provider_cancel_held" | "provider_outcome_unknown" | "provider_writes_held" | "psp_claim_requires_proof" | "psp_credentials_rejected" | "psp_exists" | "psp_key_taken" | "psp_last_active" | "psp_not_found" | "purchase_review_resolved" | "quantity_not_allowed" | "rate_card_product_not_found" | "rate_limit_exceeded" | "rebill_terms_committed" | "refund_failed" | "refund_rail_unavailable" | "refund_unsupported" | "request_body_too_large" | "resource_access_denied" | "resource_conflict" | "resource_not_found" | "revision_mismatch" | "route_not_found" | "running_charge_not_found" | "scheduled_change_exists" | "service_credential_customer_scope_denied" | "service_unavailable" | "solana_rpc_unavailable" | "solana_transaction_refused" | "step_up_required" | "step_up_unavailable" | "stored_credential_required" | "subscription_change_already_scheduled" | "subscription_change_cadence_unsupported" | "subscription_change_credit_exceeds_price" | "subscription_change_cycle_unknown" | "subscription_change_idempotency_conflict" | "subscription_change_idempotency_key_required" | "subscription_change_in_flight" | "subscription_change_period_unknown" | "subscription_change_provider_conflict" | "subscription_change_refused" | "subscription_change_renewal_due" | "subscription_change_requires_linked_plan" | "subscription_change_target_inactive" | "subscription_change_unsupported_on_rail" | "subscription_not_active" | "subscription_not_found" | "subscription_paid_through" | "subscription_resumable" | "trial_unsupported_on_rail" | "unknown_field" | "unsupported_media_type" | "usage_meter_invalid" | "usage_meter_not_found" | "usage_not_priced" | "usage_rate_card_invalid" | "webhook_account_mismatch" | "webhook_invalid";
1
+ export type OpenRailsErrorCode = "admission_captured" | "admission_not_found" | "already_owned" | "application_required" | "as_of_required" | "authentication_required" | "authentication_unavailable" | "authorization_unavailable" | "billing_archive_integrity" | "billing_archive_invalid_artifact" | "billing_archive_merchant_mismatch" | "billing_archive_not_empty" | "billing_archive_platform_cards" | "billing_archive_unavailable" | "billing_archive_unsupported_state" | "billing_policy_not_found" | "cancel_unsupported_on_rail" | "captcha_invalid" | "captcha_required" | "card_attempts_blocked" | "card_custody_reserved" | "card_declined" | "card_not_saved" | "card_requires_https" | "catalog_benefit_overlap" | "catalog_revision_conflict" | "credential_expired" | "credential_revoked" | "credit_grant_held" | "credit_grant_not_found" | "credit_grant_unavailable" | "csrf_origin_denied" | "currency_unsupported" | "custodian_capture_unavailable" | "customer_action_required" | "customer_email_required" | "customer_issuer_mismatch" | "customer_not_found" | "customer_payment_unsupported" | "customer_session_required" | "dashboard_invalid" | "database_busy" | "default_payment_method_invalid" | "default_payment_method_required" | "default_rate_card_not_found" | "destructive_actions_held" | "embed_origins_required" | "entitlement_required" | "finding_action_failed" | "finding_not_actionable" | "finding_requires_merchant_config" | "hold_not_found" | "host_event_not_found" | "host_principal_invalid" | "idempotency_key_in_use" | "idempotency_key_required" | "idempotency_key_reused" | "insufficient_credits" | "insufficient_funds" | "internal_error" | "invalid_cursor" | "invalid_customer_id" | "invalid_host_event_request" | "invalid_param" | "invalid_payment_method" | "invalid_psp_reference" | "invalid_query" | "invalid_request_body" | "invalid_settlement_status_request" | "invoker_scoped_principal" | "merchant_config_read_only" | "merchant_mismatch" | "merchant_unresolved" | "meter_in_use" | "meter_rate_card_conflict" | "method_not_allowed" | "metrics_query_invalid" | "model_unavailable" | "network_account_linked" | "network_link_challenge_invalid" | "network_link_conflict" | "network_link_in_use" | "network_terms_required" | "order_action_not_allowed" | "order_attempt_closed" | "order_attempt_expired" | "order_has_recurring_line" | "order_line_unavailable" | "order_not_cancelable" | "order_not_payable" | "order_payment_in_progress" | "order_total_changed" | "pay_url_attempts_exhausted" | "pay_url_expired" | "pay_url_not_found" | "pay_url_unavailable" | "payment_duplicate_refused" | "payment_exceeds_due" | "payment_failed" | "payment_idempotency_conflict" | "payment_in_progress" | "payment_method_delete_failed" | "payment_method_delete_unsupported" | "payment_method_not_psp_vaulted" | "payment_method_not_usable" | "payment_method_psp_mismatch" | "payment_method_required" | "payment_method_same_vault" | "payment_method_stale" | "payment_method_update_failed" | "payment_method_update_unsupported" | "payment_not_found" | "payment_not_refundable" | "payment_not_retryable" | "payment_option_unavailable" | "payment_provider_rejected" | "permission_required" | "platform_vault_unavailable" | "platform_vault_unreachable" | "price_change_currency_mismatch" | "price_change_target_archived" | "price_increase_notice_too_short" | "price_key_cadence_conflict" | "price_key_not_found" | "price_migration_not_found" | "price_not_found" | "price_not_sellable" | "product_in_use" | "product_not_found" | "product_tier_group_conflict" | "product_tier_group_in_use" | "provider_cancel_held" | "provider_outcome_unknown" | "provider_writes_held" | "psp_claim_requires_proof" | "psp_credentials_rejected" | "psp_exists" | "psp_key_taken" | "psp_last_active" | "psp_not_found" | "purchase_review_resolved" | "quantity_not_allowed" | "rate_card_product_not_found" | "rate_limit_exceeded" | "rebill_terms_committed" | "refund_failed" | "refund_rail_unavailable" | "refund_unsupported" | "request_body_too_large" | "resource_access_denied" | "resource_conflict" | "resource_not_found" | "revision_mismatch" | "route_not_found" | "running_charge_not_found" | "scheduled_change_exists" | "service_credential_customer_scope_denied" | "service_unavailable" | "solana_rpc_unavailable" | "solana_transaction_refused" | "step_up_required" | "step_up_unavailable" | "stored_credential_required" | "subscription_change_already_scheduled" | "subscription_change_cadence_unsupported" | "subscription_change_credit_exceeds_price" | "subscription_change_cycle_unknown" | "subscription_change_idempotency_conflict" | "subscription_change_idempotency_key_required" | "subscription_change_in_flight" | "subscription_change_period_unknown" | "subscription_change_provider_conflict" | "subscription_change_refused" | "subscription_change_renewal_due" | "subscription_change_requires_linked_plan" | "subscription_change_target_inactive" | "subscription_change_unsupported_on_rail" | "subscription_not_active" | "subscription_not_found" | "subscription_paid_through" | "subscription_resumable" | "trial_unsupported_on_rail" | "unknown_field" | "unsupported_media_type" | "usage_meter_invalid" | "usage_meter_not_found" | "usage_not_priced" | "usage_rate_card_invalid" | "webhook_account_mismatch" | "webhook_invalid";
2
2
  export type OpenRailsErrorType = "api_error" | "authentication_error" | "authorization_error" | "card_error" | "invalid_request_error" | "rate_limit_error";
3
3
  export declare const OPENRAILS_ERROR_CODES: Readonly<Record<OpenRailsErrorCode, {
4
4
  status: number;
@@ -98,7 +98,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
98
98
  readonly 200: "Order";
99
99
  readonly 201: "Order";
100
100
  };
101
- readonly errors: readonly ["already_owned", "card_attempts_blocked", "card_declined", "customer_action_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_line_unavailable", "order_not_payable", "order_payment_in_progress", "order_total_changed", "payment_failed", "payment_method_stale", "payment_option_unavailable", "payment_provider_rejected", "quantity_not_allowed", "resource_conflict", "resource_not_found", "service_unavailable"];
101
+ readonly errors: readonly ["already_owned", "card_attempts_blocked", "card_declined", "customer_action_required", "customer_session_required", "embed_origins_required", "entitlement_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_line_unavailable", "order_not_payable", "order_payment_in_progress", "order_total_changed", "pay_url_unavailable", "payment_failed", "payment_method_stale", "payment_option_unavailable", "payment_provider_rejected", "quantity_not_allowed", "resource_conflict", "resource_not_found", "service_unavailable"];
102
102
  readonly errorSets: readonly ["tier:customer", "request"];
103
103
  }, {
104
104
  readonly method: "GET";
@@ -140,7 +140,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
140
140
  readonly responses: {
141
141
  readonly 200: "Order";
142
142
  };
143
- readonly errors: readonly ["card_attempts_blocked", "card_declined", "customer_action_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_not_payable", "order_payment_in_progress", "order_total_changed", "payment_failed", "payment_method_stale", "payment_option_unavailable", "payment_provider_rejected", "resource_conflict", "resource_not_found", "service_unavailable"];
143
+ readonly errors: readonly ["card_attempts_blocked", "card_declined", "customer_action_required", "entitlement_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_not_payable", "order_payment_in_progress", "order_total_changed", "payment_failed", "payment_method_stale", "payment_option_unavailable", "payment_provider_rejected", "resource_conflict", "resource_not_found", "service_unavailable"];
144
144
  readonly errorSets: readonly ["tier:customer", "request"];
145
145
  }, {
146
146
  readonly method: "POST";
@@ -173,7 +173,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
173
173
  }, {
174
174
  readonly method: "GET";
175
175
  readonly path: "/v1/orders/{id}/solana-pay";
176
- readonly group: "checkout";
176
+ readonly group: "payment";
177
177
  readonly auth: "public";
178
178
  readonly permission: null;
179
179
  readonly sensitive: false;
@@ -187,7 +187,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
187
187
  }, {
188
188
  readonly method: "POST";
189
189
  readonly path: "/v1/orders/{id}/solana-pay";
190
- readonly group: "checkout";
190
+ readonly group: "payment";
191
191
  readonly auth: "public";
192
192
  readonly permission: null;
193
193
  readonly sensitive: false;
@@ -231,7 +231,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
231
231
  readonly 200: "Order";
232
232
  readonly 201: "Order";
233
233
  };
234
- readonly errors: readonly ["already_owned", "checkout_embed_origins_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_line_unavailable", "quantity_not_allowed", "resource_not_found", "service_unavailable"];
234
+ readonly errors: readonly ["already_owned", "embed_origins_required", "entitlement_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_line_unavailable", "quantity_not_allowed", "resource_not_found", "service_unavailable"];
235
235
  readonly errorSets: readonly ["tier:application", "request"];
236
236
  }, {
237
237
  readonly method: "POST";
@@ -360,20 +360,6 @@ export declare const OPENRAILS_ROUTES: readonly [{
360
360
  };
361
361
  readonly errors: readonly ["service_unavailable"];
362
362
  readonly errorSets: readonly ["tier:customer"];
363
- }, {
364
- readonly method: "GET";
365
- readonly path: "/v1/products";
366
- readonly group: "checkout";
367
- readonly auth: "public";
368
- readonly permission: null;
369
- readonly sensitive: false;
370
- readonly mountedWhen: null;
371
- readonly request: null;
372
- readonly responses: {
373
- readonly 200: "ListPage<Product>";
374
- };
375
- readonly errors: readonly ["invalid_query", "resource_not_found"];
376
- readonly errorSets: readonly ["tier:public", "request"];
377
363
  }, {
378
364
  readonly method: "POST";
379
365
  readonly path: "/v1/catalog/apply";
@@ -1823,7 +1809,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
1823
1809
  readonly responses: {
1824
1810
  readonly 201: "PSP";
1825
1811
  };
1826
- readonly errors: readonly ["invalid_param", "psp_claim_requires_proof", "psp_credentials_rejected", "psp_exists", "psp_key_taken", "revision_mismatch", "service_unavailable"];
1812
+ readonly errors: readonly ["invalid_param", "platform_vault_unreachable", "psp_claim_requires_proof", "psp_credentials_rejected", "psp_exists", "psp_key_taken", "revision_mismatch", "service_unavailable"];
1827
1813
  readonly errorSets: readonly ["tier:merchant", "request"];
1828
1814
  }, {
1829
1815
  readonly method: "GET";
@@ -1939,7 +1925,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
1939
1925
  readonly responses: {
1940
1926
  readonly 200: "MerchantConfigurationState";
1941
1927
  };
1942
- readonly errors: readonly ["invalid_param", "revision_mismatch", "service_unavailable"];
1928
+ readonly errors: readonly ["card_custody_reserved", "invalid_param", "platform_vault_unavailable", "platform_vault_unreachable", "resource_conflict", "revision_mismatch", "service_unavailable"];
1943
1929
  readonly errorSets: readonly ["tier:merchant", "request"];
1944
1930
  }, {
1945
1931
  readonly method: "GET";
@@ -2024,7 +2010,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
2024
2010
  readonly responses: {
2025
2011
  readonly 200: "application/x-ndjson";
2026
2012
  };
2027
- readonly errors: readonly ["billing_archive_unavailable", "billing_archive_unsupported_state"];
2013
+ readonly errors: readonly ["billing_archive_platform_cards", "billing_archive_unavailable", "billing_archive_unsupported_state"];
2028
2014
  readonly errorSets: readonly ["tier:merchant"];
2029
2015
  }, {
2030
2016
  readonly method: "POST";
@@ -2041,7 +2027,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
2041
2027
  readonly responses: {
2042
2028
  readonly 200: "BillingArchiveImport";
2043
2029
  };
2044
- readonly errors: readonly ["billing_archive_integrity", "billing_archive_invalid_artifact", "billing_archive_merchant_mismatch", "billing_archive_not_empty", "billing_archive_unavailable", "billing_archive_unsupported_state", "request_body_too_large"];
2030
+ readonly errors: readonly ["billing_archive_integrity", "billing_archive_invalid_artifact", "billing_archive_merchant_mismatch", "billing_archive_not_empty", "billing_archive_platform_cards", "billing_archive_unavailable", "billing_archive_unsupported_state", "request_body_too_large"];
2045
2031
  readonly errorSets: readonly ["tier:merchant", "request"];
2046
2032
  }, {
2047
2033
  readonly method: "POST";
@@ -2607,7 +2593,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
2607
2593
  readonly responses: {
2608
2594
  readonly 200: "Order";
2609
2595
  };
2610
- readonly errors: readonly ["card_attempts_blocked", "card_declined", "customer_action_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_not_payable", "order_payment_in_progress", "order_total_changed", "payment_failed", "payment_method_stale", "payment_option_unavailable", "payment_provider_rejected", "resource_conflict", "resource_not_found", "service_unavailable"];
2596
+ readonly errors: readonly ["card_attempts_blocked", "card_declined", "customer_action_required", "entitlement_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_not_payable", "order_payment_in_progress", "order_total_changed", "payment_failed", "payment_method_stale", "payment_option_unavailable", "payment_provider_rejected", "resource_conflict", "resource_not_found", "service_unavailable"];
2611
2597
  readonly errorSets: readonly ["tier:network", "request"];
2612
2598
  }, {
2613
2599
  readonly method: "POST";
@@ -145,6 +145,7 @@ export type ApplyProduct = {
145
145
  archived?: boolean | null;
146
146
  ownership?: "consumable" | "extend" | "unique" | null;
147
147
  entitlements?: string[];
148
+ required_entitlements?: string[];
148
149
  credit_grant?: CreditGrantSpec | null;
149
150
  prices?: Record<string, ApplyPrice>;
150
151
  rate_cards?: RateCard[] | null;
@@ -407,17 +408,6 @@ export type CheckEntitlementsParams = {
407
408
  prefix_limit?: number;
408
409
  at?: string;
409
410
  };
410
- export type CheckoutRoutingMatch = {
411
- currency?: string;
412
- product?: string;
413
- price?: string;
414
- mode?: string;
415
- country?: string;
416
- };
417
- export type CheckoutRoutingRule = {
418
- match?: CheckoutRoutingMatch;
419
- prefer: string[];
420
- };
421
411
  export type ClearDestructiveHoldParams = {
422
412
  reason?: string;
423
413
  };
@@ -455,6 +445,7 @@ export type CreateMyOrderParams = {
455
445
  expected_total?: string;
456
446
  payment?: OrderPaymentParams;
457
447
  reusable?: boolean;
448
+ pay_url?: MyOrderPayURLParams;
458
449
  };
459
450
  export type CreateNetworkLinkParams = {
460
451
  challenge_id?: string;
@@ -464,7 +455,7 @@ export type CreateOrderParams = {
464
455
  customer_id?: string;
465
456
  lines?: OrderLineParams[];
466
457
  expires_at?: string;
467
- checkout?: OrderCheckoutParams;
458
+ pay_url?: OrderPayURLParams;
468
459
  };
469
460
  export type CreatePSPParams = {
470
461
  key?: string;
@@ -531,6 +522,7 @@ export type CreateProductParams = {
531
522
  display_name?: string;
532
523
  description?: string;
533
524
  entitlements?: string[];
525
+ required_entitlements?: string[];
534
526
  credit_grant?: CreditGrantSpec;
535
527
  tier_group?: string;
536
528
  tier_rank?: number;
@@ -638,7 +630,7 @@ export type CustomerLink = {
638
630
  merchant_id: string;
639
631
  customer_id: string;
640
632
  account_id: string;
641
- method: "checkout" | "connect" | "sign_in";
633
+ method: "connect" | "payment_page" | "sign_in";
642
634
  status: "active" | "revoked";
643
635
  linked_at: string;
644
636
  revoked_at: string | null;
@@ -647,12 +639,12 @@ export type CustomerLink = {
647
639
  export type CustomerNetwork = {
648
640
  account_id: string;
649
641
  linked_at: string;
650
- method: "checkout" | "connect" | "sign_in";
642
+ method: "connect" | "payment_page" | "sign_in";
651
643
  };
652
644
  export type CustomerNetworkHostEvent = {
653
645
  customer_id: string;
654
646
  account_id: string;
655
- method: "checkout" | "connect" | "sign_in" | null;
647
+ method: "connect" | "payment_page" | "sign_in" | null;
656
648
  revoked_by: "account_deleted" | "customer" | "merchant_left" | null;
657
649
  };
658
650
  export type CustomerSettings = {
@@ -699,10 +691,18 @@ export type DeclaredBilling = {
699
691
  subscriptions?: DeclaredSubscription[];
700
692
  transactions?: DeclaredTransaction[];
701
693
  admin_grants?: DeclaredAdminGrant[];
694
+ purchases?: DeclaredPurchase[];
702
695
  };
703
696
  export type DeclaredCustomer = {
704
697
  customer?: string;
705
698
  };
699
+ export type DeclaredOrderLine = {
700
+ price?: string;
701
+ quantity?: number;
702
+ unit_amount?: string;
703
+ description?: string;
704
+ access_ends_at?: string;
705
+ };
706
706
  export type DeclaredPaymentMethod = {
707
707
  customer?: string;
708
708
  rail?: string;
@@ -722,6 +722,25 @@ export type DeclaredProviderSchedule = {
722
722
  interval_months?: number;
723
723
  first_due_at?: string;
724
724
  };
725
+ export type DeclaredPurchase = {
726
+ source_id?: string;
727
+ customer?: string;
728
+ rail?: string;
729
+ psp?: PSPRef;
730
+ transaction_id?: string;
731
+ currency?: string;
732
+ amount?: string;
733
+ paid_at?: string;
734
+ lines?: DeclaredOrderLine[];
735
+ settlement?: DeclaredSettlement;
736
+ evidence?: unknown;
737
+ };
738
+ export type DeclaredSettlement = {
739
+ asset?: string;
740
+ quantity?: string;
741
+ payer?: string;
742
+ recipient?: string;
743
+ };
725
744
  export type DeclaredStripeInvoice = {
726
745
  id?: string;
727
746
  customer_reference?: string;
@@ -999,13 +1018,14 @@ export type MatrixCell = {
999
1018
  unit_amount: string;
1000
1019
  maximum_amount?: string;
1001
1020
  };
1002
- export type MerchantCheckoutSettings = {
1003
- embed_origins?: string[];
1004
- };
1005
1021
  export type MerchantConfigurationState = {
1006
1022
  revision: number;
1007
1023
  display_name: string;
1008
1024
  settings: MerchantSettings;
1025
+ platform_vault: PlatformVaultState;
1026
+ };
1027
+ export type MerchantPaymentPageSettings = {
1028
+ embed_origins?: string[];
1009
1029
  };
1010
1030
  export type MerchantProfile = {
1011
1031
  logo_url?: string;
@@ -1024,10 +1044,11 @@ export type MerchantSettings = {
1024
1044
  provider_refund_access?: string;
1025
1045
  arrears_grace_days?: number;
1026
1046
  arrears_delinquency_floor?: string;
1027
- checkout_routing?: CheckoutRoutingRule[];
1047
+ psp_routing?: PSPRoutingRule[];
1028
1048
  dunning_policy?: DunningPolicy;
1029
- checkout?: MerchantCheckoutSettings;
1049
+ payment_page?: MerchantPaymentPageSettings;
1030
1050
  balance_notices?: BalanceNoticeSettings;
1051
+ card_custody?: "hosted" | "merchant" | "platform";
1031
1052
  billing_policies?: BillingPolicy[];
1032
1053
  billing_policy_bindings?: BillingPolicyBinding[];
1033
1054
  delegated_invoker_wasted_spend_limits?: BudgetWindow[];
@@ -1131,6 +1152,9 @@ export type MetricsSchema = {
1131
1152
  limits: MetricsLimits;
1132
1153
  query_shape: string;
1133
1154
  };
1155
+ export type MyOrderPayURLParams = {
1156
+ embedded?: boolean;
1157
+ };
1134
1158
  export type NetworkLink = {
1135
1159
  link: CustomerLink;
1136
1160
  merchant: PublicMerchant;
@@ -1189,7 +1213,12 @@ export type Order = {
1189
1213
  lines: OrderLine[];
1190
1214
  payment: OrderPayment;
1191
1215
  payment_options: OrderPaymentOption[];
1192
- checkout: OrderCheckout | null;
1216
+ pay_url: string | null;
1217
+ pay_url_expires_at: string | null;
1218
+ embedded: boolean;
1219
+ success_url: string | null;
1220
+ cancel_url: string | null;
1221
+ saved_payment_methods: boolean;
1193
1222
  renewal: OrderRenewal | null;
1194
1223
  usage: OrderUsage | null;
1195
1224
  expires_at: string | null;
@@ -1200,21 +1229,6 @@ export type Order = {
1200
1229
  uncollectible_at: string | null;
1201
1230
  created_at: string;
1202
1231
  };
1203
- export type OrderCheckout = {
1204
- url: string | null;
1205
- ui_mode: "embedded" | "hosted";
1206
- expires_at: string;
1207
- success_url: string;
1208
- cancel_url: string | null;
1209
- saved_payment_methods: boolean;
1210
- };
1211
- export type OrderCheckoutParams = {
1212
- ui_mode?: "embedded" | "hosted";
1213
- success_url?: string;
1214
- cancel_url?: string;
1215
- expires_at?: string;
1216
- saved_payment_methods?: boolean;
1217
- };
1218
1232
  export type OrderHostEvent = {
1219
1233
  order_id: string;
1220
1234
  customer_id: string;
@@ -1250,6 +1264,14 @@ export type OrderLineRefusal = {
1250
1264
  message: string;
1251
1265
  owned_by: string | null;
1252
1266
  hint: string | null;
1267
+ missing?: string[];
1268
+ };
1269
+ export type OrderPayURLParams = {
1270
+ embedded?: boolean;
1271
+ success_url?: string;
1272
+ cancel_url?: string;
1273
+ expires_at?: string;
1274
+ saved_payment_methods?: boolean;
1253
1275
  };
1254
1276
  export type OrderPayment = {
1255
1277
  status: "processing" | "requires_action" | "requires_payment_method" | "succeeded";
@@ -1350,7 +1372,7 @@ export type PSPPaymentConfig = {
1350
1372
  custodian: string;
1351
1373
  display_name: string;
1352
1374
  flow: string;
1353
- checkout: boolean;
1375
+ routed: boolean;
1354
1376
  config?: Record<string, string>;
1355
1377
  status?: string;
1356
1378
  retry_after?: number;
@@ -1368,6 +1390,13 @@ export type PSPRoutingCandidate = {
1368
1390
  rail: "ccbill" | "nmi" | "solana" | "stripe";
1369
1391
  skip: string | null;
1370
1392
  };
1393
+ export type PSPRoutingMatch = {
1394
+ currency?: string;
1395
+ product?: string;
1396
+ price?: string;
1397
+ mode?: string;
1398
+ country?: string;
1399
+ };
1371
1400
  export type PSPRoutingPreview = {
1372
1401
  policy: string;
1373
1402
  rule: number | null;
@@ -1376,6 +1405,10 @@ export type PSPRoutingPreview = {
1376
1405
  mode: string | null;
1377
1406
  candidates: PSPRoutingCandidate[];
1378
1407
  };
1408
+ export type PSPRoutingRule = {
1409
+ match?: PSPRoutingMatch;
1410
+ prefer: string[];
1411
+ };
1379
1412
  export type PackagePrice = {
1380
1413
  amount?: string;
1381
1414
  package_size?: number;
@@ -1513,6 +1546,9 @@ export type PerUnitPrice = {
1513
1546
  maximum_amount?: string;
1514
1547
  matrix?: Matrix;
1515
1548
  };
1549
+ export type PlatformVaultState = {
1550
+ available: boolean;
1551
+ };
1516
1552
  export type PreviewMyOrderParams = {
1517
1553
  lines?: OrderLineParams[];
1518
1554
  cart?: boolean;
@@ -1616,6 +1652,7 @@ export type Product = {
1616
1652
  display_name: string;
1617
1653
  description: string;
1618
1654
  entitlements: string[];
1655
+ required_entitlements: string[];
1619
1656
  credit_grant?: CreditGrantSpec;
1620
1657
  tier_group: string | null;
1621
1658
  tier_rank: number;
@@ -2016,6 +2053,7 @@ export type UpdateProductParams = {
2016
2053
  display_name?: string | null;
2017
2054
  description?: string | null;
2018
2055
  entitlements?: string[];
2056
+ required_entitlements?: string[];
2019
2057
  credit_grant?: CreditGrantSpec | null;
2020
2058
  tier_group?: string | null;
2021
2059
  tier_rank?: number | null;
@@ -1,4 +1,4 @@
1
- export { CANCEL_REASON_MAX, CANCEL_REASON_MIN, createBillingClient, isWalletAction, isWalletRejection, RETRY_BUDGET_MS, signWalletAction, WalletRejectedError, type BillingClient, type BillingClientOptions, type ListOptions, type OrderResult, type ProductListOptions, type SendSolanaTransaction, type SubscriptionChangeInput, type UsageOptions, } from './client';
1
+ export { CANCEL_REASON_MAX, CANCEL_REASON_MIN, createBillingClient, isWalletAction, isWalletRejection, RETRY_BUDGET_MS, signWalletAction, WalletRejectedError, type BillingClient, type BillingClientOptions, type ListOptions, type OrderResult, type SendSolanaTransaction, type SubscriptionChangeInput, type UsageOptions, } from './client';
2
2
  export { redeemAssertion, tokenSource, type RedeemAssertionOptions, type TokenResponse, type TokenSource, type TokenSourceOptions, } from './token-source';
3
3
  export { BillingError, isBillingError, isServerError, readBillingError, toBillingError, type BillingErrorBody, } from './errors';
4
4
  export type { Account, Balance, CaptchaConfig, CardSummary, Cart, Currency, CurrencyScales, CustomerConfig, CustomerEntitlement, CustomerLink, PaymentConfig, PaymentFailure, PublicConfig, PublicMerchant, ListPage, LowBalanceLine, NetworkLinkChallenge, NewCard, CardCaptureReference, NextAction, Order, OrderLine, OrderLineRefusal, OrderPaymentInput, OrderPreviewLine, Page, Payment, PaymentMethod, PaymentRecovery, Price, Product, Subscription, SubscriptionDunning, SubscriptionProduct, SubscriptionStatus, SubscriptionChange, SubscriptionChangePreview, Usage, UsageRow, } from './types';