local-storefront 0.2.0 → 0.3.0-rc.1
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/CHANGELOG.md +1299 -0
- package/README.md +14 -9
- package/bin/lsf.js +4 -1
- package/docs/README.md +59 -0
- package/docs/admin-reference.md +1406 -0
- package/docs/admin.md +1751 -0
- package/docs/agents.md +366 -0
- package/docs/architecture.md +303 -0
- package/docs/checkout.md +1609 -0
- package/docs/cli.md +873 -0
- package/docs/compatibility.md +475 -0
- package/docs/control-api.md +251 -0
- package/docs/data-format.md +943 -0
- package/docs/data-reference.md +1247 -0
- package/docs/formatting.md +119 -0
- package/docs/performance.md +266 -0
- package/docs/quickstart-admin-api.md +211 -0
- package/docs/quickstart-app.md +271 -0
- package/docs/quickstart-functions.md +207 -0
- package/docs/quickstart-theme.md +177 -0
- package/docs/storefront.md +210 -0
- package/docs/strict-liquid.md +178 -0
- package/docs/testing.md +590 -0
- package/llms.txt +39 -0
- package/package.json +11 -8
|
@@ -0,0 +1,1247 @@
|
|
|
1
|
+
# Store data reference
|
|
2
|
+
|
|
3
|
+
Every type of the store data format. This file is generated from the JSON Schema the
|
|
4
|
+
validator uses (`npx local-storefront docs --reference`); the guide is in
|
|
5
|
+
[data-format.md](data-format.md).
|
|
6
|
+
|
|
7
|
+
## Data file
|
|
8
|
+
|
|
9
|
+
A data file: any combination of the sections below. Every `*.json` file at the root of the
|
|
10
|
+
data directory is one of these, and they are merged, so you can split the data as you like
|
|
11
|
+
(`shop.json`, `catalog.json`, ...).
|
|
12
|
+
|
|
13
|
+
| Field | Type | Description |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| `$schema` | string | Lets editors validate and autocomplete the file, e.g. `"./schema/store.schema.json"`. |
|
|
16
|
+
| `shop` | [Shop](#shop) | General store information. At most one data file may define it. |
|
|
17
|
+
| `products` | array of [Product](#product) | Products. They can also live one per file in `products/`. |
|
|
18
|
+
| `collections` | array of [Collection](#collection) | Collections. They can also live one per file in `collections/`. |
|
|
19
|
+
| `pages` | array of [Page](#page) | Pages. They can also live one per file in `pages/`. |
|
|
20
|
+
| `blogs` | array of [Blog](#blog) | Blogs with their articles. They can also live one per file in `blogs/`. |
|
|
21
|
+
| `menus` | map of [Menu](#menu) | Navigation menus by handle, e.g. `main-menu` and `footer`. |
|
|
22
|
+
| `customers` | array of [Customer](#customer) | Customers. They can also live one per file in `customers/`. |
|
|
23
|
+
| `companies` | array of [Company](#company) | Companies that buy from the store (B2B). Customers join one with their `company`. |
|
|
24
|
+
| `gift_cards` | array of [GiftCard](#giftcard) | Issued gift cards, each with its own page. |
|
|
25
|
+
| `metaobjects` | map of array of [Metaobject](#metaobject) | Metaobject entries by type. |
|
|
26
|
+
| `localization` | [Localization](#localization) | The countries and languages of the store. At most one data file may define it. |
|
|
27
|
+
| `swatches` | map of [Swatch](#swatch) | The swatches of product option values, by the name of the value: `{"White": "#ffffff", "Floral": {"image": "swatches/floral.jpg"}}`. Every option value with one of these names gets the swatch, on products and in collection filters. |
|
|
28
|
+
| `locations` | array of [Location](#location) | The places the store stocks products at, for store pickup. |
|
|
29
|
+
| `selling_plan_groups` | array of [SellingPlanGroup](#sellingplangroup) | Groups of selling plans: subscriptions, pre-orders and other purchase options. |
|
|
30
|
+
| `files` | map of [File](#file) | Metadata for files in `files/`, by path. |
|
|
31
|
+
| `session` | [Session](#session) | What every new browser session starts with: a logged-in customer, a filled cart... |
|
|
32
|
+
| `checkout` | [Checkout](#checkout) | The fake checkout of `lsf app dev --app`: shipping rates, payment methods, discounts and Function settings. At most one data file may define it. |
|
|
33
|
+
| `now` | string | Freezes the clock: the instant `'now'` resolves to, e.g. `"2025-01-15T10:00:00Z"`. Set it to make renders reproducible; each `'now'` of a render is then one nanosecond after the previous one, so `%N` still differs between calls. Defaults to the real time, read at each `'now'`. |
|
|
34
|
+
| `theme_settings` | map of any JSON value | Overrides for theme settings (`config/settings_data.json`), by setting id. |
|
|
35
|
+
| `app` | [AppInstallation](#appinstallation) | The app of `--app` as this store has it installed: what its theme app extensions read. |
|
|
36
|
+
|
|
37
|
+
## Shop
|
|
38
|
+
|
|
39
|
+
General store information (the `shop` object). Every field has a sensible default.
|
|
40
|
+
|
|
41
|
+
| Field | Type | Description |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| `id` | integer | |
|
|
44
|
+
| `name` | string | Defaults to `"Local Store"`. |
|
|
45
|
+
| `description` | string | |
|
|
46
|
+
| `email` | string | |
|
|
47
|
+
| `phone` | string | |
|
|
48
|
+
| `domain` | string | The primary domain, without scheme. Defaults to the host the server is reached on. |
|
|
49
|
+
| `permanent_domain` | string | The `*.myshopify.com` domain. Defaults to a value derived from the name. |
|
|
50
|
+
| `currency` | string | ISO 4217 code of the store currency. Defaults to `USD`. |
|
|
51
|
+
| `money_format` | string | How `money` formats amounts, e.g. `"${{amount}}"` or `"{{amount_with_comma_separator}} €"`. Defaults to the usual format of the currency. |
|
|
52
|
+
| `money_with_currency_format` | string | How `money_with_currency` formats amounts, e.g. `"${{amount}} USD"`. |
|
|
53
|
+
| `timezone` | string | IANA time zone used to display dates, e.g. `"Europe/Paris"`. Defaults to `UTC`. |
|
|
54
|
+
| `address` | [Address](#address) | |
|
|
55
|
+
| `policies` | [Policies](#policies) | |
|
|
56
|
+
| `enabled_payment_types` | array of string | Payment icons to show, e.g. `["visa", "master", "american_express", "paypal"]`. |
|
|
57
|
+
| `customer_accounts_enabled` | boolean | Whether customer accounts exist at all. Defaults to `true`. |
|
|
58
|
+
| `customer_accounts_optional` | boolean | Whether checking out as a guest is possible. Defaults to `true`. |
|
|
59
|
+
| `taxes_included` | boolean | Whether prices include taxes. Defaults to `false`. |
|
|
60
|
+
| `password_message` | string | The message shown on the password page. |
|
|
61
|
+
| `password` | string | The password the `/password` page accepts. Defaults to `"password"`. The storefront is never locked: the page is there to be worked on, and nothing leads to it. |
|
|
62
|
+
| `brand` | [Brand](#brand) | |
|
|
63
|
+
| `metafields` | map of map of [Metafield](#metafield) | |
|
|
64
|
+
|
|
65
|
+
## Address
|
|
66
|
+
|
|
67
|
+
A postal address. Every field is optional.
|
|
68
|
+
|
|
69
|
+
| Field | Type | Description |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| `id` | integer | |
|
|
72
|
+
| `first_name` | string | |
|
|
73
|
+
| `last_name` | string | |
|
|
74
|
+
| `company` | string | |
|
|
75
|
+
| `address1` | string | |
|
|
76
|
+
| `address2` | string | |
|
|
77
|
+
| `city` | string | |
|
|
78
|
+
| `province` | string | Province or state name, e.g. `"Ontario"`. |
|
|
79
|
+
| `province_code` | string | E.g. `"ON"`. |
|
|
80
|
+
| `country` | string | Country name, e.g. `"Canada"`. |
|
|
81
|
+
| `country_code` | string | ISO 3166-1 alpha-2 code, e.g. `"CA"`. |
|
|
82
|
+
| `zip` | string | |
|
|
83
|
+
| `phone` | string | |
|
|
84
|
+
|
|
85
|
+
## Policies
|
|
86
|
+
|
|
87
|
+
The store policies. Each one that is set gets a page under `/policies/`.
|
|
88
|
+
|
|
89
|
+
| Field | Type | Description |
|
|
90
|
+
|---|---|---|
|
|
91
|
+
| `privacy_policy` | [Policy](#policy) | |
|
|
92
|
+
| `refund_policy` | [Policy](#policy) | |
|
|
93
|
+
| `shipping_policy` | [Policy](#policy) | |
|
|
94
|
+
| `terms_of_service` | [Policy](#policy) | |
|
|
95
|
+
| `subscription_policy` | [Policy](#policy) | |
|
|
96
|
+
|
|
97
|
+
## Policy
|
|
98
|
+
|
|
99
|
+
A store policy (`shop.refund_policy`, `/policies/refund-policy`).
|
|
100
|
+
|
|
101
|
+
| Field | Type | Description |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| `title` | string | Defaults to the standard title of the policy. |
|
|
104
|
+
| `body` | string | **Required.** HTML body. |
|
|
105
|
+
|
|
106
|
+
## Brand
|
|
107
|
+
|
|
108
|
+
The brand assets of the store (`shop.brand`).
|
|
109
|
+
|
|
110
|
+
| Field | Type | Description |
|
|
111
|
+
|---|---|---|
|
|
112
|
+
| `slogan` | string | |
|
|
113
|
+
| `short_description` | string | |
|
|
114
|
+
| `logo` | [Image](#image) | |
|
|
115
|
+
| `square_logo` | [Image](#image) | |
|
|
116
|
+
| `cover_image` | [Image](#image) | |
|
|
117
|
+
| `favicon` | [Image](#image) | |
|
|
118
|
+
| `colors` | any JSON value | Brand colors as CSS hex strings, e.g. `{"primary": ["#112233"], "secondary": []}`. |
|
|
119
|
+
|
|
120
|
+
## Image
|
|
121
|
+
|
|
122
|
+
An image: either just its source, or an object with more detail.
|
|
123
|
+
|
|
124
|
+
The source is a path inside the `files/` directory of the data directory
|
|
125
|
+
(`"shirt.jpg"` → `files/shirt.jpg`). When no such file exists a placeholder of the declared
|
|
126
|
+
size is generated, so fixtures work without shipping real images.
|
|
127
|
+
|
|
128
|
+
One of:
|
|
129
|
+
|
|
130
|
+
- string
|
|
131
|
+
- [ImageDetail](#imagedetail)
|
|
132
|
+
|
|
133
|
+
## ImageDetail
|
|
134
|
+
|
|
135
|
+
An image with its metadata.
|
|
136
|
+
|
|
137
|
+
| Field | Type | Description |
|
|
138
|
+
|---|---|---|
|
|
139
|
+
| `src` | string | **Required.** Path of the image inside `files/`, e.g. `"products/shirt-front.jpg"`. |
|
|
140
|
+
| `alt` | string | Alternative text. Defaults to an empty string. |
|
|
141
|
+
| `width` | integer | Width in pixels. Read from the file when it exists, otherwise defaults to 1200. |
|
|
142
|
+
| `height` | integer | Height in pixels. Read from the file when it exists, otherwise defaults to 1200. |
|
|
143
|
+
| `id` | integer | |
|
|
144
|
+
| `focal_point` | [FocalPoint](#focalpoint) | The focal point as percentages from the top-left corner, e.g. `{"x": 50, "y": 20}`. |
|
|
145
|
+
|
|
146
|
+
## FocalPoint
|
|
147
|
+
|
|
148
|
+
The point of an image that should stay visible when it is cropped.
|
|
149
|
+
|
|
150
|
+
| Field | Type | Description |
|
|
151
|
+
|---|---|---|
|
|
152
|
+
| `x` | number | **Required.** Horizontal position, 0 (left) to 100 (right). |
|
|
153
|
+
| `y` | number | **Required.** Vertical position, 0 (top) to 100 (bottom). |
|
|
154
|
+
|
|
155
|
+
## Metafield
|
|
156
|
+
|
|
157
|
+
A metafield value. Write the value directly and its type is inferred (string →
|
|
158
|
+
`single_line_text_field`, integer → `number_integer`, decimal → `number_decimal`, boolean →
|
|
159
|
+
`boolean`, anything else → `json`), or spell out `{"type": ..., "value": ...}`.
|
|
160
|
+
|
|
161
|
+
One of:
|
|
162
|
+
|
|
163
|
+
- [TypedMetafield](#typedmetafield)
|
|
164
|
+
- any JSON value
|
|
165
|
+
|
|
166
|
+
## TypedMetafield
|
|
167
|
+
|
|
168
|
+
A metafield with an explicit type.
|
|
169
|
+
|
|
170
|
+
| Field | Type | Description |
|
|
171
|
+
|---|---|---|
|
|
172
|
+
| `type` | string | **Required.** A Shopify metafield type, e.g. `single_line_text_field`, `multi_line_text_field`, `rich_text_field`, `number_integer`, `number_decimal`, `boolean`, `color`, `date`, `date_time`, `url`, `json`, `money`, `rating`, `weight`, `volume`, `dimension` and the other measurements (`distance`, `temperature`, `duration`...), `product_reference`, `collection_reference`, `page_reference`, `article_reference` (`blog/article`, or the article's handle alone), `file_reference`, `metaobject_reference`, or a `list.` variant of those. |
|
|
173
|
+
| `value` | any JSON value | **Required.** The value. References are written as handles (`"blue-shirt"`), files as paths inside `files/`, lists as JSON arrays. |
|
|
174
|
+
|
|
175
|
+
## Product
|
|
176
|
+
|
|
177
|
+
A product.
|
|
178
|
+
|
|
179
|
+
The smallest valid product is `{"title": "Blue shirt", "price": 1999}`: it gets a single
|
|
180
|
+
default variant, like a product without options in the Shopify admin.
|
|
181
|
+
|
|
182
|
+
| Field | Type | Description |
|
|
183
|
+
|---|---|---|
|
|
184
|
+
| `$schema` | string | Lets editors validate and autocomplete the file, e.g. `"../schema/product.schema.json"`. |
|
|
185
|
+
| `id` | integer | Generated from the handle when omitted. |
|
|
186
|
+
| `title` | string | **Required.** |
|
|
187
|
+
| `handle` | string | The URL slug (`/products/<handle>`). Derived from the title when omitted. In a `products/<name>.json` file it defaults to the file name. |
|
|
188
|
+
| `description` | string | HTML description. Also exposed as `product.content`. |
|
|
189
|
+
| `vendor` | string | |
|
|
190
|
+
| `type` | string | The product type, e.g. `"Shirts"`. |
|
|
191
|
+
| `tags` | array of string | |
|
|
192
|
+
| `options` | array of [Option](#option) | Option names, e.g. `["Size", "Color"]`. At most three. Omit for a product with a single default variant. |
|
|
193
|
+
| `variants` | array of [Variant](#variant) | The variants. Each must give one value per option. |
|
|
194
|
+
| `price` | [Money](#money) | Price of the variants that do not set their own, and of the default variant. |
|
|
195
|
+
| `compare_at_price` | [Money](#money) | Compare-at price of the variants that do not set their own. |
|
|
196
|
+
| `images` | array of [Image](#image) | Shorthand for image-only media. Use `media` for videos and 3D models. |
|
|
197
|
+
| `media` | array of [Media](#media) | Images, videos and models in display order. When set, `images` must be empty. |
|
|
198
|
+
| `available` | boolean | Shorthand to set availability on every variant that does not say otherwise. |
|
|
199
|
+
| `collections` | array of string | Handles of the collections this product belongs to, in addition to the collections that list it in their own `products`. |
|
|
200
|
+
| `template_suffix` | string | Selects `templates/product.<suffix>.json` instead of `templates/product.json`. |
|
|
201
|
+
| `gift_card` | boolean | Whether the product is a gift card (`product.gift_card?`). |
|
|
202
|
+
| `created_at` | string | |
|
|
203
|
+
| `published_at` | string | |
|
|
204
|
+
| `updated_at` | string | |
|
|
205
|
+
| `metafields` | map of map of [Metafield](#metafield) | |
|
|
206
|
+
| `recommendations` | array of string | Handles of the products returned by product recommendations for this product. Defaults to other products from the same collections. |
|
|
207
|
+
| `selling_plan_groups` | array of string | Names of the selling plan groups (from `selling_plan_groups`) this product is sold with, in addition to the groups that list it in their own `products`. |
|
|
208
|
+
| `requires_selling_plan` | boolean | Whether the product can only be bought with a selling plan, like a product sold by subscription only. Defaults to `false`. |
|
|
209
|
+
| `status` | [ProductStatus](#productstatus) | `active`, `draft` or `archived`. Defaults to `active`. Only an active product that is published is on the storefront: a draft, an archived product or one that is not published has no page, is in no collection, and cannot be bought, but the Admin API lists it. What names it (a collection, a menu, an order of the data) leaves it out without an error. |
|
|
210
|
+
| `published` | boolean | Whether the product is published on the Online Store. Defaults to `true`. |
|
|
211
|
+
|
|
212
|
+
## Option
|
|
213
|
+
|
|
214
|
+
A product option. Write just the name (`"Size"`); the values are collected from the variants.
|
|
215
|
+
|
|
216
|
+
One of:
|
|
217
|
+
|
|
218
|
+
- string
|
|
219
|
+
- [OptionDetail](#optiondetail)
|
|
220
|
+
|
|
221
|
+
## OptionDetail
|
|
222
|
+
|
|
223
|
+
A product option with its values in a chosen order.
|
|
224
|
+
|
|
225
|
+
| Field | Type | Description |
|
|
226
|
+
|---|---|---|
|
|
227
|
+
| `name` | string | **Required.** |
|
|
228
|
+
| `values` | array of [OptionValue](#optionvalue) | The values in display order. Defaults to the order they appear in the variants. A value is its name (`"White"`), or its name with a swatch (`{"name": "White", "swatch": "#ffffff"}`). |
|
|
229
|
+
|
|
230
|
+
## OptionValue
|
|
231
|
+
|
|
232
|
+
A value of a product option: its name, or its name with a swatch.
|
|
233
|
+
|
|
234
|
+
One of:
|
|
235
|
+
|
|
236
|
+
- string
|
|
237
|
+
- [OptionValueDetail](#optionvaluedetail)
|
|
238
|
+
|
|
239
|
+
## OptionValueDetail
|
|
240
|
+
|
|
241
|
+
A value of a product option with its swatch (`product_option_value.swatch`).
|
|
242
|
+
|
|
243
|
+
| Field | Type | Description |
|
|
244
|
+
|---|---|---|
|
|
245
|
+
| `name` | string | **Required.** |
|
|
246
|
+
| `swatch` | [Swatch](#swatch) | The swatch of the value on this product. Defaults to the swatch the store's `swatches` give to this name. |
|
|
247
|
+
|
|
248
|
+
## Swatch
|
|
249
|
+
|
|
250
|
+
How an option value is shown instead of its name: a CSS color (`"#f4f1ea"`), or an object
|
|
251
|
+
with a color, an image, or both.
|
|
252
|
+
|
|
253
|
+
One of:
|
|
254
|
+
|
|
255
|
+
- string
|
|
256
|
+
- [SwatchDetail](#swatchdetail)
|
|
257
|
+
|
|
258
|
+
## SwatchDetail
|
|
259
|
+
|
|
260
|
+
A swatch with a color, an image, or both (`swatch.color`, `swatch.image`).
|
|
261
|
+
|
|
262
|
+
| Field | Type | Description |
|
|
263
|
+
|---|---|---|
|
|
264
|
+
| `color` | string | A CSS color: `"#f4f1ea"`, `"rgb(244, 241, 234)"`, ... |
|
|
265
|
+
| `image` | [Image](#image) | An image, for a pattern that a single color cannot show. |
|
|
266
|
+
|
|
267
|
+
## Variant
|
|
268
|
+
|
|
269
|
+
A product variant.
|
|
270
|
+
|
|
271
|
+
| Field | Type | Description |
|
|
272
|
+
|---|---|---|
|
|
273
|
+
| `id` | integer | Generated from the product handle and the variant's position when omitted. |
|
|
274
|
+
| `title` | string | Defaults to the option values joined with ` / ` (`"Small / Blue"`). |
|
|
275
|
+
| `options` | array of string | One value per product option, in the order of the product's `options`. |
|
|
276
|
+
| `price` | [Money](#money) | Defaults to the product's `price`. |
|
|
277
|
+
| `compare_at_price` | [Money](#money) | The price before a sale. Must be higher than `price` to show as a discount. |
|
|
278
|
+
| `sku` | string | Also a convenient way to reference the variant from carts and orders. |
|
|
279
|
+
| `barcode` | string | |
|
|
280
|
+
| `available` | boolean | Whether the variant can be bought. Derived from the inventory fields when omitted. `false` alone makes the variant tracked and out of stock, as a sold-out variant is on Shopify. |
|
|
281
|
+
| `inventory_quantity` | integer | Units in stock. Setting it turns inventory tracking on. |
|
|
282
|
+
| `inventory_tracked` | boolean | Set to `false` to disable inventory tracking (the variant is then always available). Defaults to `true` when `inventory_quantity` is set or `available` is `false`, `false` otherwise. |
|
|
283
|
+
| `inventory_policy` | [InventoryPolicy](#inventorypolicy) | Defaults to `"deny"`. |
|
|
284
|
+
| `weight` | integer | Weight in grams. |
|
|
285
|
+
| `weight_unit` | string | The unit the weight is displayed in: `g`, `kg`, `oz` or `lb`. Defaults to `kg`. |
|
|
286
|
+
| `requires_shipping` | boolean | Defaults to `true`. |
|
|
287
|
+
| `taxable` | boolean | Defaults to `true`. |
|
|
288
|
+
| `image` | string | The `src` of the product image that shows this variant. |
|
|
289
|
+
| `unit_price` | [Money](#money) | |
|
|
290
|
+
| `unit_price_measurement` | [UnitPriceMeasurement](#unitpricemeasurement) | |
|
|
291
|
+
| `quantity_rule` | [QuantityRule](#quantityrule) | |
|
|
292
|
+
| `quantity_price_breaks` | array of [QuantityPriceBreak](#quantitypricebreak) | |
|
|
293
|
+
| `store_availabilities` | map of boolean | The locations (from `locations`, by name) that stock this variant, and whether it is in stock there: `{"Portland": true, "Seattle": false}`. When omitted, every location stocks the variant, and it is in stock there when the variant is available. |
|
|
294
|
+
| `metafields` | map of map of [Metafield](#metafield) | |
|
|
295
|
+
|
|
296
|
+
## Money
|
|
297
|
+
|
|
298
|
+
An amount of money: an integer number of cents (`1999`, the unit Liquid uses) or a decimal string in the shop currency (`"19.99"`). Floats such as `19.99` are rejected because they are ambiguous.
|
|
299
|
+
|
|
300
|
+
One of:
|
|
301
|
+
|
|
302
|
+
- integer: Cents, e.g. 1999 for 19.99.
|
|
303
|
+
- string: Decimal amount, e.g. "19.99" or "20".
|
|
304
|
+
|
|
305
|
+
## InventoryPolicy
|
|
306
|
+
|
|
307
|
+
What happens when a tracked variant is out of stock.
|
|
308
|
+
|
|
309
|
+
One of:
|
|
310
|
+
|
|
311
|
+
- `"deny"`: Stop selling when the stock reaches zero.
|
|
312
|
+
- `"continue"`: Keep selling when out of stock.
|
|
313
|
+
|
|
314
|
+
## UnitPriceMeasurement
|
|
315
|
+
|
|
316
|
+
What a unit price refers to, e.g. 250 g priced per 100 g.
|
|
317
|
+
|
|
318
|
+
| Field | Type | Description |
|
|
319
|
+
|---|---|---|
|
|
320
|
+
| `measured_type` | string | `weight`, `volume`, `length` or `area`. |
|
|
321
|
+
| `quantity_value` | number | **Required.** |
|
|
322
|
+
| `quantity_unit` | string | **Required.** E.g. `g`, `kg`, `ml`, `l`, `m`. |
|
|
323
|
+
| `reference_value` | number | |
|
|
324
|
+
| `reference_unit` | string | |
|
|
325
|
+
|
|
326
|
+
## QuantityRule
|
|
327
|
+
|
|
328
|
+
The quantities a variant can be bought in (`variant.quantity_rule`).
|
|
329
|
+
|
|
330
|
+
| Field | Type | Description |
|
|
331
|
+
|---|---|---|
|
|
332
|
+
| `min` | integer | Minimum quantity. Defaults to 1. |
|
|
333
|
+
| `max` | integer | Maximum quantity. No maximum when omitted. |
|
|
334
|
+
| `increment` | integer | Quantities must be a multiple of this. Defaults to 1. |
|
|
335
|
+
|
|
336
|
+
## QuantityPriceBreak
|
|
337
|
+
|
|
338
|
+
A volume price: the unit price from a given quantity.
|
|
339
|
+
|
|
340
|
+
| Field | Type | Description |
|
|
341
|
+
|---|---|---|
|
|
342
|
+
| `minimum_quantity` | integer | **Required.** |
|
|
343
|
+
| `price` | [Money](#money) | **Required.** |
|
|
344
|
+
|
|
345
|
+
## Media
|
|
346
|
+
|
|
347
|
+
A piece of product media. Images can be written as a plain string.
|
|
348
|
+
|
|
349
|
+
One of:
|
|
350
|
+
|
|
351
|
+
- [Image](#image)
|
|
352
|
+
- [MediaDetail](#mediadetail)
|
|
353
|
+
|
|
354
|
+
## MediaDetail
|
|
355
|
+
|
|
356
|
+
A video, an external (YouTube/Vimeo) video or a 3D model.
|
|
357
|
+
|
|
358
|
+
| Field | Type | Description |
|
|
359
|
+
|---|---|---|
|
|
360
|
+
| `media_type` | [MediaType](#mediatype) | **Required.** |
|
|
361
|
+
| `id` | integer | |
|
|
362
|
+
| `alt` | string | |
|
|
363
|
+
| `preview_image` | [Image](#image) | The image shown before the media plays. |
|
|
364
|
+
| `sources` | array of [MediaSource](#mediasource) | `video` and `model`: the files, by decreasing preference. |
|
|
365
|
+
| `duration` | integer | `video`: length in milliseconds. |
|
|
366
|
+
| `host` | [VideoHost](#videohost) | `external_video`: `youtube` or `vimeo`. |
|
|
367
|
+
| `external_id` | string | `external_video`: the id of the video on the host, e.g. `dQw4w9WgXcQ`. |
|
|
368
|
+
| `aspect_ratio` | number | Width divided by height. Defaults to the preview image's ratio, or 16:9. |
|
|
369
|
+
|
|
370
|
+
## MediaType
|
|
371
|
+
|
|
372
|
+
The kind of a piece of media that is not an image.
|
|
373
|
+
|
|
374
|
+
One of: `"video"`, `"external_video"`, `"model"`.
|
|
375
|
+
|
|
376
|
+
## MediaSource
|
|
377
|
+
|
|
378
|
+
One file of a video or 3D model.
|
|
379
|
+
|
|
380
|
+
| Field | Type | Description |
|
|
381
|
+
|---|---|---|
|
|
382
|
+
| `url` | string | **Required.** Path inside `files/` or an absolute URL. |
|
|
383
|
+
| `mime_type` | string | E.g. `video/mp4`, `model/gltf-binary`. |
|
|
384
|
+
| `format` | string | E.g. `mp4`, `m3u8`, `glb`, `usdz`. |
|
|
385
|
+
| `width` | integer | |
|
|
386
|
+
| `height` | integer | |
|
|
387
|
+
|
|
388
|
+
## VideoHost
|
|
389
|
+
|
|
390
|
+
Where an external video is hosted.
|
|
391
|
+
|
|
392
|
+
One of: `"youtube"`, `"vimeo"`.
|
|
393
|
+
|
|
394
|
+
## ProductStatus
|
|
395
|
+
|
|
396
|
+
Where a product is in its life, as the Shopify admin shows it.
|
|
397
|
+
|
|
398
|
+
One of:
|
|
399
|
+
|
|
400
|
+
- `"active"`: For sale.
|
|
401
|
+
- `"draft"`: Being prepared: not on the storefront yet.
|
|
402
|
+
- `"archived"`: No longer sold: not on the storefront.
|
|
403
|
+
|
|
404
|
+
## Collection
|
|
405
|
+
|
|
406
|
+
A collection of products.
|
|
407
|
+
|
|
408
|
+
A collection named `all` containing every product always exists; define it yourself only
|
|
409
|
+
to change its title or order.
|
|
410
|
+
|
|
411
|
+
| Field | Type | Description |
|
|
412
|
+
|---|---|---|
|
|
413
|
+
| `$schema` | string | Lets editors validate and autocomplete the file, e.g. `"../schema/collection.schema.json"`. |
|
|
414
|
+
| `id` | integer | |
|
|
415
|
+
| `title` | string | **Required.** |
|
|
416
|
+
| `handle` | string | |
|
|
417
|
+
| `description` | string | HTML description. |
|
|
418
|
+
| `image` | [Image](#image) | |
|
|
419
|
+
| `products` | array of string | Handles of the products in the collection, in manual order. |
|
|
420
|
+
| `rules` | array of [CollectionRule](#collectionrule) | Makes the collection automated: products matching the rules are added after the ones listed in `products`. |
|
|
421
|
+
| `disjunctive` | boolean | With several rules: `true` to match any of them, `false` (default) to match all. |
|
|
422
|
+
| `sort_order` | [SortOrder](#sortorder) | The default order of the products. Defaults to `manual`. |
|
|
423
|
+
| `template_suffix` | string | Selects `templates/collection.<suffix>.json`. |
|
|
424
|
+
| `published_at` | string | |
|
|
425
|
+
| `updated_at` | string | |
|
|
426
|
+
| `metafields` | map of map of [Metafield](#metafield) | |
|
|
427
|
+
|
|
428
|
+
## CollectionRule
|
|
429
|
+
|
|
430
|
+
A rule of an automated collection: products matching it are included.
|
|
431
|
+
|
|
432
|
+
| Field | Type | Description |
|
|
433
|
+
|---|---|---|
|
|
434
|
+
| `column` | [RuleColumn](#rulecolumn) | **Required.** What to look at: `tag`, `type`, `vendor`, `title`, `price` (cents) or `compare_at_price` (cents). |
|
|
435
|
+
| `relation` | [RuleRelation](#rulerelation) | Defaults to `equals`. |
|
|
436
|
+
| `condition` | string | **Required.** The value compared with, e.g. `"sale"` for a tag or `"5000"` for a price in cents. |
|
|
437
|
+
|
|
438
|
+
## RuleColumn
|
|
439
|
+
|
|
440
|
+
The product property an automated collection rule looks at.
|
|
441
|
+
|
|
442
|
+
One of: `"tag"`, `"type"`, `"vendor"`, `"title"`, `"price"`, `"compare_at_price"`.
|
|
443
|
+
|
|
444
|
+
## RuleRelation
|
|
445
|
+
|
|
446
|
+
How an automated collection rule compares the property to its condition.
|
|
447
|
+
|
|
448
|
+
One of: `"equals"`, `"not_equals"`, `"contains"`, `"not_contains"`, `"starts_with"`, `"ends_with"`, `"greater_than"`, `"less_than"`.
|
|
449
|
+
|
|
450
|
+
## SortOrder
|
|
451
|
+
|
|
452
|
+
How a collection orders its products by default.
|
|
453
|
+
|
|
454
|
+
One of: `"manual"`, `"best-selling"`, `"title-ascending"`, `"title-descending"`, `"price-ascending"`, `"price-descending"`, `"created-ascending"`, `"created-descending"`.
|
|
455
|
+
|
|
456
|
+
## Page
|
|
457
|
+
|
|
458
|
+
A page (`/pages/<handle>`).
|
|
459
|
+
|
|
460
|
+
| Field | Type | Description |
|
|
461
|
+
|---|---|---|
|
|
462
|
+
| `$schema` | string | Lets editors validate and autocomplete the file, e.g. `"../schema/page.schema.json"`. |
|
|
463
|
+
| `id` | integer | |
|
|
464
|
+
| `title` | string | **Required.** |
|
|
465
|
+
| `handle` | string | |
|
|
466
|
+
| `content` | string | HTML content. |
|
|
467
|
+
| `author` | string | |
|
|
468
|
+
| `template_suffix` | string | Selects `templates/page.<suffix>.json`, e.g. `"contact"`. |
|
|
469
|
+
| `published_at` | string | |
|
|
470
|
+
| `updated_at` | string | |
|
|
471
|
+
| `metafields` | map of map of [Metafield](#metafield) | |
|
|
472
|
+
|
|
473
|
+
## Blog
|
|
474
|
+
|
|
475
|
+
A blog (`/blogs/<handle>`) and its articles.
|
|
476
|
+
|
|
477
|
+
| Field | Type | Description |
|
|
478
|
+
|---|---|---|
|
|
479
|
+
| `$schema` | string | Lets editors validate and autocomplete the file, e.g. `"../schema/blog.schema.json"`. |
|
|
480
|
+
| `id` | integer | |
|
|
481
|
+
| `title` | string | **Required.** |
|
|
482
|
+
| `handle` | string | |
|
|
483
|
+
| `articles` | array of [Article](#article) | Articles, newest first unless they carry `published_at` dates. |
|
|
484
|
+
| `comments_enabled` | boolean | Whether readers can comment. Defaults to `false`. |
|
|
485
|
+
| `moderated` | boolean | Whether comments wait for approval. Defaults to `false`. |
|
|
486
|
+
| `template_suffix` | string | |
|
|
487
|
+
| `metafields` | map of map of [Metafield](#metafield) | |
|
|
488
|
+
|
|
489
|
+
## Article
|
|
490
|
+
|
|
491
|
+
A blog post.
|
|
492
|
+
|
|
493
|
+
| Field | Type | Description |
|
|
494
|
+
|---|---|---|
|
|
495
|
+
| `id` | integer | |
|
|
496
|
+
| `title` | string | **Required.** |
|
|
497
|
+
| `handle` | string | |
|
|
498
|
+
| `author` | string | |
|
|
499
|
+
| `content` | string | HTML content. |
|
|
500
|
+
| `excerpt` | string | HTML excerpt. `article.excerpt_or_content` falls back to the content. |
|
|
501
|
+
| `image` | [Image](#image) | |
|
|
502
|
+
| `tags` | array of string | |
|
|
503
|
+
| `comments` | array of [Comment](#comment) | |
|
|
504
|
+
| `template_suffix` | string | |
|
|
505
|
+
| `created_at` | string | |
|
|
506
|
+
| `published_at` | string | |
|
|
507
|
+
| `updated_at` | string | |
|
|
508
|
+
| `metafields` | map of map of [Metafield](#metafield) | |
|
|
509
|
+
|
|
510
|
+
## Comment
|
|
511
|
+
|
|
512
|
+
A comment on an article.
|
|
513
|
+
|
|
514
|
+
| Field | Type | Description |
|
|
515
|
+
|---|---|---|
|
|
516
|
+
| `id` | integer | |
|
|
517
|
+
| `author` | string | **Required.** |
|
|
518
|
+
| `email` | string | |
|
|
519
|
+
| `content` | string | **Required.** HTML content. |
|
|
520
|
+
| `created_at` | string | |
|
|
521
|
+
|
|
522
|
+
## Menu
|
|
523
|
+
|
|
524
|
+
A navigation menu (`linklists.<handle>`).
|
|
525
|
+
|
|
526
|
+
| Field | Type | Description |
|
|
527
|
+
|---|---|---|
|
|
528
|
+
| `$schema` | string | Lets editors validate and autocomplete the file, e.g. `"../schema/menu.schema.json"`. |
|
|
529
|
+
| `title` | string | Defaults to the handle, title-cased. |
|
|
530
|
+
| `links` | array of [Link](#link) | |
|
|
531
|
+
|
|
532
|
+
## Link
|
|
533
|
+
|
|
534
|
+
A link in a navigation menu.
|
|
535
|
+
|
|
536
|
+
Point it at a resource with exactly one of `url`, `collection`, `product`, `page`, `blog`,
|
|
537
|
+
`article` or `policy`; the URL and the link type follow from it. A link with none of them
|
|
538
|
+
points to `#`.
|
|
539
|
+
|
|
540
|
+
| Field | Type | Description |
|
|
541
|
+
|---|---|---|
|
|
542
|
+
| `title` | string | **Required.** |
|
|
543
|
+
| `url` | string | A literal URL: `/`, `/collections/all`, `/search`, `https://example.com`. |
|
|
544
|
+
| `collection` | string | Handle of a collection. |
|
|
545
|
+
| `product` | string | Handle of a product. |
|
|
546
|
+
| `page` | string | Handle of a page. |
|
|
547
|
+
| `blog` | string | Handle of a blog. |
|
|
548
|
+
| `article` | string | An article as `<blog-handle>/<article-handle>`. |
|
|
549
|
+
| `policy` | string | A policy: `privacy-policy`, `refund-policy`, `shipping-policy`, `terms-of-service`. |
|
|
550
|
+
| `links` | array of [Link](#link) | Nested links (up to three levels, like the Shopify admin). |
|
|
551
|
+
|
|
552
|
+
## Customer
|
|
553
|
+
|
|
554
|
+
A customer. Sessions log in as a customer by email (see `session.customer`), and the checkout
|
|
555
|
+
of an app lists the customers as login profiles: "Log in" logs the checkout in as one of them,
|
|
556
|
+
with their addresses (the first is the default) and, for a B2B customer, their locations.
|
|
557
|
+
|
|
558
|
+
| Field | Type | Description |
|
|
559
|
+
|---|---|---|
|
|
560
|
+
| `$schema` | string | Lets editors validate and autocomplete the file, e.g. `"../schema/customer.schema.json"`. |
|
|
561
|
+
| `id` | integer | |
|
|
562
|
+
| `email` | string | **Required.** |
|
|
563
|
+
| `first_name` | string | |
|
|
564
|
+
| `last_name` | string | |
|
|
565
|
+
| `phone` | string | |
|
|
566
|
+
| `tags` | array of string | |
|
|
567
|
+
| `accepts_marketing` | boolean | |
|
|
568
|
+
| `has_account` | boolean | Defaults to `true`. |
|
|
569
|
+
| `tax_exempt` | boolean | |
|
|
570
|
+
| `addresses` | array of [Address](#address) | The first address is the default one (`customer.default_address`). |
|
|
571
|
+
| `orders` | array of [Order](#order) | |
|
|
572
|
+
| `company` | string | The name of a company in `companies`: the customer buys for it (B2B). |
|
|
573
|
+
| `company_locations` | array of string | The names of the locations of the company the customer can buy for. Defaults to all of them. |
|
|
574
|
+
| `company_contact` | [CompanyContact](#companycontact) | What the company knows of the customer as a buyer: their job title, language, dates. Checkout Functions read it as `purchasingCompany.contact`. |
|
|
575
|
+
| `metafields` | map of map of [Metafield](#metafield) | |
|
|
576
|
+
|
|
577
|
+
## Order
|
|
578
|
+
|
|
579
|
+
An order of a customer, shown on account pages.
|
|
580
|
+
|
|
581
|
+
| Field | Type | Description |
|
|
582
|
+
|---|---|---|
|
|
583
|
+
| `id` | integer | |
|
|
584
|
+
| `name` | string | The order name, e.g. `"#1001"`. Generated when omitted. |
|
|
585
|
+
| `created_at` | string | |
|
|
586
|
+
| `financial_status` | string | `paid`, `pending`, `refunded`, ... Defaults to `paid`. |
|
|
587
|
+
| `fulfillment_status` | string | `fulfilled`, `unfulfilled`, `partial`. Defaults to `unfulfilled`. |
|
|
588
|
+
| `line_items` | array of [OrderLine](#orderline) | |
|
|
589
|
+
| `shipping_address` | [Address](#address) | |
|
|
590
|
+
| `billing_address` | [Address](#address) | |
|
|
591
|
+
| `shipping_price` | [Money](#money) | |
|
|
592
|
+
| `tax_price` | [Money](#money) | |
|
|
593
|
+
| `cancelled` | boolean | |
|
|
594
|
+
| `note` | string | |
|
|
595
|
+
| `returns` | array of [OrderReturn](#orderreturn) | What the customer sent back, as the customer account shows it. |
|
|
596
|
+
|
|
597
|
+
## OrderLine
|
|
598
|
+
|
|
599
|
+
A line of an order.
|
|
600
|
+
|
|
601
|
+
| Field | Type | Description |
|
|
602
|
+
|---|---|---|
|
|
603
|
+
| `variant` | [VariantRef](#variantref) | **Required.** A variant, by id or SKU, or a product handle (its first variant is used). |
|
|
604
|
+
| `quantity` | integer | Defaults to 1. |
|
|
605
|
+
|
|
606
|
+
## VariantRef
|
|
607
|
+
|
|
608
|
+
A reference to a variant: its numeric id, its SKU, or a product handle (meaning that
|
|
609
|
+
product's first variant).
|
|
610
|
+
|
|
611
|
+
One of:
|
|
612
|
+
|
|
613
|
+
- integer
|
|
614
|
+
- string
|
|
615
|
+
|
|
616
|
+
## OrderReturn
|
|
617
|
+
|
|
618
|
+
A return of an order.
|
|
619
|
+
|
|
620
|
+
| Field | Type | Description |
|
|
621
|
+
|---|---|---|
|
|
622
|
+
| `status` | string | `requested`, `open` or `closed`. Defaults to `open`. |
|
|
623
|
+
| `line_items` | array of [OrderLine](#orderline) | The lines sent back, by their variant, and how many of each. Defaults to every line of the order. |
|
|
624
|
+
|
|
625
|
+
## CompanyContact
|
|
626
|
+
|
|
627
|
+
A customer as a contact of their company (B2B): `purchasingCompany.contact` of a checkout
|
|
628
|
+
Function.
|
|
629
|
+
|
|
630
|
+
| Field | Type | Description |
|
|
631
|
+
|---|---|---|
|
|
632
|
+
| `title` | string | The job title of the contact, e.g. `"Purchasing manager"`. |
|
|
633
|
+
| `locale` | string | The language of the contact, e.g. `"fr"`. None when absent. |
|
|
634
|
+
| `created_at` | string | Defaults to the creation date of the company. |
|
|
635
|
+
| `updated_at` | string | Defaults to `created_at`. |
|
|
636
|
+
|
|
637
|
+
## Company
|
|
638
|
+
|
|
639
|
+
A company that buys from the store (B2B). A customer whose `company` names it is a B2B
|
|
640
|
+
customer: `customer.b2b?` is true, and `customer.current_company` is this company.
|
|
641
|
+
|
|
642
|
+
| Field | Type | Description |
|
|
643
|
+
|---|---|---|
|
|
644
|
+
| `id` | integer | |
|
|
645
|
+
| `name` | string | **Required.** The name customers refer to the company by. |
|
|
646
|
+
| `external_id` | string | The id the merchant gives the company in its own systems. |
|
|
647
|
+
| `locations` | array of [CompanyLocation](#companylocation) | The places the company buys for. The first one is selected when a customer logs in. |
|
|
648
|
+
| `created_at` | string | Defaults to a fixed date, 2024-01-01 plus one day per company. |
|
|
649
|
+
| `updated_at` | string | Defaults to `created_at`. |
|
|
650
|
+
| `metafields` | map of map of [Metafield](#metafield) | |
|
|
651
|
+
|
|
652
|
+
## CompanyLocation
|
|
653
|
+
|
|
654
|
+
A place a company buys for (`customer.current_location`): a branch, a shop, a warehouse.
|
|
655
|
+
|
|
656
|
+
| Field | Type | Description |
|
|
657
|
+
|---|---|---|
|
|
658
|
+
| `id` | integer | |
|
|
659
|
+
| `name` | string | **Required.** |
|
|
660
|
+
| `external_id` | string | The id the merchant gives the location in its own systems. |
|
|
661
|
+
| `shipping_address` | [Address](#address) | Where orders of this location ship to. |
|
|
662
|
+
| `tax_registration_id` | string | The tax number of the location, e.g. a VAT number. |
|
|
663
|
+
| `locale` | string | The preferred language of the location, e.g. `"fr"`. None when absent. |
|
|
664
|
+
| `created_at` | string | Defaults to the creation date of the company. |
|
|
665
|
+
| `updated_at` | string | Defaults to `created_at`. |
|
|
666
|
+
| `orders_count` | integer | The number of orders placed at the location, which checkout Functions read as `ordersCount`. The orders of the customers are not counted: defaults to 0. |
|
|
667
|
+
| `total_spent` | [Money](#money) | The amount spent at the location (`totalSpent`), e.g. `"1250.00"`. Defaults to 0. |
|
|
668
|
+
| `metafields` | map of map of [Metafield](#metafield) | |
|
|
669
|
+
|
|
670
|
+
## GiftCard
|
|
671
|
+
|
|
672
|
+
An issued gift card, shown by `templates/gift_card.liquid` at the URL the `routes` command lists
|
|
673
|
+
(`/gift_cards/<shop id>/<token>`).
|
|
674
|
+
|
|
675
|
+
| Field | Type | Description |
|
|
676
|
+
|---|---|---|
|
|
677
|
+
| `code` | string | **Required.** The code customers redeem at checkout, e.g. `"WCGX7X97G74JGDGC"`. |
|
|
678
|
+
| `initial_value` | [Money](#money) | **Required.** The value the card was issued with. |
|
|
679
|
+
| `balance` | [Money](#money) | What is left on the card. Defaults to `initial_value`. |
|
|
680
|
+
| `currency` | string | ISO 4217 code. Defaults to the shop's currency. |
|
|
681
|
+
| `expires_on` | string | The day the card stops working, e.g. `"2026-12-31"`. A date before `now` makes the card `expired`. |
|
|
682
|
+
| `enabled` | boolean | `false` for a card the merchant disabled. |
|
|
683
|
+
| `customer` | string | The email of the customer (from `customers`) the card belongs to. |
|
|
684
|
+
| `message` | string | |
|
|
685
|
+
| `recipient` | [GiftCardRecipient](#giftcardrecipient) | |
|
|
686
|
+
| `send_on` | string | When the card is scheduled to be sent to its recipient. |
|
|
687
|
+
| `product` | string | The handle of the gift card product that was bought. |
|
|
688
|
+
| `properties` | map of string | Line item properties of the purchase. |
|
|
689
|
+
| `template_suffix` | string | Selects `templates/gift_card.<suffix>.liquid`. |
|
|
690
|
+
|
|
691
|
+
## GiftCardRecipient
|
|
692
|
+
|
|
693
|
+
Who a gift card was sent to.
|
|
694
|
+
|
|
695
|
+
| Field | Type | Description |
|
|
696
|
+
|---|---|---|
|
|
697
|
+
| `name` | string | |
|
|
698
|
+
| `email` | string | |
|
|
699
|
+
| `nickname` | string | |
|
|
700
|
+
|
|
701
|
+
## Metaobject
|
|
702
|
+
|
|
703
|
+
A metaobject entry (`metaobjects.<type>.<handle>`).
|
|
704
|
+
|
|
705
|
+
| Field | Type | Description |
|
|
706
|
+
|---|---|---|
|
|
707
|
+
| `handle` | string | **Required.** |
|
|
708
|
+
| `fields` | map of [Metafield](#metafield) | Field values, with the same shorthand as metafields. |
|
|
709
|
+
| `template_suffix` | string | Selects `templates/metaobject/<type>.<suffix>.json` instead of `templates/metaobject/<type>.json` for the page of the entry, which is `/pages/<type>/<handle>`. |
|
|
710
|
+
|
|
711
|
+
## Localization
|
|
712
|
+
|
|
713
|
+
The countries and languages the store sells in (the `localization` object).
|
|
714
|
+
|
|
715
|
+
The first language is the primary one and is served at `/`; the others are served under
|
|
716
|
+
`/<iso_code>/`. Defaults to one country, the shop's (`shop.address.country_code`, else `US`),
|
|
717
|
+
and the theme's default language.
|
|
718
|
+
|
|
719
|
+
| Field | Type | Description |
|
|
720
|
+
|---|---|---|
|
|
721
|
+
| `countries` | array of [Country](#country) | |
|
|
722
|
+
| `languages` | array of [Language](#language) | |
|
|
723
|
+
| `markets` | array of [Market](#market) | Groups of countries sold as one market. A country in none of them is a market of its own, named after the country. |
|
|
724
|
+
|
|
725
|
+
## Country
|
|
726
|
+
|
|
727
|
+
A country the store sells to.
|
|
728
|
+
|
|
729
|
+
| Field | Type | Description |
|
|
730
|
+
|---|---|---|
|
|
731
|
+
| `iso_code` | string | **Required.** ISO 3166-1 alpha-2 code, e.g. `"FR"`. |
|
|
732
|
+
| `name` | string | Defaults to the English name of the country. |
|
|
733
|
+
| `currency` | string | ISO 4217 currency code. Defaults to the store currency. |
|
|
734
|
+
| `unit_system` | string | `metric` or `imperial`. Defaults to `metric`. |
|
|
735
|
+
| `popular` | boolean | Whether to list the country among the popular ones. |
|
|
736
|
+
|
|
737
|
+
## Language
|
|
738
|
+
|
|
739
|
+
A language the store is published in.
|
|
740
|
+
|
|
741
|
+
| Field | Type | Description |
|
|
742
|
+
|---|---|---|
|
|
743
|
+
| `iso_code` | string | **Required.** Locale code, e.g. `"en"`, `"fr"`, `"pt-BR"`. |
|
|
744
|
+
| `name` | string | The language's name in English. Defaults to a built-in name. |
|
|
745
|
+
| `endonym_name` | string | The language's name in that language. Defaults to a built-in name. |
|
|
746
|
+
|
|
747
|
+
## Market
|
|
748
|
+
|
|
749
|
+
A market: the countries the store sells to as one, as checkout Functions see it in
|
|
750
|
+
`localization.market` and `MailingAddress.market`.
|
|
751
|
+
|
|
752
|
+
| Field | Type | Description |
|
|
753
|
+
|---|---|---|
|
|
754
|
+
| `handle` | string | **Required.** What Functions call the market: `"europe"`. |
|
|
755
|
+
| `countries` | array of string | **Required.** The ISO 3166-1 alpha-2 codes of its countries, which are in `localization.countries`. |
|
|
756
|
+
| `metafields` | map of map of [Metafield](#metafield) | |
|
|
757
|
+
|
|
758
|
+
## Location
|
|
759
|
+
|
|
760
|
+
A place the store stocks products at, where customers can pick up their orders
|
|
761
|
+
(`variant.store_availabilities`, `store_availability.location`).
|
|
762
|
+
|
|
763
|
+
| Field | Type | Description |
|
|
764
|
+
|---|---|---|
|
|
765
|
+
| `id` | integer | |
|
|
766
|
+
| `name` | string | **Required.** The name of the location. Variants refer to it by this name. |
|
|
767
|
+
| `address` | [Address](#address) | |
|
|
768
|
+
| `pick_up_enabled` | boolean | Whether orders can be picked up at the location. Defaults to `true`. |
|
|
769
|
+
| `pick_up_time` | string | How long a pickup order takes to be ready. Defaults to `"Usually ready in 24 hours"`. |
|
|
770
|
+
| `physical_storefront` | boolean | Whether the location is a shop that sells in person. Defaults to `true`. |
|
|
771
|
+
| `latitude` | number | |
|
|
772
|
+
| `longitude` | number | |
|
|
773
|
+
| `metafields` | map of map of [Metafield](#metafield) | |
|
|
774
|
+
|
|
775
|
+
## SellingPlanGroup
|
|
776
|
+
|
|
777
|
+
A group of selling plans (`product.selling_plan_groups`): what a subscription app creates
|
|
778
|
+
for "Subscribe and save". Products are sold with a group when the group lists them in
|
|
779
|
+
`products`, or when they name the group in their own `selling_plan_groups`.
|
|
780
|
+
|
|
781
|
+
| Field | Type | Description |
|
|
782
|
+
|---|---|---|
|
|
783
|
+
| `name` | string | **Required.** The name shown to customers, e.g. `"Subscribe and save"`. Products refer to the group by this name. |
|
|
784
|
+
| `app_id` | string | The id of the app that created the group (`selling_plan_group.app_id`). |
|
|
785
|
+
| `options` | array of string | The names of the options the plans differ by. Defaults to one option, `"Delivery frequency"`. |
|
|
786
|
+
| `selling_plans` | array of [SellingPlan](#sellingplan) | **Required.** The plans of the group. At least one. |
|
|
787
|
+
| `products` | array of string | Handles of the products sold with these plans. |
|
|
788
|
+
|
|
789
|
+
## SellingPlan
|
|
790
|
+
|
|
791
|
+
A selling plan: one way of buying a product, such as "Deliver every month, 10% off".
|
|
792
|
+
|
|
793
|
+
| Field | Type | Description |
|
|
794
|
+
|---|---|---|
|
|
795
|
+
| `id` | integer | Generated from the names of the group and of the plan when omitted. |
|
|
796
|
+
| `name` | string | **Required.** The name shown to customers, e.g. `"Deliver every month, 10% off"`. |
|
|
797
|
+
| `description` | string | |
|
|
798
|
+
| `options` | array of string | One value per option of the group, e.g. `["Every month"]`. Defaults to the plan's name. |
|
|
799
|
+
| `price_adjustments` | array of [PriceAdjustment](#priceadjustment) | How the plan changes the price: at most two adjustments, the first one applies to the first orders. No adjustment means the price of the variant. |
|
|
800
|
+
| `recurring_deliveries` | boolean | Whether the plan delivers more than once. Defaults to `true`. |
|
|
801
|
+
| `checkout_charge` | [CheckoutCharge](#checkoutcharge) | What is paid at checkout. Defaults to the whole price (`percentage`, `100`). |
|
|
802
|
+
|
|
803
|
+
## PriceAdjustment
|
|
804
|
+
|
|
805
|
+
A price adjustment of a selling plan (`selling_plan.price_adjustments`).
|
|
806
|
+
|
|
807
|
+
| Field | Type | Description |
|
|
808
|
+
|---|---|---|
|
|
809
|
+
| `value_type` | [AdjustmentType](#adjustmenttype) | **Required.** |
|
|
810
|
+
| `value` | [Money](#money) | **Required.** With `percentage`: the percentage, e.g. `10`. With `fixed_amount` and `price`: an amount of money, e.g. `"2.00"` or `200`. |
|
|
811
|
+
| `order_count` | integer | The number of orders the adjustment applies to. Every order when omitted. |
|
|
812
|
+
|
|
813
|
+
## AdjustmentType
|
|
814
|
+
|
|
815
|
+
How a price adjustment of a selling plan changes the price.
|
|
816
|
+
|
|
817
|
+
One of:
|
|
818
|
+
|
|
819
|
+
- `"percentage"`: `value` percent off the price of the variant.
|
|
820
|
+
- `"fixed_amount"`: `value` (an amount of money) off the price of the variant.
|
|
821
|
+
- `"price"`: `value` (an amount of money) is the price.
|
|
822
|
+
|
|
823
|
+
## CheckoutCharge
|
|
824
|
+
|
|
825
|
+
What is paid at checkout, for plans that take a deposit (`selling_plan.checkout_charge`).
|
|
826
|
+
|
|
827
|
+
| Field | Type | Description |
|
|
828
|
+
|---|---|---|
|
|
829
|
+
| `value_type` | [CheckoutChargeType](#checkoutchargetype) | **Required.** |
|
|
830
|
+
| `value` | [Money](#money) | **Required.** With `percentage`: the percentage, e.g. `50`. With `price`: an amount of money. |
|
|
831
|
+
|
|
832
|
+
## CheckoutChargeType
|
|
833
|
+
|
|
834
|
+
How the amount due at checkout is expressed.
|
|
835
|
+
|
|
836
|
+
One of:
|
|
837
|
+
|
|
838
|
+
- `"percentage"`: `value` percent of the price.
|
|
839
|
+
- `"price"`: `value` (an amount of money).
|
|
840
|
+
|
|
841
|
+
## File
|
|
842
|
+
|
|
843
|
+
A file in `files/` that needs metadata. Files without an entry work too.
|
|
844
|
+
|
|
845
|
+
| Field | Type | Description |
|
|
846
|
+
|---|---|---|
|
|
847
|
+
| `alt` | string | |
|
|
848
|
+
| `width` | integer | Size to assume when the file itself is absent (a placeholder is generated). |
|
|
849
|
+
| `height` | integer | |
|
|
850
|
+
| `focal_point` | [FocalPoint](#focalpoint) | |
|
|
851
|
+
|
|
852
|
+
## Session
|
|
853
|
+
|
|
854
|
+
The state a browser session starts with. Tests can replace it per session through the
|
|
855
|
+
control API (`PUT /__lsf/session`).
|
|
856
|
+
|
|
857
|
+
| Field | Type | Description |
|
|
858
|
+
|---|---|---|
|
|
859
|
+
| `$schema` | string | Lets editors validate and autocomplete the file, e.g. `"../schema/session.schema.json"`. |
|
|
860
|
+
| `customer` | string | Who is logged in: the email of a customer, `"default"` for the first customer of the data, or `"none"`. Nobody is logged in when omitted. |
|
|
861
|
+
| `cart` | [Cart](#cart) | The content of the cart. Empty when omitted. |
|
|
862
|
+
| `country` | string | ISO code of the selected country. When omitted, the visitor is in the shop's country (`shop.address.country_code`), the one of its primary market: the storefront shows it, and the checkout, until an address is entered, is in it (its Functions, its UI extensions and its address form read it). A shop in a country the store does not sell to uses the first country. |
|
|
863
|
+
| `company_location` | string | For a B2B customer: the name of the company location they buy for. Defaults to the first one they have access to. |
|
|
864
|
+
|
|
865
|
+
## Cart
|
|
866
|
+
|
|
867
|
+
The cart a session starts with.
|
|
868
|
+
|
|
869
|
+
| Field | Type | Description |
|
|
870
|
+
|---|---|---|
|
|
871
|
+
| `items` | array of [CartLine](#cartline) | |
|
|
872
|
+
| `note` | string | |
|
|
873
|
+
| `attributes` | map of string | Cart attributes. |
|
|
874
|
+
|
|
875
|
+
## CartLine
|
|
876
|
+
|
|
877
|
+
A line of the cart a session starts with.
|
|
878
|
+
|
|
879
|
+
| Field | Type | Description |
|
|
880
|
+
|---|---|---|
|
|
881
|
+
| `variant` | [VariantRef](#variantref) | **Required.** A variant, by id or SKU, or a product handle (its first variant is used). |
|
|
882
|
+
| `quantity` | integer | Defaults to 1. |
|
|
883
|
+
| `properties` | map of string | Line item properties, e.g. `{"Engraving": "Hello"}`. |
|
|
884
|
+
| `selling_plan` | [SellingPlanRef](#sellingplanref) | The selling plan the line is bought with: its name or its id. The product of the variant must be sold with it. |
|
|
885
|
+
|
|
886
|
+
## SellingPlanRef
|
|
887
|
+
|
|
888
|
+
A reference to a selling plan: its numeric id, or its name.
|
|
889
|
+
|
|
890
|
+
One of:
|
|
891
|
+
|
|
892
|
+
- integer
|
|
893
|
+
- string
|
|
894
|
+
|
|
895
|
+
## Checkout
|
|
896
|
+
|
|
897
|
+
How the local checkout (`lsf app dev --app`) is set up. Every field has a default.
|
|
898
|
+
|
|
899
|
+
| Field | Type | Description |
|
|
900
|
+
|---|---|---|
|
|
901
|
+
| `shipping_rates` | array of [CheckoutShippingRate](#checkoutshippingrate) | The delivery options offered to every address. Defaults to one, "Standard" at 5.00. |
|
|
902
|
+
| `payment_methods` | array of [CheckoutPaymentMethod](#checkoutpaymentmethod) | The payment methods. Defaults to "Credit card", "Cash on Delivery" and "Bank Deposit". |
|
|
903
|
+
| `discounts` | array of [CheckoutDiscount](#checkoutdiscount) | Discounts backed by discount Functions of the app. |
|
|
904
|
+
| `functions` | map of [CheckoutFunction](#checkoutfunction) | The settings of the other Functions, by the handle of the Function. |
|
|
905
|
+
| `extensions` | map of [CheckoutExtension](#checkoutextension) | What the merchant filled in for the UI extensions of the app, by the handle of the extension: the values its `shopify.settings` (`useSettings`) reads. |
|
|
906
|
+
| `tax_rate` | number | Tax in percent, added on top of the discounted subtotal: `20` for 20 %. No tax when omitted. |
|
|
907
|
+
|
|
908
|
+
## CheckoutShippingRate
|
|
909
|
+
|
|
910
|
+
A delivery option the local checkout offers to every address.
|
|
911
|
+
|
|
912
|
+
| Field | Type | Description |
|
|
913
|
+
|---|---|---|
|
|
914
|
+
| `handle` | string | **Required.** What Functions and the page call the option: `"standard"`. |
|
|
915
|
+
| `title` | string | What the buyer sees. Defaults to the handle. |
|
|
916
|
+
| `price` | [Money](#money) | **Required.** The cost, e.g. `"4.90"`. |
|
|
917
|
+
| `description` | string | |
|
|
918
|
+
| `kind` | [CheckoutDeliveryKind](#checkoutdeliverykind) | Defaults to `"shipping"`. |
|
|
919
|
+
|
|
920
|
+
## CheckoutDeliveryKind
|
|
921
|
+
|
|
922
|
+
What kind of delivery a shipping rate is.
|
|
923
|
+
|
|
924
|
+
One of:
|
|
925
|
+
|
|
926
|
+
- `"shipping"`: Delivered to the address.
|
|
927
|
+
- `"pick_up"`: Picked up in a store.
|
|
928
|
+
- `"local"`: Delivered locally.
|
|
929
|
+
|
|
930
|
+
## CheckoutPaymentMethod
|
|
931
|
+
|
|
932
|
+
A payment method the local checkout offers.
|
|
933
|
+
|
|
934
|
+
| Field | Type | Description |
|
|
935
|
+
|---|---|---|
|
|
936
|
+
| `handle` | string | **Required.** What payment customization Functions and the page call the method: `"card"`. |
|
|
937
|
+
| `name` | string | What the buyer sees. Defaults to the handle. |
|
|
938
|
+
| `placements` | array of [CheckoutPaymentPlacement](#checkoutpaymentplacement) | Where the method is offered, which payment customization Functions read as `placements`. Defaults to `["PAYMENT_METHOD"]`: the list of the checkout. |
|
|
939
|
+
|
|
940
|
+
## CheckoutPaymentPlacement
|
|
941
|
+
|
|
942
|
+
Where a payment method is offered.
|
|
943
|
+
|
|
944
|
+
One of:
|
|
945
|
+
|
|
946
|
+
- `"PAYMENT_METHOD"`: The list of payment methods of the checkout.
|
|
947
|
+
- `"ACCELERATED_CHECKOUT"`: The express buttons (Shop Pay, Apple Pay, ...).
|
|
948
|
+
|
|
949
|
+
## CheckoutDiscount
|
|
950
|
+
|
|
951
|
+
A discount backed by a discount Function of the app.
|
|
952
|
+
|
|
953
|
+
| Field | Type | Description |
|
|
954
|
+
|---|---|---|
|
|
955
|
+
| `id` | integer | The number of the discount's id, which its Function reads (`gid://shopify/DiscountAutomaticNode/<id>`, or `DiscountCodeNode` with a code) and the Admin API gives it. Defaults to its position in the list, from 1. |
|
|
956
|
+
| `function` | string | **Required.** The handle of the discount Function in the app. |
|
|
957
|
+
| `title` | string | What the buyer sees. Defaults to the handle of the Function. |
|
|
958
|
+
| `code` | string | The code that triggers the discount. Without one the discount is automatic. |
|
|
959
|
+
| `classes` | array of [CheckoutDiscountClass](#checkoutdiscountclass) | What the discount may reduce. All three when omitted. |
|
|
960
|
+
| `metafields` | [OwnerMetafields](#ownermetafields) | The metafields of the discount, which its Function's input query reads, by `"namespace.key"`: `{"$app.function-configuration": {"type": "json", "value": {"percentage": 10}}}` for `metafield(namespace: "$app", key: "function-configuration")`. Shopify's list of `{namespace, key, type, value}` is taken too. |
|
|
961
|
+
|
|
962
|
+
## CheckoutDiscountClass
|
|
963
|
+
|
|
964
|
+
What a discount may reduce.
|
|
965
|
+
|
|
966
|
+
One of: `"PRODUCT"`, `"ORDER"`, `"SHIPPING"`.
|
|
967
|
+
|
|
968
|
+
## OwnerMetafields
|
|
969
|
+
|
|
970
|
+
The metafields of a discount or of the owner of a Function: by `"namespace.key"`, or as
|
|
971
|
+
Shopify's Admin API takes them (`metafieldsSet`, `discountAutomaticAppCreate`), a list of
|
|
972
|
+
`{namespace, key, type, value}`.
|
|
973
|
+
|
|
974
|
+
One of:
|
|
975
|
+
|
|
976
|
+
- map of [Metafield](#metafield): `{"$app.function-configuration": {"type": "json", "value": {…}}}`.
|
|
977
|
+
- array of [OwnerMetafield](#ownermetafield): `[{"namespace": "$app", "key": "function-configuration", "type": "json", "value": {…}}]`.
|
|
978
|
+
|
|
979
|
+
## OwnerMetafield
|
|
980
|
+
|
|
981
|
+
A metafield as Shopify's Admin API takes it.
|
|
982
|
+
|
|
983
|
+
| Field | Type | Description |
|
|
984
|
+
|---|---|---|
|
|
985
|
+
| `namespace` | string | **Required.** `$app`, `$app:<name>`, or another namespace. |
|
|
986
|
+
| `key` | string | **Required.** |
|
|
987
|
+
| `type` | string | The metafield type: `json`, `single_line_text_field`, … Inferred from the value when omitted. |
|
|
988
|
+
| `value` | any JSON value | **Required.** The value: JSON, or the text Shopify stores (`"{\"percentage\":10}"` for `json`). |
|
|
989
|
+
|
|
990
|
+
## CheckoutFunction
|
|
991
|
+
|
|
992
|
+
A Function that is not a discount (cart transform, delivery or payment customization,
|
|
993
|
+
validation): its owner in the shop, and its settings.
|
|
994
|
+
|
|
995
|
+
| Field | Type | Description |
|
|
996
|
+
|---|---|---|
|
|
997
|
+
| `enabled` | boolean | Whether the shop has an owner of the Function (the payment or delivery customization, validation or cart transform an app creates for it), and it is enabled. As on Shopify, the Function runs at the checkout only through an enabled owner: `true` runs it, `false` is an owner that is turned off. Without it, the shop has no owner of it, as after an install: the Function runs only for a scenario that names it in `extensions`, or for `app function run <handle>`, with these metafields. |
|
|
998
|
+
| `metafields` | [OwnerMetafields](#ownermetafields) | The metafields of the object the Function belongs to, by `"namespace.key"`: `{"$app.function-configuration": {"type": "json", "value": {…}}}` for `metafield(namespace: "$app", key: "function-configuration")`. Shopify's list of `{namespace, key, type, value}` is taken too. |
|
|
999
|
+
|
|
1000
|
+
## CheckoutExtension
|
|
1001
|
+
|
|
1002
|
+
A checkout or customer account UI extension of the app, as the merchant set it up.
|
|
1003
|
+
|
|
1004
|
+
| Field | Type | Description |
|
|
1005
|
+
|---|---|---|
|
|
1006
|
+
| `settings` | map of any JSON value | The values of the fields of its `[extensions.settings]`, by `key`, as the merchant fills them in the checkout editor: `{"title": "Free gift", "threshold": 50, "show": true}`. A field left out has no value (`undefined`), as on Shopify. |
|
|
1007
|
+
|
|
1008
|
+
## AppInstallation
|
|
1009
|
+
|
|
1010
|
+
The app of `--app` as the store has it installed, for its theme app extensions: its
|
|
1011
|
+
app-data metafields and the app embed blocks turned on.
|
|
1012
|
+
|
|
1013
|
+
| Field | Type | Description |
|
|
1014
|
+
|---|---|---|
|
|
1015
|
+
| `metafields` | map of map of [Metafield](#metafield) | The app-data metafields of the installation, by namespace then key: `{"conditions": {"reviews_enabled": true}}`. The Liquid of the app's blocks reads them as `app.metafields.conditions.reviews_enabled`, and an `available_if` of a block tests them. |
|
|
1016
|
+
| `embeds` | map of [AppEmbed](#appembed) | App embed blocks turned on or off, by the name of their file in the extension's `blocks/` (`"chat-bubble"` for `blocks/chat-bubble.liquid`): `true` turns one on, with the settings `config/settings_data.json` gives it or else its defaults; `false` turns it off; `{"settings": {...}}` turns it on with these settings. The embeds of `config/settings_data.json` that this does not name stay as the theme has them. |
|
|
1017
|
+
|
|
1018
|
+
## AppEmbed
|
|
1019
|
+
|
|
1020
|
+
An app embed block turned on (`true`) or off (`false`), or turned on with its settings.
|
|
1021
|
+
|
|
1022
|
+
One of:
|
|
1023
|
+
|
|
1024
|
+
- boolean
|
|
1025
|
+
- [AppEmbedSettings](#appembedsettings)
|
|
1026
|
+
|
|
1027
|
+
## AppEmbedSettings
|
|
1028
|
+
|
|
1029
|
+
An app embed block turned on with settings of its own.
|
|
1030
|
+
|
|
1031
|
+
| Field | Type | Description |
|
|
1032
|
+
|---|---|---|
|
|
1033
|
+
| `settings` | map of any JSON value | The values of the settings of the block's schema, by setting id. The others have their defaults. |
|
|
1034
|
+
|
|
1035
|
+
## Checkout scenario
|
|
1036
|
+
|
|
1037
|
+
A named setup of the local checkout: a file of `checkouts/`. It sets what a checkout
|
|
1038
|
+
depends on on top of the store data, and what it does not set stays as the store data says.
|
|
1039
|
+
|
|
1040
|
+
| Field | Type | Description |
|
|
1041
|
+
|---|---|---|
|
|
1042
|
+
| `$schema` | string | Lets editors validate and autocomplete the file, e.g. `"../schema/checkout-scenario.schema.json"`. |
|
|
1043
|
+
| `title` | string | The name shown on the home page. Defaults to the name of the file. |
|
|
1044
|
+
| `description` | string | What the scenario is for and what to look at, shown on the home page. |
|
|
1045
|
+
| `session` | [Session](#session) | Who buys and what is in the cart, written as the `session` of the store data and applied on top of it: `customer`, `cart` (lines, quantities, selling plans, note, attributes), `country`, `company_location`. |
|
|
1046
|
+
| `entered` | [ScenarioEntered](#scenarioentered) | What the buyer already entered: email, address, discount codes, delivery and payment. |
|
|
1047
|
+
| `language` | string | The language of the buyer, by ISO code (`"fr"`): one of `localization.languages`. The checkout opens under its locale root. Defaults to the primary language. |
|
|
1048
|
+
| `checkout` | [Checkout](#checkout) | Overrides of the `checkout` section of the store data: every field that is present replaces the one of the store (`shipping_rates`, `payment_methods`, `discounts`, `tax_rate`), except `functions` and `extensions`, which replace the settings of the Functions and extensions they name. |
|
|
1049
|
+
| `variant` | [ScenarioLook](#scenariolook) | The look of the page. Defaults to the one of the server (`--variant`). |
|
|
1050
|
+
| `extensions` | array of string | The handles of the extensions (Functions and checkout UI extensions) that run, among those of the app that `--extension` allows. When omitted, every UI extension shows and the Functions run as at the shop's checkout: a payment or delivery customization, validation or cart transform Function only through an enabled owner of it. |
|
|
1051
|
+
| `expect` | [ScenarioExpect](#scenarioexpect) | What the checkout must look like once the Functions ran: `lsf app check` fails when it does not, and says what it expected and what it got. Without it, `app check` only checks that the Functions run without an error. |
|
|
1052
|
+
|
|
1053
|
+
## ScenarioEntered
|
|
1054
|
+
|
|
1055
|
+
What the buyer already typed and chose when a scenario opens.
|
|
1056
|
+
|
|
1057
|
+
| Field | Type | Description |
|
|
1058
|
+
|---|---|---|
|
|
1059
|
+
| `email` | string | The contact email. A logged-in customer has theirs already. |
|
|
1060
|
+
| `phone` | string | |
|
|
1061
|
+
| `shipping_address` | [ScenarioAddress](#scenarioaddress) | The delivery address. Its country is the country of the checkout. |
|
|
1062
|
+
| `delivery` | string | The handle of the shipping rate chosen (`checkout.shipping_rates`). The first one available is chosen when omitted. |
|
|
1063
|
+
| `payment` | string | The handle of the payment method chosen (`checkout.payment_methods`). |
|
|
1064
|
+
| `discount_codes` | array of string | The discount codes entered, in order. A code that no discount of `checkout.discounts` has is entered all the same, and refused as on Shopify. |
|
|
1065
|
+
|
|
1066
|
+
## ScenarioAddress
|
|
1067
|
+
|
|
1068
|
+
A postal address the buyer already entered.
|
|
1069
|
+
|
|
1070
|
+
| Field | Type | Description |
|
|
1071
|
+
|---|---|---|
|
|
1072
|
+
| `first_name` | string | |
|
|
1073
|
+
| `last_name` | string | |
|
|
1074
|
+
| `company` | string | |
|
|
1075
|
+
| `address1` | string | |
|
|
1076
|
+
| `address2` | string | |
|
|
1077
|
+
| `city` | string | |
|
|
1078
|
+
| `country_code` | string | ISO 3166-1 alpha-2 code of one of the store's countries: `"US"`. |
|
|
1079
|
+
| `province_code` | string | |
|
|
1080
|
+
| `zip` | string | |
|
|
1081
|
+
| `phone` | string | |
|
|
1082
|
+
|
|
1083
|
+
## ScenarioLook
|
|
1084
|
+
|
|
1085
|
+
The look of the checkout page.
|
|
1086
|
+
|
|
1087
|
+
One of:
|
|
1088
|
+
|
|
1089
|
+
- `"standard"`: Shopify's one-page checkout.
|
|
1090
|
+
- `"shop"`: The look of the Shop app and Shop Pay.
|
|
1091
|
+
|
|
1092
|
+
## ScenarioExpect
|
|
1093
|
+
|
|
1094
|
+
What the checkout of a scenario must look like once its Functions ran, which
|
|
1095
|
+
`lsf app check` checks. Each list (`payment_methods`, `express_methods`, `delivery_options`,
|
|
1096
|
+
`discounts`, `lines`, `errors`) takes `includes`, `excludes` and `equals`; `totals` takes
|
|
1097
|
+
exact amounts:
|
|
1098
|
+
|
|
1099
|
+
```json
|
|
1100
|
+
"expect": {
|
|
1101
|
+
"express_methods": { "excludes": ["paypal"] },
|
|
1102
|
+
"payment_methods": { "includes": ["paypal"] },
|
|
1103
|
+
"totals": { "total": "120.00" }
|
|
1104
|
+
}
|
|
1105
|
+
```
|
|
1106
|
+
|
|
1107
|
+
| Field | Type | Description |
|
|
1108
|
+
|---|---|---|
|
|
1109
|
+
| `step` | [ScenarioStep](#scenariostep) | The step of the buyer journey the Functions run for: `completion` (the default), the order being placed, as `lsf app function run` runs them; `interaction`, the page as the buyer sees it before. Only a validation Function tells them apart (`buyerJourney.step`). |
|
|
1110
|
+
| `payment_methods` | [ExpectedPaymentMethods](#expectedpaymentmethods) | The payment methods of the list of the checkout (`PAYMENT_METHOD`), in order, once the payment customizations ran. A string matches the handle or the name. |
|
|
1111
|
+
| `express_methods` | [ExpectedPaymentMethods](#expectedpaymentmethods) | The express buttons (`ACCELERATED_CHECKOUT`), in order, once the payment customizations ran. A method can be in both lists. A string matches the handle or the name. |
|
|
1112
|
+
| `delivery_options` | [ExpectedDeliveryOptions](#expecteddeliveryoptions) | The delivery options, in the order the buyer sees them, once the delivery customizations and the shipping discounts ran. A string matches the handle or the title. |
|
|
1113
|
+
| `discounts` | [ExpectedDiscounts](#expecteddiscounts) | The discounts applied, product, order and shipping ones. A string matches the title (the message the Function gave) or the code. |
|
|
1114
|
+
| `lines` | [ExpectedLines](#expectedlines) | The lines of the checkout once the cart transforms ran. A string matches the SKU or the title. |
|
|
1115
|
+
| `errors` | [ExpectedErrors](#expectederrors) | The errors that block the order: those validation Functions report, and those of Functions that failed. A string matches the message. `{"equals": []}`: no error. |
|
|
1116
|
+
| `totals` | [ExpectedTotals](#expectedtotals) | The amounts of the checkout, each exactly. |
|
|
1117
|
+
|
|
1118
|
+
## ScenarioStep
|
|
1119
|
+
|
|
1120
|
+
The step of the buyer journey the Functions run for.
|
|
1121
|
+
|
|
1122
|
+
One of:
|
|
1123
|
+
|
|
1124
|
+
- `"completion"`: The buyer places the order (`CHECKOUT_COMPLETION`).
|
|
1125
|
+
- `"interaction"`: The buyer is on the page (`CHECKOUT_INTERACTION`).
|
|
1126
|
+
|
|
1127
|
+
## ExpectedPaymentMethods
|
|
1128
|
+
|
|
1129
|
+
What a list of the checkout must hold. Each entry is a string, which matches an entry of the
|
|
1130
|
+
list by its name (see the list), or an object of the fields the entry must have.
|
|
1131
|
+
|
|
1132
|
+
| Field | Type | Description |
|
|
1133
|
+
|---|---|---|
|
|
1134
|
+
| `includes` | array of string or [ExpectedPaymentMethod](#expectedpaymentmethod) | Each of these matches an entry of the list, in any order. |
|
|
1135
|
+
| `excludes` | array of string or [ExpectedPaymentMethod](#expectedpaymentmethod) | None of these matches an entry of the list. |
|
|
1136
|
+
| `equals` | array of string or [ExpectedPaymentMethod](#expectedpaymentmethod) | The whole list, in order: as many entries, the first matching the first, and so on. `[]` is an empty list. |
|
|
1137
|
+
|
|
1138
|
+
## ExpectedPaymentMethod
|
|
1139
|
+
|
|
1140
|
+
A payment method of `expect`: the fields it must have.
|
|
1141
|
+
|
|
1142
|
+
| Field | Type | Description |
|
|
1143
|
+
|---|---|---|
|
|
1144
|
+
| `handle` | string | Its handle (`checkout.payment_methods`). |
|
|
1145
|
+
| `name` | string | Its name, as the buyer sees it: the one a payment customization gave it, if any. |
|
|
1146
|
+
|
|
1147
|
+
## ExpectedDeliveryOptions
|
|
1148
|
+
|
|
1149
|
+
What a list of the checkout must hold. Each entry is a string, which matches an entry of the
|
|
1150
|
+
list by its name (see the list), or an object of the fields the entry must have.
|
|
1151
|
+
|
|
1152
|
+
| Field | Type | Description |
|
|
1153
|
+
|---|---|---|
|
|
1154
|
+
| `includes` | array of string or [ExpectedDeliveryOption](#expecteddeliveryoption) | Each of these matches an entry of the list, in any order. |
|
|
1155
|
+
| `excludes` | array of string or [ExpectedDeliveryOption](#expecteddeliveryoption) | None of these matches an entry of the list. |
|
|
1156
|
+
| `equals` | array of string or [ExpectedDeliveryOption](#expecteddeliveryoption) | The whole list, in order: as many entries, the first matching the first, and so on. `[]` is an empty list. |
|
|
1157
|
+
|
|
1158
|
+
## ExpectedDeliveryOption
|
|
1159
|
+
|
|
1160
|
+
A delivery option of `expect`: the fields it must have.
|
|
1161
|
+
|
|
1162
|
+
| Field | Type | Description |
|
|
1163
|
+
|---|---|---|
|
|
1164
|
+
| `handle` | string | Its handle (`checkout.shipping_rates`). |
|
|
1165
|
+
| `title` | string | Its title, as the buyer sees it: the one a delivery customization gave it, if any. |
|
|
1166
|
+
| `cost` | [Money](#money) | What it costs once the shipping discounts ran. |
|
|
1167
|
+
|
|
1168
|
+
## ExpectedDiscounts
|
|
1169
|
+
|
|
1170
|
+
What a list of the checkout must hold. Each entry is a string, which matches an entry of the
|
|
1171
|
+
list by its name (see the list), or an object of the fields the entry must have.
|
|
1172
|
+
|
|
1173
|
+
| Field | Type | Description |
|
|
1174
|
+
|---|---|---|
|
|
1175
|
+
| `includes` | array of string or [ExpectedDiscount](#expecteddiscount) | Each of these matches an entry of the list, in any order. |
|
|
1176
|
+
| `excludes` | array of string or [ExpectedDiscount](#expecteddiscount) | None of these matches an entry of the list. |
|
|
1177
|
+
| `equals` | array of string or [ExpectedDiscount](#expecteddiscount) | The whole list, in order: as many entries, the first matching the first, and so on. `[]` is an empty list. |
|
|
1178
|
+
|
|
1179
|
+
## ExpectedDiscount
|
|
1180
|
+
|
|
1181
|
+
A discount of `expect`: the fields it must have.
|
|
1182
|
+
|
|
1183
|
+
| Field | Type | Description |
|
|
1184
|
+
|---|---|---|
|
|
1185
|
+
| `title` | string | Its title: the message the Function gave, or the title of the discount. |
|
|
1186
|
+
| `code` | string | The code it applied with. An automatic discount has none. |
|
|
1187
|
+
| `class` | [CheckoutDiscountClass](#checkoutdiscountclass) | What it reduced: `PRODUCT`, `ORDER` or `SHIPPING`. |
|
|
1188
|
+
| `amount` | [Money](#money) | What it took off. |
|
|
1189
|
+
|
|
1190
|
+
## ExpectedLines
|
|
1191
|
+
|
|
1192
|
+
What a list of the checkout must hold. Each entry is a string, which matches an entry of the
|
|
1193
|
+
list by its name (see the list), or an object of the fields the entry must have.
|
|
1194
|
+
|
|
1195
|
+
| Field | Type | Description |
|
|
1196
|
+
|---|---|---|
|
|
1197
|
+
| `includes` | array of string or [ExpectedLine](#expectedline) | Each of these matches an entry of the list, in any order. |
|
|
1198
|
+
| `excludes` | array of string or [ExpectedLine](#expectedline) | None of these matches an entry of the list. |
|
|
1199
|
+
| `equals` | array of string or [ExpectedLine](#expectedline) | The whole list, in order: as many entries, the first matching the first, and so on. `[]` is an empty list. |
|
|
1200
|
+
|
|
1201
|
+
## ExpectedLine
|
|
1202
|
+
|
|
1203
|
+
A line of `expect`: the fields it must have.
|
|
1204
|
+
|
|
1205
|
+
| Field | Type | Description |
|
|
1206
|
+
|---|---|---|
|
|
1207
|
+
| `sku` | string | The SKU of its variant. |
|
|
1208
|
+
| `title` | string | Its title: the product's, or the one a cart transform gave it. |
|
|
1209
|
+
| `quantity` | integer | How many units it has. |
|
|
1210
|
+
| `price` | [Money](#money) | The price of one unit, before discounts. |
|
|
1211
|
+
| `total` | [Money](#money) | What the line costs once its discounts ran. |
|
|
1212
|
+
| `components` | array of string | The lines a cart transform made it of (merge) or split it into (expand), in order, each by its SKU or title. `[]`: none. |
|
|
1213
|
+
| `attributes` | map of string | Attributes it must have, by key; it can have others. |
|
|
1214
|
+
|
|
1215
|
+
## ExpectedErrors
|
|
1216
|
+
|
|
1217
|
+
What a list of the checkout must hold. Each entry is a string, which matches an entry of the
|
|
1218
|
+
list by its name (see the list), or an object of the fields the entry must have.
|
|
1219
|
+
|
|
1220
|
+
| Field | Type | Description |
|
|
1221
|
+
|---|---|---|
|
|
1222
|
+
| `includes` | array of string or [ExpectedError](#expectederror) | Each of these matches an entry of the list, in any order. |
|
|
1223
|
+
| `excludes` | array of string or [ExpectedError](#expectederror) | None of these matches an entry of the list. |
|
|
1224
|
+
| `equals` | array of string or [ExpectedError](#expectederror) | The whole list, in order: as many entries, the first matching the first, and so on. `[]` is an empty list. |
|
|
1225
|
+
|
|
1226
|
+
## ExpectedError
|
|
1227
|
+
|
|
1228
|
+
An error of `expect`: the fields it must have.
|
|
1229
|
+
|
|
1230
|
+
| Field | Type | Description |
|
|
1231
|
+
|---|---|---|
|
|
1232
|
+
| `message` | string | The message, exactly. |
|
|
1233
|
+
| `target` | string | The target the Function gave (`$.cart`, `$.cart.buyerIdentity.email`). |
|
|
1234
|
+
|
|
1235
|
+
## ExpectedTotals
|
|
1236
|
+
|
|
1237
|
+
The amounts of the checkout `expect` checks, each exactly. Those left out are not checked.
|
|
1238
|
+
|
|
1239
|
+
| Field | Type | Description |
|
|
1240
|
+
|---|---|---|
|
|
1241
|
+
| `subtotal` | [Money](#money) | The lines before discounts. |
|
|
1242
|
+
| `discounts` | [Money](#money) | The product and order discounts (the shipping discounts are in `shipping`). |
|
|
1243
|
+
| `shipping` | [Money](#money) | The selected delivery option, once the shipping discounts ran. 0 before the address has a country. |
|
|
1244
|
+
| `tax` | [Money](#money) | The tax (`checkout.tax_rate`). |
|
|
1245
|
+
| `total` | [Money](#money) | What the order costs in all, the part paid later included. |
|
|
1246
|
+
| `due_now` | [Money](#money) | What the buyer pays now. |
|
|
1247
|
+
| `due_later` | [Money](#money) | What the selling plans leave to pay later. |
|