@delopay/sdk 0.30.0 → 0.32.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
@@ -185,6 +185,8 @@ interface PaymentCreateRequest {
185
185
  allowed_payment_method_types?: PaymentMethodType[] | null;
186
186
  /** Browser metadata for 3-D Secure fingerprinting. */
187
187
  browser_info?: Record<string, unknown> | null;
188
+ /** Set to `true` to generate a hosted payment link for this payment. */
189
+ payment_link?: boolean | null;
188
190
  }
189
191
  interface PaymentUpdateRequest {
190
192
  amount?: number | null;
@@ -217,6 +219,8 @@ interface PaymentUpdateRequest {
217
219
  phone_country_code?: string | null;
218
220
  }
219
221
  interface PaymentConfirmRequest {
222
+ /** Client secret from the created payment, required for client-side confirmation with a publishable key. */
223
+ client_secret?: string | null;
220
224
  payment_method?: PaymentMethod | null;
221
225
  payment_method_type?: PaymentMethodType | null;
222
226
  payment_method_data?: Record<string, unknown> | null;
@@ -323,6 +327,8 @@ interface PaymentResponse {
323
327
  disputes?: DisputeResponse[] | null;
324
328
  /** Instructions for completing additional customer actions (3DS redirect, etc.). */
325
329
  next_action?: Record<string, unknown> | null;
330
+ /** Hosted payment link details, present when the payment was created with `payment_link: true`. */
331
+ payment_link?: PaymentLinkResponse | null;
326
332
  /** Reason provided when the payment was cancelled. */
327
333
  cancellation_reason?: string | null;
328
334
  /** Bank statement descriptor (name portion). */
@@ -541,6 +547,8 @@ interface PaymentMethodResponse {
541
547
  client_secret?: string | null;
542
548
  status?: string | null;
543
549
  billing?: Address | null;
550
+ /** Token used to charge this saved method on a later payment (pass as `payment_token` to `payments.create`). */
551
+ payment_token?: string | null;
544
552
  }
545
553
  interface PaymentMethodListParams {
546
554
  client_secret?: string | null;
@@ -668,6 +676,8 @@ interface ShopUpdateRequest {
668
676
  return_url?: string | null;
669
677
  webhook_url?: string | null;
670
678
  is_active?: boolean | null;
679
+ /** Webhook signing secret for this shop. Outgoing webhooks are HMAC-SHA512 signed with this key. */
680
+ payment_response_hash_key?: string | null;
671
681
  payment_link_config?: BusinessPaymentLinkConfig | null;
672
682
  /**
673
683
  * Origins permitted to embed this shop's hosted checkout in an iframe.
@@ -1597,6 +1607,11 @@ interface ProfileCreateRequest {
1597
1607
  * clickjacking defense.
1598
1608
  */
1599
1609
  iframe_allowed_origins?: string[] | null;
1610
+ /**
1611
+ * Merchant connector account ID of the billing processor (e.g. Stripe
1612
+ * Billing / PayPal) that owns this profile's native subscriptions.
1613
+ */
1614
+ billing_processor_id?: string | null;
1600
1615
  }
1601
1616
  interface ProfileUpdateRequest {
1602
1617
  profile_name?: string | null;
@@ -1612,6 +1627,11 @@ interface ProfileUpdateRequest {
1612
1627
  * iframe. See {@link ProfileCreateRequest.iframe_allowed_origins}.
1613
1628
  */
1614
1629
  iframe_allowed_origins?: string[] | null;
1630
+ /**
1631
+ * Merchant connector account ID of the billing processor (e.g. Stripe
1632
+ * Billing / PayPal) that owns this profile's native subscriptions.
1633
+ */
1634
+ billing_processor_id?: string | null;
1615
1635
  }
1616
1636
  interface ProfileResponse {
1617
1637
  merchant_id: string;
@@ -1635,6 +1655,11 @@ interface ProfileResponse {
1635
1655
  * iframe. See {@link ProfileCreateRequest.iframe_allowed_origins}.
1636
1656
  */
1637
1657
  iframe_allowed_origins?: string[] | null;
1658
+ /**
1659
+ * Merchant connector account ID of the billing processor (e.g. Stripe
1660
+ * Billing / PayPal) that owns this profile's native subscriptions.
1661
+ */
1662
+ billing_processor_id?: string | null;
1638
1663
  [key: string]: unknown;
1639
1664
  }
1640
1665
  type BlocklistAddRequest = {
@@ -1825,40 +1850,289 @@ interface ThreeDsRuleExecuteRequest {
1825
1850
  interface ThreeDsRuleResponse {
1826
1851
  decision: ThreeDSDecision;
1827
1852
  }
1828
- interface SubscriptionCreateRequest {
1829
- customer_id?: string;
1830
- payment_method_id?: string;
1853
+ /** Lifecycle status of a subscription. */
1854
+ type SubscriptionStatus = 'active' | 'created' | 'in_active' | 'pending' | 'trial' | 'paused' | 'unpaid' | 'onetime' | 'cancelled' | 'failed';
1855
+ /** Status of an invoice raised for one subscription billing cycle. */
1856
+ type InvoiceStatus = 'invoice_created' | 'payment_pending' | 'payment_pending_timeout' | 'payment_succeeded' | 'payment_failed' | 'payment_canceled' | 'invoice_paid' | 'manual_review' | 'voided';
1857
+ /** Billing interval unit for a subscription item price. */
1858
+ type SubscriptionPeriodUnit = 'Day' | 'Week' | 'Month' | 'Year';
1859
+ /** How the customer's saved payment method may be used for future payments. */
1860
+ type FutureUsage = 'off_session' | 'on_session';
1861
+ /** Item-type filter for `GET /subscriptions/items`. */
1862
+ type SubscriptionItemType = 'plan' | 'addon';
1863
+ /**
1864
+ * Payment leg attached to a subscription invoice. Present once a charge has
1865
+ * been attempted for the current billing cycle.
1866
+ */
1867
+ interface SubscriptionPaymentData {
1868
+ payment_id: string;
1869
+ status: IntentStatus;
1831
1870
  amount: number;
1832
1871
  currency: Currency;
1833
- recurring_details?: Record<string, unknown>;
1834
- metadata?: Record<string, unknown>;
1835
- [key: string]: unknown;
1836
- }
1837
- interface SubscriptionUpdateRequest {
1838
- amount?: number;
1839
- currency?: Currency;
1840
- metadata?: Record<string, unknown>;
1841
- [key: string]: unknown;
1872
+ profile_id?: string | null;
1873
+ connector?: string | null;
1874
+ payment_method_id?: string | null;
1875
+ return_url?: string | null;
1876
+ /** Next action to drive on the client (redirect, render QR, etc.). */
1877
+ next_action?: Record<string, unknown> | null;
1878
+ payment_experience?: string | null;
1879
+ error_code?: string | null;
1880
+ error_message?: string | null;
1881
+ payment_method_type?: PaymentMethodType | null;
1882
+ client_secret?: string | null;
1883
+ billing?: Address | null;
1884
+ shipping?: Address | null;
1885
+ payment_type?: string | null;
1886
+ payment_token?: string | null;
1842
1887
  }
1843
- interface SubscriptionResponse {
1888
+ /** A single invoice raised for one billing cycle of a subscription. */
1889
+ interface SubscriptionInvoice {
1890
+ id: string;
1844
1891
  subscription_id: string;
1845
- customer_id?: string;
1846
- status: string;
1892
+ merchant_id: string;
1893
+ profile_id: string;
1894
+ merchant_connector_id: string;
1895
+ payment_intent_id?: string | null;
1896
+ payment_method_id?: string | null;
1897
+ customer_id: string;
1847
1898
  amount: number;
1848
1899
  currency: Currency;
1849
- created_at: string;
1850
- metadata?: Record<string, unknown>;
1851
- [key: string]: unknown;
1900
+ status: InvoiceStatus;
1901
+ /** ID of this invoice on the billing processor (Stripe Billing / PayPal). */
1902
+ billing_processor_invoice_id?: string | null;
1903
+ }
1904
+ /** A purchasable price option for a subscription item (plan or addon). */
1905
+ interface SubscriptionItemPrice {
1906
+ price_id: string;
1907
+ /** Plan or addon ID this price belongs to. */
1908
+ item_id?: string | null;
1909
+ amount: number;
1910
+ currency: Currency;
1911
+ interval: SubscriptionPeriodUnit;
1912
+ interval_count: number;
1913
+ trial_period?: number | null;
1914
+ trial_period_unit?: SubscriptionPeriodUnit | null;
1915
+ }
1916
+ /** A subscription item (plan or addon) with its available prices. */
1917
+ interface SubscriptionItem {
1918
+ item_id: string;
1919
+ name: string;
1920
+ description?: string | null;
1921
+ /** Available prices for this item. */
1922
+ price_id: SubscriptionItemPrice[];
1923
+ }
1924
+ /** A single line of a subscription cost estimate. */
1925
+ interface SubscriptionLineItem {
1926
+ item_id: string;
1927
+ item_type: string;
1928
+ description: string;
1929
+ amount: number;
1930
+ currency: Currency;
1931
+ quantity: number;
1932
+ }
1933
+ /** Payment options for `POST /subscriptions/create` (create without confirming). */
1934
+ interface CreateSubscriptionPaymentDetails {
1935
+ /** URL the customer is returned to after completing the purchase. */
1936
+ return_url: string;
1937
+ setup_future_usage?: FutureUsage | null;
1938
+ capture_method?: CaptureMethod | null;
1939
+ authentication_type?: AuthenticationType | null;
1940
+ payment_type?: string | null;
1941
+ }
1942
+ /** Body for `POST /subscriptions/create`. */
1943
+ interface CreateSubscriptionRequest {
1944
+ merchant_reference_id?: string | null;
1945
+ item_price_id: string;
1946
+ plan_id?: string | null;
1947
+ coupon_code?: string | null;
1948
+ customer_id: string;
1949
+ payment_details: CreateSubscriptionPaymentDetails;
1950
+ billing?: Address | null;
1951
+ shipping?: Address | null;
1952
+ }
1953
+ /** Payment options for `POST /subscriptions` (create + confirm in one call). */
1954
+ interface SubscriptionPaymentDetails {
1955
+ payment_method?: PaymentMethod | null;
1956
+ payment_method_type?: PaymentMethodType | null;
1957
+ payment_method_data?: Record<string, unknown> | null;
1958
+ setup_future_usage?: FutureUsage | null;
1959
+ customer_acceptance?: Record<string, unknown> | null;
1960
+ /** URL the customer is returned to after completing the purchase. */
1961
+ return_url?: string | null;
1962
+ capture_method?: CaptureMethod | null;
1963
+ authentication_type?: AuthenticationType | null;
1964
+ payment_type?: string | null;
1965
+ payment_method_id?: string | null;
1966
+ }
1967
+ /** Body for `POST /subscriptions` (create and immediately confirm). */
1968
+ interface CreateAndConfirmSubscriptionRequest {
1969
+ plan_id?: string | null;
1970
+ item_price_id: string;
1971
+ coupon_code?: string | null;
1972
+ customer_id: string;
1973
+ billing?: Address | null;
1974
+ shipping?: Address | null;
1975
+ payment_details: SubscriptionPaymentDetails;
1976
+ merchant_reference_id?: string | null;
1852
1977
  }
1978
+ /** Payment options for `POST /subscriptions/{id}/confirm`. */
1979
+ interface ConfirmSubscriptionPaymentDetails {
1980
+ shipping?: Address | null;
1981
+ billing?: Address | null;
1982
+ payment_method: PaymentMethod;
1983
+ payment_method_type?: PaymentMethodType | null;
1984
+ payment_method_data?: Record<string, unknown> | null;
1985
+ customer_acceptance?: Record<string, unknown> | null;
1986
+ payment_type?: string | null;
1987
+ payment_token?: string | null;
1988
+ }
1989
+ /** Body for `POST /subscriptions/{id}/confirm`. */
1990
+ interface ConfirmSubscriptionRequest {
1991
+ /** Client secret minted at create time; required for client-side confirm. */
1992
+ client_secret?: string | null;
1993
+ payment_details: ConfirmSubscriptionPaymentDetails;
1994
+ }
1995
+ /** Body for `PUT /subscriptions/{id}/update`. */
1996
+ interface UpdateSubscriptionRequest {
1997
+ plan_id: string;
1998
+ item_price_id: string;
1999
+ }
2000
+ /** Body for `POST /subscriptions/{id}/pause`. */
2001
+ interface PauseSubscriptionRequest {
2002
+ pause_option?: 'immediately' | 'end_of_term' | 'specific_date' | null;
2003
+ /** ISO-8601 timestamp; honoured when `pause_option` is `specific_date`. */
2004
+ pause_at?: string | null;
2005
+ }
2006
+ /** Body for `POST /subscriptions/{id}/resume`. */
2007
+ interface ResumeSubscriptionRequest {
2008
+ resume_option?: 'immediately' | 'specific_date' | null;
2009
+ resume_date?: string | null;
2010
+ charges_handling?: 'invoice_immediately' | 'add_to_unbilled_charges' | null;
2011
+ unpaid_invoices_handling?: 'no_action' | 'schedule_payment_collection' | null;
2012
+ }
2013
+ /** Body for `POST /subscriptions/{id}/cancel`. */
2014
+ interface CancelSubscriptionRequest {
2015
+ cancel_option?: 'immediately' | 'end_of_term' | 'specific_date' | null;
2016
+ cancel_at?: string | null;
2017
+ unbilled_charges_option?: 'invoice' | 'delete' | null;
2018
+ credit_option_for_current_term_charges?: 'none' | 'prorate' | 'full' | null;
2019
+ account_receivables_handling?: 'no_action' | 'schedule_payment_collection' | 'write_off' | null;
2020
+ refundable_credits_handling?: 'no_action' | 'schedule_refund' | null;
2021
+ cancel_reason_code?: string | null;
2022
+ }
2023
+ /** Query for `GET /subscriptions/list`. */
1853
2024
  interface SubscriptionListParams {
1854
2025
  limit?: number;
1855
2026
  offset?: number;
1856
- customer_id?: string;
1857
- status?: string;
1858
2027
  }
1859
- interface SubscriptionListResponse {
1860
- count: number;
1861
- data: SubscriptionResponse[];
2028
+ /** Query for `GET /subscriptions/items`. */
2029
+ interface GetSubscriptionItemsParams {
2030
+ client_secret?: string;
2031
+ limit?: number;
2032
+ offset?: number;
2033
+ item_type: SubscriptionItemType;
2034
+ }
2035
+ /** Query for `GET /subscriptions/estimate`. */
2036
+ interface SubscriptionEstimateParams {
2037
+ plan_id?: string;
2038
+ item_price_id: string;
2039
+ coupon_code?: string;
2040
+ }
2041
+ /**
2042
+ * A subscription, as returned by create / retrieve / update / list. The
2043
+ * confirm and create-and-confirm flows return {@link ConfirmSubscriptionResponse}
2044
+ * instead, which additionally carries the billing-processor subscription ID and
2045
+ * the approval `redirect_url`.
2046
+ */
2047
+ interface SubscriptionResponse {
2048
+ id: string;
2049
+ merchant_reference_id?: string | null;
2050
+ status: SubscriptionStatus;
2051
+ plan_id?: string | null;
2052
+ item_price_id?: string | null;
2053
+ profile_id: string;
2054
+ /** Token (15-min TTL) used by the client SDK to authenticate confirm/session calls. */
2055
+ client_secret?: string | null;
2056
+ merchant_id: string;
2057
+ coupon_code?: string | null;
2058
+ customer_id: string;
2059
+ payment?: SubscriptionPaymentData | null;
2060
+ invoice?: SubscriptionInvoice | null;
2061
+ }
2062
+ /**
2063
+ * Returned by `POST /subscriptions` (create + confirm) and
2064
+ * `POST /subscriptions/{id}/confirm`.
2065
+ */
2066
+ interface ConfirmSubscriptionResponse {
2067
+ id: string;
2068
+ merchant_reference_id?: string | null;
2069
+ status: SubscriptionStatus;
2070
+ plan_id?: string | null;
2071
+ item_price_id?: string | null;
2072
+ coupon?: string | null;
2073
+ profile_id: string;
2074
+ payment?: SubscriptionPaymentData | null;
2075
+ customer_id?: string | null;
2076
+ invoice?: SubscriptionInvoice | null;
2077
+ /** Subscription ID on the billing processor (Stripe Billing / PayPal). */
2078
+ billing_processor_subscription_id?: string | null;
2079
+ /**
2080
+ * URL the customer must be redirected to in order to approve the
2081
+ * subscription, for billing processors that require buyer approval
2082
+ * (e.g. PayPal `APPROVAL_PENDING`). `null` for processors that activate the
2083
+ * subscription server-side (e.g. Stripe Billing with a saved payment method).
2084
+ */
2085
+ redirect_url?: string | null;
2086
+ }
2087
+ /** Returned by `POST /subscriptions/{id}/pause`. */
2088
+ interface PauseSubscriptionResponse {
2089
+ id: string;
2090
+ status: SubscriptionStatus;
2091
+ merchant_reference_id?: string | null;
2092
+ profile_id: string;
2093
+ merchant_id: string;
2094
+ customer_id: string;
2095
+ /** ISO-8601 timestamp the subscription was paused at. */
2096
+ paused_at?: string | null;
2097
+ }
2098
+ /** Returned by `POST /subscriptions/{id}/resume`. */
2099
+ interface ResumeSubscriptionResponse {
2100
+ id: string;
2101
+ status: SubscriptionStatus;
2102
+ merchant_reference_id?: string | null;
2103
+ profile_id: string;
2104
+ merchant_id: string;
2105
+ customer_id: string;
2106
+ /** ISO-8601 timestamp of the next billing cycle. */
2107
+ next_billing_at?: string | null;
2108
+ }
2109
+ /** Returned by `POST /subscriptions/{id}/cancel`. */
2110
+ interface CancelSubscriptionResponse {
2111
+ id: string;
2112
+ status: SubscriptionStatus;
2113
+ merchant_reference_id?: string | null;
2114
+ profile_id: string;
2115
+ merchant_id: string;
2116
+ customer_id: string;
2117
+ /** ISO-8601 timestamp the subscription was cancelled at. */
2118
+ cancelled_at?: string | null;
2119
+ }
2120
+ /** A subscription item with its prices, as returned by `GET /subscriptions/items`. */
2121
+ interface GetSubscriptionItemsResponse {
2122
+ item_id: string;
2123
+ name: string;
2124
+ description?: string | null;
2125
+ price_id: SubscriptionItemPrice[];
2126
+ }
2127
+ /** Returned by `GET /subscriptions/estimate`. */
2128
+ interface SubscriptionEstimateResponse {
2129
+ amount: number;
2130
+ currency: Currency;
2131
+ plan_id?: string | null;
2132
+ item_price_id?: string | null;
2133
+ coupon_code?: string | null;
2134
+ customer_id?: string | null;
2135
+ line_items: SubscriptionLineItem[];
1862
2136
  }
1863
2137
  interface RegionCreateRequest {
1864
2138
  region_name: string;
@@ -2492,18 +2766,20 @@ declare class Payments {
2492
2766
  * Create a new payment intent.
2493
2767
  *
2494
2768
  * @param params - Payment creation parameters including amount and currency.
2769
+ * @param options - Optional per-call extras: extra `headers` (e.g. an
2770
+ * `Idempotency-Key` to make the create safe to retry), a `timeout` override,
2771
+ * and an `AbortSignal`.
2495
2772
  * @returns The created payment intent.
2496
2773
  *
2497
2774
  * @example
2498
2775
  * ```typescript
2499
- * const payment = await delopay.payments.create({
2500
- * amount: 5000,
2501
- * currency: 'EUR',
2502
- * customer_id: 'cus_123',
2503
- * });
2776
+ * const payment = await delopay.payments.create(
2777
+ * { amount: 5000, currency: 'EUR', customer_id: 'cus_123' },
2778
+ * { headers: { 'Idempotency-Key': 'order_1001' } },
2779
+ * );
2504
2780
  * ```
2505
2781
  */
2506
- create(params: PaymentCreateRequest): Promise<PaymentResponse>;
2782
+ create(params: PaymentCreateRequest, options?: RequestExtras): Promise<PaymentResponse>;
2507
2783
  /**
2508
2784
  * Retrieve a payment by its ID.
2509
2785
  *
@@ -2562,6 +2838,8 @@ declare class Payments {
2562
2838
  * List payment intents, optionally filtered by customer or date range.
2563
2839
  *
2564
2840
  * @param params - Optional filter and pagination parameters.
2841
+ * @param options - Optional per-call extras: extra `headers`, a `timeout`
2842
+ * override, and an `AbortSignal` for cancellation.
2565
2843
  * @returns Paginated list of payment intents.
2566
2844
  *
2567
2845
  * @example
@@ -2569,7 +2847,7 @@ declare class Payments {
2569
2847
  * const { data } = await delopay.payments.list({ customer_id: 'cus_123', limit: 25 });
2570
2848
  * ```
2571
2849
  */
2572
- list(params?: PaymentListParams): Promise<PaymentListResponse>;
2850
+ list(params?: PaymentListParams, options?: RequestExtras): Promise<PaymentListResponse>;
2573
2851
  /** Generate session tokens. `POST /payments/session-tokens` */
2574
2852
  sessionTokens(params: Record<string, unknown>): Promise<Record<string, unknown>>;
2575
2853
  /** Retrieve payment with gateway credentials. `POST /payments/sync` */
@@ -3031,7 +3309,7 @@ declare class Shops {
3031
3309
  *
3032
3310
  * @example
3033
3311
  * ```typescript
3034
- * const shop = await delopay.shops.create('merch_123', { profile_name: 'EU Store' });
3312
+ * const shop = await delopay.shops.create('merch_123', { shop_name: 'EU Store' });
3035
3313
  * ```
3036
3314
  */
3037
3315
  create(merchantId: string, params: ShopCreateRequest): Promise<ShopResponse>;
@@ -3430,28 +3708,38 @@ declare class Regions {
3430
3708
  declare class Subscriptions {
3431
3709
  private readonly request;
3432
3710
  constructor(request: RequestFn);
3433
- /** Create and immediately confirm a subscription. `POST /subscriptions` */
3434
- createAndConfirm(params: SubscriptionCreateRequest): Promise<SubscriptionResponse>;
3435
- /** Create a subscription (without confirming). `POST /subscriptions/create` */
3436
- create(params: SubscriptionCreateRequest): Promise<SubscriptionResponse>;
3711
+ /**
3712
+ * Create and immediately confirm a subscription. `POST /subscriptions`
3713
+ *
3714
+ * For billing processors that require buyer approval (e.g. PayPal), the
3715
+ * response carries a `redirect_url` the customer must be sent to.
3716
+ */
3717
+ createAndConfirm(params: CreateAndConfirmSubscriptionRequest): Promise<ConfirmSubscriptionResponse>;
3718
+ /** Create a subscription without confirming it. `POST /subscriptions/create` */
3719
+ create(params: CreateSubscriptionRequest): Promise<SubscriptionResponse>;
3437
3720
  /** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */
3438
3721
  retrieve(subscriptionId: string): Promise<SubscriptionResponse>;
3439
- /** Confirm a subscription. `POST /subscriptions/{subscriptionId}/confirm` */
3440
- confirm(subscriptionId: string, params?: Record<string, unknown>): Promise<SubscriptionResponse>;
3441
- /** Update a subscription. `PUT /subscriptions/{subscriptionId}/update` */
3442
- update(subscriptionId: string, params: SubscriptionUpdateRequest): Promise<SubscriptionResponse>;
3443
- /** List subscriptions. `GET /subscriptions/list` */
3444
- list(params?: SubscriptionListParams): Promise<SubscriptionListResponse>;
3445
- /** Get subscription estimate. `GET /subscriptions/estimate` */
3446
- getEstimate(params?: Record<string, string | number | undefined>): Promise<Record<string, unknown>>;
3447
- /** Get subscription items. `GET /subscriptions/items` */
3448
- getItems(params?: Record<string, string | number | undefined>): Promise<Record<string, unknown>>;
3722
+ /**
3723
+ * Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`
3724
+ *
3725
+ * Like {@link createAndConfirm}, the response may carry a `redirect_url` for
3726
+ * processors that require buyer approval.
3727
+ */
3728
+ confirm(subscriptionId: string, params: ConfirmSubscriptionRequest): Promise<ConfirmSubscriptionResponse>;
3729
+ /** Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update` */
3730
+ update(subscriptionId: string, params: UpdateSubscriptionRequest): Promise<SubscriptionResponse>;
3731
+ /** List subscriptions for the profile. `GET /subscriptions/list` */
3732
+ list(params?: SubscriptionListParams): Promise<SubscriptionResponse[]>;
3733
+ /** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */
3734
+ getEstimate(params: SubscriptionEstimateParams): Promise<SubscriptionEstimateResponse>;
3735
+ /** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */
3736
+ getItems(params: GetSubscriptionItemsParams): Promise<GetSubscriptionItemsResponse[]>;
3449
3737
  /** Pause a subscription. `POST /subscriptions/{subscriptionId}/pause` */
3450
- pause(subscriptionId: string): Promise<SubscriptionResponse>;
3451
- /** Resume a subscription. `POST /subscriptions/{subscriptionId}/resume` */
3452
- resume(subscriptionId: string): Promise<SubscriptionResponse>;
3738
+ pause(subscriptionId: string, params?: PauseSubscriptionRequest): Promise<PauseSubscriptionResponse>;
3739
+ /** Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume` */
3740
+ resume(subscriptionId: string, params?: ResumeSubscriptionRequest): Promise<ResumeSubscriptionResponse>;
3453
3741
  /** Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel` */
3454
- cancel(subscriptionId: string): Promise<SubscriptionResponse>;
3742
+ cancel(subscriptionId: string, params?: CancelSubscriptionRequest): Promise<CancelSubscriptionResponse>;
3455
3743
  }
3456
3744
 
3457
3745
  /**
@@ -3508,6 +3796,12 @@ interface RequestOptions {
3508
3796
  signal?: AbortSignal;
3509
3797
  }
3510
3798
  type RequestFn = <T>(method: string, path: string, options?: RequestOptions) => Promise<T>;
3799
+ /**
3800
+ * Per-call options that resource methods accept as an optional final argument:
3801
+ * extra HTTP headers (e.g. `Idempotency-Key`), a per-request timeout override,
3802
+ * and an `AbortSignal` for cancellation.
3803
+ */
3804
+ type RequestExtras = Pick<RequestOptions, 'headers' | 'timeout' | 'signal'>;
3511
3805
  /**
3512
3806
  * Delopay API client.
3513
3807
  *
@@ -3517,7 +3811,7 @@ type RequestFn = <T>(method: string, path: string, options?: RequestOptions) =>
3517
3811
  *
3518
3812
  * @example
3519
3813
  * ```typescript
3520
- * const delopay = new Delopay('sk_live_...', { sandbox: false });
3814
+ * const delopay = new Delopay('prd_...', { sandbox: false });
3521
3815
  * const payment = await delopay.payments.create({ amount: 5000, currency: 'EUR' });
3522
3816
  * ```
3523
3817
  */
@@ -3575,7 +3869,7 @@ declare class Delopay {
3575
3869
  /**
3576
3870
  * Create a new Delopay client.
3577
3871
  *
3578
- * @param apiKey - Your Delopay API key (e.g. `sk_live_...` or `sk_test_...`).
3872
+ * @param apiKey - Your Delopay API key (e.g. `prd_...` or `snd_...`).
3579
3873
  * Pass an empty string or omit for JWT-only usage (e.g. dashboard apps).
3580
3874
  * @param options - Optional configuration (sandbox mode, base URL override, timeout).
3581
3875
  */
@@ -3608,14 +3902,32 @@ declare class Delopay {
3608
3902
  * Auto-paginate a list endpoint. Yields items one by one, fetching
3609
3903
  * the next page automatically when the current one is exhausted.
3610
3904
  *
3611
- * @param listFn - A function that takes `{ limit, offset }` and returns `{ data: T[] }` or `T[]`.
3905
+ * Delopay list endpoints use one of two pagination styles, so this helper
3906
+ * supports both:
3907
+ * - **Offset** (default) — for endpoints like `customers.list` that accept
3908
+ * `offset`/`limit`. Each page advances `offset` by the number of items returned.
3909
+ * - **Cursor** — for endpoints like `payments.list` and `payouts.list` that page
3910
+ * with `starting_after`/`limit` (they ignore `offset`). Pass a `cursor` extractor
3911
+ * that returns the id of an item; the next page is requested with
3912
+ * `starting_after` set to the last item's id.
3913
+ *
3914
+ * @param listFn - A function that takes the paging params and returns `{ data: T[] }` or `T[]`.
3612
3915
  * @param params - Additional parameters to pass to every page request.
3613
- * @param pageSize - Number of items per page. Defaults to `50`.
3916
+ * @param options - Page size (number) for offset mode, or `{ pageSize?, cursor? }`.
3917
+ * Provide `cursor` to switch to cursor pagination.
3614
3918
  *
3615
3919
  * @example
3616
3920
  * ```typescript
3921
+ * // Offset endpoint (customers):
3922
+ * for await (const c of delopay.paginate((p) => delopay.customers.list(p))) {
3923
+ * console.log(c.customer_id);
3924
+ * }
3925
+ *
3926
+ * // Cursor endpoint (payments): extract the id used as the next cursor.
3617
3927
  * for await (const payment of delopay.paginate(
3618
3928
  * (p) => delopay.payments.list(p),
3929
+ * undefined,
3930
+ * { cursor: (p) => p.payment_id },
3619
3931
  * )) {
3620
3932
  * console.log(payment.payment_id);
3621
3933
  * }
@@ -3623,10 +3935,14 @@ declare class Delopay {
3623
3935
  */
3624
3936
  paginate<T, P extends Record<string, unknown>>(listFn: (params: P & {
3625
3937
  limit: number;
3626
- offset: number;
3938
+ offset?: number;
3939
+ starting_after?: string;
3627
3940
  }) => Promise<{
3628
3941
  data: T[];
3629
- } | T[]>, params?: P, pageSize?: number): AsyncGenerator<T>;
3942
+ } | T[]>, params?: P, options?: number | {
3943
+ pageSize?: number;
3944
+ cursor?: (item: T) => string | undefined;
3945
+ }): AsyncGenerator<T>;
3630
3946
  }
3631
3947
 
3632
3948
  /**
@@ -3889,4 +4205,4 @@ declare function parseImportedBranding(raw: unknown): CheckoutBranding;
3889
4205
  declare function applyBrandingVariables(el: HTMLElement, b: CheckoutBranding): void;
3890
4206
  declare function shadowFor(style: SurfaceStyle): string;
3891
4207
 
3892
- 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, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, 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 CornerRadius, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, 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, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type GatewayConnectRequest, type GatewayResponse, type GlobalSearchRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type LabelStyle, type LayoutStyle, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type NonPillRadius, type ParentGroup, type ParentGroupInfo, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PermissionScope, 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, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionCreateRequest, type SubscriptionListParams, type SubscriptionListResponse, type SubscriptionResponse, type SubscriptionUpdateRequest, Subscriptions, type SummaryPosition, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateUserDetailsRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, logoDimensions, parseImportedBranding, radiusValue, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };
4208
+ 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, BRANDING_EXPORT_FORMAT, BRANDING_EXPORT_VERSION, type BillingCompleteSetupRequest, type BillingProfileResponse, type BillingSetupRequest, type BillingSetupResponse, type BlocklistAddRequest, type BlocklistDataKind, type BlocklistResponse, type BrandingExport, type BrandingSource, type BusinessPaymentLinkConfig, CUSTOM_CSS_MAX_LENGTH, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type CaptureMethod, type CardDetail, type CardDetailFromLocker, Cards, type ChangePasswordRequest, type CheckoutBranding, type ConfirmSubscriptionPaymentDetails, type ConfirmSubscriptionRequest, type ConfirmSubscriptionResponse, 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 CornerRadius, type CreateAndConfirmSubscriptionRequest, type CreateSubscriptionPaymentDetails, type CreateSubscriptionRequest, type Currency, type CustomerCreateRequest, type CustomerListParams, type CustomerPaymentMethodsListParams, type CustomerPaymentMethodsListResponse, type CustomerResponse, type CustomerUpdateRequest, DEFAULT_BADGES, DEFAULT_BADGES_DARK, DEFAULT_BRANDING, DEFAULT_BRANDING_DARK, type DeleteAccountRequest, Delopay, DelopayAuthenticationError, DelopayError, type DelopayLogger, type DelopayOptions, type DisputeEvidenceRequest, type DisputeListParams, type DisputeResponse, type DisputeStage, type DisputeStatus, type EncodedBranding, 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, type FontFamily, type FontWeight, Forex, type ForgotPasswordRequest, type FromEmailRequest, type FutureUsage, type GatewayConnectRequest, type GatewayResponse, type GetSubscriptionItemsParams, type GetSubscriptionItemsResponse, type GlobalSearchRequest, type IntentStatus, type InviteUsersRequest, type InviteUsersResponse, type InvoiceStatus, type LabelStyle, type LayoutStyle, type LedgerEntry, type LedgerListParams, type LedgerResponse, type LinkedRoutingConfigRetrieveResponse, type ListInvitableRolesParams, type LoginHistoryEntry, type LoginHistoryParams, type LoginHistoryResponse, type LogoShape, type LogoSize, type MandateListParams, type MandateResponse, type MandateRevokedResponse, type MandateStatus, type MandateType, type MerchantAccountCreateRequest, type MerchantAccountResponse, type MerchantAccountType, type MerchantAccountUpdateRequest, type MerchantOverviewResponse, type MerchantOverviewStat, type MerchantRoutingAlgorithm, type NonPillRadius, type ParentGroup, type ParentGroupInfo, type PauseSubscriptionRequest, type PauseSubscriptionResponse, type PaymentCancelRequest, type PaymentCaptureRequest, type PaymentConfirmRequest, type PaymentCreateRequest, type PaymentLayout, type PaymentLinkBackgroundImageConfig, type PaymentLinkConfigRequest, type PaymentLinkListParams, type PaymentLinkListResponse, type PaymentLinkResponse, type PaymentLinkTransactionDetails, type PaymentListParams, type PaymentListResponse, type PaymentMethod, type PaymentMethodCreateRequest, type PaymentMethodDeleteResponse, type PaymentMethodListParams, type PaymentMethodResponse, type PaymentMethodType, type PaymentMethodUpdateRequest, type PaymentResponse, type PaymentRetrieveOptions, type PaymentUpdateRequest, type PayoutCreateRequest, type PayoutListParams, type PayoutListResponse, type PayoutResponse, type PayoutStatus, type PayoutType, type PayoutUpdateRequest, type PermissionScope, 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 ResumeSubscriptionRequest, type ResumeSubscriptionResponse, type RoutableConnectorChoice, type RoutingActivatePayload, type RoutingConfigCreateRequest, type RoutingConfigResponse, type RoutingDeactivateRequest, type RoutingDictionary, type RoutingDictionaryRecord, Search, type SearchGroupResponse, type SearchIndex, type SearchStatus, type ShopCreateRequest, type ShopResponse, type ShopStats, type ShopUpdateRequest, type SignInRequest, type SignUpRequest, type SignUpWithMerchantIdRequest, type SignUpWithMerchantRequest, type SizeScale, type SpacingScale, type StaticRoutingAlgorithm, type StripeConnectAccountRequest, type StripeConnectAccountResponse, type StripeConnectLinkRequest, type StripeConnectLinkResponse, type SubscriptionEstimateParams, type SubscriptionEstimateResponse, type SubscriptionInvoice, type SubscriptionItem, type SubscriptionItemPrice, type SubscriptionItemType, type SubscriptionLineItem, type SubscriptionListParams, type SubscriptionPaymentData, type SubscriptionPaymentDetails, type SubscriptionPeriodUnit, type SubscriptionResponse, type SubscriptionStatus, Subscriptions, type SummaryPosition, type SurfaceStyle, type SwitchMerchantRequest, type SwitchProfileRequest, type Terminate2faQueryParams, type ThreeDSDecision, type ThreeDsRuleExecuteRequest, type ThreeDsRuleResponse, type TierSummary, type TokenPurpose, type TokenResponse, type TopupRequest, type TopupResponse, type TotpResponse, type TransactionType, type TrustBadge, type UpdateSubscriptionRequest, type UpdateUserDetailsRequest, type UserResponse, type UserSessionEntry, type UserSessionListResponse, type UserSessionRevokeResponse, type VerifyTotpRequest, type WebhookDeliveryAttempt, type WebhookEvent, Webhooks, applyBrandingVariables, buildBrandingExport, buttonPadValue, cloneBranding, decodeBadges, decodeBranding, defaultBranding, encodeBadges, encodeBranding, fontStack, fontWeightValue, inputPadValue, isDarkSurface, isHexColor, logoDimensions, parseImportedBranding, radiusValue, sanitizeCustomCss, shadowFor, surfacePadValue, verticalGapValue };