@delopay/sdk 0.18.1 → 0.18.3

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
@@ -1080,6 +1080,94 @@ interface RoutingConfigCreateRequest {
1080
1080
  profile_id?: string | null;
1081
1081
  transaction_type?: TransactionType | null;
1082
1082
  }
1083
+ /** Body for `POST /routing/{id}/activate`. */
1084
+ interface RoutingActivatePayload {
1085
+ transaction_type?: TransactionType | null;
1086
+ }
1087
+ /** Body for `POST /routing/deactivate`. */
1088
+ interface RoutingDeactivateRequest {
1089
+ name?: string | null;
1090
+ description?: string | null;
1091
+ algorithm?: Record<string, unknown> | null;
1092
+ profile_id?: string | null;
1093
+ transaction_type?: TransactionType | null;
1094
+ }
1095
+ /** Routable connector choice — used by Priority and as a member of VolumeSplit. */
1096
+ interface RoutableConnectorChoice {
1097
+ connector: string;
1098
+ merchant_connector_id?: string | null;
1099
+ }
1100
+ interface ConnectorVolumeSplit {
1101
+ connector: RoutableConnectorChoice;
1102
+ split: number;
1103
+ }
1104
+ /** Static routing algorithm shape: `{type, data}` adjacently-tagged enum. */
1105
+ type StaticRoutingAlgorithm = {
1106
+ type: 'single';
1107
+ data: RoutableConnectorChoice;
1108
+ } | {
1109
+ type: 'priority';
1110
+ data: RoutableConnectorChoice[];
1111
+ } | {
1112
+ type: 'volume_split';
1113
+ data: ConnectorVolumeSplit[];
1114
+ } | {
1115
+ type: 'advanced';
1116
+ data: Record<string, unknown>;
1117
+ } | {
1118
+ type: 'three_ds_decision_rule';
1119
+ data: Record<string, unknown>;
1120
+ };
1121
+ /** Metadata record returned by list / create / activate / deactivate. No `algorithm` field. */
1122
+ interface RoutingDictionaryRecord {
1123
+ id: string;
1124
+ profile_id: string;
1125
+ name: string;
1126
+ kind: string;
1127
+ description: string;
1128
+ /** Milliseconds since epoch. */
1129
+ created_at: number;
1130
+ /** Milliseconds since epoch. */
1131
+ modified_at: number;
1132
+ algorithm_for: TransactionType | null;
1133
+ decision_engine_routing_id?: string | null;
1134
+ }
1135
+ /** Full routing config returned by `GET /routing/{id}`. */
1136
+ interface MerchantRoutingAlgorithm {
1137
+ id: string;
1138
+ profile_id: string;
1139
+ name: string;
1140
+ description: string;
1141
+ algorithm: StaticRoutingAlgorithm | Record<string, unknown>;
1142
+ /** Milliseconds since epoch. */
1143
+ created_at: number;
1144
+ /** Milliseconds since epoch. */
1145
+ modified_at: number;
1146
+ algorithm_for: TransactionType;
1147
+ }
1148
+ /** Response from `GET /routing` and `GET /routing/list/profile`. */
1149
+ interface RoutingDictionary {
1150
+ merchant_id: string;
1151
+ active_id: string | null;
1152
+ records: RoutingDictionaryRecord[];
1153
+ }
1154
+ /** Per-profile default fallback routing returned by `GET /routing/default/profile`. */
1155
+ interface ProfileDefaultRoutingConfig {
1156
+ profile_id: string;
1157
+ connectors: RoutableConnectorChoice[];
1158
+ }
1159
+ /**
1160
+ * Response from `GET /routing/active`. Backend returns an untagged enum that's
1161
+ * either a struct `{ algorithm: ... }` (merchant-account based) or an array
1162
+ * of records (profile based).
1163
+ */
1164
+ type LinkedRoutingConfigRetrieveResponse = {
1165
+ algorithm: MerchantRoutingAlgorithm | null;
1166
+ } | RoutingDictionaryRecord[];
1167
+ /**
1168
+ * @deprecated Prefer the specific shapes: `RoutingDictionaryRecord` (list/create/activate)
1169
+ * or `MerchantRoutingAlgorithm` (retrieve). Kept for backwards compatibility.
1170
+ */
1083
1171
  interface RoutingConfigResponse {
1084
1172
  id?: string | null;
1085
1173
  name?: string | null;
@@ -2647,7 +2735,8 @@ declare class Routing {
2647
2735
  * Create a new routing algorithm.
2648
2736
  *
2649
2737
  * @param params - Routing algorithm definition (rule-based, priority, or volume-based).
2650
- * @returns The created routing configuration.
2738
+ * @returns Metadata record for the created routing configuration. The full
2739
+ * algorithm body is not echoed back — use `retrieve(id)` if you need it.
2651
2740
  *
2652
2741
  * @example
2653
2742
  * ```typescript
@@ -2657,43 +2746,49 @@ declare class Routing {
2657
2746
  * });
2658
2747
  * ```
2659
2748
  */
2660
- create(params: RoutingConfigCreateRequest): Promise<RoutingConfigResponse>;
2749
+ create(params: RoutingConfigCreateRequest): Promise<RoutingDictionaryRecord>;
2661
2750
  /**
2662
2751
  * Retrieve a routing algorithm by its ID.
2663
2752
  *
2664
2753
  * @param algorithmId - The routing algorithm ID.
2665
- * @returns The routing configuration.
2754
+ * @returns The full routing configuration including the algorithm body.
2666
2755
  */
2667
- retrieve(algorithmId: string): Promise<RoutingConfigResponse>;
2756
+ retrieve(algorithmId: string): Promise<MerchantRoutingAlgorithm>;
2668
2757
  /**
2669
- * Activate a routing algorithm, making it the active routing strategy for the shop.
2758
+ * Activate a routing algorithm, making it the active routing strategy.
2759
+ *
2760
+ * Always sends a JSON body (default `{}`) so the request carries the
2761
+ * `Content-Type: application/json` header that the server requires.
2670
2762
  *
2671
2763
  * @param algorithmId - The routing algorithm ID to activate.
2672
- * @returns The activated routing configuration.
2764
+ * @param params - Optional activation payload (e.g. `transaction_type`).
2673
2765
  */
2674
- activate(algorithmId: string): Promise<RoutingConfigResponse>;
2766
+ activate(algorithmId: string, params?: RoutingActivatePayload): Promise<RoutingDictionaryRecord>;
2675
2767
  /**
2676
2768
  * Deactivate the currently active routing algorithm (falls back to default routing).
2677
2769
  *
2678
- * @returns The deactivated routing configuration.
2770
+ * Always sends a JSON body (default `{}`) so the request carries the
2771
+ * `Content-Type: application/json` header that the server requires.
2772
+ *
2773
+ * @param params - Optional deactivation payload.
2679
2774
  */
2680
- deactivate(): Promise<RoutingConfigResponse>;
2775
+ deactivate(params?: RoutingDeactivateRequest): Promise<RoutingDictionaryRecord>;
2681
2776
  /**
2682
- * List all routing algorithms for the current shop.
2777
+ * List all routing algorithms for the current merchant.
2683
2778
  *
2684
- * @returns Array of routing configurations.
2779
+ * @returns The routing dictionary (records + currently active id).
2685
2780
  */
2686
- list(): Promise<RoutingConfigResponse[]>;
2781
+ list(): Promise<RoutingDictionary>;
2687
2782
  /** Get active routing config. `GET /routing/active` */
2688
- getActive(): Promise<RoutingConfigResponse>;
2783
+ getActive(): Promise<LinkedRoutingConfigRetrieveResponse>;
2689
2784
  /** Update default routing config. `POST /routing/default` */
2690
- updateDefault(params: Record<string, unknown>): Promise<RoutingConfigResponse>;
2785
+ updateDefault(params: Record<string, unknown>): Promise<RoutableConnectorChoice[]>;
2691
2786
  /** Retrieve default config for profiles. `GET /routing/default/profile` */
2692
- getDefaultProfile(): Promise<RoutingConfigResponse>;
2787
+ getDefaultProfile(): Promise<RoutableConnectorChoice[] | ProfileDefaultRoutingConfig[]>;
2693
2788
  /** Update default config for a profile. `POST /routing/default/profile/{profileId}` */
2694
- updateDefaultProfile(profileId: string, params: Record<string, unknown>): Promise<RoutingConfigResponse>;
2789
+ updateDefaultProfile(profileId: string, params: Record<string, unknown>): Promise<ProfileDefaultRoutingConfig>;
2695
2790
  /** List routing configs for profile. `GET /routing/list/profile` */
2696
- listForProfile(): Promise<RoutingConfigResponse[]>;
2791
+ listForProfile(): Promise<RoutingDictionary>;
2697
2792
  /** Evaluate a routing rule. `POST /routing/rule/evaluate` */
2698
2793
  evaluateRule(params: Record<string, unknown>): Promise<Record<string, unknown>>;
2699
2794
  /** Migrate routing rules for profile. `POST /routing/rule/migrate` */
@@ -3442,4 +3537,4 @@ declare const Webhooks: {
3442
3537
  verify(rawBody: string | Uint8Array, signatureHeader: string, secret: string): Promise<WebhookEvent>;
3443
3538
  };
3444
3539
 
3445
- export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, AnalyticsDashboard, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BusinessPaymentLinkConfig, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type Connector, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeType, Files, Forex, type ForgotPasswordRequest, type FromEmailRequest, type GatewayConnectRequest, type GatewayResponse, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type LedgerEntry, type LedgerListParams, type LedgerResponse, type ListInvitableRolesParams, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, 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 PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, 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 RegionCreateRequest, type RegionResponse, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestFn, type RequestOptions, type ResetPasswordRequest, type RoutingConfigCreateRequest, type RoutingConfigResponse, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionCreateRequest, type SubscriptionListParams, type SubscriptionListResponse, type SubscriptionResponse, type SubscriptionUpdateRequest, Subscriptions, 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 UpdateUserDetailsRequest, type UserResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks };
3540
+ export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, AnalyticsDashboard, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BusinessPaymentLinkConfig, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type Connector, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeType, Files, Forex, type ForgotPasswordRequest, type FromEmailRequest, type GatewayConnectRequest, type GatewayResponse, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, 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 PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, 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 PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, 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 RegionCreateRequest, type RegionResponse, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestFn, type RequestOptions, type ResetPasswordRequest, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionCreateRequest, type SubscriptionListParams, type SubscriptionListResponse, type SubscriptionResponse, type SubscriptionUpdateRequest, Subscriptions, 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 UpdateUserDetailsRequest, type UserResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks };
package/dist/index.d.ts CHANGED
@@ -1080,6 +1080,94 @@ interface RoutingConfigCreateRequest {
1080
1080
  profile_id?: string | null;
1081
1081
  transaction_type?: TransactionType | null;
1082
1082
  }
