@rechargeapps/storefront-client 0.20.0 → 0.21.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/cjs/api/address.js +2 -2
- package/dist/cjs/api/address.js.map +1 -1
- package/dist/cjs/api/charge.js +2 -2
- package/dist/cjs/api/charge.js.map +1 -1
- package/dist/cjs/api/paymentMethod.js +3 -2
- package/dist/cjs/api/paymentMethod.js.map +1 -1
- package/dist/cjs/api/subscription.js +3 -2
- package/dist/cjs/api/subscription.js.map +1 -1
- package/dist/esm/api/address.js +2 -2
- package/dist/esm/api/address.js.map +1 -1
- package/dist/esm/api/charge.js +2 -2
- package/dist/esm/api/charge.js.map +1 -1
- package/dist/esm/api/paymentMethod.js +3 -2
- package/dist/esm/api/paymentMethod.js.map +1 -1
- package/dist/esm/api/subscription.js +3 -2
- package/dist/esm/api/subscription.js.map +1 -1
- package/dist/index.d.ts +345 -270
- package/dist/umd/recharge-client.min.js +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -50,7 +50,6 @@ interface ProductImage {
|
|
|
50
50
|
sort_order?: number;
|
|
51
51
|
}
|
|
52
52
|
interface LineItem {
|
|
53
|
-
subscription_id?: number;
|
|
54
53
|
/** The Subscription or Onetime ID associated with the line_item. */
|
|
55
54
|
purchase_item_id: number;
|
|
56
55
|
/** An object containing the associated product ID as it appears in the external system. */
|
|
@@ -265,6 +264,92 @@ interface OrderListParams extends ListParams<OrderSortBy> {
|
|
|
265
264
|
updated_at_min?: IsoDateString;
|
|
266
265
|
}
|
|
267
266
|
|
|
267
|
+
interface PaymentDetails {
|
|
268
|
+
/** Payment_method brand or company powering it. valid for CREDIT_CARD only. */
|
|
269
|
+
brand?: string;
|
|
270
|
+
/** Payment_method expiry month. valid for CREDIT_CARD only. */
|
|
271
|
+
exp_month?: string;
|
|
272
|
+
/** Payment_method expiry year. valid for CREDIT_CARD only. */
|
|
273
|
+
exp_year?: string;
|
|
274
|
+
/** last 4-digits of the identifier. valid for CREDIT_CARD only. */
|
|
275
|
+
last4?: string;
|
|
276
|
+
/** email linked to paypal. valid for PAYPAL only. */
|
|
277
|
+
paypal_email?: string;
|
|
278
|
+
/** paypal user identifier. valid for PAYPAL only. */
|
|
279
|
+
paypal_payer_id?: string;
|
|
280
|
+
/** If a digital wallet. */
|
|
281
|
+
wallet_type?: string;
|
|
282
|
+
/** Type of funding for the Payment Method. */
|
|
283
|
+
funding_type?: string;
|
|
284
|
+
}
|
|
285
|
+
declare type PaymentType = 'CREDIT_CARD' | 'PAYPAL' | 'APPLE_PAY' | 'GOOGLE_PAY' | 'SEPA_DEBIT' | 'IDEAL' | 'SHOP_PAY' | 'PAYPAL_EXPRESS' | 'SOFORT' | 'GIROPAY';
|
|
286
|
+
declare type ProcessorName = 'stripe' | 'braintree' | 'authorize' | 'shopify_payments' | 'mollie' | 'adyen' | 'shopify_app_subscription_billing';
|
|
287
|
+
declare type PaymentMethodStatus = 'not_validated' | 'valid' | 'invalid';
|
|
288
|
+
interface PaymentMethod {
|
|
289
|
+
/** The unique payment method id for a customer. */
|
|
290
|
+
id: number;
|
|
291
|
+
/** An object with the customer’s address information. */
|
|
292
|
+
billing_address: AssociatedAddress;
|
|
293
|
+
/** The Recharge customer_id */
|
|
294
|
+
customer_id: number;
|
|
295
|
+
/** The time the payment method was created. */
|
|
296
|
+
created_at: IsoDateString;
|
|
297
|
+
/** If this is the default payment method for the customer */
|
|
298
|
+
default: boolean;
|
|
299
|
+
/** Details about the specific payment method */
|
|
300
|
+
payment_details: PaymentDetails;
|
|
301
|
+
/**
|
|
302
|
+
* The type of payment this is.
|
|
303
|
+
* If passed, must also be accompanied by one of stripe_customer_token, paypal_customer_token or authorizedotnet_customer_token in processor_payment_method_token.
|
|
304
|
+
*/
|
|
305
|
+
payment_type: PaymentType;
|
|
306
|
+
/** The customer token at the processor. */
|
|
307
|
+
processor_customer_token: string;
|
|
308
|
+
/**
|
|
309
|
+
* This will impact validation on billing_details.
|
|
310
|
+
* Currently, shopify_payments is in read-only mode and can only be managed by Shopify.
|
|
311
|
+
*/
|
|
312
|
+
processor_name: ProcessorName;
|
|
313
|
+
/** The payment token at the processor. */
|
|
314
|
+
processor_payment_method_token: string;
|
|
315
|
+
/** State of the Payment Method. */
|
|
316
|
+
status: PaymentMethodStatus;
|
|
317
|
+
/**
|
|
318
|
+
* The status reason for the payment method.
|
|
319
|
+
* Often used when invalid to provide background details in invalidity.
|
|
320
|
+
*/
|
|
321
|
+
status_reason: string;
|
|
322
|
+
/** The time the payment method was last updated. */
|
|
323
|
+
updated_at: IsoDateString;
|
|
324
|
+
/** Additional information as requested */
|
|
325
|
+
includes?: {
|
|
326
|
+
addresses?: Address[];
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
interface PaymentMethodsResponse {
|
|
330
|
+
next_cursor: null | string;
|
|
331
|
+
previous_cursor: null | string;
|
|
332
|
+
payment_methods: PaymentMethod[];
|
|
333
|
+
}
|
|
334
|
+
declare type PaymentMethodOptionalUpdateProps = 'billing_address' | 'default';
|
|
335
|
+
declare type UpdatePaymentMethodRequest = Partial<Pick<PaymentMethod, PaymentMethodOptionalUpdateProps>>;
|
|
336
|
+
declare type PaymentMethodIncludes = 'addresses';
|
|
337
|
+
interface GetPaymentMethodOptions {
|
|
338
|
+
include?: PaymentMethodIncludes[];
|
|
339
|
+
}
|
|
340
|
+
/** no sorting options for payment_methods, always by id-desc */
|
|
341
|
+
declare type PaymentMethodSortBy = null;
|
|
342
|
+
interface PaymentMethodListParams extends ListParams<PaymentMethodSortBy> {
|
|
343
|
+
/** Return the payment_methods linked to the given processor_name. */
|
|
344
|
+
processor_name?: ProcessorName;
|
|
345
|
+
/** Return the payment_methods linked to the given address_id. */
|
|
346
|
+
address_id?: string;
|
|
347
|
+
/** Return the payment_methods linked to the given processor_payment_method_token. */
|
|
348
|
+
processor_payment_method_token?: string;
|
|
349
|
+
/** Include related data options */
|
|
350
|
+
include?: PaymentMethodIncludes[];
|
|
351
|
+
}
|
|
352
|
+
|
|
268
353
|
declare type ChargeStatus = 'success' | 'error' | 'queued' | 'skipped' | 'refunded' | 'partially_refunded' | 'pending_manual_payment' | 'pending';
|
|
269
354
|
interface Charge {
|
|
270
355
|
/** The unique numeric identifier for the Charge. */
|
|
@@ -349,6 +434,10 @@ interface Charge {
|
|
|
349
434
|
type: 'checkout' | 'recurring';
|
|
350
435
|
/** The date time at which the Charge was most recently updated. */
|
|
351
436
|
updated_at: IsoDateString;
|
|
437
|
+
/** Additional information as requested */
|
|
438
|
+
include?: {
|
|
439
|
+
payment_methods?: PaymentMethod[];
|
|
440
|
+
};
|
|
352
441
|
}
|
|
353
442
|
interface ChargeResponse {
|
|
354
443
|
charge: Charge;
|
|
@@ -358,6 +447,10 @@ interface ChargeListResponse {
|
|
|
358
447
|
previous_cursor: null | string;
|
|
359
448
|
charges: Charge[];
|
|
360
449
|
}
|
|
450
|
+
declare type ChargeIncludes = 'payment_methods';
|
|
451
|
+
interface GetChargeOptions {
|
|
452
|
+
include?: ChargeIncludes[];
|
|
453
|
+
}
|
|
361
454
|
declare type ChargeSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc' | 'scheduled_at-asc' | 'scheduled_at-desc';
|
|
362
455
|
interface ChargeListParams extends ListParams<ChargeSortBy> {
|
|
363
456
|
/** Filter Charges by Address. */
|
|
@@ -384,7 +477,7 @@ interface ChargeListParams extends ListParams<ChargeSortBy> {
|
|
|
384
477
|
/** Show Charges scheduled to be processed after the given date. */
|
|
385
478
|
scheduled_at_min?: IsoDateString;
|
|
386
479
|
/** Filter charges by status. */
|
|
387
|
-
status?: ChargeStatus;
|
|
480
|
+
status?: ChargeStatus[];
|
|
388
481
|
/** Show charges updated before the given date. */
|
|
389
482
|
updated_at_max?: IsoDateString;
|
|
390
483
|
/** Show charges updated after the given date. */
|
|
@@ -397,6 +490,233 @@ interface ChargeListParams extends ListParams<ChargeSortBy> {
|
|
|
397
490
|
created_at_min?: IsoDateString;
|
|
398
491
|
/** Show Charges created before the given date. */
|
|
399
492
|
created_at_max?: IsoDateString;
|
|
493
|
+
/** Include related data options */
|
|
494
|
+
include?: ChargeIncludes[];
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
declare type SubscriptionStatus = 'active' | 'cancelled' | 'expired';
|
|
498
|
+
interface Subscription {
|
|
499
|
+
/** Unique numeric identifier for the subscription. */
|
|
500
|
+
id: number;
|
|
501
|
+
/** Unique numeric identifier for the address the subscription is associated with. */
|
|
502
|
+
address_id: number;
|
|
503
|
+
/** Unique numeric identifier for the customer the subscription is tied to. */
|
|
504
|
+
customer_id: number;
|
|
505
|
+
/** An object used to contain analytics data such as utm parameters. */
|
|
506
|
+
analytics_data: AnalyticsData;
|
|
507
|
+
/** Reason provided for cancellation. */
|
|
508
|
+
cancellation_reason: string | null;
|
|
509
|
+
/** Additional comment for cancellation. */
|
|
510
|
+
cancellation_reason_comments: string | null;
|
|
511
|
+
/** The time the subscription was cancelled. */
|
|
512
|
+
cancelled_at: string | null;
|
|
513
|
+
/**
|
|
514
|
+
* The number of units (specified in order_interval_unit) between each Charge. For example, order_interval_unit=month and charge_interval_frequency=3, indicate charge every 3 months.
|
|
515
|
+
* Charges must use the same unit types as orders.
|
|
516
|
+
* Max: 1000
|
|
517
|
+
*/
|
|
518
|
+
charge_interval_frequency: number;
|
|
519
|
+
/** The time the subscription was created. */
|
|
520
|
+
created_at: IsoDateString;
|
|
521
|
+
/** Set the number of charges until subscription expires. */
|
|
522
|
+
expire_after_specific_number_of_charges: number | null;
|
|
523
|
+
/** An object containing the product id as it appears in external platforms. */
|
|
524
|
+
external_product_id: ExternalId;
|
|
525
|
+
/** An object containing the variant id as it appears in external platforms. */
|
|
526
|
+
external_variant_id: ExternalId;
|
|
527
|
+
/** Retrieves true if there is queued charge. Otherwise, retrieves false. */
|
|
528
|
+
has_queued_charges: boolean;
|
|
529
|
+
/** Value is set to true if it is a prepaid item. */
|
|
530
|
+
is_prepaid: boolean;
|
|
531
|
+
/** Value is set to true if it is not a prepaid item */
|
|
532
|
+
is_skippable: boolean;
|
|
533
|
+
/** Value is set to true if it is not a prepaid item and if in Customer portal settings swap is allowed for customers. */
|
|
534
|
+
is_swappable: boolean;
|
|
535
|
+
/** Retrieves true if charge has an error max retries reached. Otherwise, retrieves false. */
|
|
536
|
+
max_retries_reached: boolean;
|
|
537
|
+
/** Date of the next charge for the subscription. */
|
|
538
|
+
next_charge_scheduled_at: IsoDateString;
|
|
539
|
+
/**
|
|
540
|
+
* The set day of the month order is created. Default is that there isn’t a strict day of the month when the order is created.
|
|
541
|
+
* This is only applicable to subscriptions with order_interval_unit:“month”.
|
|
542
|
+
*/
|
|
543
|
+
order_day_of_month: number | null;
|
|
544
|
+
/**
|
|
545
|
+
* The set day of the week order is created. Default is that there isn’t a strict day of the week order is created.
|
|
546
|
+
* This is only applicable to subscriptions with order_interval_unit = “week”.
|
|
547
|
+
* Value of 0 equals to Monday, 1 to Tuesday etc.
|
|
548
|
+
*/
|
|
549
|
+
order_day_of_week: number | null;
|
|
550
|
+
/**
|
|
551
|
+
* The number of units (specified in order_interval_unit) between each order. For example, order_interval_unit=month and order_interval_frequency=3, indicate order every 3 months. Max value: 1000
|
|
552
|
+
*/
|
|
553
|
+
order_interval_frequency: number;
|
|
554
|
+
/** The frequency unit used to determine when a subscription’s order is created. */
|
|
555
|
+
order_interval_unit: IntervalUnit;
|
|
556
|
+
/** The presentment currency of the subscription. */
|
|
557
|
+
presentment_currency: string | null;
|
|
558
|
+
/** The price of the item before discounts, taxes, or shipping have been applied. */
|
|
559
|
+
price: string;
|
|
560
|
+
/** The name of the product in a store’s catalog. */
|
|
561
|
+
product_title: string;
|
|
562
|
+
/** A list of line item objects, each one containing information about the subscription. Custom key-value pairs can be installed here, they will appear on the connected queued charge and after it is processed on the order itself. */
|
|
563
|
+
properties: Property[];
|
|
564
|
+
/** The number of items in the subscription. */
|
|
565
|
+
quantity: number;
|
|
566
|
+
/** A unique identifier of the item in the fulfillment. In cases where SKU is blank, it will be dynamically pulled whenever it is used. */
|
|
567
|
+
sku: string | null;
|
|
568
|
+
/** Flag that is automatically updated to true when SKU is passed on create or update. When sku_override is true, the SKU on the subscription will be used to generate charges and orders. When sku_override is false, Recharge will dynamically fetch the SKU from the corresponding external platform variant. */
|
|
569
|
+
sku_override: boolean;
|
|
570
|
+
/**
|
|
571
|
+
* The status of the subscription.
|
|
572
|
+
* expired - This status occurs when the maximum number of charges for a product has been reached.
|
|
573
|
+
*/
|
|
574
|
+
status: SubscriptionStatus;
|
|
575
|
+
/** The date time at which the purchase_item record was last updated. */
|
|
576
|
+
updated_at: IsoDateString;
|
|
577
|
+
/** The name of the variant in a shop’s catalog. */
|
|
578
|
+
variant_title: string;
|
|
579
|
+
/** Additional information as requested */
|
|
580
|
+
includes?: {
|
|
581
|
+
address?: Address;
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
interface SubscriptionsResponse {
|
|
585
|
+
next_cursor: null | string;
|
|
586
|
+
previous_cursor: null | string;
|
|
587
|
+
subscriptions: Subscription[];
|
|
588
|
+
}
|
|
589
|
+
declare type SubscriptionIncludes = 'address';
|
|
590
|
+
interface GetSubscriptionOptions {
|
|
591
|
+
include?: SubscriptionIncludes[];
|
|
592
|
+
}
|
|
593
|
+
declare type SubscriptionSortBy = 'id-asc' | 'id-desc' | 'created_at-asc' | 'created_at-desc' | 'updated_at-asc' | 'updated_at-desc';
|
|
594
|
+
interface SubscriptionListParams extends ListParams<SubscriptionSortBy> {
|
|
595
|
+
/** Return the subscriptions linked to the given address_id. */
|
|
596
|
+
address_id?: string;
|
|
597
|
+
/** Return the subscriptions linked to the given address_ids. */
|
|
598
|
+
address_ids?: string[];
|
|
599
|
+
/** Return the subscriptions created before the given date. */
|
|
600
|
+
created_at_max?: IsoDateString;
|
|
601
|
+
/** Return the subscriptions created after the given date. */
|
|
602
|
+
created_at_min?: IsoDateString;
|
|
603
|
+
/** Return the subscriptions linked to the given external_variant_id */
|
|
604
|
+
external_variant_id?: string;
|
|
605
|
+
/** Comma-separated list of subscription_ids to filter */
|
|
606
|
+
ids?: string[];
|
|
607
|
+
/** Return the subscriptions with specified status. */
|
|
608
|
+
status?: SubscriptionStatus;
|
|
609
|
+
/** Return the subscriptions updated before the given date. */
|
|
610
|
+
updated_at_max?: IsoDateString;
|
|
611
|
+
/** Return the subscriptions updated after the given date. */
|
|
612
|
+
updated_at_min?: IsoDateString;
|
|
613
|
+
/** Include related data options */
|
|
614
|
+
include?: SubscriptionIncludes[];
|
|
615
|
+
}
|
|
616
|
+
declare type SubscriptionRequiredCreateProps = 'address_id' | 'charge_interval_frequency' | 'external_variant_id' | 'next_charge_scheduled_at' | 'order_interval_frequency' | 'order_interval_unit' | 'quantity';
|
|
617
|
+
declare type SubscriptionOptionalCreateProps = 'expire_after_specific_number_of_charges' | 'order_day_of_month' | 'order_day_of_week' | 'external_product_id' | 'price' | 'product_title' | 'properties' | 'status';
|
|
618
|
+
declare type CreateSubscriptionRequest = SubType<Subscription, SubscriptionRequiredCreateProps, SubscriptionOptionalCreateProps>;
|
|
619
|
+
declare type SubscriptionOptionalUpdateProps = 'charge_interval_frequency' | 'expire_after_specific_number_of_charges' | 'order_day_of_month' | 'order_day_of_week' | 'order_interval_frequency' | 'order_interval_unit' | 'quantity' | 'external_product_id' | 'external_variant_id' | 'properties' | 'sku' | 'sku_override';
|
|
620
|
+
declare type UpdateSubscriptionRequest = Partial<Pick<Subscription, SubscriptionOptionalUpdateProps>>;
|
|
621
|
+
interface UpdateSubscriptionParams {
|
|
622
|
+
/** Controls whether the QUEUED charges linked to the subscription should be regenerated upon subscription update. By default the flag is set to false which will delay charge regeneration 5 seconds. This enables running multiple calls to perform changes and receive responses much faster since the API won’t wait for a charge regeneration to complete. Setting this parameter to true will cause charge regeneration to complete before returning a response. */
|
|
623
|
+
commit?: boolean;
|
|
624
|
+
}
|
|
625
|
+
interface CancelSubscriptionRequest {
|
|
626
|
+
cancellation_reason: string;
|
|
627
|
+
cancellation_reason_comments?: string;
|
|
628
|
+
send_email?: boolean;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
declare type CustomerIncludes = 'addresses' | 'payment_methods' | 'subscriptions';
|
|
632
|
+
interface GetCustomerOptions {
|
|
633
|
+
include?: CustomerIncludes[];
|
|
634
|
+
}
|
|
635
|
+
interface Customer {
|
|
636
|
+
/** Unique numeric identifier for the Customer. */
|
|
637
|
+
id: number;
|
|
638
|
+
/** An object containing analytics data associated with the customer. */
|
|
639
|
+
analytics_data: AnalyticsData;
|
|
640
|
+
/** The date and time when the customer was created. */
|
|
641
|
+
created_at: IsoDateString;
|
|
642
|
+
/** The email address of the customer. */
|
|
643
|
+
email: string;
|
|
644
|
+
/** An object containing external ids for the customer record. */
|
|
645
|
+
external_customer_id: ExternalId;
|
|
646
|
+
/** Date when first charge was processed for the customer. */
|
|
647
|
+
first_charge_processed_at: IsoDateString;
|
|
648
|
+
/** The customer’s first name. */
|
|
649
|
+
first_name: string;
|
|
650
|
+
/** A boolean that indicates if the customer has a payment method that is in dunning (failed charge). */
|
|
651
|
+
has_payment_method_in_dunning: boolean;
|
|
652
|
+
/** Is the payment method valid or not. */
|
|
653
|
+
has_valid_payment_method: boolean;
|
|
654
|
+
/** The unique string identifier used in a customers portal link. */
|
|
655
|
+
hash: string;
|
|
656
|
+
/** The customer’s last name. */
|
|
657
|
+
last_name: string;
|
|
658
|
+
/** The number of active subscriptions on addresses associated with the customer. */
|
|
659
|
+
subscriptions_active_count: number;
|
|
660
|
+
/** The total number of subscriptions created on addresses associated with the customer. */
|
|
661
|
+
subscriptions_total_count: number;
|
|
662
|
+
/** The date and time when the customer was last updated. */
|
|
663
|
+
updated_at: IsoDateString;
|
|
664
|
+
/** Additional information as requested */
|
|
665
|
+
include?: {
|
|
666
|
+
addresses?: Address[];
|
|
667
|
+
payment_methods?: PaymentMethod[];
|
|
668
|
+
subscriptions?: Subscription[];
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
declare type CustomerOptionalUpdateProps = 'email' | 'first_name' | 'last_name' | 'external_customer_id';
|
|
672
|
+
declare type UpdateCustomerRequest = Partial<Pick<Customer, CustomerOptionalUpdateProps>>;
|
|
673
|
+
interface CustomerDeliveryScheduleParams {
|
|
674
|
+
delivery_count_future?: number;
|
|
675
|
+
future_internal?: number;
|
|
676
|
+
date_max?: IsoDateString;
|
|
677
|
+
}
|
|
678
|
+
declare type DeliveryLineItem = Omit<LineItem, 'external_inventory_policy' | 'grams' | 'handle' | 'purchase_item_id' | 'purchase_item_type' | 'sku' | 'tax_due' | 'tax_lines' | 'taxable_amount' | 'taxable' | 'title' | 'total_price' | 'unit_price_includes_tax'> & {
|
|
679
|
+
/** Value is set to true if it is not a onetime or a prepaid item */
|
|
680
|
+
is_skippable: boolean;
|
|
681
|
+
/** Value is set to true if the order is skipped. */
|
|
682
|
+
is_skipped: boolean;
|
|
683
|
+
/** The type of the plan. May return null value in certain cases. */
|
|
684
|
+
plan_type: 'subscription' | 'onetime';
|
|
685
|
+
/** Value is set to true if it is a prepaid item */
|
|
686
|
+
is_prepaid: boolean;
|
|
687
|
+
/** The name of the product in a store’s catalog. */
|
|
688
|
+
product_title: string;
|
|
689
|
+
/** Unique numeric identifier for the subscription linked to this line_item in the order. */
|
|
690
|
+
subscription_id: number;
|
|
691
|
+
/** The subtotal price (sum of all line items * their quantity) of the order less discounts. */
|
|
692
|
+
subtotal_price: string;
|
|
693
|
+
};
|
|
694
|
+
declare type DeliveryPaymentMethod = Omit<PaymentMethod, 'created_at' | 'customer_id' | 'default' | 'payment_type' | 'processor_customer_token' | 'processor_name' | 'processor_payment_method_token' | 'status_reason' | 'status' | 'updated_at'> & {
|
|
695
|
+
payment_details: PaymentDetails;
|
|
696
|
+
billing_address: AssociatedAddress;
|
|
697
|
+
};
|
|
698
|
+
interface DeliveryOrder {
|
|
699
|
+
id: number;
|
|
700
|
+
address_id: number;
|
|
701
|
+
charge_id: number;
|
|
702
|
+
line_items: DeliveryLineItem[];
|
|
703
|
+
payment_method: DeliveryPaymentMethod;
|
|
704
|
+
shipping_address: AssociatedAddress;
|
|
705
|
+
order_subtotal: string;
|
|
706
|
+
currency: string;
|
|
707
|
+
}
|
|
708
|
+
interface Delivery {
|
|
709
|
+
date: IsoDateString;
|
|
710
|
+
orders: DeliveryOrder[];
|
|
711
|
+
}
|
|
712
|
+
interface CustomerDeliveryScheduleResponse {
|
|
713
|
+
customer: {
|
|
714
|
+
id: number;
|
|
715
|
+
email: string;
|
|
716
|
+
first_name: string;
|
|
717
|
+
last_name: string;
|
|
718
|
+
};
|
|
719
|
+
deliveries: Delivery[];
|
|
400
720
|
}
|
|
401
721
|
|
|
402
722
|
interface CreateAddressRequest {
|
|
@@ -413,7 +733,9 @@ interface CreateAddressRequest {
|
|
|
413
733
|
/** 2-letter country code. */
|
|
414
734
|
country_code: string;
|
|
415
735
|
/** A list of discounts applied on the address. These discounts will apply to future recurring charges associated with this address. */
|
|
416
|
-
discounts?:
|
|
736
|
+
discounts?: {
|
|
737
|
+
id: number;
|
|
738
|
+
}[];
|
|
417
739
|
/** The customer’s first name associated with the address. */
|
|
418
740
|
first_name: string;
|
|
419
741
|
/** The customer’s last name associated with the address. */
|
|
@@ -483,7 +805,9 @@ interface Address {
|
|
|
483
805
|
/** Unique numeric identifier for the customer associated with the address. */
|
|
484
806
|
customer_id: number;
|
|
485
807
|
/** A list of discounts applied on the address. These discounts will apply to future recurring charges associated with this address. */
|
|
486
|
-
discounts:
|
|
808
|
+
discounts: {
|
|
809
|
+
id: number;
|
|
810
|
+
}[];
|
|
487
811
|
/** The customer’s first name associated with the address. */
|
|
488
812
|
first_name: string;
|
|
489
813
|
/** The customer’s last name associated with the address. */
|
|
@@ -512,6 +836,12 @@ interface Address {
|
|
|
512
836
|
created_at: IsoDateString;
|
|
513
837
|
/** The date and time when the address was last updated. */
|
|
514
838
|
updated_at: IsoDateString;
|
|
839
|
+
/** Additional information as requested */
|
|
840
|
+
include?: {
|
|
841
|
+
customer?: Customer;
|
|
842
|
+
payment_methods?: PaymentMethod[];
|
|
843
|
+
subscriptions?: Subscription[];
|
|
844
|
+
};
|
|
515
845
|
}
|
|
516
846
|
interface SkipFutureChargeAddressResponse {
|
|
517
847
|
charge: Charge;
|
|
@@ -524,6 +854,10 @@ interface AddressListResponse {
|
|
|
524
854
|
previous_cursor: null | string;
|
|
525
855
|
addresses: Address[];
|
|
526
856
|
}
|
|
857
|
+
declare type AddressIncludes = 'customer' | 'payment_methods' | 'subscriptions';
|
|
858
|
+
interface GetAddressOptions {
|
|
859
|
+
include?: AddressIncludes[];
|
|
860
|
+
}
|
|
527
861
|
declare type AddressSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc';
|
|
528
862
|
interface AddressListParams extends ListParams<AddressSortBy> {
|
|
529
863
|
/** Returns addresses that have the provided discount_id. */
|
|
@@ -536,6 +870,8 @@ interface AddressListParams extends ListParams<AddressSortBy> {
|
|
|
536
870
|
created_at_max?: IsoDateString;
|
|
537
871
|
/** Returns active addresses. */
|
|
538
872
|
is_active?: boolean;
|
|
873
|
+
/** Include related data options */
|
|
874
|
+
include?: AddressIncludes[];
|
|
539
875
|
}
|
|
540
876
|
|
|
541
877
|
interface Session {
|
|
@@ -546,7 +882,7 @@ interface Session {
|
|
|
546
882
|
/** Returns all addresses from the store, or addresses for the customer given in the parameter. */
|
|
547
883
|
declare function listAddresses(session: Session, query?: AddressListParams): Promise<AddressListResponse>;
|
|
548
884
|
/** Retrieves address for customer based on specified address id. */
|
|
549
|
-
declare function getAddress(session: Session, id: string | number): Promise<Address>;
|
|
885
|
+
declare function getAddress(session: Session, id: string | number, options?: GetAddressOptions): Promise<Address>;
|
|
550
886
|
/** Create a new address for a customer. */
|
|
551
887
|
declare function createAddress(session: Session, createRequest: CreateAddressRequest): Promise<Address>;
|
|
552
888
|
/** Updates an existing address to match the specified parameters. */
|
|
@@ -569,7 +905,7 @@ declare function skipFutureCharge(session: Session, id: string | number, skipReq
|
|
|
569
905
|
declare function loginShopifyAppProxy(): Promise<Session>;
|
|
570
906
|
declare function loginShopifyApi(shopifyStorefrontToken: string, shopifyCustomerAccessToken?: string): Promise<Session | null>;
|
|
571
907
|
|
|
572
|
-
declare function getCharge(session: Session, id: number | string): Promise<Charge>;
|
|
908
|
+
declare function getCharge(session: Session, id: number | string, options?: GetChargeOptions): Promise<Charge>;
|
|
573
909
|
/** Lists charges */
|
|
574
910
|
declare function listCharges(session: Session, query?: ChargeListParams): Promise<ChargeListResponse>;
|
|
575
911
|
/**
|
|
@@ -995,267 +1331,6 @@ interface CDNBundleSettings {
|
|
|
995
1331
|
variants: CDNBundleVariant[];
|
|
996
1332
|
}
|
|
997
1333
|
|
|
998
|
-
interface PaymentDetails {
|
|
999
|
-
/** Payment_method brand or company powering it. valid for CREDIT_CARD only. */
|
|
1000
|
-
brand?: string;
|
|
1001
|
-
/** Payment_method expiry month. valid for CREDIT_CARD only. */
|
|
1002
|
-
exp_month?: string;
|
|
1003
|
-
/** Payment_method expiry year. valid for CREDIT_CARD only. */
|
|
1004
|
-
exp_year?: string;
|
|
1005
|
-
/** last 4-digits of the identifier. valid for CREDIT_CARD only. */
|
|
1006
|
-
last4?: string;
|
|
1007
|
-
/** email linked to paypal. valid for PAYPAL only. */
|
|
1008
|
-
paypal_email?: string;
|
|
1009
|
-
/** paypal user identifier. valid for PAYPAL only. */
|
|
1010
|
-
paypal_payer_id?: string;
|
|
1011
|
-
/** If a digital wallet. */
|
|
1012
|
-
wallet_type?: string;
|
|
1013
|
-
/** Type of funding for the Payment Method. */
|
|
1014
|
-
funding_type?: string;
|
|
1015
|
-
}
|
|
1016
|
-
declare type PaymentType = 'CREDIT_CARD' | 'PAYPAL' | 'APPLE_PAY' | 'GOOGLE_PAY' | 'SEPA_DEBIT';
|
|
1017
|
-
declare type ProcessorName = 'stripe' | 'braintree' | 'authorize' | 'shopify_payments' | 'mollie';
|
|
1018
|
-
declare type PaymentMethodStatus = 'not_validated' | 'valid' | 'invalid';
|
|
1019
|
-
interface PaymentMethod {
|
|
1020
|
-
/** The unique payment method id for a customer. */
|
|
1021
|
-
id: number;
|
|
1022
|
-
/** An object with the customer’s address information. */
|
|
1023
|
-
billing_address: AssociatedAddress;
|
|
1024
|
-
/** The Recharge customer_id */
|
|
1025
|
-
customer_id: number;
|
|
1026
|
-
/** The time the payment method was created. */
|
|
1027
|
-
created_at: IsoDateString;
|
|
1028
|
-
/** If this is the default payment method for the customer */
|
|
1029
|
-
default: boolean;
|
|
1030
|
-
/** Details about the specific payment method */
|
|
1031
|
-
payment_details: PaymentDetails;
|
|
1032
|
-
/**
|
|
1033
|
-
* The type of payment this is.
|
|
1034
|
-
* If passed, must also be accompanied by one of stripe_customer_token, paypal_customer_token or authorizedotnet_customer_token in processor_payment_method_token.
|
|
1035
|
-
*/
|
|
1036
|
-
payment_type: PaymentType;
|
|
1037
|
-
/** The customer token at the processor. */
|
|
1038
|
-
processor_customer_token: string;
|
|
1039
|
-
/**
|
|
1040
|
-
* This will impact validation on billing_details.
|
|
1041
|
-
* Currently, shopify_payments is in read-only mode and can only be managed by Shopify.
|
|
1042
|
-
*/
|
|
1043
|
-
processor_name: ProcessorName;
|
|
1044
|
-
/** The payment token at the processor. */
|
|
1045
|
-
processor_payment_method_token: string;
|
|
1046
|
-
/** State of the Payment Method. */
|
|
1047
|
-
status: PaymentMethodStatus;
|
|
1048
|
-
/**
|
|
1049
|
-
* The status reason for the payment method.
|
|
1050
|
-
* Often used when invalid to provide background details in invalidity.
|
|
1051
|
-
*/
|
|
1052
|
-
status_reason: string;
|
|
1053
|
-
/** The time the payment method was last updated. */
|
|
1054
|
-
updated_at: IsoDateString;
|
|
1055
|
-
}
|
|
1056
|
-
interface PaymentMethodsResponse {
|
|
1057
|
-
next_cursor: null | string;
|
|
1058
|
-
previous_cursor: null | string;
|
|
1059
|
-
payment_methods: PaymentMethod[];
|
|
1060
|
-
}
|
|
1061
|
-
declare type PaymentMethodOptionalUpdateProps = 'billing_address' | 'default';
|
|
1062
|
-
declare type UpdatePaymentMethodRequest = Partial<Pick<PaymentMethod, PaymentMethodOptionalUpdateProps>>;
|
|
1063
|
-
/** no sorting options for payment_methods, always by id-desc */
|
|
1064
|
-
declare type PaymentMethodSortBy = null;
|
|
1065
|
-
interface PaymentMethodListParams extends ListParams<PaymentMethodSortBy> {
|
|
1066
|
-
/** Return the payment_methods linked to the given processor_name. */
|
|
1067
|
-
processor_name?: ProcessorName;
|
|
1068
|
-
/** Return the payment_methods linked to the given address_id. */
|
|
1069
|
-
address_id?: string;
|
|
1070
|
-
/** Return the payment_methods linked to the given processor_payment_method_token. */
|
|
1071
|
-
processor_payment_method_token?: string;
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
declare type SubscriptionStatus = 'active' | 'cancelled' | 'expired';
|
|
1075
|
-
interface Subscription {
|
|
1076
|
-
/** Unique numeric identifier for the subscription. */
|
|
1077
|
-
id: number;
|
|
1078
|
-
/** Unique numeric identifier for the address the subscription is associated with. */
|
|
1079
|
-
address_id: number;
|
|
1080
|
-
/** Unique numeric identifier for the customer the subscription is tied to. */
|
|
1081
|
-
customer_id: number;
|
|
1082
|
-
/** An object used to contain analytics data such as utm parameters. */
|
|
1083
|
-
analytics_data: AnalyticsData;
|
|
1084
|
-
/** Reason provided for cancellation. */
|
|
1085
|
-
cancellation_reason: string | null;
|
|
1086
|
-
/** Additional comment for cancellation. */
|
|
1087
|
-
cancellation_reason_comments: string | null;
|
|
1088
|
-
/** The time the subscription was cancelled. */
|
|
1089
|
-
cancelled_at: string | null;
|
|
1090
|
-
/**
|
|
1091
|
-
* The number of units (specified in order_interval_unit) between each Charge. For example, order_interval_unit=month and charge_interval_frequency=3, indicate charge every 3 months.
|
|
1092
|
-
* Charges must use the same unit types as orders.
|
|
1093
|
-
* Max: 1000
|
|
1094
|
-
*/
|
|
1095
|
-
charge_interval_frequency: number;
|
|
1096
|
-
/** The time the subscription was created. */
|
|
1097
|
-
created_at: IsoDateString;
|
|
1098
|
-
/** Set the number of charges until subscription expires. */
|
|
1099
|
-
expire_after_specific_number_of_charges: number | null;
|
|
1100
|
-
/** An object containing the product id as it appears in external platforms. */
|
|
1101
|
-
external_product_id: ExternalId;
|
|
1102
|
-
/** An object containing the variant id as it appears in external platforms. */
|
|
1103
|
-
external_variant_id: ExternalId;
|
|
1104
|
-
/** Retrieves true if there is queued charge. Otherwise, retrieves false. */
|
|
1105
|
-
has_queued_charges: boolean;
|
|
1106
|
-
/** Value is set to true if it is a prepaid item. */
|
|
1107
|
-
is_prepaid: boolean;
|
|
1108
|
-
/** Value is set to true if it is not a prepaid item */
|
|
1109
|
-
is_skippable: boolean;
|
|
1110
|
-
/** Value is set to true if it is not a prepaid item and if in Customer portal settings swap is allowed for customers. */
|
|
1111
|
-
is_swappable: boolean;
|
|
1112
|
-
/** Retrieves true if charge has an error max retries reached. Otherwise, retrieves false. */
|
|
1113
|
-
max_retries_reached: boolean;
|
|
1114
|
-
/** Date of the next charge for the subscription. */
|
|
1115
|
-
next_charge_scheduled_at: IsoDateString;
|
|
1116
|
-
/**
|
|
1117
|
-
* The set day of the month order is created. Default is that there isn’t a strict day of the month when the order is created.
|
|
1118
|
-
* This is only applicable to subscriptions with order_interval_unit:“month”.
|
|
1119
|
-
*/
|
|
1120
|
-
order_day_of_month: number | null;
|
|
1121
|
-
/**
|
|
1122
|
-
* The set day of the week order is created. Default is that there isn’t a strict day of the week order is created.
|
|
1123
|
-
* This is only applicable to subscriptions with order_interval_unit = “week”.
|
|
1124
|
-
* Value of 0 equals to Monday, 1 to Tuesday etc.
|
|
1125
|
-
*/
|
|
1126
|
-
order_day_of_week: number | null;
|
|
1127
|
-
/**
|
|
1128
|
-
* The number of units (specified in order_interval_unit) between each order. For example, order_interval_unit=month and order_interval_frequency=3, indicate order every 3 months. Max value: 1000
|
|
1129
|
-
*/
|
|
1130
|
-
order_interval_frequency: number;
|
|
1131
|
-
/** The frequency unit used to determine when a subscription’s order is created. */
|
|
1132
|
-
order_interval_unit: IntervalUnit;
|
|
1133
|
-
/** The presentment currency of the subscription. */
|
|
1134
|
-
presentment_currency: string | null;
|
|
1135
|
-
/** The price of the item before discounts, taxes, or shipping have been applied. */
|
|
1136
|
-
price: string;
|
|
1137
|
-
/** The name of the product in a store’s catalog. */
|
|
1138
|
-
product_title: string | null;
|
|
1139
|
-
/** A list of line item objects, each one containing information about the subscription. Custom key-value pairs can be installed here, they will appear on the connected queued charge and after it is processed on the order itself. */
|
|
1140
|
-
properties: Property[];
|
|
1141
|
-
/** The number of items in the subscription. */
|
|
1142
|
-
quantity: number;
|
|
1143
|
-
/** A unique identifier of the item in the fulfillment. In cases where SKU is blank, it will be dynamically pulled whenever it is used. */
|
|
1144
|
-
sku: string | null;
|
|
1145
|
-
/** Flag that is automatically updated to true when SKU is passed on create or update. When sku_override is true, the SKU on the subscription will be used to generate charges and orders. When sku_override is false, Recharge will dynamically fetch the SKU from the corresponding external platform variant. */
|
|
1146
|
-
sku_override: boolean;
|
|
1147
|
-
/**
|
|
1148
|
-
* The status of the subscription.
|
|
1149
|
-
* expired - This status occurs when the maximum number of charges for a product has been reached.
|
|
1150
|
-
*/
|
|
1151
|
-
status: SubscriptionStatus;
|
|
1152
|
-
/** The date time at which the purchase_item record was last updated. */
|
|
1153
|
-
updated_at: IsoDateString;
|
|
1154
|
-
/** The name of the variant in a shop’s catalog. */
|
|
1155
|
-
variant_title: string;
|
|
1156
|
-
}
|
|
1157
|
-
interface SubscriptionsResponse {
|
|
1158
|
-
next_cursor: null | string;
|
|
1159
|
-
previous_cursor: null | string;
|
|
1160
|
-
subscriptions: Subscription[];
|
|
1161
|
-
}
|
|
1162
|
-
declare type SubscriptionSortBy = 'id-asc' | 'id-desc' | 'created_at-asc' | 'created_at-desc' | 'updated_at-asc' | 'updated_at-desc';
|
|
1163
|
-
interface SubscriptionListParams extends ListParams<SubscriptionSortBy> {
|
|
1164
|
-
/** Return the subscriptions linked to the given address_id. */
|
|
1165
|
-
address_id?: string;
|
|
1166
|
-
/** Return the subscriptions linked to the given address_ids. */
|
|
1167
|
-
address_ids?: string[];
|
|
1168
|
-
/** Return the subscriptions created before the given date. */
|
|
1169
|
-
created_at_max?: IsoDateString;
|
|
1170
|
-
/** Return the subscriptions created after the given date. */
|
|
1171
|
-
created_at_min?: IsoDateString;
|
|
1172
|
-
/** Return the subscriptions linked to the given external_variant_id */
|
|
1173
|
-
external_variant_id?: string;
|
|
1174
|
-
/** Comma-separated list of subscription_ids to filter */
|
|
1175
|
-
ids?: string[];
|
|
1176
|
-
/** Return the subscriptions with specified status. */
|
|
1177
|
-
status?: SubscriptionStatus;
|
|
1178
|
-
/** Return the subscriptions updated before the given date. */
|
|
1179
|
-
updated_at_max?: IsoDateString;
|
|
1180
|
-
/** Return the subscriptions updated after the given date. */
|
|
1181
|
-
updated_at_min?: IsoDateString;
|
|
1182
|
-
}
|
|
1183
|
-
declare type SubscriptionRequiredCreateProps = 'address_id' | 'charge_interval_frequency' | 'external_variant_id' | 'next_charge_scheduled_at' | 'order_interval_frequency' | 'order_interval_unit' | 'quantity';
|
|
1184
|
-
declare type SubscriptionOptionalCreateProps = 'expire_after_specific_number_of_charges' | 'order_day_of_month' | 'order_day_of_week' | 'external_product_id' | 'product_title' | 'properties' | 'status';
|
|
1185
|
-
declare type CreateSubscriptionRequest = SubType<Subscription, SubscriptionRequiredCreateProps, SubscriptionOptionalCreateProps>;
|
|
1186
|
-
declare type SubscriptionOptionalUpdateProps = 'charge_interval_frequency' | 'expire_after_specific_number_of_charges' | 'order_day_of_month' | 'order_day_of_week' | 'order_interval_frequency' | 'order_interval_unit' | 'quantity' | 'external_product_id' | 'external_variant_id' | 'properties' | 'sku' | 'sku_override';
|
|
1187
|
-
declare type UpdateSubscriptionRequest = Partial<Pick<Subscription, SubscriptionOptionalUpdateProps>>;
|
|
1188
|
-
interface UpdateSubscriptionParams {
|
|
1189
|
-
/** Controls whether the QUEUED charges linked to the subscription should be regenerated upon subscription update. By default the flag is set to false which will delay charge regeneration 5 seconds. This enables running multiple calls to perform changes and receive responses much faster since the API won’t wait for a charge regeneration to complete. Setting this parameter to true will cause charge regeneration to complete before returning a response. */
|
|
1190
|
-
commit?: boolean;
|
|
1191
|
-
}
|
|
1192
|
-
interface CancelSubscriptionRequest {
|
|
1193
|
-
cancellation_reason: string;
|
|
1194
|
-
cancellation_reason_comments?: string;
|
|
1195
|
-
send_email?: boolean;
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
declare type CustomerIncludes = 'addresses' | 'payment_methods' | 'subscriptions';
|
|
1199
|
-
interface GetCustomerOptions {
|
|
1200
|
-
include: CustomerIncludes[];
|
|
1201
|
-
}
|
|
1202
|
-
interface Customer {
|
|
1203
|
-
/** Unique numeric identifier for the Customer. */
|
|
1204
|
-
id: number;
|
|
1205
|
-
/** An object containing analytics data associated with the customer. */
|
|
1206
|
-
analytics_data: AnalyticsData;
|
|
1207
|
-
/** The date and time when the customer was created. */
|
|
1208
|
-
created_at: IsoDateString;
|
|
1209
|
-
/** The email address of the customer. */
|
|
1210
|
-
email: string;
|
|
1211
|
-
/** An object containing external ids for the customer record. */
|
|
1212
|
-
external_customer_id: ExternalId;
|
|
1213
|
-
/** Date when first charge was processed for the customer. */
|
|
1214
|
-
first_charge_processed_at: IsoDateString;
|
|
1215
|
-
/** The customer’s first name. */
|
|
1216
|
-
first_name: string;
|
|
1217
|
-
/** A boolean that indicates if the customer has a payment method that is in dunning (failed charge). */
|
|
1218
|
-
has_payment_method_in_dunning: boolean;
|
|
1219
|
-
/** Is the payment method valid or not. */
|
|
1220
|
-
has_valid_payment_method: boolean;
|
|
1221
|
-
/** The unique string identifier used in a customers portal link. */
|
|
1222
|
-
hash: string;
|
|
1223
|
-
/** The customer’s last name. */
|
|
1224
|
-
last_name: string;
|
|
1225
|
-
/** The number of active subscriptions on addresses associated with the customer. */
|
|
1226
|
-
subscriptions_active_count: number;
|
|
1227
|
-
/** The total number of subscriptions created on addresses associated with the customer. */
|
|
1228
|
-
subscriptions_total_count: number;
|
|
1229
|
-
/** The date and time when the customer was last updated. */
|
|
1230
|
-
updated_at: IsoDateString;
|
|
1231
|
-
/** Additional information as requested */
|
|
1232
|
-
include?: {
|
|
1233
|
-
addresses?: Address[];
|
|
1234
|
-
payment_methods?: PaymentMethod[];
|
|
1235
|
-
subscriptions?: Subscription[];
|
|
1236
|
-
};
|
|
1237
|
-
}
|
|
1238
|
-
declare type CustomerOptionalUpdateProps = 'email' | 'first_name' | 'last_name' | 'external_customer_id';
|
|
1239
|
-
declare type UpdateCustomerRequest = Partial<Pick<Customer, CustomerOptionalUpdateProps>>;
|
|
1240
|
-
interface CustomerDeliveryScheduleParams {
|
|
1241
|
-
delivery_count_future?: number;
|
|
1242
|
-
future_internal?: number;
|
|
1243
|
-
date_max?: IsoDateString;
|
|
1244
|
-
}
|
|
1245
|
-
interface Delivery {
|
|
1246
|
-
date: IsoDateString;
|
|
1247
|
-
orders: Order[];
|
|
1248
|
-
}
|
|
1249
|
-
interface CustomerDeliveryScheduleResponse {
|
|
1250
|
-
customer: {
|
|
1251
|
-
id: number;
|
|
1252
|
-
email: string;
|
|
1253
|
-
first_name: string;
|
|
1254
|
-
last_name: string;
|
|
1255
|
-
};
|
|
1256
|
-
deliveries: Delivery[];
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
1334
|
/** @internal */
|
|
1260
1335
|
declare type MembershipStatus = 'active' | 'inactive';
|
|
1261
1336
|
/** @internal */
|
|
@@ -1533,14 +1608,14 @@ declare function deleteOnetime(session: Session, id: string | number): Promise<v
|
|
|
1533
1608
|
declare function getOrder(session: Session, id: string | number): Promise<Order>;
|
|
1534
1609
|
declare function listOrders(session: Session, query?: OrderListParams): Promise<OrdersResponse>;
|
|
1535
1610
|
|
|
1536
|
-
declare function getPaymentMethod(session: Session, id: string | number): Promise<PaymentMethod>;
|
|
1611
|
+
declare function getPaymentMethod(session: Session, id: string | number, options?: GetPaymentMethodOptions): Promise<PaymentMethod>;
|
|
1537
1612
|
declare function updatePaymentMethod(session: Session, id: string | number, updateRequest: UpdatePaymentMethodRequest): Promise<PaymentMethod>;
|
|
1538
1613
|
declare function listPaymentMethods(session: Session, query?: PaymentMethodListParams): Promise<PaymentMethodsResponse>;
|
|
1539
1614
|
|
|
1540
1615
|
declare function getPlan(session: Session, id: string | number): Promise<Plan>;
|
|
1541
1616
|
declare function listPlans(session: Session, query?: PlanListParams): Promise<PlansResponse>;
|
|
1542
1617
|
|
|
1543
|
-
declare function getSubscription(session: Session, id: string | number): Promise<Subscription>;
|
|
1618
|
+
declare function getSubscription(session: Session, id: string | number, options?: GetSubscriptionOptions): Promise<Subscription>;
|
|
1544
1619
|
declare function listSubscriptions(session: Session, query?: SubscriptionListParams): Promise<SubscriptionsResponse>;
|
|
1545
1620
|
/**
|
|
1546
1621
|
* When creating a subscription via API, order_interval_frequency and charge_interval_frequency values do not necessarily
|
|
@@ -1587,4 +1662,4 @@ declare const api: {
|
|
|
1587
1662
|
};
|
|
1588
1663
|
declare function initRecharge(opt?: InitOptions): void;
|
|
1589
1664
|
|
|
1590
|
-
export { ActivateMembershipRequest, Address, AddressListParams, AddressListResponse, AddressResponse, AddressSortBy, AnalyticsData, AssociatedAddress, Bundle, BundleItem, BundleProperties, BundleSelection, BundleTranslations, CDNBaseWidgetSettings, CDNBundleLayoutSettings, CDNBundleSettings, CDNBundleStep, CDNBundleStepOption, CDNBundleVariant, CDNBundleVariantOptionSource, CDNBundleVariantSelectionDefault, CDNPrices, CDNProduct, CDNProductAndSettings, CDNProductKeyObject, CDNProductOption, CDNProductOptionValue, CDNProductRaw, CDNProductResource, CDNProductsAndSettings, CDNProductsAndSettingsResource, CDNSellingPlan, CDNSellingPlanAllocations, CDNSellingPlanGroup, CDNStoreSettings, CDNSubscriptionOption, CDNVariant, CDNVariantOptionValue, CDNWidgetSettings, CDNWidgetSettingsRaw, CDNWidgetSettingsResource, CRUDRequestOptions, CancelMembershipRequest, CancelSubscriptionRequest, ChannelSettings, Charge, ChargeListParams, ChargeListResponse, ChargeResponse, ChargeSortBy, ChargeStatus, ColorString, CreateAddressRequest, CreateOnetimeRequest, CreateSubscriptionRequest, Customer, CustomerDeliveryScheduleParams, CustomerDeliveryScheduleResponse, CustomerIncludes, CustomerOptionalUpdateProps, Delivery, Discount, ExternalId, ExternalTransactionId, FirstOption, GetCustomerOptions, GetRequestOptions, HTMLString, InitOptions, IntervalUnit, IsoDateString, LineItem, ListParams, LoginResponse, Membership, MembershipIncludes, MembershipListParams, MembershipListResponse, MembershipResponse, MembershipStatus, MembershipsSortBy, MergeAddressesRequest, Method, Onetime, OnetimeCreateProps, OnetimeListParams, OnetimeOptionalCreateProps, OnetimeOptionalUpdateProps, OnetimeRequiredCreateProps, OnetimesResponse, OnetimesSortBy, Order, OrderListParams, OrderSortBy, OrderStatus, OrderType, OrdersResponse, PaymentDetails, PaymentMethod, PaymentMethodListParams, PaymentMethodOptionalUpdateProps, PaymentMethodSortBy, PaymentMethodStatus, PaymentMethodsResponse, PaymentType, Plan, PlanListParams, PlanSortBy, PlanType, PlansResponse, PriceAdjustmentsType, ProcessorName, ProductImage, Property, Request, RequestHeaders, RequestOptions, RequestOptionsHeaders, Session, ShippingLine, SkipFutureChargeAddressRequest, SkipFutureChargeAddressResponse, StorefrontEnvironment, StorefrontOptions, StorefrontPurchaseOption, SubType, Subscription, SubscriptionListParams, SubscriptionOptionalCreateProps, SubscriptionOptionalUpdateProps, SubscriptionPreferences, SubscriptionRequiredCreateProps, SubscriptionSortBy, SubscriptionStatus, SubscriptionsResponse, TaxLine, Translations, UpdateAddressRequest, UpdateCustomerRequest, UpdateOnetimeRequest, UpdatePaymentMethodRequest, UpdateSubscriptionParams, UpdateSubscriptionRequest, WidgetIconColor, WidgetTemplateType, activateMembership, activateSubscription, api, applyDiscountToAddress, applyDiscountToCharge, cancelMembership, cancelSubscription, createAddress, createOnetime, createSubscription, deleteAddress, deleteOnetime, getAddress, getBundleId, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, getCustomer, getDeliverySchedule, getDynamicBundleItems, getMembership, getOnetime, getOrder, getPaymentMethod, getPlan, getSubscription, initRecharge, listAddresses, listCharges, listMemberships, listOnetimes, listOrders, listPaymentMethods, listPlans, listSubscriptions, loginShopifyApi, loginShopifyAppProxy, membershipIncludes, mergeAddresses, processCharge, removeDiscountsFromAddress, removeDiscountsFromCharge, resetCDNCache, skipCharge, skipFutureCharge, skipSubscriptionCharge, unskipCharge, updateAddress, updateCustomer, updateOnetime, updatePaymentMethod, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, validateBundle, validateDynamicBundle };
|
|
1665
|
+
export { ActivateMembershipRequest, Address, AddressIncludes, AddressListParams, AddressListResponse, AddressResponse, AddressSortBy, AnalyticsData, AssociatedAddress, Bundle, BundleItem, BundleProperties, BundleSelection, BundleTranslations, CDNBaseWidgetSettings, CDNBundleLayoutSettings, CDNBundleSettings, CDNBundleStep, CDNBundleStepOption, CDNBundleVariant, CDNBundleVariantOptionSource, CDNBundleVariantSelectionDefault, CDNPrices, CDNProduct, CDNProductAndSettings, CDNProductKeyObject, CDNProductOption, CDNProductOptionValue, CDNProductRaw, CDNProductResource, CDNProductsAndSettings, CDNProductsAndSettingsResource, CDNSellingPlan, CDNSellingPlanAllocations, CDNSellingPlanGroup, CDNStoreSettings, CDNSubscriptionOption, CDNVariant, CDNVariantOptionValue, CDNWidgetSettings, CDNWidgetSettingsRaw, CDNWidgetSettingsResource, CRUDRequestOptions, CancelMembershipRequest, CancelSubscriptionRequest, ChannelSettings, Charge, ChargeIncludes, ChargeListParams, ChargeListResponse, ChargeResponse, ChargeSortBy, ChargeStatus, ColorString, CreateAddressRequest, CreateOnetimeRequest, CreateSubscriptionRequest, Customer, CustomerDeliveryScheduleParams, CustomerDeliveryScheduleResponse, CustomerIncludes, CustomerOptionalUpdateProps, Delivery, DeliveryLineItem, DeliveryOrder, DeliveryPaymentMethod, Discount, ExternalId, ExternalTransactionId, FirstOption, GetAddressOptions, GetChargeOptions, GetCustomerOptions, GetPaymentMethodOptions, GetRequestOptions, GetSubscriptionOptions, HTMLString, InitOptions, IntervalUnit, IsoDateString, LineItem, ListParams, LoginResponse, Membership, MembershipIncludes, MembershipListParams, MembershipListResponse, MembershipResponse, MembershipStatus, MembershipsSortBy, MergeAddressesRequest, Method, Onetime, OnetimeCreateProps, OnetimeListParams, OnetimeOptionalCreateProps, OnetimeOptionalUpdateProps, OnetimeRequiredCreateProps, OnetimesResponse, OnetimesSortBy, Order, OrderListParams, OrderSortBy, OrderStatus, OrderType, OrdersResponse, PaymentDetails, PaymentMethod, PaymentMethodIncludes, PaymentMethodListParams, PaymentMethodOptionalUpdateProps, PaymentMethodSortBy, PaymentMethodStatus, PaymentMethodsResponse, PaymentType, Plan, PlanListParams, PlanSortBy, PlanType, PlansResponse, PriceAdjustmentsType, ProcessorName, ProductImage, Property, Request, RequestHeaders, RequestOptions, RequestOptionsHeaders, Session, ShippingLine, SkipFutureChargeAddressRequest, SkipFutureChargeAddressResponse, StorefrontEnvironment, StorefrontOptions, StorefrontPurchaseOption, SubType, Subscription, SubscriptionIncludes, SubscriptionListParams, SubscriptionOptionalCreateProps, SubscriptionOptionalUpdateProps, SubscriptionPreferences, SubscriptionRequiredCreateProps, SubscriptionSortBy, SubscriptionStatus, SubscriptionsResponse, TaxLine, Translations, UpdateAddressRequest, UpdateCustomerRequest, UpdateOnetimeRequest, UpdatePaymentMethodRequest, UpdateSubscriptionParams, UpdateSubscriptionRequest, WidgetIconColor, WidgetTemplateType, activateMembership, activateSubscription, api, applyDiscountToAddress, applyDiscountToCharge, cancelMembership, cancelSubscription, createAddress, createOnetime, createSubscription, deleteAddress, deleteOnetime, getAddress, getBundleId, getCDNBundleSettings, getCDNProduct, getCDNProductAndSettings, getCDNProducts, getCDNProductsAndSettings, getCDNStoreSettings, getCDNWidgetSettings, getCharge, getCustomer, getDeliverySchedule, getDynamicBundleItems, getMembership, getOnetime, getOrder, getPaymentMethod, getPlan, getSubscription, initRecharge, listAddresses, listCharges, listMemberships, listOnetimes, listOrders, listPaymentMethods, listPlans, listSubscriptions, loginShopifyApi, loginShopifyAppProxy, membershipIncludes, mergeAddresses, processCharge, removeDiscountsFromAddress, removeDiscountsFromCharge, resetCDNCache, skipCharge, skipFutureCharge, skipSubscriptionCharge, unskipCharge, updateAddress, updateCustomer, updateOnetime, updatePaymentMethod, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, validateBundle, validateDynamicBundle };
|