@rechargeapps/storefront-client 0.20.1 → 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 +712 -666
- package/dist/umd/recharge-client.min.js +3 -3
- package/package.json +1 -1
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
|
-
|
|
402
|
-
|
|
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
|
-
/**
|
|
405
|
-
|
|
406
|
-
/**
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
|
|
410
|
-
/** The
|
|
411
|
-
|
|
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
|
|
463
|
-
*
|
|
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
|
-
|
|
466
|
-
/**
|
|
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
|
-
/**
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
/**
|
|
529
|
-
|
|
530
|
-
/**
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
|
|
547
|
-
/**
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
|
|
551
|
-
/**
|
|
552
|
-
|
|
553
|
-
/**
|
|
554
|
-
|
|
555
|
-
/**
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
|
|
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>;
|
|
@@ -568,7 +905,7 @@ declare function skipFutureCharge(session: Session, id: string | number, skipReq
|
|
|
568
905
|
declare function loginShopifyAppProxy(): Promise<Session>;
|
|
569
906
|
declare function loginShopifyApi(shopifyStorefrontToken: string, shopifyCustomerAccessToken?: string): Promise<Session | null>;
|
|
570
907
|
|
|
571
|
-
declare function getCharge(session: Session, id: number | string): Promise<Charge>;
|
|
908
|
+
declare function getCharge(session: Session, id: number | string, options?: GetChargeOptions): Promise<Charge>;
|
|
572
909
|
/** Lists charges */
|
|
573
910
|
declare function listCharges(session: Session, query?: ChargeListParams): Promise<ChargeListResponse>;
|
|
574
911
|
/**
|
|
@@ -750,539 +1087,248 @@ interface CDNProductsAndSettingsResource {
|
|
|
750
1087
|
widget_settings: CDNWidgetSettingsRaw;
|
|
751
1088
|
store_settings?: CDNStoreSettings;
|
|
752
1089
|
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;
|
|
1090
|
+
status: string;
|
|
1091
|
+
message: string;
|
|
961
1092
|
};
|
|
962
1093
|
}
|
|
963
|
-
interface
|
|
1094
|
+
interface CDNSellingPlan {
|
|
1095
|
+
order_interval_frequency: string | number;
|
|
1096
|
+
created_at?: IsoDateString;
|
|
1097
|
+
order_interval_unit_type: IntervalUnit;
|
|
1098
|
+
updated_at?: IsoDateString;
|
|
964
1099
|
id: number;
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1100
|
+
selling_plan_id: number;
|
|
1101
|
+
selling_plan_name: string;
|
|
1102
|
+
price_adjustments_value_type: PriceAdjustmentsType;
|
|
1103
|
+
price_adjustments_value: number;
|
|
968
1104
|
}
|
|
969
|
-
interface
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1105
|
+
interface CDNSellingPlanGroup {
|
|
1106
|
+
selling_plan_group_id: string | number;
|
|
1107
|
+
selling_plans: CDNSellingPlan[];
|
|
1108
|
+
subscription_product_id: number;
|
|
973
1109
|
}
|
|
974
|
-
interface
|
|
975
|
-
|
|
976
|
-
|
|
1110
|
+
interface CDNSubscriptionOption {
|
|
1111
|
+
storefront_purchase_options: StorefrontPurchaseOption;
|
|
1112
|
+
updated_at: IsoDateString;
|
|
1113
|
+
is_prepaid?: boolean;
|
|
1114
|
+
}
|
|
1115
|
+
interface CDNSellingPlanAllocations {
|
|
1116
|
+
selling_plan_group_id: string | number;
|
|
1117
|
+
selling_plan_id: number;
|
|
1118
|
+
discounted_price: string;
|
|
1119
|
+
}
|
|
1120
|
+
interface CDNPrices {
|
|
1121
|
+
compare_at_price: string | null;
|
|
1122
|
+
unit_price: string;
|
|
1123
|
+
discounted_price: string;
|
|
1124
|
+
zero_decimal_currency: boolean;
|
|
1125
|
+
}
|
|
1126
|
+
interface CDNVariantOptionValue {
|
|
977
1127
|
id: number;
|
|
978
|
-
|
|
979
|
-
option_sources: CDNBundleVariantOptionSource[];
|
|
980
|
-
selection_defaults?: CDNBundleVariantSelectionDefault[];
|
|
1128
|
+
label: string;
|
|
981
1129
|
}
|
|
982
|
-
interface
|
|
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;
|
|
1130
|
+
interface CDNVariant {
|
|
988
1131
|
id: number;
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
max_quantity_per_variant: number | null;
|
|
993
|
-
reset_box_contents?: boolean;
|
|
994
|
-
variants: CDNBundleVariant[];
|
|
1132
|
+
option_values: CDNVariantOptionValue[];
|
|
1133
|
+
prices: CDNPrices;
|
|
1134
|
+
selling_plan_allocations: CDNSellingPlanAllocations[];
|
|
995
1135
|
}
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
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;
|
|
1136
|
+
interface CDNProductOptionValue {
|
|
1137
|
+
id?: number | null;
|
|
1138
|
+
label: string;
|
|
1139
|
+
position: number;
|
|
1014
1140
|
}
|
|
1015
|
-
|
|
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. */
|
|
1141
|
+
interface CDNProductOption {
|
|
1020
1142
|
id: number;
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
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;
|
|
1143
|
+
name: string;
|
|
1144
|
+
position: number;
|
|
1145
|
+
values: CDNProductOptionValue[];
|
|
1054
1146
|
}
|
|
1055
|
-
interface
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1147
|
+
interface CDNProductRaw {
|
|
1148
|
+
id: number | null;
|
|
1149
|
+
bundle_product?: CDNBundleSettings | null;
|
|
1150
|
+
external_product_id: number;
|
|
1151
|
+
in_recharge: boolean;
|
|
1152
|
+
options: CDNProductOption[];
|
|
1153
|
+
variants: CDNVariant[];
|
|
1154
|
+
subscription_options: CDNSubscriptionOption;
|
|
1155
|
+
selling_plan_groups: CDNSellingPlanGroup[];
|
|
1059
1156
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
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;
|
|
1157
|
+
interface CDNProduct extends CDNProductRaw {
|
|
1158
|
+
/** @deprecated */
|
|
1159
|
+
isSubscriptionOnly: boolean;
|
|
1160
|
+
is_subscription_only: boolean;
|
|
1071
1161
|
}
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
/**
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
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;
|
|
1162
|
+
interface CDNProductAndSettings {
|
|
1163
|
+
product: CDNProduct;
|
|
1164
|
+
widget_settings: CDNWidgetSettings;
|
|
1165
|
+
store_settings: CDNStoreSettings;
|
|
1166
|
+
/** @deprecated */
|
|
1167
|
+
widgetSettings: CDNWidgetSettings;
|
|
1168
|
+
/** @deprecated */
|
|
1169
|
+
storeSettings: CDNStoreSettings;
|
|
1170
|
+
}
|
|
1171
|
+
interface CDNProductsAndSettings {
|
|
1172
|
+
products: CDNProductKeyObject[];
|
|
1173
|
+
widget_settings: CDNWidgetSettings;
|
|
1174
|
+
store_settings: Partial<CDNStoreSettings>;
|
|
1175
|
+
}
|
|
1176
|
+
interface CDNBaseWidgetSettings {
|
|
1177
|
+
active_color: ColorString;
|
|
1178
|
+
auto_inject?: boolean;
|
|
1179
|
+
background_color: ColorString;
|
|
1180
|
+
bundle_translations?: BundleTranslations;
|
|
1181
|
+
delivery_dropdown_label: string;
|
|
1182
|
+
display_on: string[];
|
|
1183
|
+
first_option: FirstOption;
|
|
1184
|
+
font_color: ColorString;
|
|
1185
|
+
form_type: string;
|
|
1186
|
+
how_it_works: HTMLString;
|
|
1187
|
+
learnmore_url: string;
|
|
1188
|
+
learnmore_verbiage: string;
|
|
1189
|
+
onetime_message: string;
|
|
1190
|
+
popup_background_color: ColorString;
|
|
1191
|
+
popup_link_color: ColorString;
|
|
1192
|
+
popup_text_color: ColorString;
|
|
1193
|
+
poweredby_url: string;
|
|
1194
|
+
published: boolean;
|
|
1195
|
+
select_subscription_first: boolean;
|
|
1196
|
+
show_learnmore: boolean;
|
|
1197
|
+
show_poweredby: boolean;
|
|
1198
|
+
show_subscription_details: boolean;
|
|
1199
|
+
show_subscription_details_icon: boolean;
|
|
1200
|
+
sub_and_save_ext_label: string;
|
|
1201
|
+
subscribe_message: string;
|
|
1202
|
+
subscribe_without_discount_message: string;
|
|
1203
|
+
subscription_details_verbiage: string;
|
|
1204
|
+
translations: Translations;
|
|
1205
|
+
/** Whether or not plans data will be used on the widget */
|
|
1206
|
+
use_plans_data?: boolean;
|
|
1207
|
+
widget_charge_every: string;
|
|
1208
|
+
widget_deliver_every: string;
|
|
1209
|
+
widget_icon: WidgetIconColor;
|
|
1210
|
+
widget_template_type: WidgetTemplateType;
|
|
1155
1211
|
}
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1212
|
+
declare type CDNExcludedWidgetSettings = 'display_on' | 'first_option';
|
|
1213
|
+
interface CDNWidgetSettings extends Omit<CDNBaseWidgetSettings, CDNExcludedWidgetSettings> {
|
|
1214
|
+
/** @deprecated */
|
|
1215
|
+
autoInject: boolean;
|
|
1216
|
+
/** @deprecated */
|
|
1217
|
+
validPages: string[];
|
|
1218
|
+
/** @deprecated */
|
|
1219
|
+
isSubscriptionFirst: boolean;
|
|
1220
|
+
auto_inject: boolean;
|
|
1221
|
+
valid_pages: string[];
|
|
1222
|
+
is_subscription_first: boolean;
|
|
1160
1223
|
}
|
|
1161
|
-
declare type
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
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;
|
|
1224
|
+
declare type CDNWidgetSettingsRaw = {
|
|
1225
|
+
[key in keyof CDNBaseWidgetSettings]: string;
|
|
1226
|
+
};
|
|
1227
|
+
interface CDNWidgetSettingsResource {
|
|
1228
|
+
widget_settings: CDNWidgetSettingsRaw;
|
|
1229
|
+
meta: {
|
|
1230
|
+
version: string;
|
|
1231
|
+
};
|
|
1181
1232
|
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1233
|
+
interface CDNStoreSettings {
|
|
1234
|
+
store_currency: {
|
|
1235
|
+
currency_code: string;
|
|
1236
|
+
currency_symbol: string;
|
|
1237
|
+
decimal_separator: string;
|
|
1238
|
+
thousands_separator: string;
|
|
1239
|
+
currency_symbol_location: string;
|
|
1240
|
+
zero_decimal_currency?: boolean;
|
|
1241
|
+
};
|
|
1190
1242
|
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1243
|
+
/****************** 2021-08 **********************/
|
|
1244
|
+
/**************** Bundles ****************/
|
|
1245
|
+
interface CDNBundleStepOption {
|
|
1246
|
+
content: string;
|
|
1247
|
+
defaultImage: string;
|
|
1195
1248
|
}
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1249
|
+
interface CDNBundleStep {
|
|
1250
|
+
data?: {
|
|
1251
|
+
optionsMeta: {
|
|
1252
|
+
[key: string]: CDNBundleStepOption;
|
|
1253
|
+
};
|
|
1254
|
+
};
|
|
1255
|
+
disable: boolean;
|
|
1256
|
+
index: string;
|
|
1257
|
+
name: string;
|
|
1258
|
+
title: string;
|
|
1259
|
+
type: 'variantSelector' | 'all-collections' | 'addons' | 'summary' | 'cross-sells';
|
|
1200
1260
|
}
|
|
1201
|
-
interface
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1261
|
+
interface CDNBundleLayoutSettings {
|
|
1262
|
+
addToCartCallback: {
|
|
1263
|
+
type: 'none';
|
|
1264
|
+
value: string;
|
|
1265
|
+
};
|
|
1266
|
+
addons: {
|
|
1267
|
+
collectionHandle: string;
|
|
1268
|
+
collectionId: string;
|
|
1269
|
+
enabled: boolean;
|
|
1270
|
+
};
|
|
1271
|
+
collapsibleSections: boolean;
|
|
1272
|
+
crossSells: {
|
|
1273
|
+
collectionId: string;
|
|
1274
|
+
enabled: boolean;
|
|
1275
|
+
collectionHandle: string;
|
|
1276
|
+
};
|
|
1277
|
+
defaultFrequency: string;
|
|
1278
|
+
defaultVariantId: string;
|
|
1279
|
+
description: string;
|
|
1280
|
+
filters: any[];
|
|
1281
|
+
learnMoreModal: boolean;
|
|
1282
|
+
published: boolean;
|
|
1283
|
+
showVariants: boolean;
|
|
1284
|
+
template: 'one-page' | 'multi-step';
|
|
1285
|
+
templateSettings: {
|
|
1286
|
+
onePage: {
|
|
1287
|
+
frequencySelector: 'dropdown';
|
|
1288
|
+
};
|
|
1289
|
+
multiStep?: {
|
|
1290
|
+
steps: CDNBundleStep[];
|
|
1291
|
+
optionImages: string;
|
|
1292
|
+
};
|
|
1293
|
+
};
|
|
1294
|
+
title: string;
|
|
1295
|
+
visibility: {
|
|
1296
|
+
portal: boolean;
|
|
1297
|
+
signup: boolean;
|
|
1235
1298
|
};
|
|
1236
1299
|
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
date_max?: IsoDateString;
|
|
1300
|
+
interface CDNBundleVariantOptionSource {
|
|
1301
|
+
id: number;
|
|
1302
|
+
collection_id: string;
|
|
1303
|
+
quantity_max: number | null;
|
|
1304
|
+
quantity_min: number | null;
|
|
1243
1305
|
}
|
|
1244
|
-
|
|
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 {
|
|
1306
|
+
interface CDNBundleVariantSelectionDefault {
|
|
1265
1307
|
id: number;
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
line_items: DeliveryLineItem[];
|
|
1269
|
-
payment_method: DeliveryPaymentMethod;
|
|
1270
|
-
shipping_address: AssociatedAddress;
|
|
1271
|
-
order_subtotal: string;
|
|
1272
|
-
currency: string;
|
|
1308
|
+
quantity: number;
|
|
1309
|
+
external_variant_id: string;
|
|
1273
1310
|
}
|
|
1274
|
-
interface
|
|
1275
|
-
|
|
1276
|
-
|
|
1311
|
+
interface CDNBundleVariant {
|
|
1312
|
+
enabled: boolean;
|
|
1313
|
+
external_variant_id: string;
|
|
1314
|
+
id: number;
|
|
1315
|
+
items_count: number;
|
|
1316
|
+
option_sources: CDNBundleVariantOptionSource[];
|
|
1317
|
+
selection_defaults?: CDNBundleVariantSelectionDefault[];
|
|
1277
1318
|
}
|
|
1278
|
-
interface
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1319
|
+
interface CDNBundleSettings {
|
|
1320
|
+
customization_window_disabled_message: string | null;
|
|
1321
|
+
customization_window?: number;
|
|
1322
|
+
default_bundle_variant_id?: number;
|
|
1323
|
+
description: string | null;
|
|
1324
|
+
external_product_id: string;
|
|
1325
|
+
id: number;
|
|
1326
|
+
is_customizable?: boolean;
|
|
1327
|
+
layout_settings: CDNBundleLayoutSettings;
|
|
1328
|
+
layout_settings_version: '2021-11';
|
|
1329
|
+
max_quantity_per_variant: number | null;
|
|
1330
|
+
reset_box_contents?: boolean;
|
|
1331
|
+
variants: CDNBundleVariant[];
|
|
1286
1332
|
}
|
|
1287
1333
|
|
|
1288
1334
|
/** @internal */
|
|
@@ -1562,14 +1608,14 @@ declare function deleteOnetime(session: Session, id: string | number): Promise<v
|
|
|
1562
1608
|
declare function getOrder(session: Session, id: string | number): Promise<Order>;
|
|
1563
1609
|
declare function listOrders(session: Session, query?: OrderListParams): Promise<OrdersResponse>;
|
|
1564
1610
|
|
|
1565
|
-
declare function getPaymentMethod(session: Session, id: string | number): Promise<PaymentMethod>;
|
|
1611
|
+
declare function getPaymentMethod(session: Session, id: string | number, options?: GetPaymentMethodOptions): Promise<PaymentMethod>;
|
|
1566
1612
|
declare function updatePaymentMethod(session: Session, id: string | number, updateRequest: UpdatePaymentMethodRequest): Promise<PaymentMethod>;
|
|
1567
1613
|
declare function listPaymentMethods(session: Session, query?: PaymentMethodListParams): Promise<PaymentMethodsResponse>;
|
|
1568
1614
|
|
|
1569
1615
|
declare function getPlan(session: Session, id: string | number): Promise<Plan>;
|
|
1570
1616
|
declare function listPlans(session: Session, query?: PlanListParams): Promise<PlansResponse>;
|
|
1571
1617
|
|
|
1572
|
-
declare function getSubscription(session: Session, id: string | number): Promise<Subscription>;
|
|
1618
|
+
declare function getSubscription(session: Session, id: string | number, options?: GetSubscriptionOptions): Promise<Subscription>;
|
|
1573
1619
|
declare function listSubscriptions(session: Session, query?: SubscriptionListParams): Promise<SubscriptionsResponse>;
|
|
1574
1620
|
/**
|
|
1575
1621
|
* When creating a subscription via API, order_interval_frequency and charge_interval_frequency values do not necessarily
|
|
@@ -1616,4 +1662,4 @@ declare const api: {
|
|
|
1616
1662
|
};
|
|
1617
1663
|
declare function initRecharge(opt?: InitOptions): void;
|
|
1618
1664
|
|
|
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 };
|
|
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 };
|