@openrails/billing-ui 0.245.0 → 0.246.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/CHANGELOG.md +5 -0
- package/dist/client/client.d.ts +12 -2
- package/dist/client/generated/error-codes.d.ts +1 -1
- package/dist/client/generated/routes.d.ts +15 -1
- package/dist/client/generated/wire.d.ts +63 -3
- package/dist/client/index.d.ts +1 -1
- package/dist/client/types.d.ts +27 -1
- package/dist/{client-D5Af726I.js → client-CfiKK7wX.js} +89 -70
- package/dist/client-CfiKK7wX.js.map +1 -0
- package/dist/client.js +1 -1
- package/dist/{hooks-CYjlHS28.js → hooks-Cz2L8c8F.js} +2 -2
- package/dist/{hooks-CYjlHS28.js.map → hooks-Cz2L8c8F.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/react.js +1 -1
- package/package.json +1 -1
- package/dist/client-D5Af726I.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Low-balance lines
|
|
4
|
+
|
|
5
|
+
- `getAccount()` answers `low_balance_lines`: the line each balance is judged
|
|
6
|
+
at, with its `source`. `setLowBalanceLine()` sets the customer's own.
|
|
7
|
+
|
|
3
8
|
## Embeddable billing administration
|
|
4
9
|
|
|
5
10
|
- `@openrails/billing-ui/admin` exports `BillingAdmin`, `BillingCustomerSummary`,
|
package/dist/client/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BillingError } from './errors';
|
|
2
|
-
import { Account, CustomerConfig, CustomerLink, NetworkLinkChallenge, PublicConfig, CurrencyScales, ListPage, NewCard, CardCaptureReference, NextAction, Cart, Order, OrderPaymentInput, Page, Payment, PaymentMethod, Product, Subscription, SubscriptionChange, SubscriptionChangePreview, Usage } from './types';
|
|
2
|
+
import { Account, CustomerConfig, CustomerLink, LowBalanceLine, NetworkLinkChallenge, PublicConfig, CurrencyScales, ListPage, NewCard, CardCaptureReference, NextAction, Cart, Order, OrderPaymentInput, Page, Payment, PaymentMethod, Product, Subscription, SubscriptionChange, SubscriptionChangePreview, Usage } from './types';
|
|
3
3
|
export interface BillingClientOptions {
|
|
4
4
|
/** OpenRails embedded mount. Default "/billing/v1". */
|
|
5
5
|
baseUrl?: string;
|
|
@@ -228,9 +228,19 @@ export declare function createBillingClient(options?: BillingClientOptions): {
|
|
|
228
228
|
}): Promise<ListPage<Payment>>;
|
|
229
229
|
/**
|
|
230
230
|
* The customer's summary: balance and amount owed per currency, the card
|
|
231
|
-
* that pays each currency, and
|
|
231
|
+
* that pays each currency, and the low-balance line of each balance.
|
|
232
232
|
*/
|
|
233
233
|
getAccount(signal?: AbortSignal): Promise<Account>;
|
|
234
|
+
/**
|
|
235
|
+
* Sets the customer's own low-balance line in one currency and answers
|
|
236
|
+
* the line its balance is judged at. `null` inherits the merchant's; 0
|
|
237
|
+
* turns that part off.
|
|
238
|
+
*/
|
|
239
|
+
setLowBalanceLine(input: {
|
|
240
|
+
currency: string;
|
|
241
|
+
amount: string | null;
|
|
242
|
+
runwayHours: number | null;
|
|
243
|
+
}): Promise<LowBalanceLine>;
|
|
234
244
|
/**
|
|
235
245
|
* A page of the customer's usage: its groups by total amount, largest
|
|
236
246
|
* first. Pass the answer's `next_cursor` as `cursor` for the next page.
|
|
@@ -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" | "finding_action_failed" | "finding_not_actionable" | "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" | "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_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";
|
|
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;
|
|
@@ -1231,6 +1231,20 @@ export declare const OPENRAILS_ROUTES: readonly [{
|
|
|
1231
1231
|
};
|
|
1232
1232
|
readonly errors: readonly [];
|
|
1233
1233
|
readonly errorSets: readonly ["tier:customer"];
|
|
1234
|
+
}, {
|
|
1235
|
+
readonly method: "PUT";
|
|
1236
|
+
readonly path: "/v1/me/low-balance-lines/{currency}";
|
|
1237
|
+
readonly group: "customer";
|
|
1238
|
+
readonly auth: "customer";
|
|
1239
|
+
readonly permission: null;
|
|
1240
|
+
readonly sensitive: false;
|
|
1241
|
+
readonly mountedWhen: null;
|
|
1242
|
+
readonly request: "SetLowBalanceLineParams";
|
|
1243
|
+
readonly responses: {
|
|
1244
|
+
readonly 200: "EffectiveLowBalanceLine";
|
|
1245
|
+
};
|
|
1246
|
+
readonly errors: readonly ["currency_unsupported", "invalid_param"];
|
|
1247
|
+
readonly errorSets: readonly ["tier:customer", "request"];
|
|
1234
1248
|
}, {
|
|
1235
1249
|
readonly method: "GET";
|
|
1236
1250
|
readonly path: "/v1/me/balance/transactions";
|
|
@@ -2279,7 +2293,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
|
|
|
2279
2293
|
readonly responses: {
|
|
2280
2294
|
readonly 200: "FindingResolution";
|
|
2281
2295
|
};
|
|
2282
|
-
readonly errors: readonly ["finding_action_failed", "finding_not_actionable", "idempotency_key_reused", "invalid_param", "payment_not_found", "payment_not_refundable", "provider_cancel_held", "rebill_terms_committed", "refund_failed", "refund_rail_unavailable", "refund_unsupported", "resource_conflict", "resource_not_found", "service_unavailable"];
|
|
2296
|
+
readonly errors: readonly ["finding_action_failed", "finding_not_actionable", "finding_requires_merchant_config", "idempotency_key_reused", "invalid_param", "payment_not_found", "payment_not_refundable", "provider_cancel_held", "rebill_terms_committed", "refund_failed", "refund_rail_unavailable", "refund_unsupported", "resource_conflict", "resource_not_found", "service_unavailable"];
|
|
2283
2297
|
readonly errorSets: readonly ["tier:merchant", "request"];
|
|
2284
2298
|
}, {
|
|
2285
2299
|
readonly method: "GET";
|
|
@@ -171,8 +171,19 @@ export type BalanceHostEvent = {
|
|
|
171
171
|
available_amount: string;
|
|
172
172
|
owed_amount: string;
|
|
173
173
|
accrual_rate_per_hour: string;
|
|
174
|
+
usage_rate_per_hour: string;
|
|
175
|
+
low_balance_amount: string;
|
|
174
176
|
as_of: string;
|
|
175
|
-
depletes_at: string;
|
|
177
|
+
depletes_at: string | null;
|
|
178
|
+
runway_ends_at: string | null;
|
|
179
|
+
};
|
|
180
|
+
export type BalanceNoticeAmount = {
|
|
181
|
+
currency: string;
|
|
182
|
+
amount: string;
|
|
183
|
+
};
|
|
184
|
+
export type BalanceNoticeSettings = {
|
|
185
|
+
runway_hours?: number;
|
|
186
|
+
low_amounts?: BalanceNoticeAmount[];
|
|
176
187
|
};
|
|
177
188
|
export type BalanceTransaction = {
|
|
178
189
|
id: string;
|
|
@@ -366,6 +377,24 @@ export type CatalogFieldConflict = {
|
|
|
366
377
|
set_by: string;
|
|
367
378
|
set_at: string;
|
|
368
379
|
};
|
|
380
|
+
export type ChangeBasis = {
|
|
381
|
+
row_version: number | null;
|
|
382
|
+
absent_rail_id: string | null;
|
|
383
|
+
card_version_id: string | null;
|
|
384
|
+
};
|
|
385
|
+
export type ChangeEffects = {
|
|
386
|
+
ends_access: boolean;
|
|
387
|
+
moves_money: boolean;
|
|
388
|
+
provider_write: boolean;
|
|
389
|
+
};
|
|
390
|
+
export type ChangeEvidence = {
|
|
391
|
+
read: string;
|
|
392
|
+
provider: Record<string, unknown> | null;
|
|
393
|
+
};
|
|
394
|
+
export type ChangeSubject = {
|
|
395
|
+
type: string;
|
|
396
|
+
id: string;
|
|
397
|
+
};
|
|
369
398
|
export type ChangeSubscriptionParams = {
|
|
370
399
|
price_id?: string;
|
|
371
400
|
quantity?: number;
|
|
@@ -570,6 +599,7 @@ export type CustomerAccount = {
|
|
|
570
599
|
id: string;
|
|
571
600
|
balances: Balance[];
|
|
572
601
|
default_payment_methods: DefaultPaymentMethod[];
|
|
602
|
+
low_balance_lines: EffectiveLowBalanceLine[];
|
|
573
603
|
};
|
|
574
604
|
export type CustomerAmount = {
|
|
575
605
|
min_amount: string;
|
|
@@ -625,6 +655,7 @@ export type CustomerNetworkHostEvent = {
|
|
|
625
655
|
export type CustomerSettings = {
|
|
626
656
|
credit_limits: CreditLimit[];
|
|
627
657
|
trust_levels: TrustLevel[];
|
|
658
|
+
low_balance_lines: LowBalanceLine[];
|
|
628
659
|
billing_policy: string | null;
|
|
629
660
|
invoice_profile: InvoiceProfile | null;
|
|
630
661
|
};
|
|
@@ -738,6 +769,12 @@ export type DunningTier = {
|
|
|
738
769
|
max_cycle_hours?: number;
|
|
739
770
|
retry_after_hours?: number[];
|
|
740
771
|
};
|
|
772
|
+
export type EffectiveLowBalanceLine = {
|
|
773
|
+
currency: string;
|
|
774
|
+
amount: string;
|
|
775
|
+
runway_hours: number;
|
|
776
|
+
source: "customer" | "default" | "merchant";
|
|
777
|
+
};
|
|
741
778
|
export type EntitlementChange = {
|
|
742
779
|
product_id: string;
|
|
743
780
|
product_key: string;
|
|
@@ -792,9 +829,23 @@ export type Finding = {
|
|
|
792
829
|
resolution: string | null;
|
|
793
830
|
resolved_by: string | null;
|
|
794
831
|
operator_notes: string | null;
|
|
832
|
+
source: "pull" | "verification" | null;
|
|
833
|
+
change: FindingChange | null;
|
|
834
|
+
approval_run_id: string | null;
|
|
795
835
|
created_at: string;
|
|
796
836
|
updated_at: string;
|
|
797
837
|
};
|
|
838
|
+
export type FindingChange = {
|
|
839
|
+
kind: "adopt_subscription" | "cancel_provider_schedule" | "cancel_subscription" | "collect_skipped_renewal" | "create_subscription" | "record_charge" | "record_refund" | "refund_charge_after_cancel" | "revoke_access" | "update_card";
|
|
840
|
+
subject: ChangeSubject;
|
|
841
|
+
customer_id: string | null;
|
|
842
|
+
from: Record<string, unknown> | null;
|
|
843
|
+
to: Record<string, unknown> | null;
|
|
844
|
+
effects: ChangeEffects;
|
|
845
|
+
basis: ChangeBasis;
|
|
846
|
+
observed_at: string;
|
|
847
|
+
evidence: ChangeEvidence;
|
|
848
|
+
};
|
|
798
849
|
export type FindingRecommendation = {
|
|
799
850
|
action: string;
|
|
800
851
|
params: Record<string, unknown> | null;
|
|
@@ -843,6 +894,11 @@ export type InvoiceProfile = {
|
|
|
843
894
|
billing_contacts: InvoiceContact[];
|
|
844
895
|
memo: string;
|
|
845
896
|
};
|
|
897
|
+
export type LowBalanceLine = {
|
|
898
|
+
currency: string;
|
|
899
|
+
amount: string | null;
|
|
900
|
+
runway_hours: number | null;
|
|
901
|
+
};
|
|
846
902
|
export type Mandate = {
|
|
847
903
|
id: string;
|
|
848
904
|
customer_id: string;
|
|
@@ -906,6 +962,7 @@ export type MerchantSettings = {
|
|
|
906
962
|
checkout_routing?: CheckoutRoutingRule[];
|
|
907
963
|
dunning_policy?: DunningPolicy;
|
|
908
964
|
checkout?: MerchantCheckoutSettings;
|
|
965
|
+
balance_notices?: BalanceNoticeSettings;
|
|
909
966
|
billing_policies?: BillingPolicy[];
|
|
910
967
|
billing_policy_bindings?: BillingPolicyBinding[];
|
|
911
968
|
delegated_invoker_wasted_spend_limits?: BudgetWindow[];
|
|
@@ -1670,7 +1727,6 @@ export type RunningCharge = {
|
|
|
1670
1727
|
posted_amount: string;
|
|
1671
1728
|
as_of: string;
|
|
1672
1729
|
overdraft_amount: string;
|
|
1673
|
-
low_balance_amount: string;
|
|
1674
1730
|
resource: string | null;
|
|
1675
1731
|
created_at: string;
|
|
1676
1732
|
updated_at: string;
|
|
@@ -1695,6 +1751,10 @@ export type SetDashboardParams = {
|
|
|
1695
1751
|
export type SetDefaultPaymentMethodParams = {
|
|
1696
1752
|
payment_method_id?: string;
|
|
1697
1753
|
};
|
|
1754
|
+
export type SetLowBalanceLineParams = {
|
|
1755
|
+
amount?: string | null;
|
|
1756
|
+
runway_hours?: number | null;
|
|
1757
|
+
};
|
|
1698
1758
|
export type SetMeterParams = {
|
|
1699
1759
|
event_type?: string;
|
|
1700
1760
|
value_property?: string;
|
|
@@ -1740,7 +1800,6 @@ export type StartRunningChargeParams = {
|
|
|
1740
1800
|
started_at?: string;
|
|
1741
1801
|
minimum_amount?: string;
|
|
1742
1802
|
overdraft_amount?: string;
|
|
1743
|
-
low_balance_amount?: string;
|
|
1744
1803
|
resource?: string;
|
|
1745
1804
|
};
|
|
1746
1805
|
export type StopRunningChargeParams = {
|
|
@@ -1853,6 +1912,7 @@ export type UpdateAlertWebhookParams = {
|
|
|
1853
1912
|
export type UpdateCustomerParams = {
|
|
1854
1913
|
credit_limits?: CreditLimit[];
|
|
1855
1914
|
trust_levels?: TrustLevel[];
|
|
1915
|
+
low_balance_lines?: LowBalanceLine[];
|
|
1856
1916
|
billing_policy?: string | null;
|
|
1857
1917
|
invoice_profile?: InvoiceProfile | null;
|
|
1858
1918
|
};
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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';
|
|
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
|
-
export type { Account, Balance, CaptchaConfig, CardSummary, Cart, Currency, CurrencyScales, CustomerConfig, CustomerLink, PaymentConfig, PaymentFailure, PublicConfig, PublicMerchant, ListPage, 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';
|
|
4
|
+
export type { Account, Balance, CaptchaConfig, CardSummary, Cart, Currency, CurrencyScales, CustomerConfig, 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';
|
|
5
5
|
export { amountToDecimal, decimalToAmount, formatAmount, type Amount, } from '../lib/money';
|
package/dist/client/types.d.ts
CHANGED
|
@@ -694,9 +694,25 @@ export declare const balanceSchema: z.ZodObject<{
|
|
|
694
694
|
depletes_at: z.ZodNullable<z.ZodString>;
|
|
695
695
|
}, z.core.$strip>;
|
|
696
696
|
export type Balance = z.infer<typeof balanceSchema>;
|
|
697
|
+
/**
|
|
698
|
+
* The low-balance line a balance is judged at: the customer is told when what
|
|
699
|
+
* it may spend is under the larger of `amount` and its burn rate times
|
|
700
|
+
* `runway_hours`. `source` is `customer`, `merchant` or `default`.
|
|
701
|
+
*/
|
|
702
|
+
export declare const lowBalanceLineSchema: z.ZodObject<{
|
|
703
|
+
currency: z.ZodString;
|
|
704
|
+
amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
705
|
+
runway_hours: z.ZodNumber;
|
|
706
|
+
source: z.ZodEnum<{
|
|
707
|
+
customer: "customer";
|
|
708
|
+
default: "default";
|
|
709
|
+
merchant: "merchant";
|
|
710
|
+
}>;
|
|
711
|
+
}, z.core.$strip>;
|
|
712
|
+
export type LowBalanceLine = z.infer<typeof lowBalanceLineSchema>;
|
|
697
713
|
/**
|
|
698
714
|
* The signed-in customer's summary (`GET /me`): money per currency, the
|
|
699
|
-
* default card of each currency, and
|
|
715
|
+
* default card of each currency, and the low-balance line of each balance.
|
|
700
716
|
*/
|
|
701
717
|
export declare const accountSchema: z.ZodObject<{
|
|
702
718
|
id: z.ZodString;
|
|
@@ -716,6 +732,16 @@ export declare const accountSchema: z.ZodObject<{
|
|
|
716
732
|
currency: z.ZodString;
|
|
717
733
|
payment_method_id: z.ZodString;
|
|
718
734
|
}, z.core.$strip>>;
|
|
735
|
+
low_balance_lines: z.ZodArray<z.ZodObject<{
|
|
736
|
+
currency: z.ZodString;
|
|
737
|
+
amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
738
|
+
runway_hours: z.ZodNumber;
|
|
739
|
+
source: z.ZodEnum<{
|
|
740
|
+
customer: "customer";
|
|
741
|
+
default: "default";
|
|
742
|
+
merchant: "merchant";
|
|
743
|
+
}>;
|
|
744
|
+
}, z.core.$strip>>;
|
|
719
745
|
}, z.core.$strip>;
|
|
720
746
|
export type Account = z.infer<typeof accountSchema>;
|
|
721
747
|
/**
|