-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
1502 lines (1068 loc) · 61.2 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 smartpay
import (
openapi_types "github.com/deepmap/oapi-codegen/pkg/types"
)
// Address
type Address struct {
// The province, state, prefecture, county, etc. of a location. In Japan it refers to the prefecture (e.g. 東京都).
AdministrativeArea *string `json:"administrativeArea,omitempty"`
// The country as represented by the two-letter ISO 3166-1 code.
Country AddressCountry `json:"country"`
// Street address.
Line1 string `json:"line1"`
// Building name and room number.
Line2 *string `json:"line2,omitempty"`
Line3 *string `json:"line3,omitempty"`
Line4 *string `json:"line4,omitempty"`
Line5 *string `json:"line5,omitempty"`
// The city or town of a location, with a maximum of 80 characters (e.g. 目黒区).
Locality string `json:"locality"`
// The Postal Code.
PostalCode string `json:"postalCode"`
SubLocality *string `json:"subLocality,omitempty"`
}
// The country as represented by the two-letter ISO 3166-1 code.
type AddressCountry string
// Address Type
type AddressType string
// The URL the customer will be redirected to if the Checkout Session hasn't completed successfully. This means the Checkout failed, or the customer decided to cancel it.
type CancelUrl string
// CaptureMethod defines model for captureMethod.
type CaptureMethod string
// The URL to launch Smartpay checkout for this checkout session. Redirect your customer to this URL to complete the purchase.
type CheckoutSessioUrl string
// Checkout Session
type CheckoutSession struct {
// The URL the customer will be redirected to if the Checkout Session hasn't completed successfully. This means the Checkout failed, or the customer decided to cancel it.
CancelUrl *CancelUrl `json:"cancelUrl,omitempty"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
// Customer Information, the details provided here are used to pre-populate forms for your customer's checkout experiences. The more information you send, the better experience the customer will have.
CustomerInfo *CustomerInfo `json:"customerInfo,omitempty"`
// The unique identifier for the Checkout Session object.
Id *CheckoutSessionId `json:"id,omitempty"`
// Locale
Locale *Locale `json:"locale,omitempty"`
// A string representing the object’s type. The value is always `checkoutSession` for Checkout Session objects.
Object *string `json:"object,omitempty"`
// The unique identifier for the Payment object.
Order *OrderId `json:"order,omitempty"`
// The unique identifier for the Token object.
Token *TokenId `json:"token,omitempty"`
// The URL the customer will be redirected to if the Checkout Session completed successfully. This means the Checkout succeeded, i.e. the customer authorized the order.
SuccessUrl *SuccessUrl `json:"successUrl,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt,omitempty"`
// The URL to launch Smartpay checkout for this checkout session. Redirect your customer to this URL to complete the purchase.
Url *CheckoutSessioUrl `json:"url,omitempty"`
}
// Expanded Checkout Session
type CheckoutSessionExpanded struct {
// The URL the customer will be redirected to if the Checkout Session hasn't completed successfully. This means the Checkout failed, or the customer decided to cancel it.
CancelUrl *CancelUrl `json:"cancelUrl,omitempty"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
// Customer Information, the details provided here are used to pre-populate forms for your customer's checkout experiences. The more information you send, the better experience the customer will have.
CustomerInfo *CustomerInfo `json:"customerInfo,omitempty"`
// The unique identifier for the Checkout Session object.
Id *CheckoutSessionId `json:"id,omitempty"`
// Locale
Locale *Locale `json:"locale,omitempty"`
// A string representing the object’s type. The value is always `checkoutSession` for Checkout Session objects.
Object *string `json:"object,omitempty"`
// Expanded Order
Order *OrderExpanded `json:"order,omitempty"`
// A Payment token
Token *Token `json:"token,omitempty"`
// The URL the customer will be redirected to if the Checkout Session completed successfully. This means the Checkout succeeded, i.e. the customer authorized the order.
SuccessUrl *SuccessUrl `json:"successUrl,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt,omitempty"`
// The URL to launch Smartpay checkout for this checkout session. Redirect your customer to this URL to complete the purchase.
Url *CheckoutSessioUrl `json:"url,omitempty"`
}
// The unique identifier for the Checkout Session object.
type CheckoutSessionId string
// CheckoutSessionOptions defines model for checkoutSessionOptions.
type CheckoutSessionOptions interface{}
// A string representing the object’s type. The value is always `collection` for collection objects.
type CollectionObject string
// Coupon
type Coupon struct {
// Has the value `true` if the coupon is active and can be used, or the value `false` if it is not.
Active *bool `json:"active,omitempty"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
Currency *Currency `json:"currency,omitempty"`
// If the `discountType` is `amount`, the discount amount of this coupon object.
DiscountAmount *float32 `json:"discountAmount,omitempty"`
// If the `discountType` is `percentage`, the discount percentage of this coupon object.
DiscountPercentage *float32 `json:"discountPercentage,omitempty"`
// Discount Type
DiscountType *DiscountType `json:"discountType,omitempty"`
// Time at which the Coupon expires. Measured in seconds since the Unix epoch.
ExpiresAt *int `json:"expiresAt,omitempty"`
// The unique identifier for the Coupon object.
Id *CouponId `json:"id,omitempty"`
// Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid.
MaxRedemptionCount *int `json:"maxRedemptionCount,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// The coupon's name, meant to be displayable to the customer.
Name *string `json:"name,omitempty"`
// A string representing the object’s type. The value is always `coupon` for Coupon objects.
Object *string `json:"object,omitempty"`
// Number of times this coupon has been applied to an order.
RedemptionCount *int `json:"redemptionCount,omitempty"`
// Has the value `true` if the coupon is Smartpay funded, or the value `false` if it is not.
Sponsored *bool `json:"sponsored,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt,omitempty"`
}
// The unique identifier for the Coupon object.
type CouponId string
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
type CreatedAt int
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
type Currency string
// Customer Information, the details provided here are used to pre-populate forms for your customer's checkout experiences. The more information you send, the better experience the customer will have.
type CustomerInfo struct {
// The age of the customer's account on your website in days.
AccountAge *int `json:"accountAge,omitempty"`
// Address
Address *Address `json:"address,omitempty"`
// The date of birth of your customer. The date of birth specified here will be used to pre-populate the date of birth field in your customer's checkout experiences.
DateOfBirth *openapi_types.Date `json:"dateOfBirth,omitempty"`
// The email address of your customer. The email address specified here will be used to pre-populate the email address field in your customer's checkout experiences.
EmailAddress *openapi_types.Email `json:"emailAddress,omitempty"`
// The first name of your customer. The name specified here will be used to pre-populate the first name field in your customer's checkout experiences.
FirstName *string `json:"firstName,omitempty"`
// The kana version of the first name of your customer. The name specified here will be used to pre-populate the kana version of the first name field in your customer's checkout experiences.
FirstNameKana *string `json:"firstNameKana,omitempty"`
// The last name of your customer. The name specified here will be used to pre-populate the last name field in your customer's checkout experiences.
LastName *string `json:"lastName,omitempty"`
// The kana version of the last name of your customer. The name specified here will be used to pre-populate the kana version of the last name field in your customer's checkout experiences.
LastNameKana *string `json:"lastNameKana,omitempty"`
// The (legal) gender of your customer. The gender specified here will be used to pre-populate the gender field in your customer's checkout experiences.
LegalGender *CustomerInfoLegalGender `json:"legalGender,omitempty"`
// The phone number of your customer. The phone number specified here will be used to pre-populate the phone number field in your customer's checkout experiences.
PhoneNumber *string `json:"phoneNumber,omitempty"`
// The ID of the user in your system
Reference *string `json:"reference,omitempty"`
}
// The (legal) gender of your customer. The gender specified here will be used to pre-populate the gender field in your customer's checkout experiences.
type CustomerInfoLegalGender string
// Discount
type Discount struct {
Amount *float32 `json:"amount,omitempty"`
// The unique identifier for the Coupon object.
Coupon *CouponId `json:"coupon,omitempty"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
Currency *Currency `json:"currency,omitempty"`
// The unique identifier for the Discount object.
Id *DiscountId `json:"id,omitempty"`
// A string representing the object’s type. The value is always `discount` for Discount objects.
Object *string `json:"object,omitempty"`
// The unique identifier for the Promotion Code object.
PromotionCode *PromotionCodeId `json:"promotionCode,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
}
// The discount amount applied to the order through a Smartpay coupon
//type DiscountAmount int
type DiscountAmount float32
// The unique identifier for the Discount object.
type DiscountId string
// Discount Type
type DiscountType string
// Even name to subscribe to
type EventSubscription string
// A URL for an image for this product, meant to be displayed to the customer.
type ImageUrl string
// LineItem Kind
type LineItemKind string
// Item
type Item struct {
// The unit amount of this line item.
Amount float32 `json:"amount"`
// The kind of this line item. Can be either of product, tax and discount. If non given it will be treated as a product
Kind *LineItemKind `json:"kind,omitempty"`
// The brand of the Product.
Brand *string `json:"brand,omitempty"`
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
Currency Currency `json:"currency"`
// An arbitrary - ideally descriptive - long form explanation of the Line Item, meant to be displayed to the customer.
Description *string `json:"description,omitempty"`
// The Global Trade Item Number of the Product.
Gtin *string `json:"gtin,omitempty"`
// A list of up to 8 URLs of images for this product, meant to be displayed to the customer.
Images *[]ImageUrl `json:"images,omitempty"`
// A brief description of the price, not visible to customers.
Label *string `json:"label,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// The product’s name, meant to be displayed to the customer.
Name string `json:"name"`
PriceDescription *string `json:"priceDescription,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
PriceMetadata *Metadata `json:"priceMetadata,omitempty"`
// An arbitrary - ideally descriptive - long form explanation of the Product, meant to be displayed to the customer.
ProductDescription *string `json:"productDescription,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
ProductMetadata *Metadata `json:"productMetadata,omitempty"`
// The quantity of products. Needs to be positive or zero.
Quantity *int `json:"quantity,omitempty"`
// A - ideally unique - string to reference the Product in your system (e.g. a product ID, etc.).
Reference *string `json:"reference,omitempty"`
// A URL of the publicly accessible page for this Product on your site or store.
Url *ProductUrl `json:"url,omitempty"`
}
// Line Item
type LineItemExpanded struct {
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
Description *string `json:"description,omitempty"`
// The kind of this line item. Can be either of product, tax and discount. If non given it will be treated as a product
Kind *LineItemKind `json:"kind,omitempty"`
// The unit amount of this line item.
Amount *float32 `json:"amount,omitempty"`
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
Currency *Currency `json:"currency,omitempty"`
// The unique identifier for the Line Item object.
Id *LineItemId `json:"id,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// A string representing the object’s type. The value is always `lineItem` for Line Item objects.
Object *string `json:"object,omitempty"`
// Price
Price *PriceExpanded `json:"price,omitempty"`
Quantity *int `json:"quantity,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt,omitempty"`
}
// The unique identifier for the Line Item object.
type LineItemId string
// Locale
type Locale string
// The maximum number of objects returned for this call. Equals to the maxResults query parameter specified (or 20 if not specified).
type MaxResults int
// Set of up to 20 key-value pairs that you can attach to the object.
type Metadata map[string]interface{}
type Mode string
// The token for the next page of the collection of objects.
type NextPageToken string
// Order
type Order struct {
// The amount intended to be collected through this order. A positive integer in the smallest currency unit.
Amount *OrderAmount `json:"amount,omitempty"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
Currency *Currency `json:"currency,omitempty"`
// The discount amount applied to the order through a Smartpay coupon
DiscountAmount *DiscountAmount `json:"discountAmount,omitempty"`
Discounts *[]DiscountId `json:"discounts,omitempty"`
ExpiresAt *int `json:"expiresAt,omitempty"`
// The unique identifier for the Payment object.
Id *OrderId `json:"id,omitempty"`
LineItems *[]LineItemId `json:"lineItems,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// A string representing the object’s type. The value is always `order` for Order objects.
Object *string `json:"object,omitempty"`
Payments *[]PaymentId `json:"payments,omitempty"`
Reference *string `json:"reference,omitempty"`
// Shipping Information
ShippingInfo *ShippingInfo `json:"shippingInfo,omitempty"`
// Order Status
Status *OrderStatus `json:"status,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt,omitempty"`
}
// The amount intended to be collected through this order. A positive integer in the smallest currency unit.
type OrderAmount float32
// Expanded Order
type OrderExpanded struct {
// The amount intended to be collected through this order. A positive integer in the smallest currency unit.
Amount *OrderAmount `json:"amount,omitempty"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
Currency *Currency `json:"currency,omitempty"`
Description *string `json:"description,omitempty"`
// The discount amount applied to the order through a Smartpay coupon
DiscountAmount *DiscountAmount `json:"discountAmount,omitempty"`
Discounts *[]Discount `json:"discounts,omitempty"`
ExpiresAt *int `json:"expiresAt,omitempty"`
// The unique identifier for the Payment object.
Id *OrderId `json:"id,omitempty"`
LineItems *[]LineItemExpanded `json:"lineItems,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// A string representing the object’s type. The value is always `order` for Order objects.
Object *string `json:"object,omitempty"`
Payments *[]PaymentExpanded `json:"payments,omitempty"`
// Shipping Information
ShippingInfo *ShippingInfo `json:"shippingInfo,omitempty"`
// Order Status
Status *OrderStatus `json:"status,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt,omitempty"`
// The unique identifier for the Token object.
TokenId *TokenId `json:"tokenId,omitempty"`
}
// The unique identifier for the Payment object.
type OrderId string
// Expandable Order
type OrderOptions interface{}
// Order Status
type OrderStatus string
// CheckoutSessionCreate defines model for checkout-session_create.
type OrderCreate struct {
// The amount intended to be collected through this order. A positive integer in the smallest currency unit.
Amount OrderAmount `json:"amount"`
CaptureMethod *CaptureMethod `json:"captureMethod,omitempty"`
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
Currency Currency `json:"currency"`
// Customer Information, the details provided here are used to pre-populate forms for your customer's checkout experiences. The more information you send, the better experience the customer will have.
CustomerInfo CustomerInfo `json:"customerInfo"`
// The line items the customer wishes to order.
Items []Item `json:"items"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// A - ideally unique - string to reference the Order in your system (e.g. an order ID, etc.).
Reference *string `json:"reference,omitempty"`
// Shipping Information
ShippingInfo ShippingInfo `json:"shippingInfo"`
// The unique identifier for the token to be used when creating this order.
Token TokenId `json:"token"`
}
// The token for the page of the collection of objects.
type PageToken string
// Payment
type Payment struct {
Amount *float32 `json:"amount,omitempty"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
Currency *Currency `json:"currency,omitempty"`
Description *string `json:"description,omitempty"`
// The unique identifier for the Payment object.
Id *PaymentId `json:"id,omitempty"`
LineItems *[]LineItemId `json:"lineItems,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// A string representing the object’s type. The value is always `payment` for Payment objects.
Object *string `json:"object,omitempty"`
// The unique identifier for the Payment object.
Order *OrderId `json:"order,omitempty"`
Reference *string `json:"reference,omitempty"`
Status *PaymentStatus `json:"status,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt,omitempty"`
}
// PaymentStatus defines model for Payment.Status.
type PaymentStatus string
// Expanded Payment
type PaymentExpanded struct {
Amount *float32 `json:"amount,omitempty"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
Currency *Currency `json:"currency,omitempty"`
Description *string `json:"description,omitempty"`
// The unique identifier for the Payment object.
Id *PaymentId `json:"id,omitempty"`
LineItems *[]LineItemExpanded `json:"lineItems,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// A string representing the object’s type. The value is always `payment` for Payment objects.
Object *string `json:"object,omitempty"`
// The unique identifier for the Payment object.
Order *OrderId `json:"order,omitempty"`
Reference *string `json:"reference,omitempty"`
Status *PaymentExpandedStatus `json:"status,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt,omitempty"`
}
// PaymentExpandedStatus defines model for PaymentExpanded.Status.
type PaymentExpandedStatus string
// The unique identifier for the Payment object.
type PaymentId string
// Expandable Payment
type PaymentOptions interface{}
// Price
type PriceExpanded struct {
Active *bool `json:"active,omitempty"`
Amount *float32 `json:"amount,omitempty"`
CreatedAt *int `json:"createdAt,omitempty"`
Description *string `json:"description,omitempty"`
// The unique identifier for the Price object.
Id *PriceId `json:"id,omitempty"`
Label *string `json:"label,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// A string representing the object’s type. The value is always `price` for Price objects.
Object *string `json:"object,omitempty"`
// Product
Product *Product `json:"product,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
UpdatedAt *int `json:"updatedAt,omitempty"`
}
// The unique identifier for the Price object.
type PriceId string
// Product
type Product struct {
Active *bool `json:"active,omitempty"`
Brand *string `json:"brand,omitempty"`
Categories *[]ProductCategory `json:"categories,omitempty"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
Description *string `json:"description,omitempty"`
Gtin *string `json:"gtin,omitempty"`
// The unique identifier for the Product object.
Id *ProductId `json:"id,omitempty"`
Images *[]ImageUrl `json:"images,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
Name *string `json:"name,omitempty"`
// A string representing the object’s type. The value is always `product` for Product objects.
Object *string `json:"object,omitempty"`
Reference *string `json:"reference,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt,omitempty"`
// A URL of the publicly accessible page for this Product on your site or store.
Url *ProductUrl `json:"url,omitempty"`
}
// A category of items the product belongs to. Examples: apparel, cosmetics, etc.
type ProductCategory string
// The unique identifier for the Product object.
type ProductId string
// A URL of the publicly accessible page for this Product on your site or store.
type ProductUrl string
// A promotion code points to a coupon, and can be used to (attempt to) attach that coupon to an order.
type PromotionCode struct {
// Flag indicating whether the promotion code is currently active.
Active *bool `json:"active,omitempty"`
// The customer-facing code. This code must be unique across all your promotion codes.
Code *string `json:"code,omitempty"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
Currency *Currency `json:"currency,omitempty"`
// The moment at which the promotion code can no longer be redeemed. Measured in seconds since the Unix epoch.
ExpiresAt *int `json:"expiresAt,omitempty"`
// A flag indicating that the Promotion Code should only be redeemed by Customer without any successful Smartpay payments with you.
FirstTimeTransaction *bool `json:"firstTimeTransaction,omitempty"`
// The unique identifier for the Promotion Code object.
Id *PromotionCodeId `json:"id,omitempty"`
// The maximum number of times this promotion code can be redeemedcan be redeemed, in total, across all customers, before it is no longer valid.
MaxRedemptionCount *int `json:"maxRedemptionCount,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// Minimum amount required to redeem this Promotion Code into a Coupon discount.
MinimumAmount *float32 `json:"minimumAmount,omitempty"`
// A string representing the object’s type. The value is always `promotionCode` for Promotion Code objects.
Object *string `json:"object,omitempty"`
// Flag indicating that the Promotion Code should only be redeemed once by a single Customer.
OnePerCustomer *bool `json:"onePerCustomer,omitempty"`
// The number of times this promotion code has been used.
RedemptionCount *int `json:"redemptionCount,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt,omitempty"`
}
// The unique identifier for the Promotion Code object.
type PromotionCodeId string
// Refund
type Refund struct {
Amount *float32 `json:"amount,omitempty"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
Currency *Currency `json:"currency,omitempty"`
Description *string `json:"description,omitempty"`
// The unique identifier for the Refund object.
Id *RefundId `json:"id,omitempty"`
LineItems *[]LineItemId `json:"lineItems,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// A string representing the object’s type. The value is always `refund` for Refund objects.
Object *string `json:"object,omitempty"`
// The unique identifier for the Payment object.
Payment *PaymentId `json:"payment,omitempty"`
Reason *RefundReason `json:"reason,omitempty"`
Reference *string `json:"reference,omitempty"`
Status *RefundStatus `json:"status,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt,omitempty"`
}
// RefundReason defines model for Refund.Reason.
type RefundReason string
// RefundStatus defines model for Refund.Status.
type RefundStatus string
// Expanded Refund
type RefundExpanded struct {
Amount *int `json:"amount,omitempty"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
Currency *Currency `json:"currency,omitempty"`
Description *string `json:"description,omitempty"`
// The unique identifier for the Refund object.
Id *RefundId `json:"id,omitempty"`
LineItems *[]LineItemExpanded `json:"lineItems,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// A string representing the object’s type. The value is always `refund` for Refund objects.
Object *string `json:"object,omitempty"`
// The unique identifier for the Payment object.
Payment *PaymentId `json:"payment,omitempty"`
Reason *RefundExpandedReason `json:"reason,omitempty"`
Reference *string `json:"reference,omitempty"`
Status *RefundExpandedStatus `json:"status,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt,omitempty"`
}
// RefundExpandedReason defines model for RefundExpanded.Reason.
type RefundExpandedReason string
// RefundExpandedStatus defines model for RefundExpanded.Status.
type RefundExpandedStatus string
// The unique identifier for the Refund object.
type RefundId string
// Expandable Refund
type RefundOptions interface{}
// The actual number of objects returned for this call. This value is less than or equal to maxResults.
type Results int
// Shipping Information
type ShippingInfo struct {
// Address
Address Address `json:"address"`
// Address Type
AddressType *AddressType `json:"addressType,omitempty"`
// The delivery service that shipped a physical product, such as Yamato, Seino, Fedex, UPS, etc.
CarrierName *string `json:"carrierName,omitempty"`
// The shipping fee.
FeeAmount *float32 `json:"feeAmount,omitempty"`
// Three-letter ISO currency code, in uppercase. Must be a supported currency.
FeeCurrency *Currency `json:"feeCurrency,omitempty"`
// The reference for the shipment (e.g. the tracking number for a physical product, obtained from the delivery service).
Reference *string `json:"reference,omitempty"`
}
// The URL the customer will be redirected to if the Checkout Session completed successfully. This means the Checkout succeeded, i.e. the customer authorized the order.
type SuccessUrl string
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
type TestFlag bool
// Token
type Token struct {
// The unique identifier for the Token object.
Id *TokenId `json:"id,omitempty"`
// A string representing the object’s type. The value is always `checkoutSession` for Checkout Session objects.
Object *string `json:"object,omitempty"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt,omitempty"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// A - ideally unique - string to reference the Token in your system (e.g. a token ID, etc.).
Reference *string `json:"reference,omitempty"`
// The current status of the Token object.
Status *TokenStatus `json:"status,omitempty"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test,omitempty"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt,omitempty"`
}
// The unique identifier for the Token object.
type TokenId string
// Token Status
type TokenStatus string
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
type UpdatedAt int
// WebhookEndpoint defines model for webhookEndpoint.
type WebhookEndpoint struct {
// Has the value `true` if the webhook endpoint is active and events are sent to the url specified. Has the value `false if the endpoint is inactive and the events won't be sent to the url specified.
Active *bool `json:"active"`
// Time at which the object was created. Measured in milliseconds since the Unix epoch.
CreatedAt *CreatedAt `json:"createdAt"`
// An optional description for your webhook endpoint.
Description *string `json:"description"`
// The list of events to subscribe to. If not specified you will be subsribed to all events.
EventSubscriptions *[]EventSubscription `json:"eventSubscriptions,omitempty"`
// The unique identifier for the Webhook Endpoint object.
Id *WebhookEndpointId `json:"id"`
// Set of up to 20 key-value pairs that you can attach to the object.
Metadata *Metadata `json:"metadata,omitempty"`
// A string representing the object’s type. The value is always `webhookEndpoint` for Webhook Endpoint objects.
Object *string `json:"object"`
SigningSecret *string `json:"signingSecret"`
// A flag with a value `false` if the object exists in live mode or `true` if the object exists in test mode.
Test *TestFlag `json:"test"`
// The moment at which the object was last updated. Measured in milliseconds since the Unix epoch.
UpdatedAt *UpdatedAt `json:"updatedAt"`
// The url which will be called when any of the events you subscribed to occur.
Url *string `json:"url"`
}
// The unique identifier for the Webhook Endpoint object.
type WebhookEndpointId string
// Expand defines model for expand.
type Expand string
// N401 defines model for 401.
type N401 struct {
Realm *string `json:"realm,omitempty"`
Scheme *string `json:"scheme,omitempty"`
StatusCode *int `json:"statusCode,omitempty"`
}
// WebhookEndpointNotFound defines model for WebhookEndpointNotFound.
type WebhookEndpointNotFound struct {
Details []interface{} `json:"details"`
ErrorCode string `json:"errorCode"`
Message string `json:"message"`
StatusCode float32 `json:"statusCode"`
}
// Order
type CanceledOrder Order
// Coupons defines model for coupons.
type Coupons struct {
Data *[]Coupon `json:"data,omitempty"`
// The maximum number of objects returned for this call. Equals to the maxResults query parameter specified (or 20 if not specified).
MaxResults *MaxResults `json:"maxResults,omitempty"`
// The token for the next page of the collection of objects.
NextPageToken *NextPageToken `json:"nextPageToken,omitempty"`
// A string representing the object’s type. The value is always `collection` for collection objects.
Object *CollectionObject `json:"object,omitempty"`
// The token for the page of the collection of objects.
PageToken *PageToken `json:"pageToken,omitempty"`
// The actual number of objects returned for this call. This value is less than or equal to maxResults.
Results *Results `json:"results,omitempty"`
}
// ExpandableCheckoutSession defines model for expandableCheckoutSession.
type ExpandableCheckoutSession CheckoutSessionOptions
// ExpandableCheckoutSessions defines model for expandableCheckoutSessions.
type ExpandableCheckoutSessions struct {
Data *[]CheckoutSessionOptions `json:"data,omitempty"`
// The maximum number of objects returned for this call. Equals to the maxResults query parameter specified (or 20 if not specified).
MaxResults *MaxResults `json:"maxResults,omitempty"`
// The token for the next page of the collection of objects.
NextPageToken *NextPageToken `json:"nextPageToken,omitempty"`
// A string representing the object’s type. The value is always `collection` for collection objects.
Object *CollectionObject `json:"object,omitempty"`
// The token for the page of the collection of objects.
PageToken *PageToken `json:"pageToken,omitempty"`
// The actual number of objects returned for this call. This value is less than or equal to maxResults.
Results *Results `json:"results,omitempty"`
}
// Expandable Order
type ExpandableOrder OrderOptions
// ExpandableOrders defines model for expandableOrders.
type ExpandableOrders struct {
Data *[]OrderOptions `json:"data,omitempty"`
// The maximum number of objects returned for this call. Equals to the maxResults query parameter specified (or 20 if not specified).
MaxResults *MaxResults `json:"maxResults,omitempty"`
// The token for the next page of the collection of objects.
NextPageToken *NextPageToken `json:"nextPageToken,omitempty"`
// A string representing the object’s type. The value is always `collection` for collection objects.
Object *CollectionObject `json:"object,omitempty"`
// The token for the page of the collection of objects.
PageToken *PageToken `json:"pageToken,omitempty"`
// The actual number of objects returned for this call. This value is less than or equal to maxResults.
Results *Results `json:"results,omitempty"`
}
// ExpandablePayments defines model for expandablePayments.
type ExpandablePayments struct {
Data *[]PaymentOptions `json:"data,omitempty"`
// The maximum number of objects returned for this call. Equals to the maxResults query parameter specified (or 20 if not specified).
MaxResults *MaxResults `json:"maxResults,omitempty"`
// The token for the next page of the collection of objects.
NextPageToken *NextPageToken `json:"nextPageToken,omitempty"`
// A string representing the object’s type. The value is always `collection` for collection objects.
Object *CollectionObject `json:"object,omitempty"`
// The token for the page of the collection of objects.
PageToken *PageToken `json:"pageToken,omitempty"`