1083
+ /** Body for `POST /routing/{id}/activate`. */
1084
+ interface RoutingActivatePayload {
1085
+ transaction_type?: TransactionType | null;
1086
+ }
1087
+ /** Body for `POST /routing/deactivate`. */
1088
+ interface RoutingDeactivateRequest {
1089
+ name?: string | null;
1090
+ description?: string | null;
1091
+ algorithm?: Record<string, unknown> | null;
1092
+ profile_id?: string | null;
1093
+ transaction_type?: TransactionType | null;
1094
+ }
1095
+ /** Routable connector choice — used by Priority and as a member of VolumeSplit. */
1096
+ interface RoutableConnectorChoice {
1097
+ connector: string;
1098
+ merchant_connector_id?: string | null;
1099
+ }
1100
+ interface ConnectorVolumeSplit {
1101
+ connector: RoutableConnectorChoice;
1102
+ split: number;
1103
+ }
1104
+ /** Static routing algorithm shape: `{type, data}` adjacently-tagged enum. */
1105
+ type StaticRoutingAlgorithm = {
1106
+ type: 'single';
1107
+ data: RoutableConnectorChoice;
1108
+ } | {
1109
+ type: 'priority';
1110
+ data: RoutableConnectorChoice[];
1111
+ } | {
1112
+ type: 'volume_split';
1113
+ data: ConnectorVolumeSplit[];
1114
+ } | {
1115
+ type: 'advanced';
1116
+ data: Record<string, unknown>;
1117
+ } | {
1118
+ type: 'three_ds_decision_rule';
1119
+ data: Record<string, unknown>;
1120
+ };
1121
+ /** Metadata record returned by list / create / activate / deactivate. No `algorithm` field. */
1122
+ interface RoutingDictionaryRecord {
1123
+ id: string;
1124
+ profile_id: string;
1125
+ name: string;
1126
+ kind: string;
1127
+ description: string;
1128
+ /** Milliseconds since epoch. */
1129
+ created_at: number;
1130
+ /** Milliseconds since epoch. */
1131
+ modified_at: number;
1132
+ algorithm_for: TransactionType | null;
1133
+ decision_engine_routing_id?: string | null;
1134
+ }
1135
+ /** Full routing config returned by `GET /routing/{id}`. */
1136
+ interface MerchantRoutingAlgorithm {
1137
+ id: string;
1138
+ profile_id: string;
1139
+ name: string;
1140
+ description: string;
1141
+ algorithm: StaticRoutingAlgorithm | Record<string, unknown>;
1142
+ /** Milliseconds since epoch. */
1143
+ created_at: number;
1144
+ /** Milliseconds since epoch. */
1145
+ modified_at: number;
1146
+ algorithm_for: TransactionType;
1147
+ }
1148
+ /** Response from `GET /routing` and `GET /routing/list/profile`. */
1149
+ interface RoutingDictionary {
1150
+ merchant_id: string;
1151
+ active_id: string | null;
1152
+ records: RoutingDictionaryRecord[];
1153
+ }
1154
+ /** Per-profile default fallback routing returned by `GET /routing/default/profile`. */
1155
+ interface ProfileDefaultRoutingConfig {
1156
+ profile_id: string;
1157
+ connectors: RoutableConnectorChoice[];
1158
+ }
1159
+ /**
1160
+ * Response from `GET /routing/active`. Backend returns an untagged enum that's
1161
+ * either a struct `{ algorithm: ... }` (merchant-account based) or an array
1162
+ * of records (profile based).
1163
+ */
1164
+ type LinkedRoutingConfigRetrieveResponse = {
1165
+ algorithm: MerchantRoutingAlgorithm | null;
1166
+ } | RoutingDictionaryRecord[];
1167
+ /**
1168
+ * @deprecated Prefer the specific shapes: `RoutingDictionaryRecord` (list/create/activate)
1169
+ * or `MerchantRoutingAlgorithm` (retrieve). Kept for backwards compatibility.
1170
+ */
1083
1171
  interface RoutingConfigResponse {
1084
1172
  id?: string | null;
1085
1173
  name?: string | null;
@@ -2647,7 +2735,8 @@ declare class Routing {
2647
2735
  * Create a new routing algorithm.
2648
2736
  *
2649
2737
  * @param params - Routing algorithm definition (rule-based, priority, or volume-based).
2650
- * @returns The created routing configuration.
2738
+ * @returns Metadata record for the created routing configuration. The full
2739
+ * algorithm body is not echoed back — use `retrieve(id)` if you need it.
2651
2740
  *
2652
2741
  * @example
2653
2742
  * ```typescript
@@ -2657,43 +2746,49 @@ declare class Routing {
2657
2746
  * });
2658
2747
  * ```
2659
2748
  */
2660
- create(params: RoutingConfigCreateRequest): Promise<RoutingConfigResponse>;
2749
+ create(params: RoutingConfigCreateRequest): Promise<RoutingDictionaryRecord>;
2661
2750
  /**
2662
2751
  * Retrieve a routing algorithm by its ID.
2663
2752
  *
2664
2753
  * @param algorithmId - The routing algorithm ID.
2665
- * @returns The routing configuration.
2754
+ * @returns The full routing configuration including the algorithm body.
2666
2755
  */
2667
- retrieve(algorithmId: string): Promise<RoutingConfigResponse>;
2756
+ retrieve(algorithmId: string): Promise<MerchantRoutingAlgorithm>;
2668
2757
  /**
2669
- * Activate a routing algorithm, making it the active routing strategy for the shop.
2758
+ * Activate a routing algorithm, making it the active routing strategy.
2759
+ *
2760
+ * Always sends a JSON body (default `{}`) so the request carries the
2761
+ * `Content-Type: application/json` header that the server requires.
2670
2762
  *
2671
2763
  * @param algorithmId - The routing algorithm ID to activate.
2672
- * @returns The activated routing configuration.
2764
+ * @param params - Optional activation payload (e.g. `transaction_type`).
2673
2765
  */
2674
- activate(algorithmId: string): Promise<RoutingConfigResponse>;
2766
+ activate(algorithmId: string, params?: RoutingActivatePayload): Promise<RoutingDictionaryRecord>;
2675
2767
  /**
2676
2768
  * Deactivate the currently active routing algorithm (falls back to default routing).
2677
2769
  *
2678
- * @returns The deactivated routing configuration.
2770
+ * Always sends a JSON body (default `{}`) so the request carries the
2771
+ * `Content-Type: application/json` header that the server requires.
2772
+ *
2773
+ * @param params - Optional deactivation payload.
2679
2774
  */
2680
- deactivate(): Promise<RoutingConfigResponse>;
2775
+ deactivate(params?: RoutingDeactivateRequest): Promise<RoutingDictionaryRecord>;
2681
2776
  /**
2682
- * List all routing algorithms for the current shop.
2777
+ * List all routing algorithms for the current merchant.
2683
2778
  *
2684
- * @returns Array of routing configurations.
2779
+ * @returns The routing dictionary (records + currently active id).
2685
2780
  */
2686
- list(): Promise<RoutingConfigResponse[]>;
2781
+ list(): Promise<RoutingDictionary>;
2687
2782
  /** Get active routing config. `GET /routing/active` */
2688
- getActive(): Promise<RoutingConfigResponse>;
2783
+ getActive(): Promise<LinkedRoutingConfigRetrieveResponse>;
2689
2784
  /** Update default routing config. `POST /routing/default` */
2690
- updateDefault(params: Record<string, unknown>): Promise<RoutingConfigResponse>;
2785
+ updateDefault(params: Record<string, unknown>): Promise<RoutableConnectorChoice[]>;
2691
2786
  /** Retrieve default config for profiles. `GET /routing/default/profile` */
2692
- getDefaultProfile(): Promise<RoutingConfigResponse>;
2787
+ getDefaultProfile(): Promise<RoutableConnectorChoice[] | ProfileDefaultRoutingConfig[]>;
2693
2788
  /** Update default config for a profile. `POST /routing/default/profile/{profileId}` */
2694
- updateDefaultProfile(profileId: string, params: Record<string, unknown>): Promise<RoutingConfigResponse>;
2789
+ updateDefaultProfile(profileId: string, params: Record<string, unknown>): Promise<ProfileDefaultRoutingConfig>;
2695
2790
  /** List routing configs for profile. `GET /routing/list/profile` */
2696
- listForProfile(): Promise<RoutingConfigResponse[]>;
2791
+ listForProfile(): Promise<RoutingDictionary>;
2697
2792
  /** Evaluate a routing rule. `POST /routing/rule/evaluate` */
2698
2793
  evaluateRule(params: Record<string, unknown>): Promise<Record<string, unknown>>;
2699
2794
  /** Migrate routing rules for profile. `POST /routing/rule/migrate` */
@@ -3442,4 +3537,4 @@ declare const Webhooks: {
3442
3537
  verify(rawBody: string | Uint8Array, signatureHeader: string, secret: string): Promise<WebhookEvent>;
3443
3538
  };
3444
3539
 
3445
- export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, AnalyticsDashboard, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BusinessPaymentLinkConfig, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type Connector, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeType, Files, Forex, type ForgotPasswordRequest, type FromEmailRequest, type GatewayConnectRequest, type GatewayResponse, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type LedgerEntry, type LedgerListParams, type LedgerResponse, type ListInvitableRolesParams, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, 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 PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, 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 RegionCreateRequest, type RegionResponse, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestFn, type RequestOptions, type ResetPasswordRequest, type RoutingConfigCreateRequest, type RoutingConfigResponse, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionCreateRequest, type SubscriptionListParams, type SubscriptionListResponse, type SubscriptionResponse, type SubscriptionUpdateRequest, Subscriptions, 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 UpdateUserDetailsRequest, type UserResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks };
3540
+ export { type Address, type AddressDetails, type AllocationListResponse, type AllocationResponse, type AllocationTransferRequest, type AllocationTransferResponse, Analytics, AnalyticsDashboard, type ApiKeyCreateRequest, type ApiKeyCreateResponse, type ApiKeyExpiration, type ApiKeyResponse, type ApiKeyRevokeResponse, type ApiKeyUpdateRequest, type ApplePayVerificationRequest, type ApplePayVerificationResponse, type ApplePayVerifiedDomainsResponse, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BusinessPaymentLinkConfig, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type Connector, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type ConnectorVolumeSplit, type ConnectorWebhookEntry, type ConnectorWebhookEventType, type ConnectorWebhookListResponse, type ConnectorWebhookRegisterRequest, type ConnectorWebhookRegisterResponse, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EphemeralKeyCreateRequest, type EphemeralKeyCreateResponse, type EventClass, type EventDeliveryAttemptResponse, type EventDetailResponse, type EventListParams, type EventListResponse, type EventResponse, type EventType, Export, FeatureMatrix, type FeeOwner, type FeeScheduleCreateRequest, type FeeScheduleResponse, type FeeScheduleUpdateRequest, type FeeType, Files, Forex, type ForgotPasswordRequest, type FromEmailRequest, type GatewayConnectRequest, type GatewayResponse, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, 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 PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, 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 PhoneDetails, type PhoneOtpRequest, type PhoneOtpResponse, type PhoneOtpVerifyRequest, type PhoneOtpVerifyResponse, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, type ProfileDefaultRoutingConfig, 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 RegionCreateRequest, type RegionResponse, type RegionUpdateRequest, Regions, type RelayRequest, type RelayResponse, type RelayStatus, type RelayType, type RequestFn, type RequestOptions, type ResetPasswordRequest, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionCreateRequest, type SubscriptionListParams, type SubscriptionListResponse, type SubscriptionResponse, type SubscriptionUpdateRequest, Subscriptions, 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 UpdateUserDetailsRequest, type UserResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks };
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  Regions,
13
13
  Subscriptions,
14
14
  Webhooks
15
- } from "./chunk-6UL5TW3X.js";
15
+ } from "./chunk-CFM23H56.js";
16
16
  export {
17
17
  Analytics,
18
18
  AnalyticsDashboard,
package/dist/internal.cjs CHANGED
@@ -1604,7 +1604,8 @@ var Routing = class {
1604
1604
  * Create a new routing algorithm.
1605
1605
  *
1606
1606
  * @param params - Routing algorithm definition (rule-based, priority, or volume-based).
1607
- * @returns The created routing configuration.
1607
+ * @returns Metadata record for the created routing configuration. The full
1608
+ * algorithm body is not echoed back — use `retrieve(id)` if you need it.
1608
1609
  *
1609
1610
  * @example
1610
1611
  * ```typescript
@@ -1621,32 +1622,40 @@ var Routing = class {
1621
1622
  * Retrieve a routing algorithm by its ID.
1622
1623
  *
1623
1624
  * @param algorithmId - The routing algorithm ID.
1624
- * @returns The routing configuration.
1625
+ * @returns The full routing configuration including the algorithm body.
1625
1626
  */
1626
1627
  async retrieve(algorithmId) {
1627
1628
  return this.request("GET", `/routing/${encodeURIComponent(algorithmId)}`);
1628
1629
  }
1629
1630
  /**
1630
- * Activate a routing algorithm, making it the active routing strategy for the shop.
1631
+ * Activate a routing algorithm, making it the active routing strategy.
1632
+ *
1633
+ * Always sends a JSON body (default `{}`) so the request carries the
1634
+ * `Content-Type: application/json` header that the server requires.
1631
1635
  *
1632
1636
  * @param algorithmId - The routing algorithm ID to activate.
1633
- * @returns The activated routing configuration.
1637
+ * @param params - Optional activation payload (e.g. `transaction_type`).
1634
1638
  */
1635
- async activate(algorithmId) {
1636
- return this.request("POST", `/routing/${encodeURIComponent(algorithmId)}/activate`);
1639
+ async activate(algorithmId, params = {}) {
1640
+ return this.request("POST", `/routing/${encodeURIComponent(algorithmId)}/activate`, {
1641
+ body: params
1642
+ });
1637
1643
  }
1638
1644
  /**
1639
1645
  * Deactivate the currently active routing algorithm (falls back to default routing).
1640
1646
  *
1641
- * @returns The deactivated routing configuration.
1647
+ * Always sends a JSON body (default `{}`) so the request carries the
1648
+ * `Content-Type: application/json` header that the server requires.
1649
+ *
1650
+ * @param params - Optional deactivation payload.
1642
1651
  */
1643
- async deactivate() {
1644
- return this.request("POST", "/routing/deactivate");
1652
+ async deactivate(params = {}) {
1653
+ return this.request("POST", "/routing/deactivate", { body: params });
1645
1654
  }
1646
1655
  /**
1647
- * List all routing algorithms for the current shop.
1656
+ * List all routing algorithms for the current merchant.
1648
1657
  *
1649
- * @returns Array of routing configurations.
1658
+ * @returns The routing dictionary (records + currently active id).
1650
1659
  */
1651
1660
  async list() {
1652
1661
  return this.request("GET", "/routing");