-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
2684 lines (2463 loc) · 138 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package storefront
import "time"
// QueryRoot: The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start.
type QueryRoot struct {
// Articles is a list of the shop's articles.
Articles Connection[Article] `json:"articles,omitempty"`
// Blog is a specific `Blog` by one of its unique attributes.
Blog Blog `json:"blog,omitempty"`
// BlogByHandle is a blog by its handle.
BlogByHandle Blog `json:"blogByHandle,omitempty"`
// Blogs is a list of the shop's blogs.
Blogs Connection[Blog] `json:"blogs,omitempty"`
// Cart is a cart by its ID.
Cart Cart `json:"cart,omitempty"`
// Collection is a specific `Collection` by one of its unique attributes.
Collection Collection `json:"collection,omitempty"`
// CollectionByHandle is a collection by its handle.
CollectionByHandle Collection `json:"collectionByHandle,omitempty"`
// Collections is a list of the shop’s collections.
Collections Connection[Collection] `json:"collections,omitempty"`
// Customer is a customer by its access token.
Customer Customer `json:"customer,omitempty"`
// Localization is the localized experiences configured for the shop.
Localization Localization `json:"localization,omitempty"`
/*
Locations is a list of the shop's locations that support in-store pickup.
When sorting by distance, you must specify a location via the `near` argument.
*/
Locations Connection[Location] `json:"locations,omitempty"`
// Node is a specific node by ID.
Node Node `json:"node,omitempty"`
// Nodes is the list of nodes with the given IDs.
Nodes []Node `json:"nodes,omitempty"`
// Page is a specific `Page` by one of its unique attributes.
Page Page `json:"page,omitempty"`
// PageByHandle is a page by its handle.
PageByHandle Page `json:"pageByHandle,omitempty"`
// Pages is a list of the shop's pages.
Pages Connection[Page] `json:"pages,omitempty"`
// Product is a specific `Product` by one of its unique attributes.
Product Product `json:"product,omitempty"`
// ProductByHandle is a product by its handle.
ProductByHandle Product `json:"productByHandle,omitempty"`
/*
ProductRecommendations is the find recommended products related to a given `product_id`.
To learn more about how recommendations are generated, see
[*Showing product recommendations on product pages*](https://help.shopify.com/themes/development/recommended-products).
*/
ProductRecommendations []Product `json:"productRecommendations,omitempty"`
/*
ProductTags is the tags added to products.
Additional access scope required: unauthenticated_read_product_tags.
*/
ProductTags Connection[string] `json:"productTags,omitempty"`
// ProductTypes is a list of product types for the shop's products that are published to your app.
ProductTypes Connection[string] `json:"productTypes,omitempty"`
// Products is a list of the shop’s products.
Products Connection[Product] `json:"products,omitempty"`
// PublicApiVersions is the list of public Storefront API versions, including supported, release candidate and unstable versions.
PublicApiVersions []ApiVersion `json:"publicApiVersions,omitempty"`
// Shop is the shop associated with the storefront access token.
Shop Shop `json:"shop,omitempty"`
}
// ArticleSortKeys: The set of valid sort keys for the Article query.
type ArticleSortKeys string
const (
ArticleSortKeysTitle ArticleSortKeys = "TITLE"
ArticleSortKeysBlogTitle ArticleSortKeys = "BLOG_TITLE"
ArticleSortKeysAuthor ArticleSortKeys = "AUTHOR"
ArticleSortKeysUpdatedAt ArticleSortKeys = "UPDATED_AT"
ArticleSortKeysPublishedAt ArticleSortKeys = "PUBLISHED_AT"
ArticleSortKeysId ArticleSortKeys = "ID"
ArticleSortKeysRelevance ArticleSortKeys = "RELEVANCE"
)
// Article: An article in an online store blog.
type Article struct {
// Author is the article's author.
Author ArticleAuthor `json:"author,omitempty"`
// AuthorV2 is the article's author.
AuthorV2 ArticleAuthor `json:"authorV2,omitempty"`
// Blog is the blog that the article belongs to.
Blog interface{} `json:"blog,omitempty"`
// Comments is a list of comments posted on the article.
Comments Connection[Comment] `json:"comments,omitempty"`
// Content is the stripped content of the article, single line with HTML tags removed.
Content string `json:"content,omitempty"`
// ContentHTML is the content of the article, complete with HTML formatting.
ContentHTML string `json:"contentHtml,omitempty"`
// Excerpt is the stripped excerpt of the article, single line with HTML tags removed.
Excerpt string `json:"excerpt,omitempty"`
// ExcerptHTML is the excerpt of the article, complete with HTML formatting.
ExcerptHTML string `json:"excerptHtml,omitempty"`
/*
Handle is a human-friendly unique string for the Article automatically generated from its title.
*/
Handle string `json:"handle,omitempty"`
// Id is a globally-unique identifier.
Id string `json:"id,omitempty"`
// Image is the image associated with the article.
Image Image `json:"image,omitempty"`
// Metafield is a metafield found by namespace and key.
Metafield Metafield `json:"metafield,omitempty"`
// Metafields is a paginated list of metafields associated with the resource.
Metafields Connection[Metafield] `json:"metafields,omitempty"`
// OnlineStoreURL is the URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is currently not published to the Online Store sales channel.
OnlineStoreURL string `json:"onlineStoreUrl,omitempty"`
// PublishedAt is the date and time when the article was published.
PublishedAt time.Time `json:"publishedAt,omitempty"`
// SEO is the article’s SEO information.
SEO SEO `json:"seo,omitempty"`
// Tags is a categorization that a article can be tagged with.
Tags []string `json:"tags,omitempty"`
// Title is the article’s name.
Title string `json:"title,omitempty"`
}
/*
Node: An object with an ID field to support global identification, in accordance with the
[Relay specification](https://relay.dev/graphql/objectidentification.htm#sec-Node-Interface).
This interface is used by the [node](https://shopify.dev/api/admin-graphql/unstable/queries/node)
and [nodes](https://shopify.dev/api/admin-graphql/unstable/queries/nodes) queries.
*/
type Node struct {
// Id is a globally-unique identifier.
Id string `json:"id,omitempty"`
}
// HasMetafields: Represents information about the metafields associated to the specified resource.
type HasMetafields struct {
// Metafield is a metafield found by namespace and key.
Metafield Metafield `json:"metafield,omitempty"`
// Metafields is a paginated list of metafields associated with the resource.
Metafields Connection[Metafield] `json:"metafields,omitempty"`
}
/*
Metafield: Metafields represent custom metadata attached to a resource. Metafields can be sorted into namespaces and are
comprised of keys, values, and value types.
*/
type Metafield struct {
// CreatedAt is the date and time when the storefront metafield was created.
CreatedAt time.Time `json:"createdAt,omitempty"`
// Description is the description of a metafield.
Description string `json:"description,omitempty"`
// Id is a globally-unique identifier.
Id string `json:"id,omitempty"`
// Key is the key name for a metafield.
Key string `json:"key,omitempty"`
// Namespace is the namespace for a metafield.
Namespace string `json:"namespace,omitempty"`
// ParentResource is the parent object that the metafield belongs to.
ParentResource string `json:"parentResource,omitempty"`
// Reference is a reference object if the metafield definition's type is a resource reference.
Reference string `json:"reference,omitempty"`
/*
Type is the type name of the metafield.
See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types).
*/
Type string `json:"type,omitempty"`
// UpdatedAt is the date and time when the storefront metafield was updated.
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// Value is the value of a metafield.
Value string `json:"value,omitempty"`
}
// Blog: An online store blog.
type Blog struct {
// ArticleByHandle is an article by its handle.
ArticleByHandle Article `json:"articleByHandle,omitempty"`
// Articles is a list of the blog's articles.
Articles Connection[Article] `json:"articles,omitempty"`
// Authors is the authors who have contributed to the blog.
Authors []ArticleAuthor `json:"authors,omitempty"`
/*
Handle is a human-friendly unique string for the Blog automatically generated from its title.
*/
Handle string `json:"handle,omitempty"`
// Id is a globally-unique identifier.
Id string `json:"id,omitempty"`
// Metafield is a metafield found by namespace and key.
Metafield Metafield `json:"metafield,omitempty"`
// Metafields is a paginated list of metafields associated with the resource.
Metafields Connection[Metafield] `json:"metafields,omitempty"`
// OnlineStoreURL is the URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is currently not published to the Online Store sales channel.
OnlineStoreURL string `json:"onlineStoreUrl,omitempty"`
// SEO is the blog's SEO information.
SEO SEO `json:"seo,omitempty"`
// Title is the blogs’s title.
Title string `json:"title,omitempty"`
}
// OnlineStorePublishable: Represents a resource that can be published to the Online Store sales channel.
type OnlineStorePublishable struct {
// OnlineStoreURL is the URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is currently not published to the Online Store sales channel.
OnlineStoreURL string `json:"onlineStoreUrl,omitempty"`
}
// ArticleAuthor: The author of an article.
type ArticleAuthor struct {
// Bio is the author's bio.
Bio string `json:"bio,omitempty"`
// Email is the author’s email.
Email string `json:"email,omitempty"`
// FirstName is the author's first name.
FirstName string `json:"firstName,omitempty"`
// LastName is the author's last name.
LastName string `json:"lastName,omitempty"`
// Name is the author's full name.
Name string `json:"name,omitempty"`
}
/*
PageInfo: Returns information about pagination in a connection, in accordance with the
[Relay specification](https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo).
*/
type PageInfo struct {
// HasNextPage is whether there are more pages to fetch following the current page.
HasNextPage bool `json:"hasNextPage,omitempty"`
// HasPreviousPage is whether there are any pages prior to the current page.
HasPreviousPage bool `json:"hasPreviousPage,omitempty"`
}
// SEO: SEO information.
type SEO struct {
// Description is the meta description.
Description string `json:"description,omitempty"`
// Title is the SEO title.
Title string `json:"title,omitempty"`
}
// Collection: A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse.
type Collection struct {
// Description is the stripped description of the collection, single line with HTML tags removed.
Description string `json:"description,omitempty"`
// DescriptionHTML is the description of the collection, complete with HTML formatting.
DescriptionHTML string `json:"descriptionHtml,omitempty"`
/*
Handle is a human-friendly unique string for the collection automatically generated from its title.
Limit of 255 characters.
*/
Handle string `json:"handle,omitempty"`
// Id is a globally-unique identifier.
Id string `json:"id,omitempty"`
// Image is the image associated with the collection.
Image Image `json:"image,omitempty"`
// Metafield is a metafield found by namespace and key.
Metafield Metafield `json:"metafield,omitempty"`
// Metafields is a paginated list of metafields associated with the resource.
Metafields Connection[Metafield] `json:"metafields,omitempty"`
// OnlineStoreURL is the URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is currently not published to the Online Store sales channel.
OnlineStoreURL string `json:"onlineStoreUrl,omitempty"`
// Products is a list of products in the collection.
Products Connection[Product] `json:"products,omitempty"`
// Title is the collection’s name. Limit of 255 characters.
Title string `json:"title,omitempty"`
// UpdatedAt is the date and time when the collection was last modified.
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
// Image: Represents an image resource.
type Image struct {
// AltText is a word or phrase to share the nature or contents of an image.
AltText string `json:"altText,omitempty"`
// Height is the original height of the image in pixels. Returns `null` if the image is not hosted by Shopify.
Height int `json:"height,omitempty"`
// Id is a unique identifier for the image.
Id string `json:"id,omitempty"`
/*
OriginalSrc is the location of the original image as a URL.
If there are any existing transformations in the original source URL, they will remain and not be stripped.
*/
OriginalSrc string `json:"originalSrc,omitempty"`
// Src is the location of the image as a URL.
Src string `json:"src,omitempty"`
/*
TransformedSrc is the location of the transformed image as a URL.
All transformation arguments are considered "best-effort". If they can be applied to an image, they will be.
Otherwise any transformations which an image type does not support will be ignored.
*/
TransformedSrc string `json:"transformedSrc,omitempty"`
/*
URL is the location of the image as a URL.
If no transform options are specified, then the original image will be preserved including any pre-applied transforms.
All transformation options are considered "best-effort". Any transformation that the original image type doesn't support will be ignored.
If you need multiple variations of the same image, then you can use [GraphQL aliases](https://graphql.org/learn/queries/#aliases).
*/
URL string `json:"url,omitempty"`
// Width is the original width of the image in pixels. Returns `null` if the image is not hosted by Shopify.
Width int `json:"width,omitempty"`
}
// CropRegion: The part of the image that should remain after cropping.
type CropRegion string
const (
CropRegionCenter CropRegion = "CENTER"
CropRegionTop CropRegion = "TOP"
CropRegionBottom CropRegion = "BOTTOM"
CropRegionLeft CropRegion = "LEFT"
CropRegionRight CropRegion = "RIGHT"
)
// ImageContentType: List of supported image content types.
type ImageContentType string
const (
ImageContentTypePNG ImageContentType = "PNG"
ImageContentTypeJPG ImageContentType = "JPG"
ImageContentTypeWebP ImageContentType = "WEBP"
)
// ProductCollectionSortKeys: The set of valid sort keys for the ProductCollection query.
type ProductCollectionSortKeys string
const (
ProductCollectionSortKeysTitle ProductCollectionSortKeys = "TITLE"
ProductCollectionSortKeysPrice ProductCollectionSortKeys = "PRICE"
ProductCollectionSortKeysBestSelling ProductCollectionSortKeys = "BEST_SELLING"
ProductCollectionSortKeysCreated ProductCollectionSortKeys = "CREATED"
ProductCollectionSortKeysId ProductCollectionSortKeys = "ID"
ProductCollectionSortKeysManual ProductCollectionSortKeys = "MANUAL"
ProductCollectionSortKeysCollectionDefault ProductCollectionSortKeys = "COLLECTION_DEFAULT"
ProductCollectionSortKeysRelevance ProductCollectionSortKeys = "RELEVANCE"
)
/*
Product: A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be.
For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty).
*/
type Product struct {
// AvailableForSale indicates if at least one product variant is available for sale.
AvailableForSale bool `json:"availableForSale,omitempty"`
// Collections is a list of collections a product belongs to.
Collections Connection[Collection] `json:"collections,omitempty"`
// CompareAtPriceRange is the compare at price of the product across all variants.
CompareAtPriceRange ProductPriceRange `json:"compareAtPriceRange,omitempty"`
// CreatedAt is the date and time when the product was created.
CreatedAt time.Time `json:"createdAt,omitempty"`
// Description is the stripped description of the product, single line with HTML tags removed.
Description string `json:"description,omitempty"`
// DescriptionHTML is the description of the product, complete with HTML formatting.
DescriptionHTML string `json:"descriptionHtml,omitempty"`
/*
FeaturedImage is the featured image for the product.
This field is functionally equivalent to `images(first: 1)`.
*/
FeaturedImage Image `json:"featuredImage,omitempty"`
/*
Handle is a human-friendly unique string for the Product automatically generated from its title.
They are used by the Liquid templating language to refer to objects.
*/
Handle string `json:"handle,omitempty"`
// Id is a globally-unique identifier.
Id string `json:"id,omitempty"`
// Images is a list of images associated with the product.
Images Connection[Image] `json:"images,omitempty"`
// Media is the media associated with the product.
Media Connection[Media] `json:"media,omitempty"`
// Metafield is a metafield found by namespace and key.
Metafield Metafield `json:"metafield,omitempty"`
// Metafields is a paginated list of metafields associated with the resource.
Metafields Connection[Metafield] `json:"metafields,omitempty"`
// OnlineStoreURL is the URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is currently not published to the Online Store sales channel.
OnlineStoreURL string `json:"onlineStoreUrl,omitempty"`
// Options is a list of product options.
Options []ProductOption `json:"options,omitempty"`
// PriceRange is the price range.
PriceRange ProductPriceRange `json:"priceRange,omitempty"`
// ProductType is a categorization that a product can be tagged with, commonly used for filtering and searching.
ProductType string `json:"productType,omitempty"`
// PublishedAt is the date and time when the product was published to the channel.
PublishedAt time.Time `json:"publishedAt,omitempty"`
// RequiresSellingPlan is whether the product can only be purchased with a selling plan.
RequiresSellingPlan bool `json:"requiresSellingPlan,omitempty"`
// SellingPlanGroups is a list of a product's available selling plan groups. A selling plan group represents a selling method. For example, 'Subscribe and save' is a selling method where customers pay for goods or services per delivery. A selling plan group contains individual selling plans.
SellingPlanGroups Connection[SellingPlanGroup] `json:"sellingPlanGroups,omitempty"`
// SEO is the product's SEO information.
SEO SEO `json:"seo,omitempty"`
/*
Tags is a comma separated list of tags that have been added to the product.
Additional access scope required for private apps: unauthenticated_read_product_tags.
*/
Tags []string `json:"tags,omitempty"`
// Title is the product’s title.
Title string `json:"title,omitempty"`
// TotalInventory is the total quantity of inventory in stock for this Product.
TotalInventory int `json:"totalInventory,omitempty"`
/*
UpdatedAt is the date and time when the product was last modified.
A product's `updatedAt` value can change for different reasons. For example, if an order
is placed for a product that has inventory tracking set up, then the inventory adjustment
is counted as an update.
*/
UpdatedAt time.Time `json:"updatedAt,omitempty"`
/*
VariantBySelectedOptions is a product’s variant based on its selected options.
This is useful for converting a user’s selection of product options into a single matching variant.
If there is not a variant for the selected options, `null` will be returned.
*/
VariantBySelectedOptions ProductVariant `json:"variantBySelectedOptions,omitempty"`
// Variants is a list of the product’s variants.
Variants Connection[ProductVariant] `json:"variants,omitempty"`
// Vendor is the product’s vendor name.
Vendor string `json:"vendor,omitempty"`
}
// ProductPriceRange: The price range of the product.
type ProductPriceRange struct {
// MaxVariantPrice is the highest variant's price.
MaxVariantPrice MoneyV2 `json:"maxVariantPrice,omitempty"`
// MinVariantPrice is the lowest variant's price.
MinVariantPrice MoneyV2 `json:"minVariantPrice,omitempty"`
}
/*
MoneyV2: A monetary value with currency.
*/
type MoneyV2 struct {
// Amount is the decimal money amount.
Amount float64 `json:"amount,omitempty"`
// CurrencyCode is the currency of the money.
CurrencyCode string `json:"currencyCode,omitempty"`
}
// ProductImageSortKeys: The set of valid sort keys for the ProductImage query.
type ProductImageSortKeys string
const (
ProductImageSortKeysCreatedAt ProductImageSortKeys = "CREATED_AT"
ProductImageSortKeysPosition ProductImageSortKeys = "POSITION"
ProductImageSortKeysId ProductImageSortKeys = "ID"
ProductImageSortKeysRelevance ProductImageSortKeys = "RELEVANCE"
)
// ProductMediaSortKeys: The set of valid sort keys for the ProductMedia query.
type ProductMediaSortKeys string
const (
ProductMediaSortKeysPosition ProductMediaSortKeys = "POSITION"
ProductMediaSortKeysId ProductMediaSortKeys = "ID"
ProductMediaSortKeysRelevance ProductMediaSortKeys = "RELEVANCE"
)
// Media: Represents a media interface.
type Media struct {
// Alt is a word or phrase to share the nature or contents of a media.
Alt string `json:"alt,omitempty"`
// MediaContentType is the media content type.
MediaContentType MediaContentType `json:"mediaContentType,omitempty"`
// PreviewImage is the preview image for the media.
PreviewImage Image `json:"previewImage,omitempty"`
}
// MediaContentType: The possible content types for a media object.
type MediaContentType string
const (
MediaContentTypeExternalVideo MediaContentType = "EXTERNAL_VIDEO"
MediaContentTypeImage MediaContentType = "IMAGE"
MediaContentTypeModel3D MediaContentType = "MODEL_3D"
MediaContentTypeVideo MediaContentType = "VIDEO"
)
/*
ProductOption: Product property names like "Size", "Color", and "Material" that the customers can select.
Variants are selected based on permutations of these options.
255 characters limit each.
*/
type ProductOption struct {
// Id is a globally-unique identifier.
Id string `json:"id,omitempty"`
// Name is the product option’s name.
Name string `json:"name,omitempty"`
// Values is the corresponding value to the product option name.
Values []string `json:"values,omitempty"`
}
// SellingPlanGroup: Represents a selling method. For example, 'Subscribe and save' is a selling method where customers pay for goods or services per delivery. A selling plan group contains individual selling plans.
type SellingPlanGroup struct {
// AppName is a display friendly name for the app that created the selling plan group.
AppName string `json:"appName,omitempty"`
// Name is the name of the selling plan group.
Name string `json:"name,omitempty"`
// Options is the represents the selling plan options available in the drop-down list in the storefront. For example, 'Delivery every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the product.
Options []SellingPlanGroupOption `json:"options,omitempty"`
// SellingPlans is a list of selling plans in a selling plan group. A selling plan is a representation of how products and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of prepaid granola, delivered weekly'.
SellingPlans Connection[SellingPlan] `json:"sellingPlans,omitempty"`
}
// SellingPlanGroupOption: Represents an option on a selling plan group that's available in the drop-down list in the storefront.
type SellingPlanGroupOption struct {
// Name is the name of the option. For example, 'Delivery every'.
Name string `json:"name,omitempty"`
// Values is the values for the options specified by the selling plans in the selling plan group. For example, '1 week', '2 weeks', '3 weeks'.
Values []string `json:"values,omitempty"`
}
// SellingPlan: Represents how products and variants can be sold and purchased.
type SellingPlan struct {
// Description is the description of the selling plan.
Description string `json:"description,omitempty"`
// Id is a globally-unique identifier.
Id string `json:"id,omitempty"`
// Name is the name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'.
Name string `json:"name,omitempty"`
// Options is the represents the selling plan options available in the drop-down list in the storefront. For example, 'Delivery every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the product.
Options []SellingPlanOption `json:"options,omitempty"`
// PriceAdjustments is the represents how a selling plan affects pricing when a variant is purchased with a selling plan.
PriceAdjustments []SellingPlanPriceAdjustment `json:"priceAdjustments,omitempty"`
// RecurringDeliveries is the whether purchasing the selling plan will result in multiple deliveries.
RecurringDeliveries bool `json:"recurringDeliveries,omitempty"`
}
// SellingPlanOption: An option provided by a Selling Plan.
type SellingPlanOption struct {
// Name is the name of the option (ie "Delivery every").
Name string `json:"name,omitempty"`
// Value is the value of the option (ie "Month").
Value string `json:"value,omitempty"`
}
// SellingPlanPriceAdjustment: Represents by how much the price of a variant associated with a selling plan is adjusted. Each variant can have up to two price adjustments.
type SellingPlanPriceAdjustment struct {
// AdjustmentValue is the type of price adjustment. An adjustment value can have one of three types: percentage, amount off, or a new price.
AdjustmentValue string `json:"adjustmentValue,omitempty"`
// OrderCount is the number of orders that the price adjustment applies to If the price adjustment always applies, then this field is `null`.
OrderCount int `json:"orderCount,omitempty"`
}
// SellingPlanFixedAmountPriceAdjustment: A fixed amount that's deducted from the original variant price. For example, $10.00 off.
type SellingPlanFixedAmountPriceAdjustment struct {
// AdjustmentAmount is the money value of the price adjustment.
AdjustmentAmount MoneyV2 `json:"adjustmentAmount,omitempty"`
}
// SellingPlanFixedPriceAdjustment: A fixed price adjustment for a variant that's purchased with a selling plan.
type SellingPlanFixedPriceAdjustment struct {
// Price is a new price of the variant when it's purchased with the selling plan.
Price MoneyV2 `json:"price,omitempty"`
}
// SellingPlanPercentagePriceAdjustment: A percentage amount that's deducted from the original variant price. For example, 10% off.
type SellingPlanPercentagePriceAdjustment struct {
// AdjustmentPercentage is the percentage value of the price adjustment.
AdjustmentPercentage int `json:"adjustmentPercentage,omitempty"`
}
// ProductVariant: A product variant represents a different version of a product, such as differing sizes or differing colors.
type ProductVariant struct {
// AvailableForSale indicates if the product variant is available for sale.
AvailableForSale bool `json:"availableForSale,omitempty"`
// Barcode is the barcode (for example, ISBN, UPC, or GTIN) associated with the variant.
Barcode string `json:"barcode,omitempty"`
// CompareAtPrice is the compare at price of the variant. This can be used to mark a variant as on sale, when `compareAtPrice` is higher than `price`.
CompareAtPrice string `json:"compareAtPrice,omitempty"`
// CompareAtPriceV2 is the compare at price of the variant. This can be used to mark a variant as on sale, when `compareAtPriceV2` is higher than `priceV2`.
CompareAtPriceV2 MoneyV2 `json:"compareAtPriceV2,omitempty"`
// CurrentlyNotInStock is whether a product is out of stock but still available for purchase (used for backorders).
CurrentlyNotInStock bool `json:"currentlyNotInStock,omitempty"`
// Id is a globally-unique identifier.
Id string `json:"id,omitempty"`
/*
Image is the image associated with the product variant. This field falls back to the product image if no image is available.
*/
Image Image `json:"image,omitempty"`
// Metafield is a metafield found by namespace and key.
Metafield Metafield `json:"metafield,omitempty"`
// Metafields is a paginated list of metafields associated with the resource.
Metafields Connection[Metafield] `json:"metafields,omitempty"`
// Price is the product variant’s price.
Price string `json:"price,omitempty"`
// PriceV2 is the product variant’s price.
PriceV2 MoneyV2 `json:"priceV2,omitempty"`
// Product is the product object that the product variant belongs to.
Product interface{} `json:"product,omitempty"`
// QuantityAvailable is the total sellable quantity of the variant for online sales channels.
QuantityAvailable int `json:"quantityAvailable,omitempty"`
// RequiresShipping is whether a customer needs to provide a shipping address when placing an order for the product variant.
RequiresShipping bool `json:"requiresShipping,omitempty"`
// SelectedOptions is a list of product options applied to the variant.
SelectedOptions []SelectedOption `json:"selectedOptions,omitempty"`
// SellingPlanAllocations is the represents an association between a variant and a selling plan. Selling plan allocations describe which selling plans are available for each variant, and what their impact is on pricing.
SellingPlanAllocations Connection[SellingPlanAllocation] `json:"sellingPlanAllocations,omitempty"`
// SKU is the SKU (stock keeping unit) associated with the variant.
SKU string `json:"sku,omitempty"`
// StoreAvailability is the in-store pickup availability of this variant by location.
StoreAvailability Connection[StoreAvailability] `json:"storeAvailability,omitempty"`
// Title is the product variant’s title.
Title string `json:"title,omitempty"`
// UnitPrice is the unit price value for the variant based on the variant's measurement.
UnitPrice MoneyV2 `json:"unitPrice,omitempty"`
// UnitPriceMeasurement is the unit price measurement for the variant.
UnitPriceMeasurement UnitPriceMeasurement `json:"unitPriceMeasurement,omitempty"`
// Weight is the weight of the product variant in the unit system specified with `weight_unit`.
Weight float64 `json:"weight,omitempty"`
// WeightUnit is the unit of measurement for weight.
WeightUnit string `json:"weightUnit,omitempty"`
}
/*
SelectedOption: Properties used by customers to select a product variant.
Products can have multiple options, like different sizes or colors.
*/
type SelectedOption struct {
// Name is the product option’s name.
Name string `json:"name,omitempty"`
// Value is the product option’s value.
Value string `json:"value,omitempty"`
}
// SellingPlanAllocation: Represents an association between a variant and a selling plan. Selling plan allocations describe the options offered for each variant, and the price of the variant when purchased with a selling plan.
type SellingPlanAllocation struct {
// PriceAdjustments is a list of price adjustments, with a maximum of two. When there are two, the first price adjustment goes into effect at the time of purchase, while the second one starts after a certain number of orders.
PriceAdjustments []SellingPlanAllocationPriceAdjustment `json:"priceAdjustments,omitempty"`
// SellingPlan is a representation of how products and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of prepaid granola, delivered weekly'.
SellingPlan SellingPlan `json:"sellingPlan,omitempty"`
}
// SellingPlanAllocationPriceAdjustment: The resulting prices for variants when they're purchased with a specific selling plan.
type SellingPlanAllocationPriceAdjustment struct {
// CompareAtPrice is the price of the variant when it's purchased without a selling plan for the same number of deliveries. For example, if a customer purchases 6 deliveries of $10.00 granola separately, then the price is 6 x $10.00 = $60.00.
CompareAtPrice MoneyV2 `json:"compareAtPrice,omitempty"`
// PerDeliveryPrice is the effective price for a single delivery. For example, for a prepaid subscription plan that includes 6 deliveries at the price of $48.00, the per delivery price is $8.00.
PerDeliveryPrice MoneyV2 `json:"perDeliveryPrice,omitempty"`
// Price is the price of the variant when it's purchased with a selling plan For example, for a prepaid subscription plan that includes 6 deliveries of $10.00 granola, where the customer gets 20% off, the price is 6 x $10.00 x 0.80 = $48.00.
Price MoneyV2 `json:"price,omitempty"`
// UnitPrice is the resulting price per unit for the variant associated with the selling plan. If the variant isn't sold by quantity or measurement, then this field returns `null`.
UnitPrice MoneyV2 `json:"unitPrice,omitempty"`
}
/*
StoreAvailability: The availability of a product variant at a particular location.
Local pick-up must be enabled in the store's shipping settings, otherwise this will return an empty result.
*/
type StoreAvailability struct {
// Available is the whether or not this product variant is in-stock at this location.
Available bool `json:"available,omitempty"`
// Location is the location where this product variant is stocked at.
Location Location `json:"location,omitempty"`
// PickUpTime is the estimated amount of time it takes for pickup to be ready (Example: Usually ready in 24 hours).
PickUpTime string `json:"pickUpTime,omitempty"`
}
// Location: Represents a location where product inventory is held.
type Location struct {
// Address is the address of the location.
Address LocationAddress `json:"address,omitempty"`
// Id is a globally-unique identifier.
Id string `json:"id,omitempty"`
// Name is the name of the location.
Name string `json:"name,omitempty"`
}
/*
LocationAddress: Represents the address of a location.
*/
type LocationAddress struct {
// Address1 is the first line of the address for the location.
Address1 string `json:"address1,omitempty"`
// Address2 is the second line of the address for the location.
Address2 string `json:"address2,omitempty"`
// City is the city of the location.
City string `json:"city,omitempty"`
// Country is the country of the location.
Country string `json:"country,omitempty"`
// CountryCode is the country code of the location.
CountryCode string `json:"countryCode,omitempty"`
// Formatted is a formatted version of the address for the location.
Formatted []string `json:"formatted,omitempty"`
// Latitude is the latitude coordinates of the location.
Latitude float64 `json:"latitude,omitempty"`
// Longitude is the longitude coordinates of the location.
Longitude float64 `json:"longitude,omitempty"`
// Phone is the phone number of the location.
Phone string `json:"phone,omitempty"`
// Province is the province of the location.
Province string `json:"province,omitempty"`
/*
ProvinceCode is the code for the province, state, or district of the address of the location.
*/
ProvinceCode string `json:"provinceCode,omitempty"`
// ZIP is the ZIP code of the location.
ZIP string `json:"zip,omitempty"`
}
/*
UnitPriceMeasurement: The measurement used to calculate a unit price for a product variant (e.g. $9.99 / 100ml).
*/
type UnitPriceMeasurement struct {
// MeasuredType is the type of unit of measurement for the unit price measurement.
MeasuredType string `json:"measuredType,omitempty"`
// QuantityUnit is the quantity unit for the unit price measurement.
QuantityUnit string `json:"quantityUnit,omitempty"`
// QuantityValue is the quantity value for the unit price measurement.
QuantityValue float64 `json:"quantityValue,omitempty"`
// ReferenceUnit is the reference unit for the unit price measurement.
ReferenceUnit string `json:"referenceUnit,omitempty"`
// ReferenceValue is the reference value for the unit price measurement.
ReferenceValue int `json:"referenceValue,omitempty"`
}
// ProductVariantSortKeys: The set of valid sort keys for the ProductVariant query.
type ProductVariantSortKeys string
const (
ProductVariantSortKeysTitle ProductVariantSortKeys = "TITLE"
ProductVariantSortKeysSKU ProductVariantSortKeys = "SKU"
ProductVariantSortKeysPosition ProductVariantSortKeys = "POSITION"
ProductVariantSortKeysId ProductVariantSortKeys = "ID"
ProductVariantSortKeysRelevance ProductVariantSortKeys = "RELEVANCE"
)
// Filter: A filter that is supported on the parent field.
type Filter struct {
// Id is a unique identifier.
Id string `json:"id,omitempty"`
// Label is a human-friendly string for this filter.
Label string `json:"label,omitempty"`
// Type is an enumeration that denotes the type of data this filter represents.
Type FilterType `json:"type,omitempty"`
// Values is the list of values for this filter.
Values []FilterValue `json:"values,omitempty"`
}
// FilterType: Denotes the type of data this filter group represents.
type FilterType string
const (
FilterTypeList FilterType = "LIST"
FilterTypePriceRange FilterType = "PRICE_RANGE"
)
// FilterValue: A selectable value within a filter.
type FilterValue struct {
// Count is the number of results that match this filter value.
Count int `json:"count,omitempty"`
// Id is a unique identifier.
Id string `json:"id,omitempty"`
/*
Input is an input object that can be used to filter by this value on the parent field.
The value is provided as a helper for building dynamic filtering UI. For example, if you have a list of selected `FilterValue` objects, you can combine their respective `input` values to use in a subsequent query.
*/
Input map[string]interface{} `json:"input,omitempty"`
// Label is a human-friendly string for this filter value.
Label string `json:"label,omitempty"`
}
// Customer: A customer represents a customer account with the shop. Customer accounts store contact information for the customer, saving logged-in customers the trouble of having to provide it at every checkout.
type Customer struct {
// AcceptsMarketing indicates whether the customer has consented to be sent marketing material via email.
AcceptsMarketing bool `json:"acceptsMarketing,omitempty"`
// Addresses is a list of addresses for the customer.
Addresses Connection[MailingAddress] `json:"addresses,omitempty"`
// CreatedAt is the date and time when the customer was created.
CreatedAt time.Time `json:"createdAt,omitempty"`
// DefaultAddress is the customer’s default address.
DefaultAddress MailingAddress `json:"defaultAddress,omitempty"`
// DisplayName is the customer’s name, email or phone number.
DisplayName string `json:"displayName,omitempty"`
// Email is the customer’s email address.
Email string `json:"email,omitempty"`
// FirstName is the customer’s first name.
FirstName string `json:"firstName,omitempty"`
// Id is a unique identifier for the customer.
Id string `json:"id,omitempty"`
// LastIncompleteCheckout is the customer's most recently updated, incomplete checkout.
LastIncompleteCheckout Checkout `json:"lastIncompleteCheckout,omitempty"`
// LastName is the customer’s last name.
LastName string `json:"lastName,omitempty"`
// Metafield is a metafield found by namespace and key.
Metafield Metafield `json:"metafield,omitempty"`
// Metafields is a paginated list of metafields associated with the resource.
Metafields Connection[Metafield] `json:"metafields,omitempty"`
// Orders is the orders associated with the customer.
Orders Connection[Order] `json:"orders,omitempty"`
// Phone is the customer’s phone number.
Phone string `json:"phone,omitempty"`
/*
Tags is a comma separated list of tags that have been added to the customer.
Additional access scope required: unauthenticated_read_customer_tags.
*/
Tags []string `json:"tags,omitempty"`
// UpdatedAt is the date and time when the customer information was updated.
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
// MailingAddress: Represents a mailing address for customers and shipping.
type MailingAddress struct {
// Address1 is the first line of the address. Typically the street address or PO Box number.
Address1 string `json:"address1,omitempty"`
/*
Address2 is the second line of the address. Typically the number of the apartment, suite, or unit.
*/
Address2 string `json:"address2,omitempty"`
/*
City is the name of the city, district, village, or town.
*/
City string `json:"city,omitempty"`
/*
Company is the name of the customer's company or organization.
*/
Company string `json:"company,omitempty"`
/*
Country is the name of the country.
*/
Country string `json:"country,omitempty"`
/*
CountryCode is the two-letter code for the country of the address.
For example, US.
*/
CountryCode string `json:"countryCode,omitempty"`
/*
CountryCodeV2 is the two-letter code for the country of the address.
For example, US.
*/
CountryCodeV2 string `json:"countryCodeV2,omitempty"`
// FirstName is the first name of the customer.
FirstName string `json:"firstName,omitempty"`
// Formatted is a formatted version of the address, customized by the provided arguments.
Formatted []string `json:"formatted,omitempty"`
// FormattedArea is a comma-separated list of the values for city, province, and country.
FormattedArea string `json:"formattedArea,omitempty"`
// Id is a globally-unique identifier.
Id string `json:"id,omitempty"`
// LastName is the last name of the customer.
LastName string `json:"lastName,omitempty"`
// Latitude is the latitude coordinate of the customer address.
Latitude float64 `json:"latitude,omitempty"`
// Longitude is the longitude coordinate of the customer address.
Longitude float64 `json:"longitude,omitempty"`
/*
Name is the full name of the customer, based on firstName and lastName.
*/
Name string `json:"name,omitempty"`
/*
Phone is a unique phone number for the customer.
Formatted using E.164 standard. For example, _+16135551111_.
*/
Phone string `json:"phone,omitempty"`
// Province is the region of the address, such as the province, state, or district.
Province string `json:"province,omitempty"`
/*
ProvinceCode is the two-letter code for the region.
For example, ON.
*/
ProvinceCode string `json:"provinceCode,omitempty"`
// ZIP is the zip or postal code of the address.
ZIP string `json:"zip,omitempty"`
}
// Checkout: A container for all the information required to checkout items and pay.
type Checkout struct {
// AppliedGiftCards is the gift cards used on the checkout.
AppliedGiftCards []AppliedGiftCard `json:"appliedGiftCards,omitempty"`
/*
AvailableShippingRates is the available shipping rates for this Checkout.
Should only be used when checkout `requiresShipping` is `true` and
the shipping address is valid.
*/
AvailableShippingRates AvailableShippingRates `json:"availableShippingRates,omitempty"`
// BuyerIdentity is the identity of the customer associated with the checkout.
BuyerIdentity CheckoutBuyerIdentity `json:"buyerIdentity,omitempty"`
// CompletedAt is the date and time when the checkout was completed.
CompletedAt time.Time `json:"completedAt,omitempty"`
// CreatedAt is the date and time when the checkout was created.
CreatedAt time.Time `json:"createdAt,omitempty"`
// CurrencyCode is the currency code for the Checkout.
CurrencyCode string `json:"currencyCode,omitempty"`
// CustomAttributes is a list of extra information that is added to the checkout.
CustomAttributes []Attribute `json:"customAttributes,omitempty"`
// DiscountApplications is the discounts that have been applied on the checkout.
DiscountApplications Connection[DiscountApplication] `json:"discountApplications,omitempty"`
// Email is the email attached to this checkout.
Email string `json:"email,omitempty"`
// Id is a globally-unique identifier.
Id string `json:"id,omitempty"`
// LineItems is a list of line item objects, each one containing information about an item in the checkout.
LineItems Connection[CheckoutLineItem] `json:"lineItems,omitempty"`
// LineItemsSubtotalPrice is the sum of all the prices of all the items in the checkout. Duties, taxes, shipping and discounts excluded.
LineItemsSubtotalPrice MoneyV2 `json:"lineItemsSubtotalPrice,omitempty"`
// Note is the note associated with the checkout.
Note string `json:"note,omitempty"`
// Order is the resulting order from a paid checkout.
Order Order `json:"order,omitempty"`
// OrderStatusURL is the Order Status Page for this Checkout, null when checkout is not completed.
OrderStatusURL string `json:"orderStatusUrl,omitempty"`
// PaymentDue is the amount left to be paid. This is equal to the cost of the line items, taxes and shipping minus discounts and gift cards.
PaymentDue string `json:"paymentDue,omitempty"`
// PaymentDueV2 is the amount left to be paid. This is equal to the cost of the line items, duties, taxes and shipping minus discounts and gift cards.
PaymentDueV2 MoneyV2 `json:"paymentDueV2,omitempty"`
/*
Ready is the whether or not the Checkout is ready and can be completed. Checkouts may
have asynchronous operations that can take time to finish. If you want
to complete a checkout or ensure all the fields are populated and up to
date, polling is required until the value is true.
*/
Ready bool `json:"ready,omitempty"`
// RequiresShipping is the states whether or not the fulfillment requires shipping.
RequiresShipping bool `json:"requiresShipping,omitempty"`
// ShippingAddress is the shipping address to where the line items will be shipped.
ShippingAddress MailingAddress `json:"shippingAddress,omitempty"`
/*
ShippingDiscountAllocations is the discounts that have been allocated onto the shipping line by discount applications.
*/
ShippingDiscountAllocations []DiscountAllocation `json:"shippingDiscountAllocations,omitempty"`
// ShippingLine is the once a shipping rate is selected by the customer it is transitioned to a `shipping_line` object.
ShippingLine ShippingRate `json:"shippingLine,omitempty"`
// SubtotalPrice is the price of the checkout before shipping and taxes.
SubtotalPrice string `json:"subtotalPrice,omitempty"`
// SubtotalPriceV2 is the price of the checkout before duties, shipping and taxes.
SubtotalPriceV2 MoneyV2 `json:"subtotalPriceV2,omitempty"`
// TaxExempt is the specifies if the Checkout is tax exempt.
TaxExempt bool `json:"taxExempt,omitempty"`
// TaxesIncluded is the specifies if taxes are included in the line item and shipping line prices.
TaxesIncluded bool `json:"taxesIncluded,omitempty"`
// TotalDuties is the sum of all the duties applied to the line items in the checkout.
TotalDuties MoneyV2 `json:"totalDuties,omitempty"`
// TotalPrice is the sum of all the prices of all the items in the checkout, taxes and discounts included.
TotalPrice string `json:"totalPrice,omitempty"`
// TotalPriceV2 is the sum of all the prices of all the items in the checkout, duties, taxes and discounts included.
TotalPriceV2 MoneyV2 `json:"totalPriceV2,omitempty"`
// TotalTax is the sum of all the taxes applied to the line items and shipping lines in the checkout.
TotalTax string `json:"totalTax,omitempty"`
// TotalTaxV2 is the sum of all the taxes applied to the line items and shipping lines in the checkout.
TotalTaxV2 MoneyV2 `json:"totalTaxV2,omitempty"`
// UpdatedAt is the date and time when the checkout was last updated.
UpdatedAt time.Time `json:"updatedAt,omitempty"`
// WebURL is the url pointing to the checkout accessible from the web.
WebURL string `json:"webUrl,omitempty"`
}
// AppliedGiftCard: Details about the gift card used on the checkout.
type AppliedGiftCard struct {
// AmountUsed is the amount that was taken from the gift card by applying it.
AmountUsed string `json:"amountUsed,omitempty"`
// AmountUsedV2 is the amount that was taken from the gift card by applying it.
AmountUsedV2 MoneyV2 `json:"amountUsedV2,omitempty"`
// Balance is the amount left on the gift card.
Balance string `json:"balance,omitempty"`
// BalanceV2 is the amount left on the gift card.
BalanceV2 MoneyV2 `json:"balanceV2,omitempty"`
// Id is a globally-unique identifier.
Id string `json:"id,omitempty"`
// LastCharacters is the last characters of the gift card.
LastCharacters string `json:"lastCharacters,omitempty"`
// PresentmentAmountUsed is the amount that was applied to the checkout in its currency.
PresentmentAmountUsed MoneyV2 `json:"presentmentAmountUsed,omitempty"`
}
// AvailableShippingRates: A collection of available shipping rates for a checkout.
type AvailableShippingRates struct {
/*
Ready is the whether or not the shipping rates are ready.
The `shippingRates` field is `null` when this value is `false`.
This field should be polled until its value becomes `true`.
*/
Ready bool `json:"ready,omitempty"`
// ShippingRates is the fetched shipping rates. `null` until the `ready` field is `true`.
ShippingRates []ShippingRate `json:"shippingRates,omitempty"`
}
// ShippingRate: A shipping rate to be applied to a checkout.
type ShippingRate struct {
// Handle is the human-readable unique identifier for this shipping rate.
Handle string `json:"handle,omitempty"`
// Price is the price of this shipping rate.
Price string `json:"price,omitempty"`
// PriceV2 is the price of this shipping rate.
PriceV2 MoneyV2 `json:"priceV2,omitempty"`
// Title is the title of this shipping rate.
Title string `json:"title,omitempty"`
}
// CheckoutBuyerIdentity: The identity of the customer associated with the checkout.
type CheckoutBuyerIdentity struct {
// CountryCode is the country code for the checkout. For example, `CA`.
CountryCode string `json:"countryCode,omitempty"`
}
// Attribute: Represents a generic custom attribute.
type Attribute struct {
// Key is the key or name of the attribute.
Key string `json:"key,omitempty"`