@rechargeapps/storefront-client 0.20.1 → 0.22.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.ts CHANGED
@@ -264,6 +264,92 @@ interface OrderListParams extends ListParams<OrderSortBy> {
264
264
  updated_at_min?: IsoDateString;
265
265
  }
266
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
+
267
353
  declare type ChargeStatus = 'success' | 'error' | 'queued' | 'skipped' | 'refunded' | 'partially_refunded' | 'pending_manual_payment' | 'pending';
268
354
  interface Charge {
269
355
  /** The unique numeric identifier for the Charge. */
@@ -348,6 +434,10 @@ interface Charge {
348
434
  type: 'checkout' | 'recurring';
349
435
  /** The date time at which the Charge was most recently updated. */
350
436
  updated_at: IsoDateString;
437
+ /** Additional information as requested */
438
+ include?: {
439
+ payment_methods?: PaymentMethod[];
440
+ };
351
441
  }
352
442
  interface ChargeResponse {
353
443
  charge: Charge;
@@ -357,6 +447,10 @@ interface ChargeListResponse {
357
447
  previous_cursor: null | string;
358
448
  charges: Charge[];
359
449
  }
450
+ declare type ChargeIncludes = 'payment_methods';
451
+ interface GetChargeOptions {
452
+ include?: ChargeIncludes[];
453
+ }
360
454
  declare type ChargeSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc' | 'scheduled_at-asc' | 'scheduled_at-desc';
361
455
  interface ChargeListParams extends ListParams<ChargeSortBy> {
362
456
  /** Filter Charges by Address. */
@@ -396,167 +490,410 @@ interface ChargeListParams extends ListParams<ChargeSortBy> {
396
490
  created_at_min?: IsoDateString;
397
491
  /** Show Charges created before the given date. */
398
492
  created_at_max?: IsoDateString;
493
+ /** Include related data options */
494
+ include?: ChargeIncludes[];
399
495
  }
400
496
 
401
- interface CreateAddressRequest {
402
- /** Unique numeric identifier for the customer associated with the address. */
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. */
403
504
  customer_id: number;
404
- /** The street associated with the Address. Minimum length is 1 character. */
405
- address1: string;
406
- /** Any additional information associated with the Address. */
407
- address2?: string;
408
- /** The city associated with the address. */
409
- city: string;
410
- /** The company associated with the address. */
411
- company?: string;
412
- /** 2-letter country code. */
413
- country_code: string;
414
- /** A list of discounts applied on the address. These discounts will apply to future recurring charges associated with this address. */
415
- discounts?: Discount[];
416
- /** The customer’s first name associated with the address. */
417
- first_name: string;
418
- /** The customer’s last name associated with the address. */
419
- last_name: string;
420
- /** Replaces cart_attributes. Extra information that is added to the order. */
421
- order_attributes?: Property[];
422
- /** Notes to be added to all orders associated with the address. */
423
- order_note?: string | null;
424
- /** Payment method id for the Payment_method to be associated to this address. */
425
- payment_method_id?: number;
426
- /** The phone number associated with the address. Must be included in the request schema but can be an empty string. */
427
- phone: string;
428
- /** The currency on the subscription contract in Shopify. Only set if the currency is different from the store-level currency. Else, will be null. */
429
- presentment_currency?: string | null;
430
- /** The state or province associated with the address. */
431
- province: string | null;
432
- /** Used when shipping rates need to be overridden. If this parameter has value null, rates will be fetched when Charge is created or regenerated */
433
- shipping_lines_override?: {
434
- code: string;
435
- price: string;
436
- title: string;
437
- }[] | null;
438
- /** The zip or postal code associated with the address. */
439
- zip: string;
440
- }
441
- declare type UpdateAddressRequest = Omit<Partial<CreateAddressRequest>, 'presentment_currency' | 'customer_id' | 'discounts'> & {
442
- discounts?: {
443
- code: string;
444
- }[];
445
- };
446
- interface MergeAddressesRequest {
447
- /** Indicates whether source addresses should be deleted. */
448
- delete_source_addresses?: boolean;
449
- /** Specifies the next charge date of the associated subscriptions on the target address. */
450
- next_charge_date?: string;
451
- /** The address all of the subscriptions should be moved to. */
452
- target_address: Address | {
453
- id: number;
454
- };
455
- /** The list of addresses that the subscriptions should move from. */
456
- source_addresses: (Address | {
457
- id: number;
458
- })[];
459
- }
460
- interface SkipFutureChargeAddressRequest {
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;
461
513
  /**
462
- * The date in the future of the Charge to be skipped.
463
- * This date must be within the delivery schedules of the Customer.
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
464
517
  */
465
- date: IsoDateString;
466
- /** A list containing the Subscription IDs to be skipped. */
467
- subscription_ids: string;
468
- }
469
- interface Address {
470
- /** Unique numeric identifier for the Address. */
471
- id: number;
472
- /** The street associated with the Address. */
473
- address1: string;
474
- /** Any additional information associated with the Address. */
475
- address2?: string;
476
- /** The city associated with the address. */
477
- city: string;
478
- /** The company associated with the address. */
479
- company: string;
480
- /** 2-letter country code. */
481
- country_code: string;
482
- /** Unique numeric identifier for the customer associated with the address. */
483
- customer_id: number;
484
- /** A list of discounts applied on the address. These discounts will apply to future recurring charges associated with this address. */
485
- discounts: Discount[];
486
- /** The customer’s first name associated with the address. */
487
- first_name: string;
488
- /** The customer’s last name associated with the address. */
489
- last_name: string;
490
- /** Replaces cart_attributes. Extra information that is added to the order. */
491
- order_attributes: Property[];
492
- /** Notes to be added to all orders associated with the address. */
493
- order_note: string | null;
494
- /** Unique numeric identifier for the Payment Method associated to the Address. */
495
- payment_method_id: number;
496
- /** The phone number associated with the address. */
497
- phone: string;
498
- /** The currency on the subscription contract in Shopify. Only set if the currency is different from the store-level currency. Else, will be null. */
499
- presentment_currency: string | null;
500
- /** The state or province associated with the address. */
501
- province: string | null;
502
- /** Used when shipping rates need to be overridden. If this parameter has value null, rates will be fetched when Charge is created or regenerated */
503
- shipping_lines_override: {
504
- code: string;
505
- price: string;
506
- title: string;
507
- }[] | null;
508
- /** The zip or postal code associated with the address. */
509
- zip?: string | null;
510
- /** The date and time when the address was created. */
518
+ charge_interval_frequency: number;
519
+ /** The time the subscription was created. */
511
520
  created_at: IsoDateString;
512
- /** The date and time when the address was last updated. */
513
- updated_at: IsoDateString;
514
- }
515
- interface SkipFutureChargeAddressResponse {
516
- charge: Charge;
517
- }
518
- interface AddressResponse {
519
- address: Address;
520
- }
521
- interface AddressListResponse {
522
- next_cursor: null | string;
523
- previous_cursor: null | string;
524
- addresses: Address[];
525
- }
526
- declare type AddressSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc';
527
- interface AddressListParams extends ListParams<AddressSortBy> {
528
- /** Returns addresses that have the provided discount_id. */
529
- discount_id?: string;
530
- /** Returns addresses that have the provided discount_code. */
531
- discount_code?: string;
532
- /** Returns addresses created after the given time. */
533
- created_at_min?: IsoDateString;
534
- /** Returns addresses created before the given time. */
535
- created_at_max?: IsoDateString;
536
- /** Returns active addresses. */
537
- is_active?: boolean;
538
- }
539
-
540
- interface Session {
541
- apiToken: string;
542
- customerId?: string;
543
- }
544
-
545
- /** Returns all addresses from the store, or addresses for the customer given in the parameter. */
546
- declare function listAddresses(session: Session, query?: AddressListParams): Promise<AddressListResponse>;
547
- /** Retrieves address for customer based on specified address id. */
548
- declare function getAddress(session: Session, id: string | number): Promise<Address>;
549
- /** Create a new address for a customer. */
550
- declare function createAddress(session: Session, createRequest: CreateAddressRequest): Promise<Address>;
551
- /** Updates an existing address to match the specified parameters. */
552
- declare function updateAddress(session: Session, id: string | number, updateRequest: UpdateAddressRequest): Promise<Address>;
553
- /** Apply discount code to an address. Addresses are currently limited to a single discount. */
554
- declare function applyDiscountToAddress(session: Session, id: string | number, discountCode: string): Promise<Address>;
555
- /** Removes all discounts from an address. */
556
- declare function removeDiscountsFromAddress(session: Session, id: string | number): Promise<Address>;
557
- /** Deletes an address. Only Addresses with no active Subscriptions can be deleted. */
558
- declare function deleteAddress(session: Session, id: string | number): Promise<void>;
559
- /**
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[];
720
+ }
721
+
722
+ interface CreateAddressRequest {
723
+ /** Unique numeric identifier for the customer associated with the address. */
724
+ customer_id: number;
725
+ /** The street associated with the Address. Minimum length is 1 character. */
726
+ address1: string;
727
+ /** Any additional information associated with the Address. */
728
+ address2?: string;
729
+ /** The city associated with the address. */
730
+ city: string;
731
+ /** The company associated with the address. */
732
+ company?: string;
733
+ /** 2-letter country code. */
734
+ country_code: string;
735
+ /** A list of discounts applied on the address. These discounts will apply to future recurring charges associated with this address. */
736
+ discounts?: {
737
+ id: number;
738
+ }[];
739
+ /** The customer’s first name associated with the address. */
740
+ first_name: string;
741
+ /** The customer’s last name associated with the address. */
742
+ last_name: string;
743
+ /** Replaces cart_attributes. Extra information that is added to the order. */
744
+ order_attributes?: Property[];
745
+ /** Notes to be added to all orders associated with the address. */
746
+ order_note?: string | null;
747
+ /** Payment method id for the Payment_method to be associated to this address. */
748
+ payment_method_id?: number;
749
+ /** The phone number associated with the address. Must be included in the request schema but can be an empty string. */
750
+ phone: string;
751
+ /** The currency on the subscription contract in Shopify. Only set if the currency is different from the store-level currency. Else, will be null. */
752
+ presentment_currency?: string | null;
753
+ /** The state or province associated with the address. */
754
+ province: string | null;
755
+ /** Used when shipping rates need to be overridden. If this parameter has value null, rates will be fetched when Charge is created or regenerated */
756
+ shipping_lines_override?: {
757
+ code: string;
758
+ price: string;
759
+ title: string;
760
+ }[] | null;
761
+ /** The zip or postal code associated with the address. */
762
+ zip: string;
763
+ }
764
+ declare type UpdateAddressRequest = Omit<Partial<CreateAddressRequest>, 'presentment_currency' | 'customer_id' | 'discounts'> & {
765
+ discounts?: {
766
+ code: string;
767
+ }[];
768
+ };
769
+ interface MergeAddressesRequest {
770
+ /** Indicates whether source addresses should be deleted. */
771
+ delete_source_addresses?: boolean;
772
+ /** Specifies the next charge date of the associated subscriptions on the target address. */
773
+ next_charge_date?: string;
774
+ /** The address all of the subscriptions should be moved to. */
775
+ target_address: Address | {
776
+ id: number;
777
+ };
778
+ /** The list of addresses that the subscriptions should move from. */
779
+ source_addresses: (Address | {
780
+ id: number;
781
+ })[];
782
+ }
783
+ interface SkipFutureChargeAddressRequest {
784
+ /**
785
+ * The date in the future of the Charge to be skipped.
786
+ * This date must be within the delivery schedules of the Customer.
787
+ */
788
+ date: IsoDateString;
789
+ /** A list containing the Subscription IDs to be skipped. */
790
+ subscription_ids: string;
791
+ }
792
+ interface Address {
793
+ /** Unique numeric identifier for the Address. */
794
+ id: number;
795
+ /** The street associated with the Address. */
796
+ address1: string;
797
+ /** Any additional information associated with the Address. */
798
+ address2?: string;
799
+ /** The city associated with the address. */
800
+ city: string;
801
+ /** The company associated with the address. */
802
+ company: string;
803
+ /** 2-letter country code. */
804
+ country_code: string;
805
+ /** Unique numeric identifier for the customer associated with the address. */
806
+ customer_id: number;
807
+ /** A list of discounts applied on the address. These discounts will apply to future recurring charges associated with this address. */
808
+ discounts: {
809
+ id: number;
810
+ }[];
811
+ /** The customer’s first name associated with the address. */
812
+ first_name: string;
813
+ /** The customer’s last name associated with the address. */
814
+ last_name: string;
815
+ /** Replaces cart_attributes. Extra information that is added to the order. */
816
+ order_attributes: Property[];
817
+ /** Notes to be added to all orders associated with the address. */
818
+ order_note: string | null;
819
+ /** Unique numeric identifier for the Payment Method associated to the Address. */
820
+ payment_method_id: number;
821
+ /** The phone number associated with the address. */
822
+ phone: string;
823
+ /** The currency on the subscription contract in Shopify. Only set if the currency is different from the store-level currency. Else, will be null. */
824
+ presentment_currency: string | null;
825
+ /** The state or province associated with the address. */
826
+ province: string | null;
827
+ /** Used when shipping rates need to be overridden. If this parameter has value null, rates will be fetched when Charge is created or regenerated */
828
+ shipping_lines_override: {
829
+ code: string;
830
+ price: string;
831
+ title: string;
832
+ }[] | null;
833
+ /** The zip or postal code associated with the address. */
834
+ zip?: string | null;
835
+ /** The date and time when the address was created. */
836
+ created_at: IsoDateString;
837
+ /** The date and time when the address was last updated. */
838
+ updated_at: IsoDateString;
839
+ /** Additional information as requested */
840
+ include?: {
841
+ customer?: Customer;
842
+ payment_methods?: PaymentMethod[];
843
+ subscriptions?: Subscription[];
844
+ };
845
+ }
846
+ interface SkipFutureChargeAddressResponse {
847
+ charge: Charge;
848
+ }
849
+ interface AddressResponse {
850
+ address: Address;
851
+ }
852
+ interface AddressListResponse {
853
+ next_cursor: null | string;
854
+ previous_cursor: null | string;
855
+ addresses: Address[];
856
+ }
857
+ declare type AddressIncludes = 'customer' | 'payment_methods' | 'subscriptions';
858
+ interface GetAddressOptions {
859
+ include?: AddressIncludes[];
860
+ }
861
+ declare type AddressSortBy = 'id-asc' | 'id-desc' | 'updated_at-asc' | 'updated_at-desc';
862
+ interface AddressListParams extends ListParams<AddressSortBy> {
863
+ /** Returns addresses that have the provided discount_id. */
864
+ discount_id?: string;
865
+ /** Returns addresses that have the provided discount_code. */
866
+ discount_code?: string;
867
+ /** Returns addresses created after the given time. */
868
+ created_at_min?: IsoDateString;
869
+ /** Returns addresses created before the given time. */
870
+ created_at_max?: IsoDateString;
871
+ /** Returns active addresses. */
872
+ is_active?: boolean;
873
+ /** Include related data options */
874
+ include?: AddressIncludes[];
875
+ }
876
+
877
+ interface Session {
878
+ apiToken: string;
879
+ customerId?: string;
880
+ }
881
+
882
+ /** Returns all addresses from the store, or addresses for the customer given in the parameter. */
883
+ declare function listAddresses(session: Session, query?: AddressListParams): Promise<AddressListResponse>;
884
+ /** Retrieves address for customer based on specified address id. */
885
+ declare function getAddress(session: Session, id: string | number, options?: GetAddressOptions): Promise<Address>;
886
+ /** Create a new address for a customer. */
887
+ declare function createAddress(session: Session, createRequest: CreateAddressRequest): Promise<Address>;
888
+ /** Updates an existing address to match the specified parameters. */
889
+ declare function updateAddress(session: Session, id: string | number, updateRequest: UpdateAddressRequest): Promise<Address>;
890
+ /** Apply discount code to an address. Addresses are currently limited to a single discount. */
891
+ declare function applyDiscountToAddress(session: Session, id: string | number, discountCode: string): Promise<Address>;
892
+ /** Removes all discounts from an address. */
893
+ declare function removeDiscountsFromAddress(session: Session, id: string | number): Promise<Address>;
894
+ /** Deletes an address. Only Addresses with no active Subscriptions can be deleted. */
895
+ declare function deleteAddress(session: Session, id: string | number): Promise<void>;
896
+ /**
560
897
  * Merges up to 10 source addresses into 1 target address.
561
898
  */
562
899
  declare function mergeAddresses(session: Session, mergeRequest: MergeAddressesRequest): Promise<Address>;
@@ -567,8 +904,12 @@ declare function skipFutureCharge(session: Session, id: string | number, skipReq
567
904
 
568
905
  declare function loginShopifyAppProxy(): Promise<Session>;
569
906
  declare function loginShopifyApi(shopifyStorefrontToken: string, shopifyCustomerAccessToken?: string): Promise<Session | null>;
907
+ declare function sendPasswordlessCode(email: string): Promise<string>;
908
+ declare function sendPasswordlessCodeAppProxy(email: string): Promise<string>;
909
+ declare function validatePasswordlessCode(email: string, session_token: string, code: string): Promise<Session>;
910
+ declare function validatePasswordlessCodeAppProxy(email: string, session_token: string, code: string): Promise<Session>;
570
911
 
571
- declare function getCharge(session: Session, id: number | string): Promise<Charge>;
912
+ declare function getCharge(session: Session, id: number | string, options?: GetChargeOptions): Promise<Charge>;
572
913
  /** Lists charges */
573
914
  declare function listCharges(session: Session, query?: ChargeListParams): Promise<ChargeListResponse>;
574
915
  /**
@@ -614,6 +955,15 @@ interface LoginResponse {
614
955
  api_token: string;
615
956
  customer_id?: string;
616
957
  }
958
+ interface PasswordlessCodeResponse {
959
+ session_token: string;
960
+ errors?: string;
961
+ }
962
+ interface PasswordlessValidateResponse {
963
+ api_token: string;
964
+ customer_id: string;
965
+ errors?: string;
966
+ }
617
967
 
618
968
  interface BundleSelection {
619
969
  collectionId: string;
@@ -750,539 +1100,248 @@ interface CDNProductsAndSettingsResource {
750
1100
  widget_settings: CDNWidgetSettingsRaw;
751
1101
  store_settings?: CDNStoreSettings;
752
1102
  meta?: {
753
- status: string;
754
- message: string;
755
- };
756
- }
757
- interface CDNSellingPlan {
758
- order_interval_frequency: string | number;
759
- created_at?: IsoDateString;
760
- order_interval_unit_type: IntervalUnit;
761
- updated_at?: IsoDateString;
762
- id: number;
763
- selling_plan_id: number;
764
- selling_plan_name: string;
765
- price_adjustments_value_type: PriceAdjustmentsType;
766
- price_adjustments_value: number;
767
- }
768
- interface CDNSellingPlanGroup {
769
- selling_plan_group_id: string | number;
770
- selling_plans: CDNSellingPlan[];
771
- subscription_product_id: number;
772
- }
773
- interface CDNSubscriptionOption {
774
- storefront_purchase_options: StorefrontPurchaseOption;
775
- updated_at: IsoDateString;
776
- is_prepaid?: boolean;
777
- }
778
- interface CDNSellingPlanAllocations {
779
- selling_plan_group_id: string | number;
780
- selling_plan_id: number;
781
- discounted_price: string;
782
- }
783
- interface CDNPrices {
784
- compare_at_price: string | null;
785
- unit_price: string;
786
- discounted_price: string;
787
- zero_decimal_currency: boolean;
788
- }
789
- interface CDNVariantOptionValue {
790
- id: number;
791
- label: string;
792
- }
793
- interface CDNVariant {
794
- id: number;
795
- option_values: CDNVariantOptionValue[];
796
- prices: CDNPrices;
797
- selling_plan_allocations: CDNSellingPlanAllocations[];
798
- }
799
- interface CDNProductOptionValue {
800
- id?: number | null;
801
- label: string;
802
- position: number;
803
- }
804
- interface CDNProductOption {
805
- id: number;
806
- name: string;
807
- position: number;
808
- values: CDNProductOptionValue[];
809
- }
810
- interface CDNProductRaw {
811
- id: number | null;
812
- bundle_product?: CDNBundleSettings | null;
813
- external_product_id: number;
814
- in_recharge: boolean;
815
- options: CDNProductOption[];
816
- variants: CDNVariant[];
817
- subscription_options: CDNSubscriptionOption;
818
- selling_plan_groups: CDNSellingPlanGroup[];
819
- }
820
- interface CDNProduct extends CDNProductRaw {
821
- /** @deprecated */
822
- isSubscriptionOnly: boolean;
823
- is_subscription_only: boolean;
824
- }
825
- interface CDNProductAndSettings {
826
- product: CDNProduct;
827
- widget_settings: CDNWidgetSettings;
828
- store_settings: CDNStoreSettings;
829
- /** @deprecated */
830
- widgetSettings: CDNWidgetSettings;
831
- /** @deprecated */
832
- storeSettings: CDNStoreSettings;
833
- }
834
- interface CDNProductsAndSettings {
835
- products: CDNProductKeyObject[];
836
- widget_settings: CDNWidgetSettings;
837
- store_settings: Partial<CDNStoreSettings>;
838
- }
839
- interface CDNBaseWidgetSettings {
840
- active_color: ColorString;
841
- auto_inject?: boolean;
842
- background_color: ColorString;
843
- bundle_translations?: BundleTranslations;
844
- delivery_dropdown_label: string;
845
- display_on: string[];
846
- first_option: FirstOption;
847
- font_color: ColorString;
848
- form_type: string;
849
- how_it_works: HTMLString;
850
- learnmore_url: string;
851
- learnmore_verbiage: string;
852
- onetime_message: string;
853
- popup_background_color: ColorString;
854
- popup_link_color: ColorString;
855
- popup_text_color: ColorString;
856
- poweredby_url: string;
857
- published: boolean;
858
- select_subscription_first: boolean;
859
- show_learnmore: boolean;
860
- show_poweredby: boolean;
861
- show_subscription_details: boolean;
862
- show_subscription_details_icon: boolean;
863
- sub_and_save_ext_label: string;
864
- subscribe_message: string;
865
- subscribe_without_discount_message: string;
866
- subscription_details_verbiage: string;
867
- translations: Translations;
868
- /** Whether or not plans data will be used on the widget */
869
- use_plans_data?: boolean;
870
- widget_charge_every: string;
871
- widget_deliver_every: string;
872
- widget_icon: WidgetIconColor;
873
- widget_template_type: WidgetTemplateType;
874
- }
875
- declare type CDNExcludedWidgetSettings = 'display_on' | 'first_option';
876
- interface CDNWidgetSettings extends Omit<CDNBaseWidgetSettings, CDNExcludedWidgetSettings> {
877
- /** @deprecated */
878
- autoInject: boolean;
879
- /** @deprecated */
880
- validPages: string[];
881
- /** @deprecated */
882
- isSubscriptionFirst: boolean;
883
- auto_inject: boolean;
884
- valid_pages: string[];
885
- is_subscription_first: boolean;
886
- }
887
- declare type CDNWidgetSettingsRaw = {
888
- [key in keyof CDNBaseWidgetSettings]: string;
889
- };
890
- interface CDNWidgetSettingsResource {
891
- widget_settings: CDNWidgetSettingsRaw;
892
- meta: {
893
- version: string;
894
- };
895
- }
896
- interface CDNStoreSettings {
897
- store_currency: {
898
- currency_code: string;
899
- currency_symbol: string;
900
- decimal_separator: string;
901
- thousands_separator: string;
902
- currency_symbol_location: string;
903
- zero_decimal_currency?: boolean;
904
- };
905
- }
906
- /****************** 2021-08 **********************/
907
- /**************** Bundles ****************/
908
- interface CDNBundleStepOption {
909
- content: string;
910
- defaultImage: string;
911
- }
912
- interface CDNBundleStep {
913
- data?: {
914
- optionsMeta: {
915
- [key: string]: CDNBundleStepOption;
916
- };
917
- };
918
- disable: boolean;
919
- index: string;
920
- name: string;
921
- title: string;
922
- type: 'variantSelector' | 'all-collections' | 'addons' | 'summary' | 'cross-sells';
923
- }
924
- interface CDNBundleLayoutSettings {
925
- addToCartCallback: {
926
- type: 'none';
927
- value: string;
928
- };
929
- addons: {
930
- collectionHandle: string;
931
- collectionId: string;
932
- enabled: boolean;
933
- };
934
- collapsibleSections: boolean;
935
- crossSells: {
936
- collectionId: string;
937
- enabled: boolean;
938
- collectionHandle: string;
939
- };
940
- defaultFrequency: string;
941
- defaultVariantId: string;
942
- description: string;
943
- filters: any[];
944
- learnMoreModal: boolean;
945
- published: boolean;
946
- showVariants: boolean;
947
- template: 'one-page' | 'multi-step';
948
- templateSettings: {
949
- onePage: {
950
- frequencySelector: 'dropdown';
951
- };
952
- multiStep?: {
953
- steps: CDNBundleStep[];
954
- optionImages: string;
955
- };
956
- };
957
- title: string;
958
- visibility: {
959
- portal: boolean;
960
- signup: boolean;
1103
+ status: string;
1104
+ message: string;
961
1105
  };
962
1106
  }
963
- interface CDNBundleVariantOptionSource {
1107
+ interface CDNSellingPlan {
1108
+ order_interval_frequency: string | number;
1109
+ created_at?: IsoDateString;
1110
+ order_interval_unit_type: IntervalUnit;
1111
+ updated_at?: IsoDateString;
964
1112
  id: number;
965
- collection_id: string;
966
- quantity_max: number | null;
967
- quantity_min: number | null;
1113
+ selling_plan_id: number;
1114
+ selling_plan_name: string;
1115
+ price_adjustments_value_type: PriceAdjustmentsType;
1116
+ price_adjustments_value: number;
968
1117
  }
969
- interface CDNBundleVariantSelectionDefault {
970
- id: number;
971
- quantity: number;
972
- external_variant_id: string;
1118
+ interface CDNSellingPlanGroup {
1119
+ selling_plan_group_id: string | number;
1120
+ selling_plans: CDNSellingPlan[];
1121
+ subscription_product_id: number;
973
1122
  }
974
- interface CDNBundleVariant {
975
- enabled: boolean;
976
- external_variant_id: string;
1123
+ interface CDNSubscriptionOption {
1124
+ storefront_purchase_options: StorefrontPurchaseOption;
1125
+ updated_at: IsoDateString;
1126
+ is_prepaid?: boolean;
1127
+ }
1128
+ interface CDNSellingPlanAllocations {
1129
+ selling_plan_group_id: string | number;
1130
+ selling_plan_id: number;
1131
+ discounted_price: string;
1132
+ }
1133
+ interface CDNPrices {
1134
+ compare_at_price: string | null;
1135
+ unit_price: string;
1136
+ discounted_price: string;
1137
+ zero_decimal_currency: boolean;
1138
+ }
1139
+ interface CDNVariantOptionValue {
977
1140
  id: number;
978
- items_count: number;
979
- option_sources: CDNBundleVariantOptionSource[];
980
- selection_defaults?: CDNBundleVariantSelectionDefault[];
1141
+ label: string;
981
1142
  }
982
- interface CDNBundleSettings {
983
- customization_window_disabled_message: string | null;
984
- customization_window?: number;
985
- default_bundle_variant_id?: number;
986
- description: string | null;
987
- external_product_id: string;
1143
+ interface CDNVariant {
988
1144
  id: number;
989
- is_customizable?: boolean;
990
- layout_settings: CDNBundleLayoutSettings;
991
- layout_settings_version: '2021-11';
992
- max_quantity_per_variant: number | null;
993
- reset_box_contents?: boolean;
994
- variants: CDNBundleVariant[];
1145
+ option_values: CDNVariantOptionValue[];
1146
+ prices: CDNPrices;
1147
+ selling_plan_allocations: CDNSellingPlanAllocations[];
995
1148
  }
996
-
997
- interface PaymentDetails {
998
- /** Payment_method brand or company powering it. valid for CREDIT_CARD only. */
999
- brand?: string;
1000
- /** Payment_method expiry month. valid for CREDIT_CARD only. */
1001
- exp_month?: string;
1002
- /** Payment_method expiry year. valid for CREDIT_CARD only. */
1003
- exp_year?: string;
1004
- /** last 4-digits of the identifier. valid for CREDIT_CARD only. */
1005
- last4?: string;
1006
- /** email linked to paypal. valid for PAYPAL only. */
1007
- paypal_email?: string;
1008
- /** paypal user identifier. valid for PAYPAL only. */
1009
- paypal_payer_id?: string;
1010
- /** If a digital wallet. */
1011
- wallet_type?: string;
1012
- /** Type of funding for the Payment Method. */
1013
- funding_type?: string;
1149
+ interface CDNProductOptionValue {
1150
+ id?: number | null;
1151
+ label: string;
1152
+ position: number;
1014
1153
  }
1015
- declare type PaymentType = 'CREDIT_CARD' | 'PAYPAL' | 'APPLE_PAY' | 'GOOGLE_PAY' | 'SEPA_DEBIT';
1016
- declare type ProcessorName = 'stripe' | 'braintree' | 'authorize' | 'shopify_payments' | 'mollie';
1017
- declare type PaymentMethodStatus = 'not_validated' | 'valid' | 'invalid';
1018
- interface PaymentMethod {
1019
- /** The unique payment method id for a customer. */
1154
+ interface CDNProductOption {
1020
1155
  id: number;
1021
- /** An object with the customer’s address information. */
1022
- billing_address: AssociatedAddress;
1023
- /** The Recharge customer_id */
1024
- customer_id: number;
1025
- /** The time the payment method was created. */
1026
- created_at: IsoDateString;
1027
- /** If this is the default payment method for the customer */
1028
- default: boolean;
1029
- /** Details about the specific payment method */
1030
- payment_details: PaymentDetails;
1031
- /**
1032
- * The type of payment this is.
1033
- * If passed, must also be accompanied by one of stripe_customer_token, paypal_customer_token or authorizedotnet_customer_token in processor_payment_method_token.
1034
- */
1035
- payment_type: PaymentType;
1036
- /** The customer token at the processor. */
1037
- processor_customer_token: string;
1038
- /**
1039
- * This will impact validation on billing_details.
1040
- * Currently, shopify_payments is in read-only mode and can only be managed by Shopify.
1041
- */
1042
- processor_name: ProcessorName;
1043
- /** The payment token at the processor. */
1044
- processor_payment_method_token: string;
1045
- /** State of the Payment Method. */
1046
- status: PaymentMethodStatus;
1047
- /**
1048
- * The status reason for the payment method.
1049
- * Often used when invalid to provide background details in invalidity.
1050
- */
1051
- status_reason: string;
1052
- /** The time the payment method was last updated. */
1053
- updated_at: IsoDateString;
1156
+ name: string;
1157
+ position: number;
1158
+ values: CDNProductOptionValue[];
1054
1159
  }
1055
- interface PaymentMethodsResponse {
1056
- next_cursor: null | string;
1057
- previous_cursor: null | string;
1058
- payment_methods: PaymentMethod[];
1160
+ interface CDNProductRaw {
1161
+ id: number | null;
1162
+ bundle_product?: CDNBundleSettings | null;
1163
+ external_product_id: number;
1164
+ in_recharge: boolean;
1165
+ options: CDNProductOption[];
1166
+ variants: CDNVariant[];
1167
+ subscription_options: CDNSubscriptionOption;
1168
+ selling_plan_groups: CDNSellingPlanGroup[];
1059
1169
  }
1060
- declare type PaymentMethodOptionalUpdateProps = 'billing_address' | 'default';
1061
- declare type UpdatePaymentMethodRequest = Partial<Pick<PaymentMethod, PaymentMethodOptionalUpdateProps>>;
1062
- /** no sorting options for payment_methods, always by id-desc */
1063
- declare type PaymentMethodSortBy = null;
1064
- interface PaymentMethodListParams extends ListParams<PaymentMethodSortBy> {
1065
- /** Return the payment_methods linked to the given processor_name. */
1066
- processor_name?: ProcessorName;
1067
- /** Return the payment_methods linked to the given address_id. */
1068
- address_id?: string;
1069
- /** Return the payment_methods linked to the given processor_payment_method_token. */
1070
- processor_payment_method_token?: string;
1170
+ interface CDNProduct extends CDNProductRaw {
1171
+ /** @deprecated */
1172
+ isSubscriptionOnly: boolean;
1173
+ is_subscription_only: boolean;
1071
1174
  }
1072
-
1073
- declare type SubscriptionStatus = 'active' | 'cancelled' | 'expired';
1074
- interface Subscription {
1075
- /** Unique numeric identifier for the subscription. */
1076
- id: number;
1077
- /** Unique numeric identifier for the address the subscription is associated with. */
1078
- address_id: number;
1079
- /** Unique numeric identifier for the customer the subscription is tied to. */
1080
- customer_id: number;
1081
- /** An object used to contain analytics data such as utm parameters. */
1082
- analytics_data: AnalyticsData;
1083
- /** Reason provided for cancellation. */
1084
- cancellation_reason: string | null;
1085
- /** Additional comment for cancellation. */
1086
- cancellation_reason_comments: string | null;
1087
- /** The time the subscription was cancelled. */
1088
- cancelled_at: string | null;
1089
- /**
1090
- * 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.
1091
- * Charges must use the same unit types as orders.
1092
- * Max: 1000
1093
- */
1094
- charge_interval_frequency: number;
1095
- /** The time the subscription was created. */
1096
- created_at: IsoDateString;
1097
- /** Set the number of charges until subscription expires. */
1098
- expire_after_specific_number_of_charges: number | null;
1099
- /** An object containing the product id as it appears in external platforms. */
1100
- external_product_id: ExternalId;
1101
- /** An object containing the variant id as it appears in external platforms. */
1102
- external_variant_id: ExternalId;
1103
- /** Retrieves true if there is queued charge. Otherwise, retrieves false. */
1104
- has_queued_charges: boolean;
1105
- /** Value is set to true if it is a prepaid item. */
1106
- is_prepaid: boolean;
1107
- /** Value is set to true if it is not a prepaid item */
1108
- is_skippable: boolean;
1109
- /** Value is set to true if it is not a prepaid item and if in Customer portal settings swap is allowed for customers. */
1110
- is_swappable: boolean;
1111
- /** Retrieves true if charge has an error max retries reached. Otherwise, retrieves false. */
1112
- max_retries_reached: boolean;
1113
- /** Date of the next charge for the subscription. */
1114
- next_charge_scheduled_at: IsoDateString;
1115
- /**
1116
- * 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.
1117
- * This is only applicable to subscriptions with order_interval_unit:“month”.
1118
- */
1119
- order_day_of_month: number | null;
1120
- /**
1121
- * The set day of the week order is created. Default is that there isn’t a strict day of the week order is created.
1122
- * This is only applicable to subscriptions with order_interval_unit = “week”.
1123
- * Value of 0 equals to Monday, 1 to Tuesday etc.
1124
- */
1125
- order_day_of_week: number | null;
1126
- /**
1127
- * 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
1128
- */
1129
- order_interval_frequency: number;
1130
- /** The frequency unit used to determine when a subscription’s order is created. */
1131
- order_interval_unit: IntervalUnit;
1132
- /** The presentment currency of the subscription. */
1133
- presentment_currency: string | null;
1134
- /** The price of the item before discounts, taxes, or shipping have been applied. */
1135
- price: string;
1136
- /** The name of the product in a store’s catalog. */
1137
- product_title: string;
1138
- /** 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. */
1139
- properties: Property[];
1140
- /** The number of items in the subscription. */
1141
- quantity: number;
1142
- /** A unique identifier of the item in the fulfillment. In cases where SKU is blank, it will be dynamically pulled whenever it is used. */
1143
- sku: string | null;
1144
- /** 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. */
1145
- sku_override: boolean;
1146
- /**
1147
- * The status of the subscription.
1148
- * expired - This status occurs when the maximum number of charges for a product has been reached.
1149
- */
1150
- status: SubscriptionStatus;
1151
- /** The date time at which the purchase_item record was last updated. */
1152
- updated_at: IsoDateString;
1153
- /** The name of the variant in a shop’s catalog. */
1154
- variant_title: string;
1175
+ interface CDNProductAndSettings {
1176
+ product: CDNProduct;
1177
+ widget_settings: CDNWidgetSettings;
1178
+ store_settings: CDNStoreSettings;
1179
+ /** @deprecated */
1180
+ widgetSettings: CDNWidgetSettings;
1181
+ /** @deprecated */
1182
+ storeSettings: CDNStoreSettings;
1183
+ }
1184
+ interface CDNProductsAndSettings {
1185
+ products: CDNProductKeyObject[];
1186
+ widget_settings: CDNWidgetSettings;
1187
+ store_settings: Partial<CDNStoreSettings>;
1188
+ }
1189
+ interface CDNBaseWidgetSettings {
1190
+ active_color: ColorString;
1191
+ auto_inject?: boolean;
1192
+ background_color: ColorString;
1193
+ bundle_translations?: BundleTranslations;
1194
+ delivery_dropdown_label: string;
1195
+ display_on: string[];
1196
+ first_option: FirstOption;
1197
+ font_color: ColorString;
1198
+ form_type: string;
1199
+ how_it_works: HTMLString;
1200
+ learnmore_url: string;
1201
+ learnmore_verbiage: string;
1202
+ onetime_message: string;
1203
+ popup_background_color: ColorString;
1204
+ popup_link_color: ColorString;
1205
+ popup_text_color: ColorString;
1206
+ poweredby_url: string;
1207
+ published: boolean;
1208
+ select_subscription_first: boolean;
1209
+ show_learnmore: boolean;
1210
+ show_poweredby: boolean;
1211
+ show_subscription_details: boolean;
1212
+ show_subscription_details_icon: boolean;
1213
+ sub_and_save_ext_label: string;
1214
+ subscribe_message: string;
1215
+ subscribe_without_discount_message: string;
1216
+ subscription_details_verbiage: string;
1217
+ translations: Translations;
1218
+ /** Whether or not plans data will be used on the widget */
1219
+ use_plans_data?: boolean;
1220
+ widget_charge_every: string;
1221
+ widget_deliver_every: string;
1222
+ widget_icon: WidgetIconColor;
1223
+ widget_template_type: WidgetTemplateType;
1155
1224
  }
1156
- interface SubscriptionsResponse {
1157
- next_cursor: null | string;
1158
- previous_cursor: null | string;
1159
- subscriptions: Subscription[];
1225
+ declare type CDNExcludedWidgetSettings = 'display_on' | 'first_option';
1226
+ interface CDNWidgetSettings extends Omit<CDNBaseWidgetSettings, CDNExcludedWidgetSettings> {
1227
+ /** @deprecated */
1228
+ autoInject: boolean;
1229
+ /** @deprecated */
1230
+ validPages: string[];
1231
+ /** @deprecated */
1232
+ isSubscriptionFirst: boolean;
1233
+ auto_inject: boolean;
1234
+ valid_pages: string[];
1235
+ is_subscription_first: boolean;
1160
1236
  }
1161
- declare type SubscriptionSortBy = 'id-asc' | 'id-desc' | 'created_at-asc' | 'created_at-desc' | 'updated_at-asc' | 'updated_at-desc';
1162
- interface SubscriptionListParams extends ListParams<SubscriptionSortBy> {
1163
- /** Return the subscriptions linked to the given address_id. */
1164
- address_id?: string;
1165
- /** Return the subscriptions linked to the given address_ids. */
1166
- address_ids?: string[];
1167
- /** Return the subscriptions created before the given date. */
1168
- created_at_max?: IsoDateString;
1169
- /** Return the subscriptions created after the given date. */
1170
- created_at_min?: IsoDateString;
1171
- /** Return the subscriptions linked to the given external_variant_id */
1172
- external_variant_id?: string;
1173
- /** Comma-separated list of subscription_ids to filter */
1174
- ids?: string[];
1175
- /** Return the subscriptions with specified status. */
1176
- status?: SubscriptionStatus;
1177
- /** Return the subscriptions updated before the given date. */
1178
- updated_at_max?: IsoDateString;
1179
- /** Return the subscriptions updated after the given date. */
1180
- updated_at_min?: IsoDateString;
1237
+ declare type CDNWidgetSettingsRaw = {
1238
+ [key in keyof CDNBaseWidgetSettings]: string;
1239
+ };
1240
+ interface CDNWidgetSettingsResource {
1241
+ widget_settings: CDNWidgetSettingsRaw;
1242
+ meta: {
1243
+ version: string;
1244
+ };
1181
1245
  }
1182
- declare type SubscriptionRequiredCreateProps = 'address_id' | 'charge_interval_frequency' | 'external_variant_id' | 'next_charge_scheduled_at' | 'order_interval_frequency' | 'order_interval_unit' | 'quantity';
1183
- 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';
1184
- declare type CreateSubscriptionRequest = SubType<Subscription, SubscriptionRequiredCreateProps, SubscriptionOptionalCreateProps>;
1185
- 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';
1186
- declare type UpdateSubscriptionRequest = Partial<Pick<Subscription, SubscriptionOptionalUpdateProps>>;
1187
- interface UpdateSubscriptionParams {
1188
- /** 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. */
1189
- commit?: boolean;
1246
+ interface CDNStoreSettings {
1247
+ store_currency: {
1248
+ currency_code: string;
1249
+ currency_symbol: string;
1250
+ decimal_separator: string;
1251
+ thousands_separator: string;
1252
+ currency_symbol_location: string;
1253
+ zero_decimal_currency?: boolean;
1254
+ };
1190
1255
  }
1191
- interface CancelSubscriptionRequest {
1192
- cancellation_reason: string;
1193
- cancellation_reason_comments?: string;
1194
- send_email?: boolean;
1256
+ /****************** 2021-08 **********************/
1257
+ /**************** Bundles ****************/
1258
+ interface CDNBundleStepOption {
1259
+ content: string;
1260
+ defaultImage: string;
1195
1261
  }
1196
-
1197
- declare type CustomerIncludes = 'addresses' | 'payment_methods' | 'subscriptions';
1198
- interface GetCustomerOptions {
1199
- include: CustomerIncludes[];
1262
+ interface CDNBundleStep {
1263
+ data?: {
1264
+ optionsMeta: {
1265
+ [key: string]: CDNBundleStepOption;
1266
+ };
1267
+ };
1268
+ disable: boolean;
1269
+ index: string;
1270
+ name: string;
1271
+ title: string;
1272
+ type: 'variantSelector' | 'all-collections' | 'addons' | 'summary' | 'cross-sells';
1200
1273
  }
1201
- interface Customer {
1202
- /** Unique numeric identifier for the Customer. */
1203
- id: number;
1204
- /** An object containing analytics data associated with the customer. */
1205
- analytics_data: AnalyticsData;
1206
- /** The date and time when the customer was created. */
1207
- created_at: IsoDateString;
1208
- /** The email address of the customer. */
1209
- email: string;
1210
- /** An object containing external ids for the customer record. */
1211
- external_customer_id: ExternalId;
1212
- /** Date when first charge was processed for the customer. */
1213
- first_charge_processed_at: IsoDateString;
1214
- /** The customer’s first name. */
1215
- first_name: string;
1216
- /** A boolean that indicates if the customer has a payment method that is in dunning (failed charge). */
1217
- has_payment_method_in_dunning: boolean;
1218
- /** Is the payment method valid or not. */
1219
- has_valid_payment_method: boolean;
1220
- /** The unique string identifier used in a customers portal link. */
1221
- hash: string;
1222
- /** The customer’s last name. */
1223
- last_name: string;
1224
- /** The number of active subscriptions on addresses associated with the customer. */
1225
- subscriptions_active_count: number;
1226
- /** The total number of subscriptions created on addresses associated with the customer. */
1227
- subscriptions_total_count: number;
1228
- /** The date and time when the customer was last updated. */
1229
- updated_at: IsoDateString;
1230
- /** Additional information as requested */
1231
- include?: {
1232
- addresses?: Address[];
1233
- payment_methods?: PaymentMethod[];
1234
- subscriptions?: Subscription[];
1274
+ interface CDNBundleLayoutSettings {
1275
+ addToCartCallback: {
1276
+ type: 'none';
1277
+ value: string;
1278
+ };
1279
+ addons: {
1280
+ collectionHandle: string;
1281
+ collectionId: string;
1282
+ enabled: boolean;
1283
+ };
1284
+ collapsibleSections: boolean;
1285
+ crossSells: {
1286
+ collectionId: string;
1287
+ enabled: boolean;
1288
+ collectionHandle: string;
1289
+ };
1290
+ defaultFrequency: string;
1291
+ defaultVariantId: string;
1292
+ description: string;
1293
+ filters: any[];
1294
+ learnMoreModal: boolean;
1295
+ published: boolean;
1296
+ showVariants: boolean;
1297
+ template: 'one-page' | 'multi-step';
1298
+ templateSettings: {
1299
+ onePage: {
1300
+ frequencySelector: 'dropdown';
1301
+ };
1302
+ multiStep?: {
1303
+ steps: CDNBundleStep[];
1304
+ optionImages: string;
1305
+ };
1306
+ };
1307
+ title: string;
1308
+ visibility: {
1309
+ portal: boolean;
1310
+ signup: boolean;
1235
1311
  };
1236
1312
  }
1237
- declare type CustomerOptionalUpdateProps = 'email' | 'first_name' | 'last_name' | 'external_customer_id';
1238
- declare type UpdateCustomerRequest = Partial<Pick<Customer, CustomerOptionalUpdateProps>>;
1239
- interface CustomerDeliveryScheduleParams {
1240
- delivery_count_future?: number;
1241
- future_internal?: number;
1242
- date_max?: IsoDateString;
1313
+ interface CDNBundleVariantOptionSource {
1314
+ id: number;
1315
+ collection_id: string;
1316
+ quantity_max: number | null;
1317
+ quantity_min: number | null;
1243
1318
  }
1244
- 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'> & {
1245
- /** Value is set to true if it is not a onetime or a prepaid item */
1246
- is_skippable: boolean;
1247
- /** Value is set to true if the order is skipped. */
1248
- is_skipped: boolean;
1249
- /** The type of the plan. May return null value in certain cases. */
1250
- plan_type: 'subscription' | 'onetime';
1251
- /** Value is set to true if it is a prepaid item */
1252
- is_prepaid: boolean;
1253
- /** The name of the product in a store’s catalog. */
1254
- product_title: string;
1255
- /** Unique numeric identifier for the subscription linked to this line_item in the order. */
1256
- subscription_id: number;
1257
- /** The subtotal price (sum of all line items * their quantity) of the order less discounts. */
1258
- subtotal_price: string;
1259
- };
1260
- 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'> & {
1261
- payment_details: PaymentDetails;
1262
- billing_address: AssociatedAddress;
1263
- };
1264
- interface DeliveryOrder {
1319
+ interface CDNBundleVariantSelectionDefault {
1265
1320
  id: number;
1266
- address_id: number;
1267
- charge_id: number;
1268
- line_items: DeliveryLineItem[];
1269
- payment_method: DeliveryPaymentMethod;
1270
- shipping_address: AssociatedAddress;
1271
- order_subtotal: string;
1272
- currency: string;
1321
+ quantity: number;
1322
+ external_variant_id: string;
1273
1323
  }
1274
- interface Delivery {
1275
- date: IsoDateString;
1276
- orders: DeliveryOrder[];
1324
+ interface CDNBundleVariant {
1325
+ enabled: boolean;
1326
+ external_variant_id: string;
1327
+ id: number;
1328
+ items_count: number;
1329
+ option_sources: CDNBundleVariantOptionSource[];
1330
+ selection_defaults?: CDNBundleVariantSelectionDefault[];
1277
1331
  }
1278
- interface CustomerDeliveryScheduleResponse {
1279
- customer: {
1280
- id: number;
1281
- email: string;
1282
- first_name: string;
1283
- last_name: string;
1284
- };
1285
- deliveries: Delivery[];
1332
+ interface CDNBundleSettings {
1333
+ customization_window_disabled_message: string | null;
1334
+ customization_window?: number;
1335
+ default_bundle_variant_id?: number;
1336
+ description: string | null;
1337
+ external_product_id: string;
1338
+ id: number;
1339
+ is_customizable?: boolean;
1340
+ layout_settings: CDNBundleLayoutSettings;
1341
+ layout_settings_version: '2021-11';
1342
+ max_quantity_per_variant: number | null;
1343
+ reset_box_contents?: boolean;
1344
+ variants: CDNBundleVariant[];
1286
1345
  }
1287
1346
 
1288
1347
  /** @internal */
@@ -1562,14 +1621,14 @@ declare function deleteOnetime(session: Session, id: string | number): Promise<v
1562
1621
  declare function getOrder(session: Session, id: string | number): Promise<Order>;
1563
1622
  declare function listOrders(session: Session, query?: OrderListParams): Promise<OrdersResponse>;
1564
1623
 
1565
- declare function getPaymentMethod(session: Session, id: string | number): Promise<PaymentMethod>;
1624
+ declare function getPaymentMethod(session: Session, id: string | number, options?: GetPaymentMethodOptions): Promise<PaymentMethod>;
1566
1625
  declare function updatePaymentMethod(session: Session, id: string | number, updateRequest: UpdatePaymentMethodRequest): Promise<PaymentMethod>;
1567
1626
  declare function listPaymentMethods(session: Session, query?: PaymentMethodListParams): Promise<PaymentMethodsResponse>;
1568
1627
 
1569
1628
  declare function getPlan(session: Session, id: string | number): Promise<Plan>;
1570
1629
  declare function listPlans(session: Session, query?: PlanListParams): Promise<PlansResponse>;
1571
1630
 
1572
- declare function getSubscription(session: Session, id: string | number): Promise<Subscription>;
1631
+ declare function getSubscription(session: Session, id: string | number, options?: GetSubscriptionOptions): Promise<Subscription>;
1573
1632
  declare function listSubscriptions(session: Session, query?: SubscriptionListParams): Promise<SubscriptionsResponse>;
1574
1633
  /**
1575
1634
  * When creating a subscription via API, order_interval_frequency and charge_interval_frequency values do not necessarily
@@ -1616,4 +1675,4 @@ declare const api: {
1616
1675
  };
1617
1676
  declare function initRecharge(opt?: InitOptions): void;
1618
1677
 
1619
- 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, DeliveryLineItem, DeliveryOrder, DeliveryPaymentMethod, 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 };
1678
+ 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, PasswordlessCodeResponse, PasswordlessValidateResponse, 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, sendPasswordlessCode, sendPasswordlessCodeAppProxy, skipCharge, skipFutureCharge, skipSubscriptionCharge, unskipCharge, updateAddress, updateCustomer, updateOnetime, updatePaymentMethod, updateSubscription, updateSubscriptionAddress, updateSubscriptionChargeDate, validateBundle, validateDynamicBundle, validatePasswordlessCode, validatePasswordlessCodeAppProxy };