@delopay/sdk 0.1.7 → 0.3.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
@@ -71,14 +71,18 @@ interface CardDetail {
71
71
  interface CardDetailFromLocker {
72
72
  scheme?: string | null;
73
73
  issuer_country?: string | null;
74
+ issuer_country_code?: string | null;
74
75
  last4_digits?: string | null;
75
76
  expiry_month?: string | null;
76
77
  expiry_year?: string | null;
78
+ card_token?: string | null;
77
79
  card_holder_name?: string | null;
78
80
  card_fingerprint?: string | null;
79
81
  nick_name?: string | null;
80
82
  card_network?: string | null;
81
83
  card_isin?: string | null;
84
+ card_issuer?: string | null;
85
+ card_type?: string | null;
82
86
  card_extended_bin?: string | null;
83
87
  card_exp_month?: string | null;
84
88
  card_exp_year?: string | null;
@@ -374,6 +378,8 @@ interface RefundResponse {
374
378
  currency: string;
375
379
  /** Current status of the refund. */
376
380
  status: RefundStatus;
381
+ /** Connector that processed the refund. */
382
+ connector: string;
377
383
  /** Reason provided at creation. */
378
384
  reason?: string | null;
379
385
  /** Arbitrary key-value metadata. */
@@ -390,12 +396,18 @@ interface RefundResponse {
390
396
  created_at?: string | null;
391
397
  /** ISO 8601 timestamp of the last status update. */
392
398
  updated_at?: string | null;
393
- /** Connector that processed the refund. */
394
- connector?: string | null;
395
399
  /** Shop (business profile) ID the refund was processed under. */
396
400
  profile_id?: string | null;
397
401
  /** Connector account ID used. */
398
402
  merchant_connector_id?: string | null;
403
+ /** Connector-assigned refund identifier. */
404
+ connector_refund_id?: string | null;
405
+ /** Error code received from the issuer for failed refunds. */
406
+ issuer_error_code?: string | null;
407
+ /** Error message received from the issuer for failed refunds. */
408
+ issuer_error_message?: string | null;
409
+ /** Raw connector response payload (debugging). */
410
+ raw_connector_response?: string | null;
399
411
  }
400
412
  interface RefundListParams {
401
413
  payment_id?: string | null;
@@ -467,6 +479,10 @@ interface CustomerResponse {
467
479
  metadata?: Record<string, unknown> | null;
468
480
  /** ID of the customer's default saved payment method, if any. */
469
481
  default_payment_method_id?: string | null;
482
+ /** VAT or tax registration number for B2B invoicing. */
483
+ tax_registration_id?: string | null;
484
+ /** Structured identity / KYC documents attached to the customer. */
485
+ document_details?: Record<string, unknown> | null;
470
486
  }
471
487
  interface CustomerListParams {
472
488
  limit?: number | null;
@@ -515,6 +531,16 @@ interface PaymentMethodResponse {
515
531
  interface PaymentMethodListParams {
516
532
  client_secret?: string | null;
517
533
  }
534
+ interface CustomerPaymentMethodsListParams {
535
+ client_secret?: string | null;
536
+ accepted_countries?: string[] | null;
537
+ accepted_currencies?: string[] | null;
538
+ amount?: number | null;
539
+ recurring_enabled?: boolean | null;
540
+ installment_payment_enabled?: boolean | null;
541
+ limit?: number | null;
542
+ card_networks?: string[] | null;
543
+ }
518
544
  interface CustomerPaymentMethodsListResponse {
519
545
  customer_payment_methods: PaymentMethodResponse[];
520
546
  is_guest_customer?: boolean | null;
@@ -1005,14 +1031,16 @@ interface SignUpRequest {
1005
1031
  email: string;
1006
1032
  password: string;
1007
1033
  }
1008
- /** Full signup with merchant details */
1009
- interface SignUpWithMerchantRequest {
1034
+ /** Full signup with merchant details — creates a merchant admin user and the merchant account atomically. */
1035
+ interface SignUpWithMerchantIdRequest {
1010
1036
  name: string;
1011
1037
  email: string;
1012
1038
  password: string;
1013
1039
  company_name: string;
1014
1040
  organization_type?: string | null;
1015
1041
  }
1042
+ /** @deprecated Use `SignUpWithMerchantIdRequest`. */
1043
+ type SignUpWithMerchantRequest = SignUpWithMerchantIdRequest;
1016
1044
  interface SignInRequest {
1017
1045
  email: string;
1018
1046
  password: string;
@@ -1093,6 +1121,57 @@ interface AdminSignInRequest {
1093
1121
  email: string;
1094
1122
  password: string;
1095
1123
  }
1124
+ /**
1125
+ * Response returned by admin signup/signin endpoints.
1126
+ *
1127
+ * The admin flow is passwordless-after-signup: the endpoint triggers an
1128
+ * email (confirmation or sign-in link) and `is_email_sent` indicates whether
1129
+ * delivery was attempted successfully.
1130
+ */
1131
+ interface AuthorizeResponse {
1132
+ is_email_sent: boolean;
1133
+ }
1134
+ /** Create a new internal DeloPay admin user. Requires the server admin API key. */
1135
+ interface CreateInternalUserRequest {
1136
+ name: string;
1137
+ email: string;
1138
+ password: string;
1139
+ /** Predefined internal role id (e.g. `internal_view_only`). Cannot be `internal_admin`. */
1140
+ role_id: string;
1141
+ }
1142
+ /** Create a new tenant-level admin user. Requires the server admin API key. */
1143
+ interface CreateTenantUserRequest {
1144
+ name: string;
1145
+ email: string;
1146
+ password: string;
1147
+ }
1148
+ /** Bootstrap a new merchant: creates user, merchant account, project, profile, and API keys in one call. */
1149
+ interface OnboardMerchantRequest {
1150
+ email: string;
1151
+ name: string;
1152
+ password: string;
1153
+ company_name: string;
1154
+ }
1155
+ /** All identifiers and keys produced by the onboard flow. */
1156
+ interface OnboardMerchantResponse {
1157
+ merchant_id: string;
1158
+ user_id: string;
1159
+ user_email: string;
1160
+ project_id: string;
1161
+ profile_id: string;
1162
+ /** Secret API key (sk_…). Show once; store securely. */
1163
+ api_key: string;
1164
+ /** Publishable key (pk_…) for client-side SDKs. */
1165
+ publishable_key: string;
1166
+ }
1167
+ /** Toggle public signup on or off at runtime. */
1168
+ interface SignupToggleRequest {
1169
+ enabled: boolean;
1170
+ }
1171
+ /** Current public-signup status. */
1172
+ interface SignupToggleResponse {
1173
+ signup_enabled: boolean;
1174
+ }
1096
1175
  interface AdminCustomerListParams {
1097
1176
  search?: string | null;
1098
1177
  is_active?: boolean | null;
@@ -1629,33 +1708,33 @@ interface RegionResponse {
1629
1708
  [key: string]: unknown;
1630
1709
  }
1631
1710
 
1632
- type RequestFn$I = <T>(method: string, path: string, options?: {
1633
- body?: unknown;
1634
- query?: Record<string, string | number | boolean | undefined>;
1635
- headers?: Record<string, string>;
1636
- }) => Promise<T>;
1637
1711
  declare class Admin {
1638
1712
  private readonly request;
1639
- constructor(request: RequestFn$I);
1713
+ constructor(request: RequestFn);
1640
1714
  signIn(params: AdminSignInRequest): Promise<AuthResponse>;
1641
- createInternalUser(params: Record<string, unknown>): Promise<AuthResponse>;
1642
- createTenant(params: Record<string, unknown>): Promise<AuthResponse>;
1643
- /** Set signup settings. `POST /admin/signup_settings` */
1644
- setSignupSettings(params: Record<string, unknown>): Promise<Record<string, unknown>>;
1645
- /** Get signup settings. `GET /admin/signup_settings` */
1646
- getSignupSettings(): Promise<Record<string, unknown>>;
1647
- /** Onboard a merchant. `POST /admin/onboard_merchant` */
1648
- onboardMerchant(params: Record<string, unknown>): Promise<Record<string, unknown>>;
1715
+ createInternalUser(params: CreateInternalUserRequest): Promise<AuthorizeResponse>;
1716
+ createTenant(params: CreateTenantUserRequest): Promise<AuthorizeResponse>;
1717
+ /**
1718
+ * Create a new merchant admin user and merchant account atomically.
1719
+ *
1720
+ * This is the correct endpoint for bootstrapping the first admin user in a
1721
+ * fresh deployment `internal_signup`/`tenant_signup` both require
1722
+ * pre-existing merchant records that don't exist on a clean database.
1723
+ *
1724
+ * `POST /admin/signup_with_merchant_id`
1725
+ */
1726
+ signupWithMerchantId(params: SignUpWithMerchantIdRequest): Promise<AuthorizeResponse>;
1727
+ /** Toggle public signup on/off. `POST /admin/settings/signup` */
1728
+ setSignupSettings(params: SignupToggleRequest): Promise<SignupToggleResponse>;
1729
+ /** Read current public-signup status. `GET /admin/settings/signup` */
1730
+ getSignupSettings(): Promise<SignupToggleResponse>;
1731
+ /** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard_merchant` */
1732
+ onboardMerchant(params: OnboardMerchantRequest): Promise<OnboardMerchantResponse>;
1649
1733
  }
1650
1734
 
1651
- type RequestFn$H = <T>(method: string, path: string, options?: {
1652
- body?: unknown;
1653
- query?: Record<string, string | number | boolean | undefined>;
1654
- headers?: Record<string, string>;
1655
- }) => Promise<T>;
1656
1735
  declare class AdminPortal {
1657
1736
  private readonly request;
1658
- constructor(request: RequestFn$H);
1737
+ constructor(request: RequestFn);
1659
1738
  listCustomers(params?: AdminCustomerListParams): Promise<AdminCustomerListResponse>;
1660
1739
  getCustomer(customerId: string): Promise<AdminCustomerDetail>;
1661
1740
  listTransactions(params?: AdminTransactionListParams): Promise<AdminTransactionListResponse>;
@@ -1664,15 +1743,10 @@ declare class AdminPortal {
1664
1743
  paymentAnalytics(params: PaymentAnalyticsRequest): Promise<PaymentAnalyticsResponse>;
1665
1744
  }
1666
1745
 
1667
- type RequestFn$G = <T>(method: string, path: string, options?: {
1668
- body?: unknown;
1669
- query?: Record<string, string | number | boolean | undefined>;
1670
- headers?: Record<string, string>;
1671
- }) => Promise<T>;
1672
1746
  /** Create and manage API keys for a merchant account. */
1673
1747
  declare class ApiKeys {
1674
1748
  private readonly request;
1675
- constructor(request: RequestFn$G);
1749
+ constructor(request: RequestFn);
1676
1750
  /**
1677
1751
  * Create a new API key for a merchant.
1678
1752
  *
@@ -1720,26 +1794,16 @@ declare class ApiKeys {
1720
1794
  list(merchantId: string): Promise<ApiKeyResponse[]>;
1721
1795
  }
1722
1796
 
1723
- type RequestFn$F = <T>(method: string, path: string, options?: {
1724
- body?: unknown;
1725
- query?: Record<string, string | number | boolean | undefined>;
1726
- headers?: Record<string, string>;
1727
- }) => Promise<T>;
1728
1797
  declare class AuditLogs {
1729
1798
  private readonly request;
1730
- constructor(request: RequestFn$F);
1799
+ constructor(request: RequestFn);
1731
1800
  list(params?: AuditLogListParams): Promise<AuditLogListResponse>;
1732
1801
  retrieve(logId: string): Promise<AuditLogResponse>;
1733
1802
  }
1734
1803
 
1735
- type RequestFn$E = <T>(method: string, path: string, options?: {
1736
- body?: unknown;
1737
- query?: Record<string, string | number | boolean | undefined>;
1738
- headers?: Record<string, string>;
1739
- }) => Promise<T>;
1740
1804
  declare class Authentication {
1741
1805
  private readonly request;
1742
- constructor(request: RequestFn$E);
1806
+ constructor(request: RequestFn);
1743
1807
  create(params: AuthenticationCreateRequest): Promise<AuthenticationResponse>;
1744
1808
  checkEligibility(authId: string): Promise<AuthenticationResponse>;
1745
1809
  authenticate(authId: string, params: Record<string, unknown>): Promise<AuthenticationResponse>;
@@ -1752,15 +1816,10 @@ declare class Authentication {
1752
1816
  eligibilityCheck(authId: string, params: Record<string, unknown>): Promise<Record<string, unknown>>;
1753
1817
  }
1754
1818
 
1755
- type RequestFn$D = <T>(method: string, path: string, options?: {
1756
- body?: unknown;
1757
- query?: Record<string, string | number | boolean | undefined>;
1758
- headers?: Record<string, string>;
1759
- }) => Promise<T>;
1760
1819
  /** Manage per-shop prepaid balance allocations transferred from the host merchant treasury. */
1761
1820
  declare class BillingAllocations {
1762
1821
  private readonly request;
1763
- constructor(request: RequestFn$D);
1822
+ constructor(request: RequestFn);
1764
1823
  /**
1765
1824
  * Transfer funds from the host merchant treasury into a shop's allocation.
1766
1825
  *
@@ -1803,7 +1862,7 @@ declare class Billing {
1803
1862
  private readonly request;
1804
1863
  /** Per-shop balance allocation management for host merchants. */
1805
1864
  readonly allocations: BillingAllocations;
1806
- constructor(request: RequestFn$D);
1865
+ constructor(request: RequestFn);
1807
1866
  /**
1808
1867
  * Retrieve a merchant's billing profile (balance, status, auto-recharge config).
1809
1868
  *
@@ -1875,11 +1934,6 @@ declare class Billing {
1875
1934
  adminDebit(merchantId: string, params: AdminAdjustmentRequest): Promise<AdminAdjustmentResponse>;
1876
1935
  }
1877
1936
 
1878
- type RequestFn$C = <T>(method: string, path: string, options?: {
1879
- body?: unknown;
1880
- query?: Record<string, string | number | boolean | undefined>;
1881
- headers?: Record<string, string>;
1882
- }) => Promise<T>;
1883
1937
  interface BlocklistListParams {
1884
1938
  data_kind?: BlocklistDataKind | null;
1885
1939
  limit?: number | null;
@@ -1890,34 +1944,24 @@ interface BlocklistToggleParams {
1890
1944
  }
1891
1945
  declare class Blocklist {
1892
1946
  private readonly request;
1893
- constructor(request: RequestFn$C);
1947
+ constructor(request: RequestFn);
1894
1948
  add(params: BlocklistAddRequest): Promise<BlocklistResponse>;
1895
1949
  remove(params: BlocklistAddRequest): Promise<BlocklistResponse>;
1896
1950
  list(params?: BlocklistListParams): Promise<BlocklistResponse[]>;
1897
1951
  toggle(params: BlocklistToggleParams): Promise<Record<string, unknown>>;
1898
1952
  }
1899
1953
 
1900
- type RequestFn$B = <T>(method: string, path: string, options?: {
1901
- body?: unknown;
1902
- query?: Record<string, string | number | boolean | undefined>;
1903
- headers?: Record<string, string>;
1904
- }) => Promise<T>;
1905
1954
  declare class CardIssuers {
1906
1955
  private readonly request;
1907
- constructor(request: RequestFn$B);
1956
+ constructor(request: RequestFn);
1908
1957
  create(params: CardIssuerCreateRequest): Promise<CardIssuerResponse>;
1909
1958
  update(issuerId: string, params: CardIssuerUpdateRequest): Promise<CardIssuerResponse>;
1910
1959
  list(): Promise<CardIssuerListResponse>;
1911
1960
  }
1912
1961
 
1913
- type RequestFn$A = <T>(method: string, path: string, options?: {
1914
- body?: unknown;
1915
- query?: Record<string, string | number | boolean | undefined>;
1916
- headers?: Record<string, string>;
1917
- }) => Promise<T>;
1918
1962
  declare class Connectors {
1919
1963
  private readonly request;
1920
- constructor(request: RequestFn$A);
1964
+ constructor(request: RequestFn);
1921
1965
  create(accountId: string, params: ConnectorCreateRequest): Promise<ConnectorResponse>;
1922
1966
  retrieve(accountId: string, connectorId: string): Promise<ConnectorResponse>;
1923
1967
  list(accountId: string): Promise<ConnectorResponse[]>;
@@ -1933,15 +1977,10 @@ declare class Connectors {
1933
1977
  listPaymentMethods(): Promise<Record<string, unknown>[]>;
1934
1978
  }
1935
1979
 
1936
- type RequestFn$z = <T>(method: string, path: string, options?: {
1937
- body?: unknown;
1938
- query?: Record<string, string | number | boolean | undefined>;
1939
- headers?: Record<string, string>;
1940
- }) => Promise<T>;
1941
1980
  /** Create and manage customer profiles. */
1942
1981
  declare class Customers {
1943
1982
  private readonly request;
1944
- constructor(request: RequestFn$z);
1983
+ constructor(request: RequestFn);
1945
1984
  /**
1946
1985
  * Create a new customer.
1947
1986
  *
@@ -2001,15 +2040,10 @@ declare class Customers {
2001
2040
  listMandates(customerId: string): Promise<Record<string, unknown>[]>;
2002
2041
  }
2003
2042
 
2004
- type RequestFn$y = <T>(method: string, path: string, options?: {
2005
- body?: unknown;
2006
- query?: Record<string, string | number | boolean | undefined>;
2007
- headers?: Record<string, string>;
2008
- }) => Promise<T>;
2009
2043
  /** View and respond to payment disputes and chargebacks. */
2010
2044
  declare class Disputes {
2011
2045
  private readonly request;
2012
- constructor(request: RequestFn$y);
2046
+ constructor(request: RequestFn);
2013
2047
  /**
2014
2048
  * Retrieve a dispute by its ID.
2015
2049
  *
@@ -2068,15 +2102,18 @@ declare class Disputes {
2068
2102
  aggregate(params?: Record<string, string | number | undefined>): Promise<Record<string, unknown>>;
2069
2103
  /** Get dispute aggregates (profile-scoped). `GET /disputes/profile/aggregate` */
2070
2104
  aggregateByProfile(params?: Record<string, string | number | undefined>): Promise<Record<string, unknown>>;
2071
- /** Fetch dispute from connector. `POST /disputes/{disputeId}/fetch_from_connector` */
2072
- fetchFromConnector(disputeId: string): Promise<DisputeResponse>;
2105
+ /**
2106
+ * Fetch the latest dispute state from the connector (gateway).
2107
+ * `GET /disputes/{connectorId}/fetch`
2108
+ *
2109
+ * Note: the path parameter is the **connector dispute id** on the gateway, not the
2110
+ * Delopay dispute id. Method is GET (not POST) and this method signature was
2111
+ * previously wrong — callers depending on the old `POST /disputes/{id}/fetch_from_connector`
2112
+ * path were silently hitting 404s.
2113
+ */
2114
+ fetchFromConnector(connectorId: string): Promise<DisputeResponse>;
2073
2115
  }
2074
2116
 
2075
- type RequestFn$x = <T>(method: string, path: string, options?: {
2076
- body?: unknown;
2077
- query?: Record<string, string | number | boolean | undefined>;
2078
- headers?: Record<string, string>;
2079
- }) => Promise<T>;
2080
2117
  /**
2081
2118
  * Create short-lived ephemeral keys for secure client-side operations.
2082
2119
  *
@@ -2086,7 +2123,7 @@ type RequestFn$x = <T>(method: string, path: string, options?: {
2086
2123
  */
2087
2124
  declare class EphemeralKeys {
2088
2125
  private readonly request;
2089
- constructor(request: RequestFn$x);
2126
+ constructor(request: RequestFn);
2090
2127
  /**
2091
2128
  * Create an ephemeral key scoped to a specific customer.
2092
2129
  *
@@ -2109,14 +2146,9 @@ declare class EphemeralKeys {
2109
2146
  delete(keyId: string): Promise<EphemeralKeyCreateResponse>;
2110
2147
  }
2111
2148
 
2112
- type RequestFn$w = <T>(method: string, path: string, options?: {
2113
- body?: unknown;
2114
- query?: Record<string, string | number | boolean | undefined>;
2115
- headers?: Record<string, string>;
2116
- }) => Promise<T>;
2117
2149
  declare class Events {
2118
2150
  private readonly request;
2119
- constructor(request: RequestFn$w);
2151
+ constructor(request: RequestFn);
2120
2152
  list(merchantId: string, params?: EventListParams): Promise<EventListResponse>;
2121
2153
  listDeliveryAttempts(merchantId: string, eventId: string): Promise<EventDeliveryAttemptResponse[]>;
2122
2154
  retryDelivery(merchantId: string, eventId: string): Promise<EventDetailResponse>;
@@ -2124,18 +2156,13 @@ declare class Events {
2124
2156
  listByProfile(params?: Record<string, unknown>): Promise<EventListResponse>;
2125
2157
  }
2126
2158
 
2127
- type RequestFn$v = <T>(method: string, path: string, options?: {
2128
- body?: unknown;
2129
- query?: Record<string, string | number | boolean | undefined>;
2130
- headers?: Record<string, string>;
2131
- }) => Promise<T>;
2132
2159
  /**
2133
2160
  * Admin-only fee schedule management.
2134
2161
  * Requires an admin API key.
2135
2162
  */
2136
2163
  declare class PlatformFees {
2137
2164
  private readonly request;
2138
- constructor(request: RequestFn$v);
2165
+ constructor(request: RequestFn);
2139
2166
  /**
2140
2167
  * Create a new platform fee schedule for a merchant (admin only).
2141
2168
  *
@@ -2177,7 +2204,7 @@ declare class PlatformFees {
2177
2204
  /** Per-shop merchant fee schedule overrides (merchant-scoped). */
2178
2205
  declare class MerchantFees {
2179
2206
  private readonly request;
2180
- constructor(request: RequestFn$v);
2207
+ constructor(request: RequestFn);
2181
2208
  /**
2182
2209
  * Create a merchant-scoped fee schedule override for a specific shop.
2183
2210
  *
@@ -2220,32 +2247,22 @@ declare class Fees {
2220
2247
  readonly platform: PlatformFees;
2221
2248
  /** Merchant-managed per-shop fee schedule overrides. */
2222
2249
  readonly merchant: MerchantFees;
2223
- constructor(request: RequestFn$v);
2250
+ constructor(request: RequestFn);
2224
2251
  }
2225
2252
 
2226
- type RequestFn$u = <T>(method: string, path: string, options?: {
2227
- body?: unknown;
2228
- query?: Record<string, string | number | boolean | undefined>;
2229
- headers?: Record<string, string>;
2230
- }) => Promise<T>;
2231
2253
  declare class Gsm {
2232
2254
  private readonly request;
2233
- constructor(request: RequestFn$u);
2255
+ constructor(request: RequestFn);
2234
2256
  create(params: GsmRuleCreateRequest): Promise<GsmRuleResponse>;
2235
2257
  retrieve(params: Record<string, unknown>): Promise<GsmRuleResponse>;
2236
2258
  update(params: GsmRuleUpdateRequest): Promise<GsmRuleResponse>;
2237
2259
  delete(params: Record<string, unknown>): Promise<GsmRuleResponse>;
2238
2260
  }
2239
2261
 
2240
- type RequestFn$t = <T>(method: string, path: string, options?: {
2241
- body?: unknown;
2242
- query?: Record<string, string | number | boolean | undefined>;
2243
- headers?: Record<string, string>;
2244
- }) => Promise<T>;
2245
2262
  /** View and revoke recurring payment mandates. */
2246
2263
  declare class Mandates {
2247
2264
  private readonly request;
2248
- constructor(request: RequestFn$t);
2265
+ constructor(request: RequestFn);
2249
2266
  /**
2250
2267
  * Retrieve a mandate by its ID.
2251
2268
  *
@@ -2269,14 +2286,9 @@ declare class Mandates {
2269
2286
  list(params?: MandateListParams): Promise<MandateResponse[]>;
2270
2287
  }
2271
2288
 
2272
- type RequestFn$s = <T>(method: string, path: string, options?: {
2273
- body?: unknown;
2274
- query?: Record<string, string | number | boolean | undefined>;
2275
- headers?: Record<string, string>;
2276
- }) => Promise<T>;
2277
2289
  declare class MerchantAccounts {
2278
2290
  private readonly request;
2279
- constructor(request: RequestFn$s);
2291
+ constructor(request: RequestFn);
2280
2292
  create(params: MerchantAccountCreateRequest): Promise<MerchantAccountResponse>;
2281
2293
  retrieve(accountId: string): Promise<MerchantAccountResponse>;
2282
2294
  update(accountId: string, params: MerchantAccountUpdateRequest): Promise<MerchantAccountResponse>;
@@ -2287,19 +2299,14 @@ declare class MerchantAccounts {
2287
2299
  toggleKv(accountId: string): Promise<Record<string, unknown>>;
2288
2300
  /** Get KV status for a merchant. `GET /accounts/{accountId}/kv` */
2289
2301
  getKvStatus(accountId: string): Promise<Record<string, unknown>>;
2290
- /** Transfer keys between merchants. `POST /accounts/transfer_keys` */
2302
+ /** Transfer keys between merchants. `POST /accounts/transfer` */
2291
2303
  transferKeys(params: Record<string, unknown>): Promise<Record<string, unknown>>;
2292
2304
  }
2293
2305
 
2294
- type RequestFn$r = <T>(method: string, path: string, options?: {
2295
- body?: unknown;
2296
- query?: Record<string, string | number | boolean | undefined>;
2297
- headers?: Record<string, string>;
2298
- }) => Promise<T>;
2299
2306
  /** Retrieve and list hosted payment links. */
2300
2307
  declare class PaymentLinks {
2301
2308
  private readonly request;
2302
- constructor(request: RequestFn$r);
2309
+ constructor(request: RequestFn);
2303
2310
  /**
2304
2311
  * Retrieve a payment link by its ID.
2305
2312
  *
@@ -2320,15 +2327,10 @@ declare class PaymentLinks {
2320
2327
  status(merchantId: string, paymentId: string): Promise<Record<string, unknown>>;
2321
2328
  }
2322
2329
 
2323
- type RequestFn$q = <T>(method: string, path: string, options?: {
2324
- body?: unknown;
2325
- query?: Record<string, string | number | boolean | undefined>;
2326
- headers?: Record<string, string>;
2327
- }) => Promise<T>;
2328
2330
  /** Create and manage saved payment methods for customers. */
2329
2331
  declare class PaymentMethods {
2330
2332
  private readonly request;
2331
- constructor(request: RequestFn$q);
2333
+ constructor(request: RequestFn);
2332
2334
  /**
2333
2335
  * Save a new payment method (card, bank account, wallet, etc.).
2334
2336
  *
@@ -2375,17 +2377,22 @@ declare class PaymentMethods {
2375
2377
  */
2376
2378
  list(params?: PaymentMethodListParams): Promise<PaymentMethodResponse[]>;
2377
2379
  /**
2378
- * List all saved payment methods for a customer.
2380
+ * List all saved payment methods for a customer, optionally filtered.
2379
2381
  *
2380
2382
  * @param customerId - The customer ID.
2383
+ * @param params - Optional filters: `client_secret`, `accepted_countries`, `accepted_currencies`,
2384
+ * `amount`, `recurring_enabled`, `installment_payment_enabled`, `limit`, `card_networks`.
2381
2385
  * @returns Customer's saved payment methods.
2382
2386
  *
2383
2387
  * @example
2384
2388
  * ```typescript
2385
- * const { customer_payment_methods } = await delopay.paymentMethods.listForCustomer('cus_123');
2389
+ * const { customer_payment_methods } = await delopay.paymentMethods.listForCustomer(
2390
+ * 'cus_123',
2391
+ * { accepted_currencies: ['EUR'], amount: 5000 },
2392
+ * );
2386
2393
  * ```
2387
2394
  */
2388
- listForCustomer(customerId: string): Promise<CustomerPaymentMethodsListResponse>;
2395
+ listForCustomer(customerId: string, params?: CustomerPaymentMethodsListParams): Promise<CustomerPaymentMethodsListResponse>;
2389
2396
  /**
2390
2397
  * Set a payment method as the default for a customer.
2391
2398
  *
@@ -2418,15 +2425,10 @@ declare class PaymentMethods {
2418
2425
  tokenizeCardForMethod(methodId: string, params: Record<string, unknown>): Promise<Record<string, unknown>>;
2419
2426
  }
2420
2427
 
2421
- type RequestFn$p = <T>(method: string, path: string, options?: {
2422
- body?: unknown;
2423
- query?: Record<string, string | number | boolean | undefined>;
2424
- headers?: Record<string, string>;
2425
- }) => Promise<T>;
2426
2428
  /** Manage payment intents — create, confirm, capture, cancel, and list payments. */
2427
2429
  declare class Payments {
2428
2430
  private readonly request;
2429
- constructor(request: RequestFn$p);
2431
+ constructor(request: RequestFn);
2430
2432
  /**
2431
2433
  * Create a new payment intent.
2432
2434
  *
@@ -2541,15 +2543,10 @@ declare class Payments {
2541
2543
  threeDsAuthentication(paymentId: string, params: Record<string, unknown>): Promise<Record<string, unknown>>;
2542
2544
  }
2543
2545
 
2544
- type RequestFn$o = <T>(method: string, path: string, options?: {
2545
- body?: unknown;
2546
- query?: Record<string, string | number | boolean | undefined>;
2547
- headers?: Record<string, string>;
2548
- }) => Promise<T>;
2549
2546
  /** Create and manage payouts — fund transfers from merchant to a recipient bank account. */
2550
2547
  declare class Payouts {
2551
2548
  private readonly request;
2552
- constructor(request: RequestFn$o);
2549
+ constructor(request: RequestFn);
2553
2550
  /**
2554
2551
  * Create a new payout.
2555
2552
  *
@@ -2626,37 +2623,22 @@ declare class Payouts {
2626
2623
  manualUpdate(payoutId: string, params: Record<string, unknown>): Promise<PayoutResponse>;
2627
2624
  }
2628
2625
 
2629
- type RequestFn$n = <T>(method: string, path: string, options?: {
2630
- body?: unknown;
2631
- query?: Record<string, string | number | boolean | undefined>;
2632
- headers?: Record<string, string>;
2633
- }) => Promise<T>;
2634
2626
  declare class Poll {
2635
2627
  private readonly request;
2636
- constructor(request: RequestFn$n);
2628
+ constructor(request: RequestFn);
2637
2629
  getStatus(pollId: string): Promise<PollStatusResponse>;
2638
2630
  }
2639
2631
 
2640
- type RequestFn$m = <T>(method: string, path: string, options?: {
2641
- body?: unknown;
2642
- query?: Record<string, string | number | boolean | undefined>;
2643
- headers?: Record<string, string>;
2644
- }) => Promise<T>;
2645
2632
  declare class ProfileAcquirers {
2646
2633
  private readonly request;
2647
- constructor(request: RequestFn$m);
2634
+ constructor(request: RequestFn);
2648
2635
  create(params: ProfileAcquirerCreateRequest): Promise<ProfileAcquirerResponse>;
2649
2636
  update(profileId: string, profileAcquirerId: string, params: ProfileAcquirerUpdateRequest): Promise<ProfileAcquirerResponse>;
2650
2637
  }
2651
2638
 
2652
- type RequestFn$l = <T>(method: string, path: string, options?: {
2653
- body?: unknown;
2654
- query?: Record<string, string | number | boolean | undefined>;
2655
- headers?: Record<string, string>;
2656
- }) => Promise<T>;
2657
2639
  declare class Profiles {
2658
2640
  private readonly request;
2659
- constructor(request: RequestFn$l);
2641
+ constructor(request: RequestFn);
2660
2642
  create(accountId: string, params: ProfileCreateRequest): Promise<ProfileResponse>;
2661
2643
  retrieve(accountId: string, profileId: string): Promise<ProfileResponse>;
2662
2644
  list(accountId: string): Promise<ProfileResponse[]>;
@@ -2668,15 +2650,10 @@ declare class Profiles {
2668
2650
  toggleConnectorAgnosticMit(accountId: string, profileId: string): Promise<ProfileResponse>;
2669
2651
  }
2670
2652
 
2671
- type RequestFn$k = <T>(method: string, path: string, options?: {
2672
- body?: unknown;
2673
- query?: Record<string, string | number | boolean | undefined>;
2674
- headers?: Record<string, string>;
2675
- }) => Promise<T>;
2676
2653
  /** Create and manage projects — optional grouping layers that contain one or more shops. */
2677
2654
  declare class Projects {
2678
2655
  private readonly request;
2679
- constructor(request: RequestFn$k);
2656
+ constructor(request: RequestFn);
2680
2657
  /**
2681
2658
  * Create a new project under a merchant account.
2682
2659
  *
@@ -2735,15 +2712,10 @@ declare class Projects {
2735
2712
  overview(merchantId: string): Promise<MerchantOverviewResponse>;
2736
2713
  }
2737
2714
 
2738
- type RequestFn$j = <T>(method: string, path: string, options?: {
2739
- body?: unknown;
2740
- query?: Record<string, string | number | boolean | undefined>;
2741
- headers?: Record<string, string>;
2742
- }) => Promise<T>;
2743
2715
  /** Create and manage refunds for completed payments. */
2744
2716
  declare class Refunds {
2745
2717
  private readonly request;
2746
- constructor(request: RequestFn$j);
2718
+ constructor(request: RequestFn);
2747
2719
  /**
2748
2720
  * Create a refund for a payment.
2749
2721
  *
@@ -2800,23 +2772,13 @@ declare class Refunds {
2800
2772
  manualUpdate(refundId: string, params: Record<string, unknown>): Promise<RefundResponse>;
2801
2773
  }
2802
2774
 
2803
- type RequestFn$i = <T>(method: string, path: string, options?: {
2804
- body?: unknown;
2805
- query?: Record<string, string | number | boolean | undefined>;
2806
- headers?: Record<string, string>;
2807
- }) => Promise<T>;
2808
2775
  declare class Relay {
2809
2776
  private readonly request;
2810
- constructor(request: RequestFn$i);
2777
+ constructor(request: RequestFn);
2811
2778
  create(params: RelayRequest): Promise<RelayResponse>;
2812
2779
  retrieve(relayId: string): Promise<RelayResponse>;
2813
2780
  }
2814
2781
 
2815
- type RequestFn$h = <T>(method: string, path: string, options?: {
2816
- body?: unknown;
2817
- query?: Record<string, string | number | boolean | undefined>;
2818
- headers?: Record<string, string>;
2819
- }) => Promise<T>;
2820
2782
  /**
2821
2783
  * Create and manage payment routing algorithms.
2822
2784
  *
@@ -2826,7 +2788,7 @@ type RequestFn$h = <T>(method: string, path: string, options?: {
2826
2788
  declare class Routing {
2827
2789
  private readonly request;
2828
2790
  readonly decision: RoutingDecisionManager;
2829
- constructor(request: RequestFn$h);
2791
+ constructor(request: RequestFn);
2830
2792
  /**
2831
2793
  * Create a new routing algorithm.
2832
2794
  *
@@ -2889,7 +2851,7 @@ declare class Routing {
2889
2851
  }
2890
2852
  declare class RoutingDecisionManager {
2891
2853
  private readonly request;
2892
- constructor(request: RequestFn$h);
2854
+ constructor(request: RequestFn);
2893
2855
  /** Upsert decision manager config. `PUT /routing/decision` */
2894
2856
  upsert(params: Record<string, unknown>): Promise<Record<string, unknown>>;
2895
2857
  /** Retrieve decision manager config. `GET /routing/decision` */
@@ -2904,15 +2866,10 @@ declare class RoutingDecisionManager {
2904
2866
  deleteSurcharge(): Promise<Record<string, unknown>>;
2905
2867
  }
2906
2868
 
2907
- type RequestFn$g = <T>(method: string, path: string, options?: {
2908
- body?: unknown;
2909
- query?: Record<string, string | number | boolean | undefined>;
2910
- headers?: Record<string, string>;
2911
- }) => Promise<T>;
2912
2869
  /** Manage gateway connections for a specific shop. */
2913
2870
  declare class ShopGateways {
2914
2871
  private readonly request;
2915
- constructor(request: RequestFn$g);
2872
+ constructor(request: RequestFn);
2916
2873
  /**
2917
2874
  * Connect a payment gateway to a shop.
2918
2875
  *
@@ -2949,7 +2906,7 @@ declare class Shops {
2949
2906
  private readonly request;
2950
2907
  /** Gateway connection management for shops. */
2951
2908
  readonly gateways: ShopGateways;
2952
- constructor(request: RequestFn$g);
2909
+ constructor(request: RequestFn);
2953
2910
  /**
2954
2911
  * Create a new shop under a merchant account.
2955
2912
  *
@@ -2997,14 +2954,9 @@ declare class Shops {
2997
2954
  list(merchantId: string): Promise<ShopResponse[]>;
2998
2955
  }
2999
2956
 
3000
- type RequestFn$f = <T>(method: string, path: string, options?: {
3001
- body?: unknown;
3002
- query?: Record<string, string | number | boolean | undefined>;
3003
- headers?: Record<string, string>;
3004
- }) => Promise<T>;
3005
2957
  declare class StripeConnect {
3006
2958
  private readonly request;
3007
- constructor(request: RequestFn$f);
2959
+ constructor(request: RequestFn);
3008
2960
  createAccount(params: StripeConnectAccountRequest): Promise<StripeConnectAccountResponse>;
3009
2961
  createAccountLink(params: StripeConnectLinkRequest): Promise<StripeConnectLinkResponse>;
3010
2962
  /** Get onboarding action URL. `POST /connector_onboarding/action_url` */
@@ -3015,25 +2967,15 @@ declare class StripeConnect {
3015
2967
  resetTrackingId(params: Record<string, unknown>): Promise<Record<string, unknown>>;
3016
2968
  }
3017
2969
 
3018
- type RequestFn$e = <T>(method: string, path: string, options?: {
3019
- body?: unknown;
3020
- query?: Record<string, string | number | boolean | undefined>;
3021
- headers?: Record<string, string>;
3022
- }) => Promise<T>;
3023
2970
  declare class ThreeDsRules {
3024
2971
  private readonly request;
3025
- constructor(request: RequestFn$e);
2972
+ constructor(request: RequestFn);
3026
2973
  execute(params: ThreeDsRuleExecuteRequest): Promise<ThreeDsRuleResponse>;
3027
2974
  }
3028
2975
 
3029
- type RequestFn$d = <T>(method: string, path: string, options?: {
3030
- body?: unknown;
3031
- query?: Record<string, string | number | boolean | undefined>;
3032
- headers?: Record<string, string>;
3033
- }) => Promise<T>;
3034
2976
  declare class Users {
3035
2977
  private readonly request;
3036
- constructor(request: RequestFn$d);
2978
+ constructor(request: RequestFn);
3037
2979
  signUp(params: SignUpRequest | SignUpWithMerchantRequest): Promise<AuthResponse>;
3038
2980
  signIn(params: SignInRequest): Promise<AuthResponse>;
3039
2981
  signOut(): Promise<Record<string, unknown>>;
@@ -3128,28 +3070,18 @@ declare class Users {
3128
3070
  updateRole(roleId: string, params: Record<string, unknown>): Promise<Record<string, unknown>>;
3129
3071
  }
3130
3072
 
3131
- type RequestFn$c = <T>(method: string, path: string, options?: {
3132
- body?: unknown;
3133
- query?: Record<string, string | number | boolean | undefined>;
3134
- headers?: Record<string, string>;
3135
- }) => Promise<T>;
3136
3073
  declare class Verification {
3137
3074
  private readonly request;
3138
- constructor(request: RequestFn$c);
3075
+ constructor(request: RequestFn);
3139
3076
  registerApplePayDomains(merchantId: string, params: ApplePayVerificationRequest): Promise<ApplePayVerificationResponse>;
3140
3077
  getApplePayVerifiedDomains(params: Record<string, string>): Promise<ApplePayVerifiedDomainsResponse>;
3141
3078
  }
3142
3079
 
3143
- type RequestFn$b = <T>(method: string, path: string, options?: {
3144
- body?: unknown;
3145
- query?: Record<string, string | number | boolean | undefined>;
3146
- headers?: Record<string, string>;
3147
- }) => Promise<T>;
3148
3080
  type AnalyticsScope = 'merchant' | 'org' | 'profile';
3149
3081
  declare class AnalyticsDomain {
3150
3082
  private readonly request;
3151
3083
  private readonly domain;
3152
- constructor(request: RequestFn$b, domain: string);
3084
+ constructor(request: RequestFn, domain: string);
3153
3085
  /** Get metrics. `POST /analytics/v1/metrics/{domain}` */
3154
3086
  metrics(params: Record<string, unknown>, scope?: AnalyticsScope): Promise<Record<string, unknown>>;
3155
3087
  /** Get filters. `POST /analytics/v1/filters/{domain}` */
@@ -3169,7 +3101,7 @@ declare class Analytics {
3169
3101
  readonly frm: AnalyticsDomain;
3170
3102
  readonly apiEvents: AnalyticsDomain;
3171
3103
  readonly routing: AnalyticsDomain;
3172
- constructor(request: RequestFn$b);
3104
+ constructor(request: RequestFn);
3173
3105
  /** Global search. `POST /analytics/v1/search` */
3174
3106
  search(params: Record<string, unknown>): Promise<Record<string, unknown>>;
3175
3107
  /** Domain-specific search. `POST /analytics/v1/search/{domain}` */
@@ -3188,40 +3120,25 @@ declare class Analytics {
3188
3120
  outgoingWebhookEventLogs(params?: Record<string, string | number | undefined>): Promise<Record<string, unknown>>;
3189
3121
  }
3190
3122
 
3191
- type RequestFn$a = <T>(method: string, path: string, options?: {
3192
- body?: unknown;
3193
- query?: Record<string, string | number | boolean | undefined>;
3194
- headers?: Record<string, string>;
3195
- }) => Promise<T>;
3196
3123
  declare class AnalyticsDashboard {
3197
3124
  private readonly request;
3198
- constructor(request: RequestFn$a);
3125
+ constructor(request: RequestFn);
3199
3126
  /** Get analytics dashboard data. `GET /analytics-dashboard` */
3200
3127
  retrieve(params?: Record<string, string | number | undefined>): Promise<Record<string, unknown>>;
3201
3128
  /** Generate analytics dashboard report. `POST /analytics-dashboard` */
3202
3129
  generate(params: Record<string, unknown>): Promise<Record<string, unknown>>;
3203
3130
  }
3204
3131
 
3205
- type RequestFn$9 = <T>(method: string, path: string, options?: {
3206
- body?: unknown;
3207
- query?: Record<string, string | number | boolean | undefined>;
3208
- headers?: Record<string, string>;
3209
- }) => Promise<T>;
3210
3132
  declare class Cache {
3211
3133
  private readonly request;
3212
- constructor(request: RequestFn$9);
3134
+ constructor(request: RequestFn);
3213
3135
  /** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */
3214
3136
  invalidate(key: string): Promise<Record<string, unknown>>;
3215
3137
  }
3216
3138
 
3217
- type RequestFn$8 = <T>(method: string, path: string, options?: {
3218
- body?: unknown;
3219
- query?: Record<string, string | number | boolean | undefined>;
3220
- headers?: Record<string, string>;
3221
- }) => Promise<T>;
3222
3139
  declare class Cards {
3223
3140
  private readonly request;
3224
- constructor(request: RequestFn$8);
3141
+ constructor(request: RequestFn);
3225
3142
  /** Create a card. `POST /cards/create` */
3226
3143
  create(params: Record<string, unknown>): Promise<Record<string, unknown>>;
3227
3144
  /** Update a card. `POST /cards/update` */
@@ -3230,14 +3147,9 @@ declare class Cards {
3230
3147
  retrieve(bin: string): Promise<Record<string, unknown>>;
3231
3148
  }
3232
3149
 
3233
- type RequestFn$7 = <T>(method: string, path: string, options?: {
3234
- body?: unknown;
3235
- query?: Record<string, string | number | boolean | undefined>;
3236
- headers?: Record<string, string>;
3237
- }) => Promise<T>;
3238
3150
  declare class Configs {
3239
3151
  private readonly request;
3240
- constructor(request: RequestFn$7);
3152
+ constructor(request: RequestFn);
3241
3153
  /** Create a config. `POST /configs` */
3242
3154
  create(params: Record<string, unknown>): Promise<Record<string, unknown>>;
3243
3155
  /** Retrieve a config by key. `GET /configs/{key}` */
@@ -3248,38 +3160,23 @@ declare class Configs {
3248
3160
  delete(key: string): Promise<Record<string, unknown>>;
3249
3161
  }
3250
3162
 
3251
- type RequestFn$6 = <T>(method: string, path: string, options?: {
3252
- body?: unknown;
3253
- query?: Record<string, string | number | boolean | undefined>;
3254
- headers?: Record<string, string>;
3255
- }) => Promise<T>;
3256
3163
  declare class Export {
3257
3164
  private readonly request;
3258
- constructor(request: RequestFn$6);
3165
+ constructor(request: RequestFn);
3259
3166
  /** Export transactions. `POST /export/transactions` */
3260
3167
  transactions(params: Record<string, unknown>): Promise<Record<string, unknown>>;
3261
3168
  }
3262
3169
 
3263
- type RequestFn$5 = <T>(method: string, path: string, options?: {
3264
- body?: unknown;
3265
- query?: Record<string, string | number | boolean | undefined>;
3266
- headers?: Record<string, string>;
3267
- }) => Promise<T>;
3268
3170
  declare class FeatureMatrix {
3269
3171
  private readonly request;
3270
- constructor(request: RequestFn$5);
3172
+ constructor(request: RequestFn);
3271
3173
  /** Retrieve the feature matrix. `GET /feature_matrix` */
3272
3174
  retrieve(): Promise<Record<string, unknown>>;
3273
3175
  }
3274
3176
 
3275
- type RequestFn$4 = <T>(method: string, path: string, options?: {
3276
- body?: unknown;
3277
- query?: Record<string, string | number | boolean | undefined>;
3278
- headers?: Record<string, string>;
3279
- }) => Promise<T>;
3280
3177
  declare class Files {
3281
3178
  private readonly request;
3282
- constructor(request: RequestFn$4);
3179
+ constructor(request: RequestFn);
3283
3180
  /** Upload a file. `POST /files` */
3284
3181
  create(params: Record<string, unknown>): Promise<Record<string, unknown>>;
3285
3182
  /** Retrieve/download a file. `GET /files/{fileId}` */
@@ -3288,28 +3185,18 @@ declare class Files {
3288
3185
  delete(fileId: string): Promise<Record<string, unknown>>;
3289
3186
  }
3290
3187
 
3291
- type RequestFn$3 = <T>(method: string, path: string, options?: {
3292
- body?: unknown;
3293
- query?: Record<string, string | number | boolean | undefined>;
3294
- headers?: Record<string, string>;
3295
- }) => Promise<T>;
3296
3188
  declare class Forex {
3297
3189
  private readonly request;
3298
- constructor(request: RequestFn$3);
3190
+ constructor(request: RequestFn);
3299
3191
  /** Retrieve forex rates. `GET /forex/rates` */
3300
3192
  getRates(params?: Record<string, string | number | undefined>): Promise<Record<string, unknown>>;
3301
3193
  /** Convert from minor currency. `GET /forex/convert_from_minor` */
3302
3194
  convertFromMinor(params: Record<string, string | number | undefined>): Promise<Record<string, unknown>>;
3303
3195
  }
3304
3196
 
3305
- type RequestFn$2 = <T>(method: string, path: string, options?: {
3306
- body?: unknown;
3307
- query?: Record<string, string | number | boolean | undefined>;
3308
- headers?: Record<string, string>;
3309
- }) => Promise<T>;
3310
3197
  declare class Regions {
3311
3198
  private readonly request;
3312
- constructor(request: RequestFn$2);
3199
+ constructor(request: RequestFn);
3313
3200
  /** Create a region. `POST /regions` */
3314
3201
  create(params: RegionCreateRequest): Promise<RegionResponse>;
3315
3202
  /** Retrieve a region by ID. `GET /regions/{regionId}` */
@@ -3322,14 +3209,9 @@ declare class Regions {
3322
3209
  list(): Promise<RegionResponse[]>;
3323
3210
  }
3324
3211
 
3325
- type RequestFn$1 = <T>(method: string, path: string, options?: {
3326
- body?: unknown;
3327
- query?: Record<string, string | number | boolean | undefined>;
3328
- headers?: Record<string, string>;
3329
- }) => Promise<T>;
3330
3212
  declare class Subscriptions {
3331
3213
  private readonly request;
3332
- constructor(request: RequestFn$1);
3214
+ constructor(request: RequestFn);
3333
3215
  /** Create and immediately confirm a subscription. `POST /subscriptions` */
3334
3216
  createAndConfirm(params: SubscriptionCreateRequest): Promise<SubscriptionResponse>;
3335
3217
  /** Create a subscription (without confirming). `POST /subscriptions/create` */
@@ -3354,6 +3236,13 @@ declare class Subscriptions {
3354
3236
  cancel(subscriptionId: string): Promise<SubscriptionResponse>;
3355
3237
  }
3356
3238
 
3239
+ /**
3240
+ * Events emitted by the debug logger.
3241
+ * - `request` — about to send a request (`method`, `url`, `path`)
3242
+ * - `response` — response received (`status`, `method`, `path`, `requestId?`)
3243
+ * - `retry` — about to retry after a transient failure (`attempt`, `maxRetries`, `method`, `path`)
3244
+ */
3245
+ type DelopayLogger = (event: 'request' | 'response' | 'retry', data: Record<string, unknown>) => void;
3357
3246
  /**
3358
3247
  * Configuration options for the Delopay client.
3359
3248
  */
@@ -3370,8 +3259,14 @@ interface DelopayOptions {
3370
3259
  * Only idempotent-safe requests (GET, DELETE, and requests with an `Idempotency-Key` header) are retried.
3371
3260
  */
3372
3261
  maxRetries?: number;
3373
- /** Enable debug logging of requests and responses to `console.log`. Defaults to `false`. */
3262
+ /** Enable debug logging of requests and responses. Defaults to `false`. */
3374
3263
  debug?: boolean;
3264
+ /**
3265
+ * Custom logger for debug events (`request`, `response`, `retry`). When omitted,
3266
+ * debug output is written to `console.log`. Has no effect unless `debug` is `true`.
3267
+ * Useful for routing SDK logs through pino, winston, or similar structured loggers.
3268
+ */
3269
+ logger?: DelopayLogger;
3375
3270
  }
3376
3271
  /**
3377
3272
  * Low-level options forwarded to a single HTTP request.
@@ -3379,10 +3274,20 @@ interface DelopayOptions {
3379
3274
  interface RequestOptions {
3380
3275
  /** Request body, serialised as JSON. */
3381
3276
  body?: unknown;
3382
- /** Query-string parameters. `undefined` values are omitted. */
3383
- query?: Record<string, string | number | boolean | undefined>;
3277
+ /**
3278
+ * Query-string parameters. `undefined` and `null` values are omitted.
3279
+ * Array values are emitted as repeated keys (`?tag=a&tag=b`) — not comma-joined.
3280
+ */
3281
+ query?: Record<string, string | number | boolean | null | undefined | (string | number | boolean)[]>;
3384
3282
  /** Additional HTTP headers merged with the default `api-key` header. */
3385
3283
  headers?: Record<string, string>;
3284
+ /** Override the client-level timeout for this request, in milliseconds. */
3285
+ timeout?: number;
3286
+ /**
3287
+ * Caller-provided `AbortSignal`. Aborting it cancels the in-flight request and rejects
3288
+ * with a `DelopayError` carrying code `'ABORTED'`. Combined with the per-request timeout.
3289
+ */
3290
+ signal?: AbortSignal;
3386
3291
  }
3387
3292
  type RequestFn = <T>(method: string, path: string, options?: RequestOptions) => Promise<T>;
3388
3293
  /**
@@ -3401,7 +3306,7 @@ type RequestFn = <T>(method: string, path: string, options?: RequestOptions) =>
3401
3306
  declare class Delopay {
3402
3307
  /** Utility for verifying incoming webhook signatures (static, no instance needed). */
3403
3308
  static webhooks: {
3404
- verify(rawBody: string, signatureHeader: string, secret: string, options?: VerifyOptions): WebhookEvent;
3309
+ verify(rawBody: string, signatureHeader: string, secret: string, options?: VerifyOptions): Promise<WebhookEvent>;
3405
3310
  };
3406
3311
  /** The resolved base URL used for all API requests. */
3407
3312
  readonly baseUrl: string;
@@ -3409,6 +3314,7 @@ declare class Delopay {
3409
3314
  private readonly timeout;
3410
3315
  private readonly maxRetries;
3411
3316
  private readonly debug;
3317
+ private readonly logger?;
3412
3318
  private jwtToken?;
3413
3319
  readonly payments: Payments;
3414
3320
  readonly refunds: Refunds;
@@ -3521,7 +3427,7 @@ declare class Delopay {
3521
3427
  * await delopay.payments.create({ amount: 5000, currency: 'EUR' });
3522
3428
  * } catch (e) {
3523
3429
  * if (e instanceof DelopayError) {
3524
- * console.error(e.status, e.code, e.message);
3430
+ * console.error(e.status, e.code, e.requestId, e.message);
3525
3431
  * }
3526
3432
  * }
3527
3433
  * ```
@@ -3533,10 +3439,20 @@ declare class DelopayError extends Error {
3533
3439
  readonly code: string;
3534
3440
  /** Error category (e.g. `'invalid_request'`, `'timeout_error'`). */
3535
3441
  readonly type: string;
3442
+ /** Value of the `x-request-id` response header, when present. Include this when contacting support. */
3443
+ readonly requestId?: string;
3444
+ /**
3445
+ * Raw response body (truncated to ~2 KB). Populated when the server returns a
3446
+ * non-JSON error body (e.g. an HTML 502 from an upstream proxy) so debugging
3447
+ * still has something to go on.
3448
+ */
3449
+ readonly rawBody?: string;
3536
3450
  constructor(message: string, options: {
3537
3451
  status: number;
3538
3452
  code: string;
3539
3453
  type: string;
3454
+ requestId?: string;
3455
+ rawBody?: string;
3540
3456
  });
3541
3457
  }
3542
3458
  /**
@@ -3550,7 +3466,10 @@ declare class DelopayError extends Error {
3550
3466
  * ```
3551
3467
  */
3552
3468
  declare class DelopayAuthenticationError extends DelopayError {
3553
- constructor(message?: string);
3469
+ constructor(message?: string, options?: {
3470
+ requestId?: string;
3471
+ rawBody?: string;
3472
+ });
3554
3473
  }
3555
3474
 
3556
3475
  /**
@@ -3580,6 +3499,9 @@ declare const Webhooks: {
3580
3499
  /**
3581
3500
  * Verify the signature of an incoming Delopay webhook and return the parsed event.
3582
3501
  *
3502
+ * Uses the Web Crypto API (`globalThis.crypto.subtle`), so it runs unchanged in
3503
+ * Node 18+, modern browsers, Deno, Bun, and edge runtimes (Cloudflare Workers, Vercel Edge).
3504
+ *
3583
3505
  * This method is available as a static property on the `Delopay` class
3584
3506
  * (`Delopay.webhooks.verify`) and does not require a client instance.
3585
3507
  *
@@ -3587,14 +3509,14 @@ declare const Webhooks: {
3587
3509
  * @param signatureHeader - The value of the `delopay-signature` HTTP header.
3588
3510
  * @param secret - Your webhook signing secret from the Delopay dashboard.
3589
3511
  * @param options - Optional verification settings (replay tolerance).
3590
- * @returns The parsed webhook event.
3512
+ * @returns Promise that resolves to the parsed webhook event.
3591
3513
  * @throws {Error} When the signature is invalid, the timestamp is missing, or the event is too old.
3592
3514
  *
3593
3515
  * @example
3594
3516
  * ```typescript
3595
3517
  * // Express example
3596
- * app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
3597
- * const event = Delopay.webhooks.verify(
3518
+ * app.post('/webhook', express.raw({ type: 'application/json' }), async (req, res) => {
3519
+ * const event = await Delopay.webhooks.verify(
3598
3520
  * req.body.toString(),
3599
3521
  * req.headers['delopay-signature'] as string,
3600
3522
  * process.env.DELOPAY_WEBHOOK_SECRET!,
@@ -3604,7 +3526,7 @@ declare const Webhooks: {
3604
3526
  * });
3605
3527
  * ```
3606
3528
  */
3607
- verify(rawBody: string, signatureHeader: string, secret: string, options?: VerifyOptions): WebhookEvent;
3529
+ verify(rawBody: string, signatureHeader: string, secret: string, options?: VerifyOptions): Promise<WebhookEvent>;
3608
3530
  };
3609
3531
 
3610
- export { type Address, type AddressDetails, type AdminAdjustmentRequest, type AdminAdjustmentResponse, type AdminAnalyticsRequest, type AdminCustomerDetail, type AdminCustomerListParams, type AdminCustomerListResponse, type AdminSignInRequest, type AdminTransactionListParams, type AdminTransactionListResponse, 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 AuditLogListParams, type AuditLogListResponse, type AuditLogResponse, 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, Cache, type CaptureMethod, type CardDetail, type CardDetailFromLocker, type CardIssuerCreateRequest, type CardIssuerListResponse, type CardIssuerResponse, type CardIssuerUpdateRequest, Cards, type ChangePasswordRequest, Configs, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerSummary, type CustomerUpdateRequest, type CustomerUser, type DashboardMetadataResponse, Delopay, DelopayAuthenticationError, DelopayError, 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 GatewayConnectRequest, type GatewayResponse, type GsmDecision, type GsmRuleCreateRequest, type GsmRuleResponse, type GsmRuleUpdateRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type LedgerEntry, type LedgerListParams, type LedgerResponse, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type OverviewStat, type OverviewStatsResponse, type PaymentAnalyticsRequest, type PaymentAnalyticsResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentStat, 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 PlatformAnalyticsResponse, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, 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 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 ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type UpdateUserDetailsRequest, type UserResponse, type VerifyOptions, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks };
3532
+ export { type Address, type AddressDetails, type AdminAdjustmentRequest, type AdminAdjustmentResponse, type AdminAnalyticsRequest, type AdminCustomerDetail, type AdminCustomerListParams, type AdminCustomerListResponse, type AdminSignInRequest, type AdminTransactionListParams, type AdminTransactionListResponse, 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 AuditLogListParams, type AuditLogListResponse, type AuditLogResponse, type AuthResponse, type AuthenticationCreateRequest, type AuthenticationResponse, type AuthenticationStatus, type AuthenticationType, type AuthorizeResponse, type AutoRechargeConfig, type AutoRechargeUpdateRequest, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, Cache, type CaptureMethod, type CardDetail, type CardDetailFromLocker, type CardIssuerCreateRequest, type CardIssuerListResponse, type CardIssuerResponse, type CardIssuerUpdateRequest, Cards, type ChangePasswordRequest, Configs, type ConnectorCreateRequest, type ConnectorListResponse, type ConnectorResponse, type ConnectorType, type ConnectorUpdateRequest, type CreateInternalUserRequest, type CreateTenantUserRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerSummary, type CustomerUpdateRequest, type CustomerUser, type DashboardMetadataResponse, 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 GatewayConnectRequest, type GatewayResponse, type GsmDecision, type GsmRuleCreateRequest, type GsmRuleResponse, type GsmRuleUpdateRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type LedgerEntry, type LedgerListParams, type LedgerResponse, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type OnboardMerchantRequest, type OnboardMerchantResponse, type OverviewStat, type OverviewStatsResponse, type PaymentAnalyticsRequest, type PaymentAnalyticsResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentStat, 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 PlatformAnalyticsResponse, type PollStatus, type PollStatusResponse, type ProfileAcquirerCreateRequest, type ProfileAcquirerResponse, type ProfileAcquirerUpdateRequest, type ProfileCreateRequest, 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 SignupToggleRequest, type SignupToggleResponse, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionCreateRequest, type SubscriptionListParams, type SubscriptionListResponse, type SubscriptionResponse, type SubscriptionUpdateRequest, Subscriptions, type SwitchMerchantRequest, type SwitchProfileRequest, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type UpdateUserDetailsRequest, type UserResponse, type VerifyOptions, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks };