-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Expand file tree
/
Copy pathindex.ts
More file actions
553 lines (526 loc) · 11.5 KB
/
index.ts
File metadata and controls
553 lines (526 loc) · 11.5 KB
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
export default `
enum ChangeActionType {
CANCEL_RETURN_ITEM
FULFILL_ITEM
CANCEL_ITEM_FULFILLMENT
ITEM_ADD
ITEM_REMOVE
ITEM_UPDATE
RECEIVE_DAMAGED_RETURN_ITEM
RECEIVE_RETURN_ITEM
RETURN_ITEM
SHIPPING_ADD
SHIPPING_REMOVE
SHIP_ITEM
WRITE_OFF_ITEM
REINSTATE_ITEM
}
type OrderSummary {
pending_difference: Float
current_order_total: Float
original_order_total: Float
transaction_total: Float
paid_total: Float
refunded_total: Float
credit_line_total: Float
accounting_total: Float
raw_pending_difference: JSON
raw_current_order_total: JSON
raw_original_order_total: JSON
raw_transaction_total: JSON
raw_paid_total: JSON
raw_refunded_total: JSON
raw_credit_line_total: JSON
raw_accounting_total: JSON
}
type OrderShippingMethodAdjustment {
id: ID!
code: String
amount: Float
order_id: String!
description: String
promotion_id: String
provider_id: String
created_at: DateTime
updated_at: DateTime
shipping_method: OrderShippingMethod
shipping_method_id: String!
}
type OrderLineItemAdjustment {
id: ID!
code: String
amount: Float
order_id: String!
description: String
promotion_id: String
provider_id: String
created_at: DateTime
updated_at: DateTime
item: OrderLineItem
item_id: String!
}
type OrderShippingMethodTaxLine {
id: ID!
description: String
tax_rate_id: String
code: String!
rate: Float
provider_id: String
created_at: DateTime
updated_at: DateTime
shipping_method: OrderShippingMethod
shipping_method_id: String!
total: Float
subtotal: Float
raw_total: JSON
raw_subtotal: JSON
}
type OrderLineItemTaxLine {
id: ID!
description: String
tax_rate_id: String
code: String!
rate: Float
provider_id: String
created_at: DateTime
updated_at: DateTime
item: OrderLineItem
item_id: String!
total: Float
subtotal: Float
raw_total: JSON
raw_subtotal: JSON
}
type OrderAddress {
id: ID!
customer_id: String
first_name: String
last_name: String
phone: String
company: String
address_1: String
address_2: String
city: String
country_code: String
province: String
postal_code: String
metadata: JSON
created_at: DateTime
updated_at: DateTime
}
type OrderShippingMethod {
id: ID!
order_id: String!
name: String!
description: String
amount: Float
raw_amount: JSON
is_tax_inclusive: Boolean
shipping_option_id: String
data: JSON
metadata: JSON
tax_lines: [OrderShippingMethodTaxLine]
adjustments: [OrderShippingMethodAdjustment]
created_at: DateTime
updated_at: DateTime
original_total: Float
original_subtotal: Float
original_tax_total: Float
total: Float
subtotal: Float
tax_total: Float
discount_total: Float
discount_tax_total: Float
raw_original_total: JSON
raw_original_subtotal: JSON
raw_original_tax_total: JSON
raw_total: JSON
raw_subtotal: JSON
raw_tax_total: JSON
raw_discount_total: JSON
raw_discount_tax_total: JSON
}
type OrderLineItem {
id: ID!
title: String!
subtitle: String
thumbnail: String
variant_id: String
product_id: String
product_title: String
product_description: String
product_subtitle: String
product_type: String
product_type_id: String
product_collection: String
product_handle: String
variant_sku: String
variant_barcode: String
variant_title: String
variant_option_values: JSON
requires_shipping: Boolean!
is_discountable: Boolean!
is_tax_inclusive: Boolean!
compare_at_unit_price: Float
raw_compare_at_unit_price: JSON
unit_price: Float!
raw_unit_price: JSON
quantity: Int!
raw_quantity: JSON
tax_lines: [OrderLineItemTaxLine]
adjustments: [OrderLineItemAdjustment]
detail: OrderItem!
created_at: DateTime!
updated_at: DateTime!
metadata: JSON
original_total: Float
original_subtotal: Float
original_tax_total: Float
item_total: Float
item_subtotal: Float
item_tax_total: Float
total: Float
subtotal: Float
tax_total: Float
discount_total: Float
discount_tax_total: Float
refundable_total: Float
refundable_total_per_unit: Float
raw_original_total: JSON
raw_original_subtotal: JSON
raw_original_tax_total: JSON
raw_item_total: JSON
raw_item_subtotal: JSON
raw_item_tax_total: JSON
raw_total: JSON
raw_subtotal: JSON
raw_tax_total: JSON
raw_discount_total: JSON
raw_discount_tax_total: JSON
raw_refundable_total: JSON
raw_refundable_total_per_unit: JSON
}
type OrderItem {
id: ID!
item_id: String!
item: OrderLineItem!
quantity: Int!
raw_quantity: JSON
fulfilled_quantity: Int!
raw_fulfilled_quantity: JSON
shipped_quantity: Int!
raw_shipped_quantity: JSON
return_requested_quantity: Int!
raw_return_requested_quantity: JSON
return_received_quantity: Int!
raw_return_received_quantity: JSON
return_dismissed_quantity: Int!
raw_return_dismissed_quantity: JSON
written_off_quantity: Int!
raw_written_off_quantity: JSON
metadata: JSON
created_at: DateTime!
updated_at: DateTime!
}
enum OrderStatus {
pending
completed
draft
archived
canceled
requires_action
}
type Order {
id: ID!
version: Int!
order_change: OrderChange
status: OrderStatus!
region_id: String
customer_id: String
sales_channel_id: String
email: String
currency_code: String!
shipping_address: OrderAddress
billing_address: OrderAddress
items: [OrderLineItem]
shipping_methods: [OrderShippingMethod]
transactions: [OrderTransaction]
summary: OrderSummary
metadata: JSON
canceled_at: DateTime
created_at: DateTime!
updated_at: DateTime!
original_item_total: Float!
original_item_subtotal: Float!
original_item_tax_total: Float!
item_total: Float!
item_subtotal: Float!
item_tax_total: Float!
original_total: Float!
original_subtotal: Float!
original_tax_total: Float!
total: Float!
subtotal: Float!
tax_total: Float!
discount_total: Float!
discount_tax_total: Float!
gift_card_total: Float!
gift_card_tax_total: Float!
shipping_total: Float!
shipping_subtotal: Float!
shipping_tax_total: Float!
original_shipping_total: Float!
original_shipping_subtotal: Float!
original_shipping_tax_total: Float!
raw_original_item_total: JSON
raw_original_item_subtotal: JSON
raw_original_item_tax_total: JSON
raw_item_total: JSON
raw_item_subtotal: JSON
raw_item_tax_total: JSON
raw_original_total: JSON
raw_original_subtotal: JSON
raw_original_tax_total: JSON
raw_total: JSON
raw_subtotal: JSON
raw_tax_total: JSON
raw_discount_total: JSON
raw_discount_tax_total: JSON
raw_gift_card_total: JSON
raw_gift_card_tax_total: JSON
raw_shipping_total: JSON
raw_shipping_subtotal: JSON
raw_shipping_tax_total: JSON
raw_original_shipping_total: JSON
raw_original_shipping_subtotal: JSON
raw_original_shipping_tax_total: JSON
}
enum ReturnStatus {
requested
received
partially_received
canceled
}
type Return {
id: ID!
status: ReturnStatus!
refund_amount: Float
order_id: String!
items: [OrderReturnItem]!
}
type OrderReturnItem {
id: ID!
return_id: String!
order_id: String!
item_id: String!
reason_id: String
quantity: Int!
raw_quantity: JSON
received_quantity: Int
raw_received_quantity: JSON
metadata: JSON
created_at: DateTime
updated_at: DateTime
}
type OrderClaimItem {
id: ID!
claim_id: String!
order_id: String!
item_id: String!
quantity: Int!
reason: ClaimReason!
images: [OrderClaimItemImage]
raw_quantity: JSON
metadata: JSON
created_at: DateTime
updated_at: DateTime
}
type OrderClaimItemImage {
id: ID!
claim_item_id: String!
item: OrderClaimItem!
url: String
metadata: JSON
created_at: DateTime
updated_at: DateTime
}
type OrderExchangeItem {
id: ID!
exchange_id: String!
order_id: String!
item_id: String!
quantity: Int!
raw_quantity: JSON
metadata: JSON
created_at: DateTime
updated_at: DateTime
}
type OrderClaim {
order_id: String!
claim_items: [OrderClaimItem]!
additional_items: [OrderClaimItem]!
return: Return
return_id: String
no_notification: Boolean
refund_amount: Float
created_by: String
}
type OrderExchange {
order_id: String!
return_items: [OrderReturnItem]!
additional_items: [OrderExchangeItem]!
no_notification: Boolean
difference_due: Float
return: Return
return_id: String
created_by: String
}
enum PaymentStatus {
not_paid
awaiting
authorized
partially_authorized
captured
partially_captured
partially_refunded
refunded
canceled
requires_action
}
enum FulfillmentStatus {
not_fulfilled
partially_fulfilled
fulfilled
partially_shipped
shipped
partially_delivered
delivered
canceled
}
type OrderDetail {
id: ID!
version: Int!
order_change: OrderChange
status: OrderStatus!
region_id: String
customer_id: String
sales_channel_id: String
email: String
currency_code: String!
shipping_address: OrderAddress
billing_address: OrderAddress
items: [OrderLineItem]
shipping_methods: [OrderShippingMethod]
transactions: [OrderTransaction]
summary: OrderSummary
metadata: JSON
canceled_at: DateTime
created_at: DateTime!
updated_at: DateTime!
original_item_total: Float!
original_item_subtotal: Float!
original_item_tax_total: Float!
item_total: Float!
item_subtotal: Float!
item_tax_total: Float!
original_total: Float!
original_subtotal: Float!
original_tax_total: Float!
total: Float!
subtotal: Float!
tax_total: Float!
discount_total: Float!
discount_tax_total: Float!
gift_card_total: Float!
gift_card_tax_total: Float!
shipping_total: Float!
shipping_subtotal: Float!
shipping_tax_total: Float!
original_shipping_total: Float!
original_shipping_subtotal: Float!
original_shipping_tax_total: Float!
raw_original_item_total: JSON
raw_original_item_subtotal: JSON
raw_original_item_tax_total: JSON
raw_item_total: JSON
raw_item_subtotal: JSON
raw_item_tax_total: JSON
raw_original_total: JSON
raw_original_subtotal: JSON
raw_original_tax_total: JSON
raw_total: JSON
raw_subtotal: JSON
raw_tax_total: JSON
raw_discount_total: JSON
raw_discount_tax_total: JSON
raw_gift_card_total: JSON
raw_gift_card_tax_total: JSON
raw_shipping_total: JSON
raw_shipping_subtotal: JSON
raw_shipping_tax_total: JSON
raw_original_shipping_total: JSON
raw_original_shipping_subtotal: JSON
raw_original_shipping_tax_total: JSON
payment_collections: [PaymentCollection]
payment_status: PaymentStatus!
fulfillments: [Fulfillment]
fulfillment_status: FulfillmentStatus!
}
type OrderChange {
id: ID!
version: Int!
change_type: String
order_id: String!
return_id: String
exchange_id: String
claim_id: String
order: Order!
return_order: Return
exchange: OrderExchange
claim: OrderClaim
actions: [OrderChangeAction]!
status: String!
requested_by: String
requested_at: DateTime
confirmed_by: String
confirmed_at: DateTime
declined_by: String
declined_reason: String
metadata: JSON
declined_at: DateTime
canceled_by: String
canceled_at: DateTime
created_at: DateTime!
updated_at: DateTime!
}
type OrderChangeAction {
id: ID!
order_change_id: String
order_change: OrderChange
order_id: String
return_id: String
claim_id: String
exchange_id: String
order: Order
reference: String!
reference_id: String!
action: ChangeActionType!
details: JSON
internal_note: String
created_at: DateTime!
updated_at: DateTime!
}
type OrderTransaction {
id: ID!
order_id: String!
order: Order!
amount: Float!
raw_amount: JSON
currency_code: String!
reference: String!
reference_id: String!
metadata: JSON
created_at: DateTime!
updated_at: DateTime!
}
`