@shopify/ui-extensions 2023.4.2 → 2023.7.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/README.md +1 -1
- package/build/cjs/surfaces/admin/components/ResourceItem/ResourceItem.js +14 -0
- package/build/cjs/surfaces/admin/components/ResourceList/ResourceList.js +15 -0
- package/build/cjs/surfaces/admin/components/Thumbnail/Thumbnail.js +12 -0
- package/build/cjs/surfaces/admin.js +6 -0
- package/build/cjs/surfaces/checkout/extension.js +7 -28
- package/build/cjs/surfaces/checkout.js +0 -1
- package/build/esm/surfaces/admin/components/ResourceItem/ResourceItem.mjs +10 -0
- package/build/esm/surfaces/admin/components/ResourceList/ResourceList.mjs +11 -0
- package/build/esm/surfaces/admin/components/Thumbnail/Thumbnail.mjs +8 -0
- package/build/esm/surfaces/admin.mjs +3 -0
- package/build/esm/surfaces/checkout/extension.mjs +7 -27
- package/build/esm/surfaces/checkout.mjs +1 -1
- package/build/esnext/surfaces/admin/components/ResourceItem/ResourceItem.esnext +10 -0
- package/build/esnext/surfaces/admin/components/ResourceList/ResourceList.esnext +11 -0
- package/build/esnext/surfaces/admin/components/Thumbnail/Thumbnail.esnext +8 -0
- package/build/esnext/surfaces/admin.esnext +3 -0
- package/build/esnext/surfaces/checkout/extension.esnext +7 -27
- package/build/esnext/surfaces/checkout.esnext +1 -1
- package/build/ts/api.d.ts +0 -15
- package/build/ts/api.d.ts.map +1 -1
- package/build/ts/extension.d.ts +0 -3
- package/build/ts/extension.d.ts.map +1 -1
- package/build/ts/surfaces/admin/api/action/action.d.ts +5 -2
- package/build/ts/surfaces/admin/api/action/action.d.ts.map +1 -1
- package/build/ts/surfaces/admin/api/block/block.d.ts +10 -0
- package/build/ts/surfaces/admin/api/block/block.d.ts.map +1 -0
- package/build/ts/surfaces/admin/api/block/block.doc.d.ts +4 -0
- package/build/ts/surfaces/admin/api/block/block.doc.d.ts.map +1 -0
- package/build/ts/surfaces/admin/api/product-configuration/product-details-configuration.d.ts +45 -0
- package/build/ts/surfaces/admin/api/product-configuration/product-details-configuration.d.ts.map +1 -0
- package/build/ts/surfaces/admin/api/product-configuration/product-variant-details-configuration.d.ts +46 -0
- package/build/ts/surfaces/admin/api/product-configuration/product-variant-details-configuration.d.ts.map +1 -0
- package/build/ts/surfaces/admin/api/shared.d.ts +9 -0
- package/build/ts/surfaces/admin/api/shared.d.ts.map +1 -0
- package/build/ts/surfaces/admin/api/standard/standard.d.ts +18 -2
- package/build/ts/surfaces/admin/api/standard/standard.d.ts.map +1 -1
- package/build/ts/surfaces/admin/api.d.ts +4 -1
- package/build/ts/surfaces/admin/api.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Checkbox/Checkbox.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Form/Form.d.ts +0 -10
- package/build/ts/surfaces/admin/components/Form/Form.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Form/Form.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/HeadingGroup/HeadingGroup.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/ResourceItem/ResourceItem.d.ts +17 -0
- package/build/ts/surfaces/admin/components/ResourceItem/ResourceItem.d.ts.map +1 -0
- package/build/ts/surfaces/admin/components/ResourceList/ResourceList.d.ts +26 -0
- package/build/ts/surfaces/admin/components/ResourceList/ResourceList.d.ts.map +1 -0
- package/build/ts/surfaces/admin/components/Select/Select.doc.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Thumbnail/Thumbnail.d.ts +19 -0
- package/build/ts/surfaces/admin/components/Thumbnail/Thumbnail.d.ts.map +1 -0
- package/build/ts/surfaces/admin/components.d.ts +6 -0
- package/build/ts/surfaces/admin/components.d.ts.map +1 -1
- package/build/ts/surfaces/admin/extension-targets.d.ts +10 -4
- package/build/ts/surfaces/admin/extension-targets.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api/cart-line/cart-line-item.d.ts +9 -0
- package/build/ts/surfaces/checkout/api/cart-line/cart-line-item.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api/checkout/checkout.d.ts +67 -1
- package/build/ts/surfaces/checkout/api/checkout/checkout.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api/{payment-method/render.d.ts → payment/payment-option-item.d.ts} +2 -2
- package/build/ts/surfaces/checkout/api/payment/payment-option-item.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api/pickup/{pickup-points.d.ts → pickup-location-list.d.ts} +3 -3
- package/build/ts/surfaces/checkout/api/pickup/pickup-location-list.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api/pickup/{pickup-locations.d.ts → pickup-point-list.d.ts} +3 -3
- package/build/ts/surfaces/checkout/api/pickup/pickup-point-list.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api/redeemable/{render.d.ts → redeemable.d.ts} +2 -2
- package/build/ts/surfaces/checkout/api/redeemable/redeemable.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api/shared.d.ts +91 -1
- package/build/ts/surfaces/checkout/api/shared.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api/shipping/{shipping-method-details.d.ts → shipping-option-item.d.ts} +4 -4
- package/build/ts/surfaces/checkout/api/shipping/shipping-option-item.d.ts.map +1 -0
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts +171 -171
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api.d.ts +9 -9
- package/build/ts/surfaces/checkout/api.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components/PhoneField/PhoneField.d.ts +1 -1
- package/build/ts/surfaces/checkout/components/TextField/TextField.d.ts +1 -1
- package/build/ts/surfaces/checkout/components/shared.d.ts +11 -2
- package/build/ts/surfaces/checkout/components/shared.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/extension.d.ts +7 -28
- package/build/ts/surfaces/checkout/extension.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/globals.d.ts +2 -2
- package/build/ts/surfaces/checkout/globals.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/targets.d.ts +411 -0
- package/build/ts/surfaces/checkout/targets.d.ts.map +1 -0
- package/build/ts/surfaces/checkout.d.ts +1 -1
- package/build/ts/surfaces/checkout.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/api/cart-line/cart-line-item.d.ts +9 -0
- package/build/ts/surfaces/customer-account/api/cart-line/cart-line-item.d.ts.map +1 -0
- package/build/ts/surfaces/customer-account/api/order-status/order-status.d.ts +1212 -0
- package/build/ts/surfaces/customer-account/api/order-status/order-status.d.ts.map +1 -0
- package/build/ts/surfaces/customer-account/api/shared.d.ts +126 -0
- package/build/ts/surfaces/customer-account/api/shared.d.ts.map +1 -0
- package/build/ts/surfaces/customer-account/api.d.ts +4 -0
- package/build/ts/surfaces/customer-account/api.d.ts.map +1 -0
- package/build/ts/surfaces/customer-account/extension.d.ts +16 -0
- package/build/ts/surfaces/customer-account/extension.d.ts.map +1 -0
- package/build/ts/surfaces/customer-account/globals.d.ts +11 -0
- package/build/ts/surfaces/customer-account/globals.d.ts.map +1 -0
- package/build/ts/surfaces/customer-account/targets.d.ts +78 -0
- package/build/ts/surfaces/customer-account/targets.d.ts.map +1 -0
- package/build/ts/surfaces/customer-account.d.ts +8 -0
- package/build/ts/surfaces/customer-account.d.ts.map +1 -0
- package/build/ts/utilities/registration.d.ts +5 -5
- package/build/ts/utilities/registration.d.ts.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -8
- package/src/api.ts +0 -18
- package/src/extension.ts +0 -4
- package/src/surfaces/admin/api/action/action.ts +6 -4
- package/src/surfaces/admin/api/block/block.doc.ts +20 -0
- package/src/surfaces/admin/api/block/block.ts +11 -0
- package/src/surfaces/admin/api/product-configuration/product-details-configuration.ts +49 -0
- package/src/surfaces/admin/api/product-configuration/product-variant-details-configuration.ts +50 -0
- package/src/surfaces/admin/api/shared.ts +6 -0
- package/src/surfaces/admin/api/standard/standard.ts +20 -8
- package/src/surfaces/admin/api.ts +4 -1
- package/src/surfaces/admin/components/Checkbox/Checkbox.doc.ts +1 -7
- package/src/surfaces/admin/components/Form/Form.doc.ts +0 -5
- package/src/surfaces/admin/components/Form/Form.ts +0 -12
- package/src/surfaces/admin/components/HeadingGroup/HeadingGroup.doc.ts +0 -7
- package/src/surfaces/admin/components/ResourceItem/ResourceItem.ts +19 -0
- package/src/surfaces/admin/components/ResourceItem/examples/basic-ResourceItem.example.ts +22 -0
- package/src/surfaces/admin/components/ResourceList/ResourceList.ts +30 -0
- package/src/surfaces/admin/components/ResourceList/examples/basic-ResourceList.example.ts +29 -0
- package/src/surfaces/admin/components/Select/Select.doc.ts +1 -7
- package/src/surfaces/admin/components/Thumbnail/Thumbnail.ts +31 -0
- package/src/surfaces/admin/components/Thumbnail/examples/basic-Thumbnail.example.ts +13 -0
- package/src/surfaces/admin/components.ts +6 -0
- package/src/surfaces/admin/extension-targets.ts +38 -3
- package/src/surfaces/checkout/api/cart-line/cart-line-item.ts +10 -0
- package/src/surfaces/checkout/api/checkout/checkout.ts +83 -1
- package/src/surfaces/checkout/api/{payment-method/render.ts → payment/payment-option-item.ts} +1 -1
- package/src/surfaces/checkout/api/pickup/{pickup-points.ts → pickup-location-list.ts} +2 -2
- package/src/surfaces/checkout/api/pickup/{pickup-locations.ts → pickup-point-list.ts} +2 -2
- package/src/surfaces/checkout/api/redeemable/{render.ts → redeemable.ts} +1 -1
- package/src/surfaces/checkout/api/shared.ts +103 -0
- package/src/surfaces/checkout/api/shipping/{shipping-method-details.ts → shipping-option-item.ts} +3 -3
- package/src/surfaces/checkout/api/standard/README.md +12 -10
- package/src/surfaces/checkout/api/standard/standard.ts +180 -187
- package/src/surfaces/checkout/api.ts +18 -10
- package/src/surfaces/checkout/components/Banner/examples/basic-banner.example.ts +1 -1
- package/src/surfaces/checkout/components/BlockLayout/examples/basic-blockLayout.example.ts +1 -1
- package/src/surfaces/checkout/components/BlockLayout/examples/basic-blocklayout.example.ts +1 -1
- package/src/surfaces/checkout/components/BlockSpacer/examples/basic-blockspacer.example.ts +1 -1
- package/src/surfaces/checkout/components/BlockStack/examples/basic-blockstack.example.ts +1 -1
- package/src/surfaces/checkout/components/Button/examples/basic-button.example.ts +1 -1
- package/src/surfaces/checkout/components/Checkbox/examples/basic-checkbox.example.ts +1 -1
- package/src/surfaces/checkout/components/Choice/examples/basic-choice.example.ts +1 -1
- package/src/surfaces/checkout/components/ChoiceList/examples/basic-choicelist.example.ts +1 -1
- package/src/surfaces/checkout/components/DateField/examples/basic-datefield.example.ts +1 -1
- package/src/surfaces/checkout/components/DatePicker/examples/basic-datepicker.example.ts +1 -1
- package/src/surfaces/checkout/components/Disclosure/examples/basic-disclosure.example.ts +1 -1
- package/src/surfaces/checkout/components/Divider/examples/basic-divider.example.ts +1 -1
- package/src/surfaces/checkout/components/Form/examples/basic-form.example.ts +1 -1
- package/src/surfaces/checkout/components/Grid/examples/basic-grid.example.ts +1 -1
- package/src/surfaces/checkout/components/GridItem/examples/basic-griditem.example.ts +1 -1
- package/src/surfaces/checkout/components/Heading/examples/basic-heading.example.ts +1 -1
- package/src/surfaces/checkout/components/HeadingGroup/examples/basic-headinggroup.example.ts +1 -1
- package/src/surfaces/checkout/components/Icon/examples/basic-icon.example.ts +1 -1
- package/src/surfaces/checkout/components/Image/examples/basic-image.example.ts +1 -1
- package/src/surfaces/checkout/components/InlineLayout/examples/basic-inlineLayout.example.ts +1 -1
- package/src/surfaces/checkout/components/InlineLayout/examples/basic-inlinelayout.example.ts +1 -1
- package/src/surfaces/checkout/components/InlineSpacer/examples/basic-inlinespacer.example.ts +1 -1
- package/src/surfaces/checkout/components/InlineStack/examples/basic-inlinestack.example.ts +1 -1
- package/src/surfaces/checkout/components/Link/examples/basic-link.example.ts +1 -1
- package/src/surfaces/checkout/components/List/examples/basic-list.example.ts +1 -1
- package/src/surfaces/checkout/components/ListItem/examples/basic-listitem.example.ts +1 -1
- package/src/surfaces/checkout/components/Modal/examples/basic-modal.example.ts +1 -1
- package/src/surfaces/checkout/components/PhoneField/PhoneField.ts +1 -1
- package/src/surfaces/checkout/components/PhoneField/examples/basic-phonefield.example.ts +1 -1
- package/src/surfaces/checkout/components/Popover/examples/basic-popover.example.ts +1 -1
- package/src/surfaces/checkout/components/Pressable/examples/basic-pressable.example.ts +1 -1
- package/src/surfaces/checkout/components/ScrollView/examples/basic-scrollview.example.ts +1 -1
- package/src/surfaces/checkout/components/Select/examples/basic-select.example.ts +1 -1
- package/src/surfaces/checkout/components/SkeletonImage/examples/basic-skeletonimage.example.ts +1 -1
- package/src/surfaces/checkout/components/SkeletonText/examples/basic-skeletontext.example.ts +1 -1
- package/src/surfaces/checkout/components/SkeletonTextBlock/examples/basic-skeletontextblock.example.ts +1 -1
- package/src/surfaces/checkout/components/Spinner/examples/basic-spinner.example.ts +1 -1
- package/src/surfaces/checkout/components/Stepper/examples/basic-stepper.example.ts +1 -1
- package/src/surfaces/checkout/components/Tag/examples/basic-tag.example.ts +1 -1
- package/src/surfaces/checkout/components/Text/examples/basic-text.example.ts +1 -1
- package/src/surfaces/checkout/components/TextBlock/examples/basic-textblock.example.ts +1 -1
- package/src/surfaces/checkout/components/TextField/TextField.ts +1 -1
- package/src/surfaces/checkout/components/TextField/examples/basic-textfield.example.ts +1 -1
- package/src/surfaces/checkout/components/Tooltip/examples/basic-tooltip.example.ts +1 -1
- package/src/surfaces/checkout/components/View/examples/basic-view.example.ts +1 -1
- package/src/surfaces/checkout/components/shared.ts +22 -5
- package/src/surfaces/checkout/extension.ts +10 -56
- package/src/surfaces/checkout/globals.ts +7 -4
- package/src/surfaces/checkout/style/examples/style.example.ts +1 -1
- package/src/surfaces/checkout/style/examples/style.example.tsx +8 -2
- package/src/surfaces/checkout/targets.ts +701 -0
- package/src/surfaces/checkout.ts +1 -1
- package/src/surfaces/customer-account/api/cart-line/cart-line-item.ts +10 -0
- package/src/surfaces/customer-account/api/order-status/order-status.ts +1414 -0
- package/src/surfaces/customer-account/api/shared.ts +953 -0
- package/src/surfaces/customer-account/api.ts +66 -0
- package/src/surfaces/customer-account/extension.ts +21 -0
- package/src/surfaces/customer-account/globals.ts +18 -0
- package/src/surfaces/customer-account/targets.ts +116 -0
- package/src/surfaces/customer-account.ts +8 -0
- package/src/utilities/registration.ts +13 -12
- package/build/ts/surfaces/checkout/api/cart-line/cart-line-details.d.ts +0 -9
- package/build/ts/surfaces/checkout/api/cart-line/cart-line-details.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/api/payment-method/render.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/api/pickup/pickup-locations.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/api/pickup/pickup-points.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/api/redeemable/render.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/api/shipping/shipping-method-details.d.ts.map +0 -1
- package/build/ts/surfaces/checkout/extension-points.d.ts +0 -220
- package/build/ts/surfaces/checkout/extension-points.d.ts.map +0 -1
- package/src/surfaces/checkout/api/cart-line/cart-line-details.ts +0 -10
- package/src/surfaces/checkout/components/Banner/README.md +0 -14
- package/src/surfaces/checkout/components/BlockLayout/README.md +0 -101
- package/src/surfaces/checkout/components/BlockSpacer/README.md +0 -14
- package/src/surfaces/checkout/components/BlockStack/README.md +0 -77
- package/src/surfaces/checkout/components/Button/README.md +0 -22
- package/src/surfaces/checkout/components/Checkbox/README.md +0 -18
- package/src/surfaces/checkout/components/Choice/README.md +0 -14
- package/src/surfaces/checkout/components/ChoiceList/README.md +0 -14
- package/src/surfaces/checkout/components/Divider/README.md +0 -13
- package/src/surfaces/checkout/components/Form/README.md +0 -21
- package/src/surfaces/checkout/components/Grid/README.md +0 -105
- package/src/surfaces/checkout/components/GridItem/README.md +0 -72
- package/src/surfaces/checkout/components/Heading/README.md +0 -19
- package/src/surfaces/checkout/components/HeadingGroup/README.md +0 -7
- package/src/surfaces/checkout/components/Icon/README.md +0 -15
- package/src/surfaces/checkout/components/Image/README.md +0 -53
- package/src/surfaces/checkout/components/InlineLayout/README.md +0 -103
- package/src/surfaces/checkout/components/InlineSpacer/README.md +0 -14
- package/src/surfaces/checkout/components/InlineStack/README.md +0 -87
- package/src/surfaces/checkout/components/Link/README.md +0 -18
- package/src/surfaces/checkout/components/List/README.md +0 -19
- package/src/surfaces/checkout/components/ListItem/README.md +0 -5
- package/src/surfaces/checkout/components/PhoneField/README.md +0 -49
- package/src/surfaces/checkout/components/Pressable/README.md +0 -74
- package/src/surfaces/checkout/components/ScrollView/README.md +0 -62
- package/src/surfaces/checkout/components/Select/README.md +0 -41
- package/src/surfaces/checkout/components/SkeletonImage/README.md +0 -13
- package/src/surfaces/checkout/components/SkeletonText/README.md +0 -13
- package/src/surfaces/checkout/components/SkeletonTextBlock/README.md +0 -13
- package/src/surfaces/checkout/components/Spinner/README.md +0 -14
- package/src/surfaces/checkout/components/Stepper/README.md +0 -28
- package/src/surfaces/checkout/components/Tag/README.md +0 -14
- package/src/surfaces/checkout/components/Text/README.md +0 -17
- package/src/surfaces/checkout/components/TextBlock/README.md +0 -15
- package/src/surfaces/checkout/components/TextField/README.md +0 -49
- package/src/surfaces/checkout/components/Tooltip/README.md +0 -8
- package/src/surfaces/checkout/components/View/README.md +0 -97
- package/src/surfaces/checkout/extension-points.ts +0 -369
|
@@ -0,0 +1,1212 @@
|
|
|
1
|
+
import type { StatefulRemoteSubscribable } from '@remote-ui/async-subscription';
|
|
2
|
+
import type { CurrencyCode, CountryCode, Timezone, GraphQLError, StorefrontApiVersion, SellingPlan, Attribute, MailingAddress } from '../shared';
|
|
3
|
+
import type { ExtensionTarget } from '../../targets';
|
|
4
|
+
/**
|
|
5
|
+
* A key-value storage object for extension targets.
|
|
6
|
+
*
|
|
7
|
+
* Stored data is only available to this specific app
|
|
8
|
+
* at this specific extension target.
|
|
9
|
+
*
|
|
10
|
+
* The storage backend is implemented with `localStorage` and
|
|
11
|
+
* should persist across the buyer's checkout session.
|
|
12
|
+
* However, data persistence isn't guaranteed.
|
|
13
|
+
*/
|
|
14
|
+
export interface Storage {
|
|
15
|
+
/**
|
|
16
|
+
* Read and return a stored value by key.
|
|
17
|
+
*
|
|
18
|
+
* The stored data is deserialized from JSON and returned as
|
|
19
|
+
* its original primitive.
|
|
20
|
+
*
|
|
21
|
+
* Returns `null` if no stored data exists.
|
|
22
|
+
*/
|
|
23
|
+
read<T = unknown>(key: string): Promise<T | null>;
|
|
24
|
+
/**
|
|
25
|
+
* Write stored data for this key.
|
|
26
|
+
*
|
|
27
|
+
* The data must be serializable to JSON.
|
|
28
|
+
*/
|
|
29
|
+
write(key: string, data: any): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Delete stored data by key.
|
|
32
|
+
*/
|
|
33
|
+
delete(key: string): Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The capabilities an extension has access to.
|
|
37
|
+
*
|
|
38
|
+
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
|
|
39
|
+
*
|
|
40
|
+
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
|
|
41
|
+
*
|
|
42
|
+
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior.
|
|
43
|
+
*/
|
|
44
|
+
export type Capability = 'api_access' | 'network_access' | 'block_progress';
|
|
45
|
+
/**
|
|
46
|
+
* Meta information about an extension target.
|
|
47
|
+
*/
|
|
48
|
+
export interface Extension<Target extends ExtensionTarget = ExtensionTarget> {
|
|
49
|
+
/**
|
|
50
|
+
* The API version that was set in the extension config file.
|
|
51
|
+
*
|
|
52
|
+
* @example '2023-04', '2023-07'
|
|
53
|
+
*/
|
|
54
|
+
apiVersion: ApiVersion;
|
|
55
|
+
/**
|
|
56
|
+
* The allowed capabilities of the extension, defined
|
|
57
|
+
* in your [shopify.ui.extension.toml](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
|
|
58
|
+
*
|
|
59
|
+
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
|
|
60
|
+
*
|
|
61
|
+
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
|
|
62
|
+
*
|
|
63
|
+
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior.
|
|
64
|
+
*/
|
|
65
|
+
capabilities: StatefulRemoteSubscribable<Capability[]>;
|
|
66
|
+
/**
|
|
67
|
+
* Information about the editor where the extension is being rendered.
|
|
68
|
+
*
|
|
69
|
+
* The value is undefined if the extension is not rendering in an editor.
|
|
70
|
+
*/
|
|
71
|
+
editor?: Editor;
|
|
72
|
+
/**
|
|
73
|
+
* Whether your extension is currently rendered to the screen.
|
|
74
|
+
*
|
|
75
|
+
* Shopify might render your extension before it's visible in the UI,
|
|
76
|
+
* typically to pre-render extensions that will appear on a later step of the
|
|
77
|
+
* checkout.
|
|
78
|
+
*
|
|
79
|
+
* Your extension might also continue to run after the buyer has navigated away
|
|
80
|
+
* from where it was rendered. The extension continues running so that
|
|
81
|
+
* your extension is immediately available to render if the buyer navigates back.
|
|
82
|
+
*/
|
|
83
|
+
rendered: StatefulRemoteSubscribable<boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* The URL to the script that started the extension target.
|
|
86
|
+
*/
|
|
87
|
+
scriptUrl: string;
|
|
88
|
+
/**
|
|
89
|
+
* The identifier that specifies where in Shopify’s UI your code is being
|
|
90
|
+
* injected. This will be one of the targets you have included in your
|
|
91
|
+
* extension’s configuration file.
|
|
92
|
+
*
|
|
93
|
+
* @example 'customer-account.order-status.block.render'
|
|
94
|
+
* @see https://shopify.dev/docs/api/checkout-ui-extensions/unstable/extension-targets-overview
|
|
95
|
+
* @see https://shopify.dev/docs/apps/app-extensions/configuration#targets
|
|
96
|
+
*/
|
|
97
|
+
target: Target;
|
|
98
|
+
/**
|
|
99
|
+
* The published version of the running extension target.
|
|
100
|
+
*
|
|
101
|
+
* For unpublished extensions, the value is `undefined`.
|
|
102
|
+
*
|
|
103
|
+
* @example 3.0.10
|
|
104
|
+
*/
|
|
105
|
+
version?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface Editor {
|
|
108
|
+
/**
|
|
109
|
+
* Indicates whether the extension is rendering in the checkout editor.
|
|
110
|
+
*/
|
|
111
|
+
type: 'checkout';
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Metadata associated with the checkout.
|
|
115
|
+
*/
|
|
116
|
+
export interface Metafield {
|
|
117
|
+
/**
|
|
118
|
+
* The name of the metafield. It must be between 3 and 30 characters in
|
|
119
|
+
* length (inclusive).
|
|
120
|
+
*/
|
|
121
|
+
key: string;
|
|
122
|
+
/**
|
|
123
|
+
* A container for a set of metafields. You need to define a custom
|
|
124
|
+
* namespace for your metafields to distinguish them from the metafields
|
|
125
|
+
* used by other apps. This must be between 2 and 20 characters in length (inclusive).
|
|
126
|
+
*/
|
|
127
|
+
namespace: string;
|
|
128
|
+
/**
|
|
129
|
+
* The information to be stored as metadata.
|
|
130
|
+
*/
|
|
131
|
+
value: string | number;
|
|
132
|
+
/** The metafield’s information type. */
|
|
133
|
+
valueType: 'integer' | 'string' | 'json_string';
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Represents a custom metadata attached to a resource.
|
|
137
|
+
*/
|
|
138
|
+
export interface AppMetafield {
|
|
139
|
+
/** The key name of a metafield. */
|
|
140
|
+
key: string;
|
|
141
|
+
/** The namespace for a metafield. */
|
|
142
|
+
namespace: string;
|
|
143
|
+
/** The value of a metafield. */
|
|
144
|
+
value: string | number | boolean;
|
|
145
|
+
/** The metafield’s information type. */
|
|
146
|
+
valueType: 'boolean' | 'float' | 'integer' | 'json_string' | 'string';
|
|
147
|
+
/** The metafield's type name. */
|
|
148
|
+
type: string;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Represents a custom metadata attached to a resource.
|
|
152
|
+
*/
|
|
153
|
+
export interface CartMetafield {
|
|
154
|
+
/** The key name of a metafield. */
|
|
155
|
+
key: string;
|
|
156
|
+
/** The namespace for a metafield. */
|
|
157
|
+
namespace: string;
|
|
158
|
+
/** The value of a metafield. */
|
|
159
|
+
value: string;
|
|
160
|
+
/** The metafield's type name. */
|
|
161
|
+
type: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The metafield owner.
|
|
165
|
+
*/
|
|
166
|
+
export interface AppMetafieldEntryTarget {
|
|
167
|
+
/**
|
|
168
|
+
* The type of the metafield owner.
|
|
169
|
+
*
|
|
170
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data) when the type is `customer`, `company` or `companyLocation`.
|
|
171
|
+
*/
|
|
172
|
+
type: 'customer' | 'product' | 'shop' | 'variant' | 'company' | 'companyLocation' | 'cart';
|
|
173
|
+
/** The numeric owner ID that is associated with the metafield. */
|
|
174
|
+
id: string;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* A metafield associated with the shop or a resource on the checkout.
|
|
178
|
+
*/
|
|
179
|
+
export interface AppMetafieldEntry {
|
|
180
|
+
/**
|
|
181
|
+
* The target that is associated to the metadata.
|
|
182
|
+
*
|
|
183
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data) when the type is `customer`, `company` or `companyLocation`.
|
|
184
|
+
*/
|
|
185
|
+
target: AppMetafieldEntryTarget;
|
|
186
|
+
/** The metadata information. */
|
|
187
|
+
metafield: AppMetafield;
|
|
188
|
+
}
|
|
189
|
+
export type ApiVersion = '2023-04' | '2023-07' | 'unstable';
|
|
190
|
+
export type Version = string;
|
|
191
|
+
/**
|
|
192
|
+
* This returns a translated string matching a key in a locale file.
|
|
193
|
+
*
|
|
194
|
+
* @example translate("banner.title")
|
|
195
|
+
*/
|
|
196
|
+
export type I18nTranslate<ReplacementType = string> = (key: string, options?: {
|
|
197
|
+
[placeholderKey: string]: ReplacementType | string | number;
|
|
198
|
+
}) => ReplacementType extends string | number ? string : (string | ReplacementType)[];
|
|
199
|
+
export interface I18n {
|
|
200
|
+
/**
|
|
201
|
+
* Returns a localized number.
|
|
202
|
+
*
|
|
203
|
+
* This function behaves like the standard `Intl.NumberFormat()`
|
|
204
|
+
* with a style of `decimal` applied. It uses the buyer's locale by default.
|
|
205
|
+
*
|
|
206
|
+
* @param options.inExtensionLocale - if true, use the extension's locale
|
|
207
|
+
*/
|
|
208
|
+
formatNumber: (number: number | bigint, options?: {
|
|
209
|
+
inExtensionLocale?: boolean;
|
|
210
|
+
} & Intl.NumberFormatOptions) => string;
|
|
211
|
+
/**
|
|
212
|
+
* Returns a localized currency value.
|
|
213
|
+
*
|
|
214
|
+
* This function behaves like the standard `Intl.NumberFormat()`
|
|
215
|
+
* with a style of `currency` applied. It uses the buyer's locale by default.
|
|
216
|
+
*
|
|
217
|
+
* @param options.inExtensionLocale - if true, use the extension's locale
|
|
218
|
+
*/
|
|
219
|
+
formatCurrency: (number: number | bigint, options?: {
|
|
220
|
+
inExtensionLocale?: boolean;
|
|
221
|
+
} & Intl.NumberFormatOptions) => string;
|
|
222
|
+
/**
|
|
223
|
+
* Returns a localized date value.
|
|
224
|
+
*
|
|
225
|
+
* This function behaves like the standard `Intl.DateTimeFormatOptions()` and uses
|
|
226
|
+
* the buyer's locale by default. Formatting options can be passed in as
|
|
227
|
+
* options.
|
|
228
|
+
*
|
|
229
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat0
|
|
230
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options
|
|
231
|
+
*
|
|
232
|
+
* @param options.inExtensionLocale - if true, use the extension's locale
|
|
233
|
+
*/
|
|
234
|
+
formatDate: (date: Date, options?: {
|
|
235
|
+
inExtensionLocale?: boolean;
|
|
236
|
+
} & Intl.DateTimeFormatOptions) => string;
|
|
237
|
+
/**
|
|
238
|
+
* Returns translated content in the buyer's locale,
|
|
239
|
+
* as supported by the extension.
|
|
240
|
+
*
|
|
241
|
+
* - `options.count` is a special numeric value used in pluralization.
|
|
242
|
+
* - The other option keys and values are treated as replacements for interpolation.
|
|
243
|
+
* - If the replacements are all primitives, then `translate()` returns a single string.
|
|
244
|
+
* - If replacements contain UI components, then `translate()` returns an array of elements.
|
|
245
|
+
*/
|
|
246
|
+
translate: I18nTranslate;
|
|
247
|
+
}
|
|
248
|
+
export interface Language {
|
|
249
|
+
/**
|
|
250
|
+
* The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code.
|
|
251
|
+
*
|
|
252
|
+
* @example 'en' for English, or 'en-US' for English local to United States.
|
|
253
|
+
* @see https://en.wikipedia.org/wiki/IETF_language_tag
|
|
254
|
+
* @see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
|
255
|
+
*/
|
|
256
|
+
isoCode: string;
|
|
257
|
+
}
|
|
258
|
+
export interface Currency {
|
|
259
|
+
/**
|
|
260
|
+
* The ISO-4217 code for this currency.
|
|
261
|
+
* @see https://www.iso.org/iso-4217-currency-codes.html
|
|
262
|
+
*/
|
|
263
|
+
isoCode: CurrencyCode;
|
|
264
|
+
}
|
|
265
|
+
export interface Country {
|
|
266
|
+
/**
|
|
267
|
+
* The ISO-3166-1 code for this country.
|
|
268
|
+
* @see https://www.iso.org/iso-3166-country-codes.html
|
|
269
|
+
*/
|
|
270
|
+
isoCode: CountryCode;
|
|
271
|
+
}
|
|
272
|
+
export interface Market {
|
|
273
|
+
/**
|
|
274
|
+
* A globally-unique identifier for a market.
|
|
275
|
+
*/
|
|
276
|
+
id: string;
|
|
277
|
+
/**
|
|
278
|
+
* The human-readable, shop-scoped identifier for the market.
|
|
279
|
+
*/
|
|
280
|
+
handle: string;
|
|
281
|
+
}
|
|
282
|
+
export interface Localization {
|
|
283
|
+
/**
|
|
284
|
+
* The currency that the buyer sees for money amounts in the checkout.
|
|
285
|
+
*/
|
|
286
|
+
currency: StatefulRemoteSubscribable<Currency>;
|
|
287
|
+
/**
|
|
288
|
+
* The buyer’s time zone.
|
|
289
|
+
*/
|
|
290
|
+
timezone: StatefulRemoteSubscribable<Timezone>;
|
|
291
|
+
/**
|
|
292
|
+
* The language the buyer sees in the checkout.
|
|
293
|
+
*/
|
|
294
|
+
language: StatefulRemoteSubscribable<Language>;
|
|
295
|
+
/**
|
|
296
|
+
* This is the buyer's language, as supported by the extension.
|
|
297
|
+
* If the buyer's actual language is not supported by the extension,
|
|
298
|
+
* this is the fallback locale used for translations.
|
|
299
|
+
*
|
|
300
|
+
* For example, if the buyer's language is 'fr-CA' but your extension
|
|
301
|
+
* only supports translations for 'fr', then the `isoCode` for this
|
|
302
|
+
* language is 'fr'. If your extension does not provide french
|
|
303
|
+
* translations at all, this value is the default locale for your
|
|
304
|
+
* extension (that is, the one matching your .default.json file).
|
|
305
|
+
*/
|
|
306
|
+
extensionLanguage: StatefulRemoteSubscribable<Language>;
|
|
307
|
+
/**
|
|
308
|
+
* The country context of the checkout. This value carries over from the
|
|
309
|
+
* context of the cart, where it was used to contextualize the storefront
|
|
310
|
+
* experience. It will update if the buyer changes the country of their
|
|
311
|
+
* shipping address. The value is undefined if unknown.
|
|
312
|
+
*/
|
|
313
|
+
country: StatefulRemoteSubscribable<Country | undefined>;
|
|
314
|
+
/**
|
|
315
|
+
* The [market](https://shopify.dev/docs/apps/markets) context of the
|
|
316
|
+
* checkout. This value carries over from the context of the cart, where it
|
|
317
|
+
* was used to contextualize the storefront experience. It will update if the
|
|
318
|
+
* buyer changes the country of their shipping address. The value is undefined
|
|
319
|
+
* if unknown.
|
|
320
|
+
*/
|
|
321
|
+
market: StatefulRemoteSubscribable<Market | undefined>;
|
|
322
|
+
}
|
|
323
|
+
export interface OrderStatusApi<Target extends ExtensionTarget> {
|
|
324
|
+
/**
|
|
325
|
+
* Methods for interacting with [Web Pixels](https://shopify.dev/docs/apps/marketing), such as emitting an event.
|
|
326
|
+
*/
|
|
327
|
+
analytics: Analytics;
|
|
328
|
+
/**
|
|
329
|
+
* Gift Cards that have been applied to the order.
|
|
330
|
+
*/
|
|
331
|
+
appliedGiftCards: StatefulRemoteSubscribable<AppliedGiftCard[]>;
|
|
332
|
+
/**
|
|
333
|
+
* The metafields requested in the
|
|
334
|
+
* [`shopify.ui.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration)
|
|
335
|
+
* file. These metafields are updated when there's a change in the merchandise items
|
|
336
|
+
* being purchased by the customer.
|
|
337
|
+
*
|
|
338
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
339
|
+
*/
|
|
340
|
+
appMetafields: StatefulRemoteSubscribable<AppMetafieldEntry[]>;
|
|
341
|
+
/**
|
|
342
|
+
* Custom attributes left by the customer to the merchant, either in their cart or during checkout.
|
|
343
|
+
*/
|
|
344
|
+
attributes: StatefulRemoteSubscribable<Attribute[] | undefined>;
|
|
345
|
+
/**
|
|
346
|
+
* Information about the buyer that is interacting with the order.
|
|
347
|
+
*
|
|
348
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
349
|
+
*/
|
|
350
|
+
buyerIdentity?: BuyerIdentity;
|
|
351
|
+
/**
|
|
352
|
+
* Settings applied to the buyer's checkout.
|
|
353
|
+
*/
|
|
354
|
+
checkoutSettings: StatefulRemoteSubscribable<CheckoutSettings>;
|
|
355
|
+
/**
|
|
356
|
+
* Details on the costs of the purchase for the buyer.
|
|
357
|
+
*/
|
|
358
|
+
cost: CartCost;
|
|
359
|
+
/**
|
|
360
|
+
* A list of discount codes applied to the purchase.
|
|
361
|
+
*/
|
|
362
|
+
discountCodes: StatefulRemoteSubscribable<CartDiscountCode[]>;
|
|
363
|
+
/**
|
|
364
|
+
* Discounts that have been applied to the entire cart.
|
|
365
|
+
*/
|
|
366
|
+
discountAllocations: StatefulRemoteSubscribable<CartDiscountAllocation[]>;
|
|
367
|
+
/**
|
|
368
|
+
* Meta information about the extension.
|
|
369
|
+
*/
|
|
370
|
+
extension: Extension<Target>;
|
|
371
|
+
/**
|
|
372
|
+
* The identifier that specifies where in Shopify’s UI your code is being
|
|
373
|
+
* injected. This will be one of the targets you have included in your
|
|
374
|
+
* extension’s configuration file.
|
|
375
|
+
*
|
|
376
|
+
* @example 'customer-account.order-status.block.render'
|
|
377
|
+
* @see https://shopify.dev/docs/api/checkout-ui-extensions/unstable/extension-targets-overview
|
|
378
|
+
* @see https://shopify.dev/docs/apps/app-extensions/configuration#targets
|
|
379
|
+
*
|
|
380
|
+
* @deprecated Deprecated as of version `2023-07`, use `extension.target` instead.
|
|
381
|
+
*/
|
|
382
|
+
extensionPoint: Target;
|
|
383
|
+
/**
|
|
384
|
+
* Utilities for translating content and formatting values according to the current
|
|
385
|
+
* [`localization`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi#properties-propertydetail-localization)
|
|
386
|
+
* of the order.
|
|
387
|
+
*
|
|
388
|
+
* See [localization examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi#example-localization)
|
|
389
|
+
* for more information.
|
|
390
|
+
*/
|
|
391
|
+
i18n: I18n;
|
|
392
|
+
/**
|
|
393
|
+
* A list of lines containing information about the items the customer intends to purchase.
|
|
394
|
+
*/
|
|
395
|
+
lines: StatefulRemoteSubscribable<CartLine[]>;
|
|
396
|
+
/**
|
|
397
|
+
* Details about the location, language, and currency of the buyer. For utilities to easily
|
|
398
|
+
* format and translate content based on these details, you can use the
|
|
399
|
+
* [`i18n`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi#properties-propertydetail-i18n)
|
|
400
|
+
* object instead.
|
|
401
|
+
*/
|
|
402
|
+
localization: Localization;
|
|
403
|
+
/**
|
|
404
|
+
* The metafields that apply to the current order. The actual resource
|
|
405
|
+
* on which these metafields exist depends on the source of the order:
|
|
406
|
+
*
|
|
407
|
+
* - If the source is an order, then the metafields are on the order.
|
|
408
|
+
* - If the source is a draft order, then the initial value of metafields are
|
|
409
|
+
* from the draft order, and any new metafields you write are applied
|
|
410
|
+
* to the order created by the checkout.
|
|
411
|
+
* - For all other sources, the metafields are only stored locally on the
|
|
412
|
+
* client creating the checkout, and are applied to the order that
|
|
413
|
+
* results from checkout.
|
|
414
|
+
*
|
|
415
|
+
* These metafields are shared by all extensions running on checkout, and
|
|
416
|
+
* persist for as long as the customer is working on this checkout.
|
|
417
|
+
*
|
|
418
|
+
* Once the order is created, you can query these metafields using the
|
|
419
|
+
* [GraphQL Admin API](https://shopify.dev/docs/admin-api/graphql/reference/orders/order#metafield-2021-01)
|
|
420
|
+
*/
|
|
421
|
+
metafields: StatefulRemoteSubscribable<Metafield[]>;
|
|
422
|
+
/**
|
|
423
|
+
* A note left by the customer to the merchant, either in their cart or during checkout.
|
|
424
|
+
*/
|
|
425
|
+
note: StatefulRemoteSubscribable<string | undefined>;
|
|
426
|
+
/**
|
|
427
|
+
* Information about the order that was placed.
|
|
428
|
+
*/
|
|
429
|
+
order: StatefulRemoteSubscribable<Order | undefined>;
|
|
430
|
+
/**
|
|
431
|
+
* Used to query the Storefront GraphQL API with a prefetched token.
|
|
432
|
+
*
|
|
433
|
+
* See [storefront api access examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi#example-storefront-api-access) for more information.
|
|
434
|
+
*/
|
|
435
|
+
query: <Data = unknown, Variables = {
|
|
436
|
+
[key: string]: unknown;
|
|
437
|
+
}>(query: string, options?: {
|
|
438
|
+
variables?: Variables;
|
|
439
|
+
version?: StorefrontApiVersion;
|
|
440
|
+
}) => Promise<{
|
|
441
|
+
data?: Data;
|
|
442
|
+
errors?: GraphQLError[];
|
|
443
|
+
}>;
|
|
444
|
+
/**
|
|
445
|
+
* Provides access to session tokens, which can be used to verify token claims on your app's server.
|
|
446
|
+
*
|
|
447
|
+
* See [session token examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi#example-session-token) for more information.
|
|
448
|
+
*/
|
|
449
|
+
sessionToken: SessionToken;
|
|
450
|
+
/**
|
|
451
|
+
* The settings matching the settings definition written in the
|
|
452
|
+
* [`shopify.ui.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
|
|
453
|
+
*
|
|
454
|
+
* See [settings examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi#example-settings) for more information.
|
|
455
|
+
*
|
|
456
|
+
* > Note: When an extension is being installed in the editor, the settings will be empty until
|
|
457
|
+
* a merchant sets a value. In that case, this object will be updated in real time as a merchant fills in the settings.
|
|
458
|
+
*/
|
|
459
|
+
settings: StatefulRemoteSubscribable<ExtensionSettings>;
|
|
460
|
+
/**
|
|
461
|
+
* The proposed buyer shipping address. During the information step, the address
|
|
462
|
+
* updates when the field is committed (on change) rather than every keystroke.
|
|
463
|
+
* An address value is only present if delivery is required. Otherwise, the
|
|
464
|
+
* subscribable value is undefined.
|
|
465
|
+
*
|
|
466
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
467
|
+
*/
|
|
468
|
+
shippingAddress?: StatefulRemoteSubscribable<MailingAddress | undefined>;
|
|
469
|
+
/** Shop where the purchase took place. */
|
|
470
|
+
shop: Shop;
|
|
471
|
+
/**
|
|
472
|
+
* Key-value storage for the extension target.
|
|
473
|
+
*/
|
|
474
|
+
storage: Storage;
|
|
475
|
+
/**
|
|
476
|
+
* Methods to interact with the extension's UI.
|
|
477
|
+
*/
|
|
478
|
+
ui: Ui;
|
|
479
|
+
/**
|
|
480
|
+
* The renderer version being used for the extension.
|
|
481
|
+
*
|
|
482
|
+
* @example 'unstable'
|
|
483
|
+
*/
|
|
484
|
+
version: Version;
|
|
485
|
+
}
|
|
486
|
+
export interface Ui {
|
|
487
|
+
overlay: {
|
|
488
|
+
close(overlayId: string): void;
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
export interface SessionToken {
|
|
492
|
+
/**
|
|
493
|
+
* Requests a session token that hasn't expired. You should call this method every
|
|
494
|
+
* time you need to make a request to your backend in order to get a valid token.
|
|
495
|
+
* This method will return cached tokens when possible, so you don’t need to worry
|
|
496
|
+
* about storing these tokens yourself.
|
|
497
|
+
*/
|
|
498
|
+
get(): Promise<string>;
|
|
499
|
+
}
|
|
500
|
+
export interface BuyerIdentity {
|
|
501
|
+
/**
|
|
502
|
+
* The buyer's customer account. The value is undefined if the buyer isn’t a
|
|
503
|
+
* known customer for this shop or if they haven't logged in yet.
|
|
504
|
+
*
|
|
505
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
506
|
+
*/
|
|
507
|
+
customer: StatefulRemoteSubscribable<Customer | undefined>;
|
|
508
|
+
/**
|
|
509
|
+
* The email address of the buyer that is interacting with the cart.
|
|
510
|
+
* The value is `undefined` if the app does not have access to customer data.
|
|
511
|
+
*
|
|
512
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
513
|
+
*/
|
|
514
|
+
email: StatefulRemoteSubscribable<string | undefined>;
|
|
515
|
+
/**
|
|
516
|
+
* The phone number of the buyer that is interacting with the cart.
|
|
517
|
+
* The value is `undefined` if the app does not have access to customer data.
|
|
518
|
+
*
|
|
519
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
520
|
+
*/
|
|
521
|
+
phone: StatefulRemoteSubscribable<string | undefined>;
|
|
522
|
+
/**
|
|
523
|
+
* Provides details of the company and the company location that the business customer is purchasing on behalf of.
|
|
524
|
+
* This includes information that can be used to identify the company and the company location that the business
|
|
525
|
+
* customer belongs to.
|
|
526
|
+
*
|
|
527
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
528
|
+
*/
|
|
529
|
+
purchasingCompany: StatefulRemoteSubscribable<PurchasingCompany | undefined>;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Information about a company that the business customer is purchasing on behalf of.
|
|
533
|
+
*/
|
|
534
|
+
export interface PurchasingCompany {
|
|
535
|
+
/**
|
|
536
|
+
* Includes information of the company that the business customer is purchasing on behalf of.
|
|
537
|
+
*
|
|
538
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
539
|
+
*/
|
|
540
|
+
company: Company;
|
|
541
|
+
/**
|
|
542
|
+
* Includes information of the company location that the business customer is purchasing on behalf of.
|
|
543
|
+
*
|
|
544
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
545
|
+
*/
|
|
546
|
+
location: CompanyLocation;
|
|
547
|
+
}
|
|
548
|
+
export interface Company {
|
|
549
|
+
/**
|
|
550
|
+
* The company ID.
|
|
551
|
+
*
|
|
552
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
553
|
+
*/
|
|
554
|
+
id: string;
|
|
555
|
+
/**
|
|
556
|
+
* The name of the company.
|
|
557
|
+
*
|
|
558
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
559
|
+
*/
|
|
560
|
+
name: string;
|
|
561
|
+
/**
|
|
562
|
+
* The external ID of the company that can be set by the merchant.
|
|
563
|
+
*
|
|
564
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
565
|
+
*/
|
|
566
|
+
externalId?: string;
|
|
567
|
+
}
|
|
568
|
+
export interface CompanyLocation {
|
|
569
|
+
/**
|
|
570
|
+
* The company location ID.
|
|
571
|
+
*
|
|
572
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
573
|
+
*/
|
|
574
|
+
id: string;
|
|
575
|
+
/**
|
|
576
|
+
* The name of the company location.
|
|
577
|
+
*
|
|
578
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
579
|
+
*/
|
|
580
|
+
name: string;
|
|
581
|
+
/**
|
|
582
|
+
* The external ID of the company location that can be set by the merchant.
|
|
583
|
+
*
|
|
584
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
585
|
+
*/
|
|
586
|
+
externalId?: string;
|
|
587
|
+
}
|
|
588
|
+
export interface AppliedGiftCard {
|
|
589
|
+
/**
|
|
590
|
+
* The last four characters of the applied gift card's code.
|
|
591
|
+
*/
|
|
592
|
+
lastCharacters: string;
|
|
593
|
+
/**
|
|
594
|
+
* The amount of the applied gift card that will be used when the checkout is completed.
|
|
595
|
+
*/
|
|
596
|
+
amountUsed: Money;
|
|
597
|
+
/**
|
|
598
|
+
* The current balance of the applied gift card prior to checkout completion.
|
|
599
|
+
*/
|
|
600
|
+
balance: Money;
|
|
601
|
+
}
|
|
602
|
+
export interface Shop {
|
|
603
|
+
/**
|
|
604
|
+
* The shop ID.
|
|
605
|
+
* @example 'gid://shopify/Shop/123'
|
|
606
|
+
*/
|
|
607
|
+
id: string;
|
|
608
|
+
/**
|
|
609
|
+
* The name of the shop.
|
|
610
|
+
*/
|
|
611
|
+
name: string;
|
|
612
|
+
/**
|
|
613
|
+
* The primary storefront URL.
|
|
614
|
+
*/
|
|
615
|
+
storefrontUrl?: string;
|
|
616
|
+
/**
|
|
617
|
+
* The shop's myshopify.com domain.
|
|
618
|
+
*/
|
|
619
|
+
myshopifyDomain: string;
|
|
620
|
+
}
|
|
621
|
+
export interface CartCost {
|
|
622
|
+
/**
|
|
623
|
+
* A `Money` value representing the minimum a buyer can expect to pay at the current
|
|
624
|
+
* step of checkout. This value excludes amounts yet to be negotiated. For example,
|
|
625
|
+
* the information step might not have delivery costs calculated.
|
|
626
|
+
*/
|
|
627
|
+
totalAmount: StatefulRemoteSubscribable<Money>;
|
|
628
|
+
}
|
|
629
|
+
export interface CartLine {
|
|
630
|
+
/**
|
|
631
|
+
* These line item IDs are not stable at the moment, they might change after
|
|
632
|
+
* any operations on the line items. You should always look up for an updated
|
|
633
|
+
* ID before any call to `applyCartLinesChange` because you'll need the ID to
|
|
634
|
+
* create a `CartLineChange` object.
|
|
635
|
+
* @example 'gid://shopify/CartLine/123'
|
|
636
|
+
*/
|
|
637
|
+
id: string;
|
|
638
|
+
/**
|
|
639
|
+
* The merchandise being purchased.
|
|
640
|
+
*/
|
|
641
|
+
merchandise: Merchandise;
|
|
642
|
+
/**
|
|
643
|
+
* The quantity of the merchandise being purchased.
|
|
644
|
+
*/
|
|
645
|
+
quantity: number;
|
|
646
|
+
/**
|
|
647
|
+
* The details about the cost components attributed to the cart line.
|
|
648
|
+
*/
|
|
649
|
+
cost: CartLineCost;
|
|
650
|
+
/**
|
|
651
|
+
* The line item additional custom attributes.
|
|
652
|
+
*/
|
|
653
|
+
attributes: Attribute[];
|
|
654
|
+
/**
|
|
655
|
+
* Discounts applied to the cart line.
|
|
656
|
+
*/
|
|
657
|
+
discountAllocations: CartDiscountAllocation[];
|
|
658
|
+
/**
|
|
659
|
+
* Sub lines of the merchandise line. If no sub lines are present, this will be an empty array.
|
|
660
|
+
*/
|
|
661
|
+
lineComponents: CartLineComponentType[];
|
|
662
|
+
}
|
|
663
|
+
type CartLineComponentType = CartBundleLineComponent;
|
|
664
|
+
export interface CartBundleLineComponent {
|
|
665
|
+
type: 'bundle';
|
|
666
|
+
/**
|
|
667
|
+
* A unique identifier for the bundle line component.
|
|
668
|
+
*
|
|
669
|
+
* This ID is not stable. If an operation updates the line items in any way, all IDs could change.
|
|
670
|
+
*
|
|
671
|
+
* @example 'gid://shopify/CartLineComponent/123'
|
|
672
|
+
*/
|
|
673
|
+
id: string;
|
|
674
|
+
/**
|
|
675
|
+
* The merchandise of this bundle line component.
|
|
676
|
+
*/
|
|
677
|
+
merchandise: Merchandise;
|
|
678
|
+
/**
|
|
679
|
+
* The quantity of merchandise being purchased.
|
|
680
|
+
*/
|
|
681
|
+
quantity: number;
|
|
682
|
+
/**
|
|
683
|
+
* The cost attributed to this bundle line component.
|
|
684
|
+
*/
|
|
685
|
+
cost: CartLineCost;
|
|
686
|
+
/**
|
|
687
|
+
* Additional custom attributes for the bundle line component.
|
|
688
|
+
*
|
|
689
|
+
* @example [{key: 'engraving', value: 'hello world'}]
|
|
690
|
+
*/
|
|
691
|
+
attributes: Attribute[];
|
|
692
|
+
}
|
|
693
|
+
export interface CartLineCost {
|
|
694
|
+
/**
|
|
695
|
+
* The total amount after reductions the buyer can expect to pay that is directly attributable to a single
|
|
696
|
+
* cart line.
|
|
697
|
+
*/
|
|
698
|
+
totalAmount: Money;
|
|
699
|
+
}
|
|
700
|
+
export interface Money {
|
|
701
|
+
/**
|
|
702
|
+
* The price amount.
|
|
703
|
+
*/
|
|
704
|
+
amount: number;
|
|
705
|
+
/**
|
|
706
|
+
* The ISO 4217 format for the currency.
|
|
707
|
+
* @example 'CAD' for Canadian dollar
|
|
708
|
+
*/
|
|
709
|
+
currencyCode: CurrencyCode;
|
|
710
|
+
}
|
|
711
|
+
export type Merchandise = ProductVariant;
|
|
712
|
+
export interface BaseMerchandise {
|
|
713
|
+
/**
|
|
714
|
+
* The merchandise ID.
|
|
715
|
+
*/
|
|
716
|
+
id: string;
|
|
717
|
+
}
|
|
718
|
+
export interface ProductVariant extends BaseMerchandise {
|
|
719
|
+
type: 'variant';
|
|
720
|
+
/**
|
|
721
|
+
* A globally-unique identifier.
|
|
722
|
+
* @example 'gid://shopify/ProductVariant/123'
|
|
723
|
+
*/
|
|
724
|
+
id: string;
|
|
725
|
+
/**
|
|
726
|
+
* The product variant’s title.
|
|
727
|
+
*/
|
|
728
|
+
title: string;
|
|
729
|
+
/**
|
|
730
|
+
* The product variant's subtitle.
|
|
731
|
+
*/
|
|
732
|
+
subtitle?: string;
|
|
733
|
+
/**
|
|
734
|
+
* Image associated with the product variant. This field falls back to the product
|
|
735
|
+
* image if no image is available.
|
|
736
|
+
*/
|
|
737
|
+
image?: ImageDetails;
|
|
738
|
+
/**
|
|
739
|
+
* List of product options applied to the variant.
|
|
740
|
+
*/
|
|
741
|
+
selectedOptions: SelectedOption[];
|
|
742
|
+
/**
|
|
743
|
+
* The product object that the product variant belongs to.
|
|
744
|
+
*/
|
|
745
|
+
product: Product;
|
|
746
|
+
/**
|
|
747
|
+
* Whether or not the product requires shipping.
|
|
748
|
+
*/
|
|
749
|
+
requiresShipping: boolean;
|
|
750
|
+
/**
|
|
751
|
+
* The selling plan associated with the merchandise.
|
|
752
|
+
*/
|
|
753
|
+
sellingPlan?: SellingPlan;
|
|
754
|
+
}
|
|
755
|
+
export interface Product {
|
|
756
|
+
/**
|
|
757
|
+
* A globally-unique identifier.
|
|
758
|
+
*/
|
|
759
|
+
id: string;
|
|
760
|
+
/**
|
|
761
|
+
* The product’s vendor name.
|
|
762
|
+
*/
|
|
763
|
+
vendor: string;
|
|
764
|
+
/**
|
|
765
|
+
* A categorization that a product can be tagged with, commonly used for filtering and searching.
|
|
766
|
+
*/
|
|
767
|
+
productType: string;
|
|
768
|
+
}
|
|
769
|
+
export interface ImageDetails {
|
|
770
|
+
/**
|
|
771
|
+
* The image URL.
|
|
772
|
+
*/
|
|
773
|
+
url: string;
|
|
774
|
+
/**
|
|
775
|
+
* The alternative text for the image.
|
|
776
|
+
*/
|
|
777
|
+
altText?: string;
|
|
778
|
+
}
|
|
779
|
+
export interface SelectedOption {
|
|
780
|
+
/**
|
|
781
|
+
* The name of the merchandise option.
|
|
782
|
+
*/
|
|
783
|
+
name: string;
|
|
784
|
+
/**
|
|
785
|
+
* The value of the merchandise option.
|
|
786
|
+
*/
|
|
787
|
+
value: string;
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* A payment option presented to the buyer.
|
|
791
|
+
*/
|
|
792
|
+
export interface PaymentOption {
|
|
793
|
+
/**
|
|
794
|
+
* The type of the payment option.
|
|
795
|
+
*
|
|
796
|
+
* Shops can be configured to support many different payment options. Some options are only available to buyers in specific regions.
|
|
797
|
+
*
|
|
798
|
+
* | Type | Description |
|
|
799
|
+
* |---|---|
|
|
800
|
+
* | `creditCard` | A vaulted or manually entered credit card. |
|
|
801
|
+
* | `deferred` | A [deferred payment](https://help.shopify.com/en/manual/orders/deferred-payments), such as invoicing the buyer and collecting payment at a later time. |
|
|
802
|
+
* | `local` | A [local payment option](https://help.shopify.com/en/manual/payments/shopify-payments/local-payment-methods) specific to the current region or market |
|
|
803
|
+
* | `manualPayment` | A manual payment option such as an in-person retail transaction. |
|
|
804
|
+
* | `offsite` | A payment processed outside of Shopify's checkout, excluding integrated wallets. |
|
|
805
|
+
* | `other` | Another type of payment not defined here. |
|
|
806
|
+
* | `paymentOnDelivery` | A payment that will be collected on delivery. |
|
|
807
|
+
* | `redeemable` | A redeemable payment option such as a gift card or store credit. |
|
|
808
|
+
* | `wallet` | An integrated wallet such as PayPal, Google Pay, Apple Pay, etc. |
|
|
809
|
+
* | `customOnsite` | A custom payment option that is processed through a checkout extension with a payments app. |
|
|
810
|
+
*/
|
|
811
|
+
type: 'creditCard' | 'deferred' | 'local' | 'manualPayment' | 'offsite' | 'other' | 'paymentOnDelivery' | 'redeemable' | 'wallet' | 'customOnsite';
|
|
812
|
+
/**
|
|
813
|
+
* The unique handle for the payment option.
|
|
814
|
+
*
|
|
815
|
+
* This is not a globally unique identifier. It may be an identifier specific to the given checkout session or the current shop.
|
|
816
|
+
*/
|
|
817
|
+
handle: string;
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* A payment option selected by the buyer.
|
|
821
|
+
*/
|
|
822
|
+
export interface SelectedPaymentOption {
|
|
823
|
+
/**
|
|
824
|
+
* The unique handle referencing `PaymentOption.handle`.
|
|
825
|
+
*
|
|
826
|
+
* See [availablePaymentOptions](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi#properties-propertydetail-availablepaymentoptions).
|
|
827
|
+
*/
|
|
828
|
+
handle: string;
|
|
829
|
+
}
|
|
830
|
+
export interface CartDiscountCode {
|
|
831
|
+
/**
|
|
832
|
+
* The code for the discount
|
|
833
|
+
*/
|
|
834
|
+
code: string;
|
|
835
|
+
}
|
|
836
|
+
export type CartDiscountAllocation = CartCodeDiscountAllocation | CartAutomaticDiscountAllocation | CartCustomDiscountAllocation;
|
|
837
|
+
export interface CartDiscountAllocationBase {
|
|
838
|
+
/**
|
|
839
|
+
* The money amount that has been discounted from the order
|
|
840
|
+
*/
|
|
841
|
+
discountedAmount: Money;
|
|
842
|
+
}
|
|
843
|
+
export interface CartCodeDiscountAllocation extends CartDiscountAllocationBase {
|
|
844
|
+
/**
|
|
845
|
+
* The code for the discount
|
|
846
|
+
*/
|
|
847
|
+
code: string;
|
|
848
|
+
/**
|
|
849
|
+
* The type of the code discount
|
|
850
|
+
*/
|
|
851
|
+
type: 'code';
|
|
852
|
+
}
|
|
853
|
+
export interface CartAutomaticDiscountAllocation extends CartDiscountAllocationBase {
|
|
854
|
+
/**
|
|
855
|
+
* The title of the automatic discount
|
|
856
|
+
*/
|
|
857
|
+
title: string;
|
|
858
|
+
/**
|
|
859
|
+
* The type of the automatic discount
|
|
860
|
+
*/
|
|
861
|
+
type: 'automatic';
|
|
862
|
+
}
|
|
863
|
+
export interface CartCustomDiscountAllocation extends CartDiscountAllocationBase {
|
|
864
|
+
/**
|
|
865
|
+
* The title of the custom discount
|
|
866
|
+
*/
|
|
867
|
+
title: string;
|
|
868
|
+
/**
|
|
869
|
+
* The type of the custom discount
|
|
870
|
+
*/
|
|
871
|
+
type: 'custom';
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Information about a customer who has previously purchased from this shop.
|
|
875
|
+
*
|
|
876
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
877
|
+
*/
|
|
878
|
+
export interface Customer {
|
|
879
|
+
/**
|
|
880
|
+
* Customer ID.
|
|
881
|
+
*
|
|
882
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
883
|
+
*
|
|
884
|
+
* @example 'gid://shopify/Customer/123'
|
|
885
|
+
*/
|
|
886
|
+
id: string;
|
|
887
|
+
/**
|
|
888
|
+
* The email of the customer.
|
|
889
|
+
*
|
|
890
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
891
|
+
*/
|
|
892
|
+
email?: string;
|
|
893
|
+
/**
|
|
894
|
+
* The phone number of the customer.
|
|
895
|
+
*
|
|
896
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
897
|
+
*/
|
|
898
|
+
phone?: string;
|
|
899
|
+
/**
|
|
900
|
+
* The full name of the customer.
|
|
901
|
+
*
|
|
902
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
903
|
+
*/
|
|
904
|
+
fullName?: string;
|
|
905
|
+
/**
|
|
906
|
+
* The first name of the customer.
|
|
907
|
+
*
|
|
908
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
909
|
+
*/
|
|
910
|
+
firstName?: string;
|
|
911
|
+
/**
|
|
912
|
+
* The last name of the customer.
|
|
913
|
+
*
|
|
914
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
915
|
+
*/
|
|
916
|
+
lastName?: string;
|
|
917
|
+
/**
|
|
918
|
+
* The image associated with the customer.
|
|
919
|
+
*
|
|
920
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
921
|
+
*/
|
|
922
|
+
image: ImageDetails;
|
|
923
|
+
/**
|
|
924
|
+
* Defines if the customer accepts marketing activities.
|
|
925
|
+
*
|
|
926
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
927
|
+
*/
|
|
928
|
+
acceptsMarketing: boolean;
|
|
929
|
+
/**
|
|
930
|
+
* The Store Credit Accounts owned by the customer and usable during the checkout process.
|
|
931
|
+
*
|
|
932
|
+
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
|
|
933
|
+
*
|
|
934
|
+
* @private
|
|
935
|
+
*/
|
|
936
|
+
storeCreditAccounts: StoreCreditAccount[];
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Settings describing the behavior of the buyer's checkout.
|
|
940
|
+
*/
|
|
941
|
+
export interface CheckoutSettings {
|
|
942
|
+
/**
|
|
943
|
+
* The type of order that will be created once the buyer completes checkout.
|
|
944
|
+
*/
|
|
945
|
+
orderSubmission: 'DRAFT_ORDER' | 'ORDER';
|
|
946
|
+
/**
|
|
947
|
+
* Represents the merchant configured payment terms.
|
|
948
|
+
*/
|
|
949
|
+
paymentTermsTemplate?: PaymentTermsTemplate;
|
|
950
|
+
/**
|
|
951
|
+
* Settings describing the behavior of the shipping address.
|
|
952
|
+
*/
|
|
953
|
+
shippingAddress: ShippingAddressSettings;
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* Settings describing the behavior of the shipping address.
|
|
957
|
+
*/
|
|
958
|
+
export interface ShippingAddressSettings {
|
|
959
|
+
/**
|
|
960
|
+
* Describes whether the buyer can ship to any address during checkout.
|
|
961
|
+
*/
|
|
962
|
+
isEditable: boolean;
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* Represents the payment terms template object.
|
|
966
|
+
*/
|
|
967
|
+
export interface PaymentTermsTemplate {
|
|
968
|
+
/**
|
|
969
|
+
* A globally-unique ID.
|
|
970
|
+
* @example 'gid://shopify/PaymentTermsTemplate/1'
|
|
971
|
+
*/
|
|
972
|
+
id: string;
|
|
973
|
+
/**
|
|
974
|
+
* The name of the payment terms translated to the buyer's current language. See [localization.language](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi#properties-propertydetail-localization).
|
|
975
|
+
*/
|
|
976
|
+
name: string;
|
|
977
|
+
/**
|
|
978
|
+
* The due date for net payment terms as a ISO 8601 formatted string `YYYY-MM-DDTHH:mm:ss.sssZ`.
|
|
979
|
+
*/
|
|
980
|
+
dueDate?: string;
|
|
981
|
+
/**
|
|
982
|
+
* The number of days between the issued date and due date if using net payment terms.
|
|
983
|
+
*/
|
|
984
|
+
dueInDays?: number;
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* Information about a Store Credit Account.
|
|
988
|
+
*/
|
|
989
|
+
export interface StoreCreditAccount {
|
|
990
|
+
/**
|
|
991
|
+
* A globally-unique identifier.
|
|
992
|
+
* @example 'gid://shopify/StoreCreditAccount/1'
|
|
993
|
+
*/
|
|
994
|
+
id: string;
|
|
995
|
+
/**
|
|
996
|
+
* The current balance of the Store Credit Account.
|
|
997
|
+
*/
|
|
998
|
+
balance: Money;
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* The merchant-defined setting values for the extension.
|
|
1002
|
+
*/
|
|
1003
|
+
export interface ExtensionSettings {
|
|
1004
|
+
[key: string]: string | number | boolean | undefined;
|
|
1005
|
+
}
|
|
1006
|
+
export interface Analytics {
|
|
1007
|
+
/**
|
|
1008
|
+
* Publish method to emit analytics events to [Web Pixels](https://shopify.dev/docs/apps/marketing).
|
|
1009
|
+
*/
|
|
1010
|
+
publish(name: string, data: {
|
|
1011
|
+
[key: string]: unknown;
|
|
1012
|
+
}): Promise<boolean>;
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* Represents the delivery information and options available for one or
|
|
1016
|
+
* more cart lines.
|
|
1017
|
+
*/
|
|
1018
|
+
export interface DeliveryGroup {
|
|
1019
|
+
/**
|
|
1020
|
+
* The cart line references associated to the delivery group.
|
|
1021
|
+
*/
|
|
1022
|
+
targetedCartLines: CartLineReference[];
|
|
1023
|
+
/**
|
|
1024
|
+
* The delivery options available for the delivery group.
|
|
1025
|
+
*/
|
|
1026
|
+
deliveryOptions: DeliveryOption[];
|
|
1027
|
+
/**
|
|
1028
|
+
* The selected delivery option for the delivery group.
|
|
1029
|
+
*/
|
|
1030
|
+
selectedDeliveryOption?: DeliveryOptionReference;
|
|
1031
|
+
/**
|
|
1032
|
+
* The type of the delivery group.
|
|
1033
|
+
*/
|
|
1034
|
+
groupType: DeliveryGroupType;
|
|
1035
|
+
/**
|
|
1036
|
+
* Whether delivery is required for the delivery group.
|
|
1037
|
+
*/
|
|
1038
|
+
isDeliveryRequired: boolean;
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* The possible types of a delivery group.
|
|
1042
|
+
*/
|
|
1043
|
+
export type DeliveryGroupType = 'oneTimePurchase' | 'subscription';
|
|
1044
|
+
/**
|
|
1045
|
+
* Represents a reference to a cart line.
|
|
1046
|
+
*/
|
|
1047
|
+
export interface CartLineReference {
|
|
1048
|
+
/**
|
|
1049
|
+
* The unique identifier of the referenced cart line.
|
|
1050
|
+
*/
|
|
1051
|
+
id: string;
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Represents a reference to a delivery option.
|
|
1055
|
+
*/
|
|
1056
|
+
export interface DeliveryOptionReference {
|
|
1057
|
+
/**
|
|
1058
|
+
* The unique identifier of the referenced delivery option.
|
|
1059
|
+
*/
|
|
1060
|
+
handle: string;
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Represents a base interface for a single delivery option.
|
|
1064
|
+
*/
|
|
1065
|
+
export interface DeliveryOption {
|
|
1066
|
+
/**
|
|
1067
|
+
* The unique identifier of the delivery option.
|
|
1068
|
+
*/
|
|
1069
|
+
handle: string;
|
|
1070
|
+
/**
|
|
1071
|
+
* The title of the delivery option.
|
|
1072
|
+
*/
|
|
1073
|
+
title?: string;
|
|
1074
|
+
/**
|
|
1075
|
+
* The description of the delivery option.
|
|
1076
|
+
*/
|
|
1077
|
+
description?: string;
|
|
1078
|
+
}
|
|
1079
|
+
/**
|
|
1080
|
+
* Represents a delivery option that is a shipping option.
|
|
1081
|
+
*/
|
|
1082
|
+
export interface ShippingOption extends DeliveryOption {
|
|
1083
|
+
/**
|
|
1084
|
+
* The type of this delivery option.
|
|
1085
|
+
*/
|
|
1086
|
+
type: 'shipping' | 'local';
|
|
1087
|
+
/**
|
|
1088
|
+
* Information about the carrier.
|
|
1089
|
+
*/
|
|
1090
|
+
carrier: ShippingOptionCarrier;
|
|
1091
|
+
/**
|
|
1092
|
+
* The cost of the delivery.
|
|
1093
|
+
*/
|
|
1094
|
+
cost: Money;
|
|
1095
|
+
/**
|
|
1096
|
+
* The cost of the delivery including discounts.
|
|
1097
|
+
*/
|
|
1098
|
+
costAfterDiscounts: Money;
|
|
1099
|
+
/**
|
|
1100
|
+
* Information about the estimated delivery time.
|
|
1101
|
+
*/
|
|
1102
|
+
deliveryEstimate: DeliveryEstimate;
|
|
1103
|
+
}
|
|
1104
|
+
export interface DeliveryEstimate {
|
|
1105
|
+
/**
|
|
1106
|
+
* The estimated time in transit for the delivery in seconds.
|
|
1107
|
+
*/
|
|
1108
|
+
timeInTransit?: NumberRange;
|
|
1109
|
+
}
|
|
1110
|
+
export interface ShippingOptionCarrier {
|
|
1111
|
+
/**
|
|
1112
|
+
* The name of the carrier.
|
|
1113
|
+
*/
|
|
1114
|
+
name?: string;
|
|
1115
|
+
}
|
|
1116
|
+
export interface PickupPointOption extends DeliveryOption {
|
|
1117
|
+
/**
|
|
1118
|
+
* The type of this delivery option.
|
|
1119
|
+
*/
|
|
1120
|
+
type: 'pickupPoint';
|
|
1121
|
+
/**
|
|
1122
|
+
* Information about the carrier that ships to the pickup point.
|
|
1123
|
+
*/
|
|
1124
|
+
carrier: PickupPointCarrier;
|
|
1125
|
+
/**
|
|
1126
|
+
* The cost to ship to this pickup point.
|
|
1127
|
+
*/
|
|
1128
|
+
cost: Money;
|
|
1129
|
+
/**
|
|
1130
|
+
* The cost to ship to this pickup point including discounts.
|
|
1131
|
+
*/
|
|
1132
|
+
costAfterDiscounts: Money;
|
|
1133
|
+
/**
|
|
1134
|
+
* The location details of the pickup point.
|
|
1135
|
+
*/
|
|
1136
|
+
location: PickupPointLocation;
|
|
1137
|
+
}
|
|
1138
|
+
export interface PickupLocationOption extends DeliveryOption {
|
|
1139
|
+
/**
|
|
1140
|
+
* The type of this delivery option.
|
|
1141
|
+
*/
|
|
1142
|
+
type: 'pickup';
|
|
1143
|
+
/**
|
|
1144
|
+
* The location details of the pickup location.
|
|
1145
|
+
*/
|
|
1146
|
+
location: PickupLocation;
|
|
1147
|
+
}
|
|
1148
|
+
interface PickupLocation {
|
|
1149
|
+
/**
|
|
1150
|
+
* The name of the pickup location.
|
|
1151
|
+
*/
|
|
1152
|
+
name?: string;
|
|
1153
|
+
/**
|
|
1154
|
+
* The address of the pickup location.
|
|
1155
|
+
*/
|
|
1156
|
+
address: MailingAddress;
|
|
1157
|
+
}
|
|
1158
|
+
interface PickupPointLocation {
|
|
1159
|
+
/**
|
|
1160
|
+
* The name of the pickup point.
|
|
1161
|
+
*/
|
|
1162
|
+
name?: string;
|
|
1163
|
+
/**
|
|
1164
|
+
* The unique identifier of the pickup point.
|
|
1165
|
+
*/
|
|
1166
|
+
handle: string;
|
|
1167
|
+
/**
|
|
1168
|
+
* The address of the pickup point.
|
|
1169
|
+
*/
|
|
1170
|
+
address: MailingAddress;
|
|
1171
|
+
}
|
|
1172
|
+
interface PickupPointCarrier {
|
|
1173
|
+
/**
|
|
1174
|
+
* The code identifying the carrier.
|
|
1175
|
+
*/
|
|
1176
|
+
code?: string;
|
|
1177
|
+
/**
|
|
1178
|
+
* The name of the carrier.
|
|
1179
|
+
*/
|
|
1180
|
+
name?: string;
|
|
1181
|
+
}
|
|
1182
|
+
export interface NumberRange {
|
|
1183
|
+
/**
|
|
1184
|
+
* The lower bound of the number range.
|
|
1185
|
+
*/
|
|
1186
|
+
lower?: number;
|
|
1187
|
+
/**
|
|
1188
|
+
* The upper bound of the number range.
|
|
1189
|
+
*/
|
|
1190
|
+
upper?: number;
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* Information about an order that was placed.
|
|
1194
|
+
*/
|
|
1195
|
+
export interface Order {
|
|
1196
|
+
/**
|
|
1197
|
+
* A globally-unique identifier.
|
|
1198
|
+
* @example 'gid://shopify/Order/1'
|
|
1199
|
+
*/
|
|
1200
|
+
id: string;
|
|
1201
|
+
/**
|
|
1202
|
+
* Unique identifier for the order that appears on the order.
|
|
1203
|
+
* @example '#1000'
|
|
1204
|
+
*/
|
|
1205
|
+
name: string;
|
|
1206
|
+
/**
|
|
1207
|
+
* If cancelled, the time at which the order was cancelled.
|
|
1208
|
+
*/
|
|
1209
|
+
cancelledAt?: string;
|
|
1210
|
+
}
|
|
1211
|
+
export {};
|
|
1212
|
+
//# sourceMappingURL=order-status.d.ts.map
|