@delopay/sdk 0.62.0 → 0.64.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/index.d.cts CHANGED
@@ -767,6 +767,25 @@ interface MandateRevokedResponse {
767
767
  error_code?: string | null;
768
768
  error_message?: string | null;
769
769
  }
770
+ /** Charset of the random body of a custom-format payment id. */
771
+ type PaymentIdStyle = 'numeric' | 'alphanumeric' | 'alphanumeric_uppercase';
772
+ /**
773
+ * Merchant-configurable format for generated payment ids (cloaking),
774
+ * e.g. `ORD-74219807`. Applied per shop (business profile): payments
775
+ * created without an explicit `payment_id` get `<prefix><random body>`.
776
+ */
777
+ interface PaymentIdFormatConfig {
778
+ /**
779
+ * Static prefix, e.g. `ORD-`. May be empty. Max 16 chars; allowed
780
+ * characters: ascii alphanumerics, `-`, `_`. Internal prefixes
781
+ * (`pay`, `cus`, ...) are rejected.
782
+ */
783
+ prefix: string;
784
+ /** Charset used for the random body of the id. */
785
+ style: PaymentIdStyle;
786
+ /** Length of the random body (6..=32). */
787
+ length: number;
788
+ }
770
789
  interface ShopCreateRequest {
771
790
  shop_name: string;
772
791
  return_url?: string | null;
@@ -788,6 +807,11 @@ interface ShopUpdateRequest {
788
807
  * clickjacking defense. Example: `["https://shop.acme.com"]`.
789
808
  */
790
809
  iframe_allowed_origins?: string[] | null;
810
+ /**
811
+ * Custom format for generated payment ids (cloaking), e.g.
812
+ * `ORD-74219807`. `null` = default `pay_<random>` ids.
813
+ */
814
+ payment_id_format?: PaymentIdFormatConfig | null;
791
815
  }
792
816
  interface ShopResponse {
793
817
  shop_id: string;
@@ -804,6 +828,11 @@ interface ShopResponse {
804
828
  * See {@link ShopUpdateRequest.iframe_allowed_origins}.
805
829
  */
806
830
  iframe_allowed_origins?: string[] | null;
831
+ /**
832
+ * Custom format for generated payment ids (cloaking), e.g.
833
+ * `ORD-74219807`. `null` = default `pay_<random>` ids.
834
+ */
835
+ payment_id_format?: PaymentIdFormatConfig | null;
807
836
  }
808
837
  /** Branding and behavior overrides for a shop's hosted checkout. */
809
838
  interface BusinessPaymentLinkConfig {
@@ -1406,7 +1435,8 @@ interface PaymentLinkListResponse {
1406
1435
  interface RoutingConfigCreateRequest {
1407
1436
  name?: string | null;
1408
1437
  description?: string | null;
1409
- algorithm?: Record<string, unknown> | null;
1438
+ /** Prefer `StaticRoutingAlgorithm`; the raw-record escape hatch is kept for forward compat. */
1439
+ algorithm?: StaticRoutingAlgorithm | Record<string, unknown> | null;
1410
1440
  profile_id?: string | null;
1411
1441
  transaction_type?: TransactionType | null;
1412
1442
  }
@@ -1429,8 +1459,46 @@ interface RoutableConnectorChoice {
1429
1459
  }
1430
1460
  interface ConnectorVolumeSplit {
1431
1461
  connector: RoutableConnectorChoice;
1462
+ /** Percentage weight. All splits in one selection must sum to exactly 100 (server-validated). */
1432
1463
  split: number;
1433
1464
  }
1465
+ /**
1466
+ * Connector-selection leaf of an advanced routing rule: an ordered priority
1467
+ * list or a weighted volume split. snake_case `{type, data}` on the wire.
1468
+ *
1469
+ * Volume splits are drawn per payment via weighted random — the ratio converges
1470
+ * statistically over volume; it is not an exact quota.
1471
+ */
1472
+ type ConnectorSelection = {
1473
+ type: 'priority';
1474
+ data: RoutableConnectorChoice[];
1475
+ } | {
1476
+ type: 'volume_split';
1477
+ data: ConnectorVolumeSplit[];
1478
+ };
1479
+ /**
1480
+ * A single advanced-routing rule (`Rule<ConnectorSelection>`). camelCase on the
1481
+ * wire, like the fee-rule tree (see the note above `EuclidComparisonType`).
1482
+ * Conditions use the Euclid dimension keys, e.g. `payment_method`, `amount`
1483
+ * (minor units), `currency`, `card_network`.
1484
+ */
1485
+ interface RuleConnectorSelection {
1486
+ name: string;
1487
+ connectorSelection: ConnectorSelection;
1488
+ statements: EuclidIfStatement[];
1489
+ }
1490
+ /**
1491
+ * The advanced-routing program (`Program<ConnectorSelection>`) carried by
1492
+ * `{ type: 'advanced' }`. Rules are evaluated top-down, first match wins;
1493
+ * `defaultSelection` applies when no rule matches. Every referenced connector
1494
+ * must be an enabled connector (MCA) of the target profile.
1495
+ */
1496
+ interface ProgramConnectorSelection {
1497
+ defaultSelection: ConnectorSelection;
1498
+ rules: RuleConnectorSelection[];
1499
+ /** Required on the wire — send `{}` when empty. */
1500
+ metadata: Record<string, unknown>;
1501
+ }
1434
1502
  /** Static routing algorithm shape: `{type, data}` adjacently-tagged enum. */
1435
1503
  type StaticRoutingAlgorithm = {
1436
1504
  type: 'single';
@@ -1443,7 +1511,7 @@ type StaticRoutingAlgorithm = {
1443
1511
  data: ConnectorVolumeSplit[];
1444
1512
  } | {
1445
1513
  type: 'advanced';
1446
- data: Record<string, unknown>;
1514
+ data: ProgramConnectorSelection;
1447
1515
  } | {
1448
1516
  type: 'three_ds_decision_rule';
1449
1517
  data: Record<string, unknown>;
@@ -1920,6 +1988,38 @@ interface UserSessionListResponse {
1920
1988
  interface UserSessionRevokeResponse {
1921
1989
  revoked: boolean;
1922
1990
  }
1991
+ /** Optional query params for `GET /user/employees/list`. */
1992
+ interface ListUsersInLineageParams {
1993
+ /**
1994
+ * Lineage level to list members of: `'tenant'`, `'organization'`,
1995
+ * `'merchant'` or `'profile'`. Defaults to the widest level your role can
1996
+ * see.
1997
+ */
1998
+ entity_type?: string;
1999
+ /**
2000
+ * Shop to list members of. Only meaningful together with
2001
+ * `entity_type: 'profile'`, and ignored otherwise. Send it when managing a
2002
+ * shop's team as a merchant-scoped admin: your token points at your own
2003
+ * shop, not the one you are viewing. Defaults to your own shop.
2004
+ */
2005
+ profile_id?: string;
2006
+ }
2007
+ /** A role a member holds, as returned by `GET /user/employees/list`. */
2008
+ interface MinimalRoleInfo {
2009
+ role_id: string;
2010
+ role_name: string;
2011
+ }
2012
+ /** One member of the current lineage. `GET /user/employees/list` */
2013
+ interface UserInLineage {
2014
+ /**
2015
+ * Stable identifier of the member. Use it to target them specifically — for
2016
+ * a per-user operation-limit override, or to resolve a user id stamped on
2017
+ * another resource (such as a refund's `initiated_by`) back to a person.
2018
+ */
2019
+ user_id: string;
2020
+ email: string;
2021
+ roles: MinimalRoleInfo[];
2022
+ }
1923
2023
  /** Optional query params for `GET /user/role/list/invite`. */
1924
2024
  interface ListInvitableRolesParams {
1925
2025
  /**
@@ -2056,6 +2156,11 @@ interface ProfileCreateRequest {
2056
2156
  * Billing / PayPal) that owns this profile's native subscriptions.
2057
2157
  */
2058
2158
  billing_processor_id?: string | null;
2159
+ /**
2160
+ * Custom format for generated payment ids (cloaking), e.g.
2161
+ * `ORD-74219807`. `null` = default `pay_<random>` ids.
2162
+ */
2163
+ payment_id_format?: PaymentIdFormatConfig | null;
2059
2164
  }
2060
2165
  interface ProfileUpdateRequest {
2061
2166
  profile_name?: string | null;
@@ -2076,6 +2181,11 @@ interface ProfileUpdateRequest {
2076
2181
  * Billing / PayPal) that owns this profile's native subscriptions.
2077
2182
  */
2078
2183
  billing_processor_id?: string | null;
2184
+ /**
2185
+ * Custom format for generated payment ids (cloaking), e.g.
2186
+ * `ORD-74219807`. `null` = default `pay_<random>` ids.
2187
+ */
2188
+ payment_id_format?: PaymentIdFormatConfig | null;
2079
2189
  }
2080
2190
  interface ProfileResponse {
2081
2191
  merchant_id: string;
@@ -2104,6 +2214,11 @@ interface ProfileResponse {
2104
2214
  * Billing / PayPal) that owns this profile's native subscriptions.
2105
2215
  */
2106
2216
  billing_processor_id?: string | null;
2217
+ /**
2218
+ * Custom format for generated payment ids (cloaking), e.g.
2219
+ * `ORD-74219807`. `null` = default `pay_<random>` ids.
2220
+ */
2221
+ payment_id_format?: PaymentIdFormatConfig | null;
2107
2222
  [key: string]: unknown;
2108
2223
  }
2109
2224
  type BlocklistAddRequest = {
@@ -3962,6 +4077,48 @@ declare class Routing {
3962
4077
  * algorithm: { type: 'priority', data: [{ connector: 'stripe' }] },
3963
4078
  * });
3964
4079
  * ```
4080
+ *
4081
+ * @example Conditional volume split (advanced): cards → 90% epayouts / 10% stripe.
4082
+ * Rules run top-down (first match wins); `defaultSelection` is the fallback.
4083
+ * Splits must sum to 100; `amount` conditions are in minor units.
4084
+ * ```typescript
4085
+ * const config = await delopay.routing.create({
4086
+ * name: 'Card split 90/10',
4087
+ * profile_id: 'pro_...',
4088
+ * algorithm: {
4089
+ * type: 'advanced',
4090
+ * data: {
4091
+ * defaultSelection: { type: 'priority', data: [{ connector: 'stripe' }] },
4092
+ * rules: [
4093
+ * {
4094
+ * name: 'cards',
4095
+ * connectorSelection: {
4096
+ * type: 'volume_split',
4097
+ * data: [
4098
+ * { connector: { connector: 'epayouts' }, split: 90 },
4099
+ * { connector: { connector: 'stripe' }, split: 10 },
4100
+ * ],
4101
+ * },
4102
+ * statements: [
4103
+ * {
4104
+ * condition: [
4105
+ * {
4106
+ * lhs: 'payment_method',
4107
+ * comparison: 'equal',
4108
+ * value: { type: 'enum_variant', value: 'card' },
4109
+ * metadata: {},
4110
+ * },
4111
+ * ],
4112
+ * },
4113
+ * ],
4114
+ * },
4115
+ * ],
4116
+ * metadata: {},
4117
+ * },
4118
+ * },
4119
+ * });
4120
+ * await delopay.routing.activate(config.id);
4121
+ * ```
3965
4122
  */
3966
4123
  create(params: RoutingConfigCreateRequest): Promise<RoutingDictionaryRecord>;
3967
4124
  /**
@@ -4460,9 +4617,7 @@ declare class Users {
4460
4617
  /** Select auth method. `POST /user/auth/select` */
4461
4618
  selectAuth(params: Record<string, unknown>): Promise<Record<string, unknown>>;
4462
4619
  /** List users in lineage. `GET /user/employees/list` */
4463
- listUsersInLineage(params?: {
4464
- entity_type?: string;
4465
- }): Promise<Record<string, unknown>[]>;
4620
+ listUsersInLineage(params?: ListUsersInLineageParams): Promise<UserInLineage[]>;
4466
4621
  /** Resend invite. `POST /user/resend-invite` */
4467
4622
  resendInvite(params: Record<string, unknown>): Promise<Record<string, unknown>>;
4468
4623
  /**
@@ -5342,4 +5497,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
5342
5497
  declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
5343
5498
  declare function shadowFor(style: SurfaceStyle): string;
5344
5499
 
5345
- export { type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
5500
+ export { type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorSelection, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type ListUsersInLineageParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type MinimalRoleInfo, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentIdFormatConfig, type PaymentIdStyle, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProgramConnectorSelection, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, type RuleConnectorSelection, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserInLineage, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
package/dist/index.d.ts CHANGED
@@ -767,6 +767,25 @@ interface MandateRevokedResponse {
767
767
  error_code?: string | null;
768
768
  error_message?: string | null;
769
769
  }
770
+ /** Charset of the random body of a custom-format payment id. */
771
+ type PaymentIdStyle = 'numeric' | 'alphanumeric' | 'alphanumeric_uppercase';
772
+ /**
773
+ * Merchant-configurable format for generated payment ids (cloaking),
774
+ * e.g. `ORD-74219807`. Applied per shop (business profile): payments
775
+ * created without an explicit `payment_id` get `<prefix><random body>`.
776
+ */
777
+ interface PaymentIdFormatConfig {
778
+ /**
779
+ * Static prefix, e.g. `ORD-`. May be empty. Max 16 chars; allowed
780
+ * characters: ascii alphanumerics, `-`, `_`. Internal prefixes
781
+ * (`pay`, `cus`, ...) are rejected.
782
+ */
783
+ prefix: string;
784
+ /** Charset used for the random body of the id. */
785
+ style: PaymentIdStyle;
786
+ /** Length of the random body (6..=32). */
787
+ length: number;
788
+ }
770
789
  interface ShopCreateRequest {
771
790
  shop_name: string;
772
791
  return_url?: string | null;
@@ -788,6 +807,11 @@ interface ShopUpdateRequest {
788
807
  * clickjacking defense. Example: `["https://shop.acme.com"]`.
789
808
  */
790
809
  iframe_allowed_origins?: string[] | null;
810
+ /**
811
+ * Custom format for generated payment ids (cloaking), e.g.
812
+ * `ORD-74219807`. `null` = default `pay_<random>` ids.
813
+ */
814
+ payment_id_format?: PaymentIdFormatConfig | null;
791
815
  }
792
816
  interface ShopResponse {
793
817
  shop_id: string;
@@ -804,6 +828,11 @@ interface ShopResponse {
804
828
  * See {@link ShopUpdateRequest.iframe_allowed_origins}.
805
829
  */
806
830
  iframe_allowed_origins?: string[] | null;
831
+ /**
832
+ * Custom format for generated payment ids (cloaking), e.g.
833
+ * `ORD-74219807`. `null` = default `pay_<random>` ids.
834
+ */
835
+ payment_id_format?: PaymentIdFormatConfig | null;
807
836
  }
808
837
  /** Branding and behavior overrides for a shop's hosted checkout. */
809
838
  interface BusinessPaymentLinkConfig {
@@ -1406,7 +1435,8 @@ interface PaymentLinkListResponse {
1406
1435
  interface RoutingConfigCreateRequest {
1407
1436
  name?: string | null;
1408
1437
  description?: string | null;
1409
- algorithm?: Record<string, unknown> | null;
1438
+ /** Prefer `StaticRoutingAlgorithm`; the raw-record escape hatch is kept for forward compat. */
1439
+ algorithm?: StaticRoutingAlgorithm | Record<string, unknown> | null;
1410
1440
  profile_id?: string | null;
1411
1441
  transaction_type?: TransactionType | null;
1412
1442
  }
@@ -1429,8 +1459,46 @@ interface RoutableConnectorChoice {
1429
1459
  }
1430
1460
  interface ConnectorVolumeSplit {
1431
1461
  connector: RoutableConnectorChoice;
1462
+ /** Percentage weight. All splits in one selection must sum to exactly 100 (server-validated). */
1432
1463
  split: number;
1433
1464
  }
1465
+ /**
1466
+ * Connector-selection leaf of an advanced routing rule: an ordered priority
1467
+ * list or a weighted volume split. snake_case `{type, data}` on the wire.
1468
+ *
1469
+ * Volume splits are drawn per payment via weighted random — the ratio converges
1470
+ * statistically over volume; it is not an exact quota.
1471
+ */
1472
+ type ConnectorSelection = {
1473
+ type: 'priority';
1474
+ data: RoutableConnectorChoice[];
1475
+ } | {
1476
+ type: 'volume_split';
1477
+ data: ConnectorVolumeSplit[];
1478
+ };
1479
+ /**
1480
+ * A single advanced-routing rule (`Rule<ConnectorSelection>`). camelCase on the
1481
+ * wire, like the fee-rule tree (see the note above `EuclidComparisonType`).
1482
+ * Conditions use the Euclid dimension keys, e.g. `payment_method`, `amount`
1483
+ * (minor units), `currency`, `card_network`.
1484
+ */
1485
+ interface RuleConnectorSelection {
1486
+ name: string;
1487
+ connectorSelection: ConnectorSelection;
1488
+ statements: EuclidIfStatement[];
1489
+ }
1490
+ /**
1491
+ * The advanced-routing program (`Program<ConnectorSelection>`) carried by
1492
+ * `{ type: 'advanced' }`. Rules are evaluated top-down, first match wins;
1493
+ * `defaultSelection` applies when no rule matches. Every referenced connector
1494
+ * must be an enabled connector (MCA) of the target profile.
1495
+ */
1496
+ interface ProgramConnectorSelection {
1497
+ defaultSelection: ConnectorSelection;
1498
+ rules: RuleConnectorSelection[];
1499
+ /** Required on the wire — send `{}` when empty. */
1500
+ metadata: Record<string, unknown>;
1501
+ }
1434
1502
  /** Static routing algorithm shape: `{type, data}` adjacently-tagged enum. */
1435
1503
  type StaticRoutingAlgorithm = {
1436
1504
  type: 'single';
@@ -1443,7 +1511,7 @@ type StaticRoutingAlgorithm = {
1443
1511
  data: ConnectorVolumeSplit[];
1444
1512
  } | {
1445
1513
  type: 'advanced';
1446
- data: Record<string, unknown>;
1514
+ data: ProgramConnectorSelection;
1447
1515
  } | {
1448
1516
  type: 'three_ds_decision_rule';
1449
1517
  data: Record<string, unknown>;
@@ -1920,6 +1988,38 @@ interface UserSessionListResponse {
1920
1988
  interface UserSessionRevokeResponse {
1921
1989
  revoked: boolean;
1922
1990
  }
1991
+ /** Optional query params for `GET /user/employees/list`. */
1992
+ interface ListUsersInLineageParams {
1993
+ /**
1994
+ * Lineage level to list members of: `'tenant'`, `'organization'`,
1995
+ * `'merchant'` or `'profile'`. Defaults to the widest level your role can
1996
+ * see.
1997
+ */
1998
+ entity_type?: string;
1999
+ /**
2000
+ * Shop to list members of. Only meaningful together with
2001
+ * `entity_type: 'profile'`, and ignored otherwise. Send it when managing a
2002
+ * shop's team as a merchant-scoped admin: your token points at your own
2003
+ * shop, not the one you are viewing. Defaults to your own shop.
2004
+ */
2005
+ profile_id?: string;
2006
+ }
2007
+ /** A role a member holds, as returned by `GET /user/employees/list`. */
2008
+ interface MinimalRoleInfo {
2009
+ role_id: string;
2010
+ role_name: string;
2011
+ }
2012
+ /** One member of the current lineage. `GET /user/employees/list` */
2013
+ interface UserInLineage {
2014
+ /**
2015
+ * Stable identifier of the member. Use it to target them specifically — for
2016
+ * a per-user operation-limit override, or to resolve a user id stamped on
2017
+ * another resource (such as a refund's `initiated_by`) back to a person.
2018
+ */
2019
+ user_id: string;
2020
+ email: string;
2021
+ roles: MinimalRoleInfo[];
2022
+ }
1923
2023
  /** Optional query params for `GET /user/role/list/invite`. */
1924
2024
  interface ListInvitableRolesParams {
1925
2025
  /**
@@ -2056,6 +2156,11 @@ interface ProfileCreateRequest {
2056
2156
  * Billing / PayPal) that owns this profile's native subscriptions.
2057
2157
  */
2058
2158
  billing_processor_id?: string | null;
2159
+ /**
2160
+ * Custom format for generated payment ids (cloaking), e.g.
2161
+ * `ORD-74219807`. `null` = default `pay_<random>` ids.
2162
+ */
2163
+ payment_id_format?: PaymentIdFormatConfig | null;
2059
2164
  }
2060
2165
  interface ProfileUpdateRequest {
2061
2166
  profile_name?: string | null;
@@ -2076,6 +2181,11 @@ interface ProfileUpdateRequest {
2076
2181
  * Billing / PayPal) that owns this profile's native subscriptions.
2077
2182
  */
2078
2183
  billing_processor_id?: string | null;
2184
+ /**
2185
+ * Custom format for generated payment ids (cloaking), e.g.
2186
+ * `ORD-74219807`. `null` = default `pay_<random>` ids.
2187
+ */
2188
+ payment_id_format?: PaymentIdFormatConfig | null;
2079
2189
  }
2080
2190
  interface ProfileResponse {
2081
2191
  merchant_id: string;
@@ -2104,6 +2214,11 @@ interface ProfileResponse {
2104
2214
  * Billing / PayPal) that owns this profile's native subscriptions.
2105
2215
  */
2106
2216
  billing_processor_id?: string | null;
2217
+ /**
2218
+ * Custom format for generated payment ids (cloaking), e.g.
2219
+ * `ORD-74219807`. `null` = default `pay_<random>` ids.
2220
+ */
2221
+ payment_id_format?: PaymentIdFormatConfig | null;
2107
2222
  [key: string]: unknown;
2108
2223
  }
2109
2224
  type BlocklistAddRequest = {
@@ -3962,6 +4077,48 @@ declare class Routing {
3962
4077
  * algorithm: { type: 'priority', data: [{ connector: 'stripe' }] },
3963
4078
  * });
3964
4079
  * ```
4080
+ *
4081
+ * @example Conditional volume split (advanced): cards → 90% epayouts / 10% stripe.
4082
+ * Rules run top-down (first match wins); `defaultSelection` is the fallback.
4083
+ * Splits must sum to 100; `amount` conditions are in minor units.
4084
+ * ```typescript
4085
+ * const config = await delopay.routing.create({
4086
+ * name: 'Card split 90/10',
4087
+ * profile_id: 'pro_...',
4088
+ * algorithm: {
4089
+ * type: 'advanced',
4090
+ * data: {
4091
+ * defaultSelection: { type: 'priority', data: [{ connector: 'stripe' }] },
4092
+ * rules: [
4093
+ * {
4094
+ * name: 'cards',
4095
+ * connectorSelection: {
4096
+ * type: 'volume_split',
4097
+ * data: [
4098
+ * { connector: { connector: 'epayouts' }, split: 90 },
4099
+ * { connector: { connector: 'stripe' }, split: 10 },
4100
+ * ],
4101
+ * },
4102
+ * statements: [
4103
+ * {
4104
+ * condition: [
4105
+ * {
4106
+ * lhs: 'payment_method',
4107
+ * comparison: 'equal',
4108
+ * value: { type: 'enum_variant', value: 'card' },
4109
+ * metadata: {},
4110
+ * },
4111
+ * ],
4112
+ * },
4113
+ * ],
4114
+ * },
4115
+ * ],
4116
+ * metadata: {},
4117
+ * },
4118
+ * },
4119
+ * });
4120
+ * await delopay.routing.activate(config.id);
4121
+ * ```
3965
4122
  */
3966
4123
  create(params: RoutingConfigCreateRequest): Promise<RoutingDictionaryRecord>;
3967
4124
  /**
@@ -4460,9 +4617,7 @@ declare class Users {
4460
4617
  /** Select auth method. `POST /user/auth/select` */
4461
4618
  selectAuth(params: Record<string, unknown>): Promise<Record<string, unknown>>;
4462
4619
  /** List users in lineage. `GET /user/employees/list` */
4463
- listUsersInLineage(params?: {
4464
- entity_type?: string;
4465
- }): Promise<Record<string, unknown>[]>;
4620
+ listUsersInLineage(params?: ListUsersInLineageParams): Promise<UserInLineage[]>;
4466
4621
  /** Resend invite. `POST /user/resend-invite` */
4467
4622
  resendInvite(params: Record<string, unknown>): Promise<Record<string, unknown>>;
4468
4623
  /**
@@ -5342,4 +5497,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
5342
5497
  declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
5343
5498
  declare function shadowFor(style: SurfaceStyle): string;
5344
5499
 
5345
- export { type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
5500
+ export { type AddUserRequest, type AddUserResponse, type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, type AnalyticsChild, type AnalyticsConnectorDay, type AnalyticsConnectorSeries, AnalyticsDashboard, type AnalyticsDayBucket, type AnalyticsScopeRequest, type AnalyticsScopeResponse, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyListConstraints, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AttemptStatus, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type AvailabilityOverrideCreateRequest, type AvailabilityOverrideResponse, AvailabilityOverrides, type AvailabilityPreviewMethod, type AvailabilityPreviewParams, type AvailabilityPreviewResponse, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlockedAttempt, type BlockedAttemptListParams, type BlockedAttemptListResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BuiltInRegionGroupResponse, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConditionNode, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, type Connector, type ConnectorCloneRequest, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorSelection, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, type DeleteUserRoleRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EuclidComparison, type EuclidComparisonType, type EuclidIfStatement, type EuclidValue, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, FeeProgramBuilder, type FeeRuleConditions, type FeeRuleInput, type FeeRulePreviewRequest, type FeeRulePreviewResponse, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeSpecInput, type FeeType, Files, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type GroupNode, type ImpersonateEmployeeRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LeafNode, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type ListUsersInLineageParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type MethodSurcharge, type MinimalRoleInfo, type NonPillRadius, type OverrideAction, type OverrideScope, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentAttemptResponse, type PaymentAttemptsListResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentErrorDetails, type PaymentExperience, type PaymentIdFormatConfig, type PaymentIdStyle, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PerMethodSurchargeItem, type PermissionScope, type PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PlatformFeeKind, type PlatformFeeOutput, type PlatformFeeProgram, type PlatformFeeRule, type PlatformFeeRuleInput, type PlatformFeeRuleOutput, type PlatformFeeRuleRecord, type PlatformFeeRuleRequest, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, type ProfileDeniedConnectorsResponse, type ProfileLogoUploadResponse, type ProfileResponse, type ProfileUpdateRequest, type ProgramConnectorSelection, type ProjectCreateRequest, type ProjectResponse, type ProjectStats, type ProjectStatsResponse, type ProjectUpdateRequest, type RecoveryCodesResponse, type RefundCreateRequest, type RefundListParams, type RefundListResponse, type RefundResponse, type RefundStatus, type RefundType, type RefundUpdateRequest, type RegionCountriesResponse, type RegionCreateRequest, type RegionResponse, type RegionSetCountriesRequest, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestExtras, type RequestFn, type RequestOptions, type ResetPasswordRequest, type ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, type RuleConnectorSelection, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurchargeRuleRequest, type SurchargeRuleResponse, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UpdateUserRoleRequest, type UserInLineage, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, type WebhookRegistrationEnvironment, Webhooks, allOf, anyOf, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, feeProgram, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, leaf, logoDimensions, parseImportedBranding, programToTree, radiusValue, ruleMatchToTree, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
package/dist/index.js CHANGED
@@ -49,7 +49,7 @@ import {
49
49
  shadowFor,
50
50
  surfacePadValue,
51
51
  verticalGapValue
52
- } from "./chunk-2OWZIFZO.js";
52
+ } from "./chunk-UQ47CRAI.js";
53
53
  export {
54
54
  Analytics,
55
55
  AnalyticsDashboard,
package/dist/internal.cjs CHANGED
@@ -1892,6 +1892,48 @@ var Routing = class {
1892
1892
  * algorithm: { type: 'priority', data: [{ connector: 'stripe' }] },
1893
1893
  * });
1894
1894
  * ```
1895
+ *
1896
+ * @example Conditional volume split (advanced): cards → 90% epayouts / 10% stripe.
1897
+ * Rules run top-down (first match wins); `defaultSelection` is the fallback.
1898
+ * Splits must sum to 100; `amount` conditions are in minor units.
1899
+ * ```typescript
1900
+ * const config = await delopay.routing.create({
1901
+ * name: 'Card split 90/10',
1902
+ * profile_id: 'pro_...',
1903
+ * algorithm: {
1904
+ * type: 'advanced',
1905
+ * data: {
1906
+ * defaultSelection: { type: 'priority', data: [{ connector: 'stripe' }] },
1907
+ * rules: [
1908
+ * {
1909
+ * name: 'cards',
1910
+ * connectorSelection: {
1911
+ * type: 'volume_split',
1912
+ * data: [
1913
+ * { connector: { connector: 'epayouts' }, split: 90 },
1914
+ * { connector: { connector: 'stripe' }, split: 10 },
1915
+ * ],
1916
+ * },
1917
+ * statements: [
1918
+ * {
1919
+ * condition: [
1920
+ * {
1921
+ * lhs: 'payment_method',
1922
+ * comparison: 'equal',
1923
+ * value: { type: 'enum_variant', value: 'card' },
1924
+ * metadata: {},
1925
+ * },
1926
+ * ],
1927
+ * },
1928
+ * ],
1929
+ * },
1930
+ * ],
1931
+ * metadata: {},
1932
+ * },
1933
+ * },
1934
+ * });
1935
+ * await delopay.routing.activate(config.id);
1936
+ * ```
1895
1937
  */
1896
1938
  async create(params) {
1897
1939
  return this.request("POST", "/routing", { body: params });