-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathwebhook.html.md.erb
More file actions
2353 lines (2253 loc) · 65.9 KB
/
webhook.html.md.erb
File metadata and controls
2353 lines (2253 loc) · 65.9 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
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
---
parent: smart_cart
title: webhook
---
<%= partial 'partials/page_locales' %>
# Webhook <%= edit_link %>
> <i class="fa fa-exclamation-triangle"></i>
> **Important update:** From 5/7/2021 onwards, more order state updates will be sent via Webhook requests. [Read more](/smart_cart/webhook#webhook-events)
Smart Cart webhook allows Skroutz Merchants to automatically receive order details to their
platform when a new Smart Cart order is placed or an existing one is updated.
You may find a high level overview of the service and descriptive guides for its activation in the
[merchant support guidelines](https://<%= settings.merchants_domain %>/merchants/support/guidelines/skroutz_marketplace_integration).
<%= partial 'partials/toc' %>
## Setup
In order to be able to use the webhook, a **webhook URL** should be registered
by the merchant from within
[Smart Cart settings](https://<%= settings.merchants_domain %>/merchants/account/shop/ecommerce_details)
page in merchant's panel (Merchants > Services > [Skroutz Marketplace](https://<%= settings.merchants_domain %>/merchants/account/shop/ecommerce_details)).
Webhook requests are sent to your specified URL from the following IP ranges:
**IPv4:**
* **185.6.76.0/22**
* **3.73.204.153/32**
* **3.72.204.195/32**
* **3.67.183.221/32**
* **63.34.193.172/32**
* **54.195.53.34/32**
* **108.129.50.199/32**
**IPv6:**
* **2a03:e40::/32**
Please ensure these IPs are whitelisted in your firewall or security tools to prevent webhook delivery failures.
> You can also access the IP ranges in [JSON format](/ip_ranges.json) for programmatic consumption.
> <i class="fa fa-exclamation-triangle"></i>
> The **webhook URL should match the shop's domain** and it should follow secure **HTTP (HTTPS)**
##### Webhook URL example
Shop URL | Webhook URL
-------- | ----------
`https://shop.gr` | `https://shop.gr/smart_cart_orders`
## Webhook requests
An HTTP `POST` request is sent to the predefined webhook URL once an event has been triggered.
### Handling failures / retries
Any failed request (including server timeouts or non -`200` responses) would be **retried automatically**
within the next 20 minutes. There is a retry limit of 4 requests in total for every order/event.
The merchant can also trigger sending (or retrying the latest) an **order webhook request** at any time from within
the order page.
The expected request payload would be the same in both scenarios.
### The anatomy of a request
##### Request
<pre class="terminal">
POST {webhook_url}
</pre>
##### Request headers
Header | Value
-------------- | -----
`Content-Type` | `application/json; charset=utf-8`
`User-Agent` | `Skroutz OrderNotifier v1`
##### Expected request response
<pre class="terminal">
200
</pre>
## Webhook events
The available webhook events for which a request is performed are:
* **new order** events
* **order update** events
### New order
A **new order** webhook request is triggered upon the placement of a new order.
### Order updates
An **order update** event is triggered upon the update of an order. As of right now, an update
event notification is sent for the following cases:
* When an order is **cancelled** (either by the user or our support team).
* When an order is **extended** (allowing more time to handle the order).
* When an order's courier voucher is **created** (for the associated shipment).
* **From 5/7/2021 onwards**: When an order's **state changes** to one of the following states `[:accepted, :rejected, :expired, :dispatched, :cancelled, :partially_returned, :returned]` (either by the user, our support team, or the merchant)
#### Request payload
Name | Type | Value | Description
-------------- | ------ | ----- | ------------------
`event_type` | String | `new_order`, `order_updated`| Order event type
`event_time` | Date String in format<br> `YYYY-MM-DDTHH:MM:SS+HH:M` | | Event creation time
`order` | Object | | [Order details](#order-object)
`changes` | Object | | [Order changes with old and new values (optional)](#order-changes-object)
#### Order changes object
Name | Type | Value | Description
-------------- | ------ | ----- | -------------
`state` | Object | `{ "old": "open", "new": "cancelled" }` | The state changed values (optional)
`expires_at` | Object | `{ "old": "2019-11-02T13:15:43+02:00", "new": "2019-11-04T13:15:00+02:00" }` | The order's current expiration time changes (optional)
`dispatch_until` | Object | `{ "old": "2019-11-03T12:00:00+02:00", "new": "2019-11-04T18:00:00+02:00" }` | The order's current time until dispatching changes (optional)
`courier` | Object | `{ "old": "Skroutz Last Mile", "new": "ACS" }` | The order's shipment serving courier changes (optional)
`courier_voucher` | Object | `{ "old": null, "new": "https://b.scdn.gr/path-to/voucher.pdf" }` | The order's shipment courier voucher URL (optional)
`courier_tracking_codes` | Object | `{ "old": [], "new": ["123456789"] }` | The order's shipment courier tracking codes (optional)
`fbs_delivery_note` | Object | `{ "old": null, "new": "ΤΛΑΠΟ0454022" }` | The order's fulfilled by Skroutz warehouse delivery note (optional)
`fbs_delivery_note_url` | Object | `{ "old": null, "new": "https://b.scdn.gr/path-to/fbs_delivery_note.pdf" }` | The order's fulfilled by Skroutz warehouse digital delivery note PDF url (optional)
`pickup_window` | Object | `{ "old": null, "new: { from: "2019-11-02T15:00:00+02:00", "to": "2019-11-02T16:00:00+02:00" } }` | The order's shipment pickup window (optional). It is sent when the order is accepted.
`number_of_parcels` | Integer | `{ "old": null, "new": 2 }` | The order's shipment number of parcels (optional). It is sent when the order is accepted.
`pickup_address` | String | `{ "old": null, "new": "Πανεπιστημίου 2, Τ.Κ. 12345, Αθήνα, Αττική" }` | The order's pickup address (optional).
> The order object included in webhook payload is the sames as the one when
> retrieving a single order via the [orders API](/smart_cart/orders_api).
> Field behavior notes:
> - `invoice_document` is always present with one of: `receipt`, `invoice`, `invoice_39a`, `invoice_vies`
> - `fees` is always present as an object (`{}` when no fees apply)
> - Fee sub-fields are present only when their values are positive
> - `replacements` and `replaced` are omitted entirely when not applicable
<%= partial 'localizable/smart_cart/order_object' %>
## Test requests (sandbox)
For [demo orders](/smart_cart/orders_api/#test-requests-sandbox), separate **API endpoints** are available to **trigger different
kinds of Webhook requests** for testing. In the following examples, `:code` should be replaced with one of the following values:
- `DEMO-OPEN`
- `DEMO-ACCEPTED`
- `DEMO-REJECTED`
- `DEMO-INVOICE`
- `DEMO-INVOICE39A`
- `DEMO-FBS`
- `DEMO-FBS-DISPATCHED`
- `DEMO-STORE-PICKUP`
- `DEMO-FEES`
- `DEMO-REPLACEMENT`
- `DEMO-REPLACED`
- `DEMO-INVOICE-VIES`
An order creation or order update event should be received at the webhook url of the shop, depending on the request action.
Sending any of the following requests should request in a successful response (`200 OK`):
<pre class="terminal">
{
"success": true
}
</pre>
> Note: Demo webhook requests are not executed instantly, so they may take from a few seconds up to a few minutes to be processed and sent.
> After getting a successful response (200 OK), you would just have to wait a bit, before trying another one.
> All requests will be sent to the live Webhook URL that is already set-up in the Merchants panel for your shop.
#### New order
This sends a Webhook request payload just like if the order is new, with `"event_type": "new_order"`.
<pre class="terminal">
POST /merchants/ecommerce/orders/:code/trigger_webhook_request/creation
</pre>
#### Courier voucher issued
This sends a Webhook request payload just like if the order was updated with a PDF voucher
file, with `"event_type": “order_updated”`.
<pre class="terminal">
POST /merchants/ecommerce/orders/:code/trigger_webhook_request/voucher_update
</pre>
#### Order extended
This sends a Webhook request payload just like if the order acceptance period was extended by Skroutz support,
with `"event_type": “order_updated”`.
<pre class="terminal">
POST /merchants/ecommerce/orders/:code/trigger_webhook_request/extension
</pre>
#### Order cancelled
Would send a Webhook request payload just like if the order was cancelled by the user, with
`"event_type": “order_updated”`.
<pre class="terminal">
POST /merchants/ecommerce/orders/:code/trigger_webhook_request/cancellation
</pre>
## Payload Examples
#### Example 1
~~~ json
{
"event_type": "new_order",
"event_time": "2019-11-28T13:24:37+02:00",
"order": {
"code": "191029-5130474",
"state": "open",
"customer": {
"id": "PA4oqvpz8x",
"first_name": "John",
"last_name": "Doe",
"address":{
"street_name":"Πανεπιστημίου",
"street_number":"4",
"zip":"12345",
"city":"Αθήνα",
"region":"Αττικής",
"country_code": "GR",
"pickup_from_collection_point": false
}
},
"invoice": false,
"uploaded_invoice_file": null,
"comments": "Παράδοση στο γραφείο",
"courier": "ACS",
"courier_voucher": null,
"courier_tracking_codes": [],
"line_items": [
{
"id": "l39vKqxqwe",
"shop_uid": "100",
"product_name": "L'Oreal Professionel Salon Steam Pod V2 White",
"quantity": 2,
"unit_price": 10.40,
"total_price": 20.80,
"price_includes_vat": true,
"commission": 1.73,
"commission_rate": 8.34,
"island_vat_discount_applied": false,
"ean": "1234567890123",
"mpn": "JA-1059",
"serial_numbers": null,
"tags": ["plus_deal", "coupon_deal", "two_plus_deal", "price_optimizer", "cc_installments"]
},
{
"id": "l39vKqxqh2",
"shop_uid": "10",
"product_name": "Paul Mitchell Ultimate Color Repair 200ml",
"quantity": 1,
"unit_price": 25,
"total_price": 25,
"price_includes_vat": true,
"commission": 2.32,
"commission_rate": 9.28,
"island_vat_discount_applied": false,
"serial_numbers": null
}
],
"created_at": "2019-11-28T13:24:37+02:00",
"expires_at": "2019-12-04T10:24:00+02:00",
"dispatch_until": "2019-12-04T18:00:00+02:00",
"express": false,
"gift_wrap": false,
"fulfilled_by_skroutz": false,
"store_pickup": false,
"commission": 4.05,
"fbs_delivery_note": null,
"fbs_delivery_note_url": null,
"paid_by_user": true,
"payment_method": "card",
"accept_options": {
"number_of_parcels": [
1
],
"pickup_location": [
{
"id": "YlpD0KROym",
"label": "Πανεπιστημίου 2, Τ.Κ. 12345, Αθήνα, Αττική"
},
{
"id": "onpL6DXG4l",
"label": "Σταδίου 1, Τ.Κ. 12345, Αθήνα, Αττική"
},
{
"id": "wgO1N22OaQ",
"label": "Κρήτης 50, Τ.Κ. 73100, Χανιά, Χανιά"
}
],
"pickup_window": [
{
"id": 1,
"label": "15:00 - 18:00, Τρί 03/12/19"
},
{
"id": 2,
"label": "10:00 - 12:00, Τετ 04/12/19"
},
{
"id": 3,
"label": "12:00 - 15:00, Τετ 04/12/19"
},
{
"id": 4,
"label": "15:00 - 18:00, Τετ 04/12/19"
}
]
},
"reject_options": {
"line_item_rejection_reasons": [
{
"id": 1,
"label": "Εκτός αποθέματος στο κατάστημα ή στον προμηθευτή",
"requires_available_quantity": false
},
{
"id": 2,
"label": "Λάθος καταχωρημένη τιμή(ες)",
"requires_available_quantity": false
},
{
"id": 4,
"label": "Περιορισμένα τεμάχια",
"requires_available_quantity": true
},
{
"id": 5,
"label": "To προϊόν καταργήθηκε",
"requires_available_quantity": false
}
]
}
}
}
~~~
#### Example 2 (with size-related fields)
~~~ json
{
"event_type": "new_order",
"event_time": "2019-11-28T13:24:37+02:00",
"order": {
"code": "191025-0111363",
"state": "open",
"customer": {
"id": "PA4oqvpz8x",
"first_name": "John",
"last_name": "Doe",
"address":{
"street_name":"Πανεπιστημίου",
"street_number":"4",
"zip":"12345",
"city":"Αθήνα",
"region":"Αττικής",
"country_code": "GR",
"pickup_from_collection_point": false
}
},
"invoice": false,
"uploaded_invoice_file": null,
"comments": "",
"courier": "ACS",
"courier_voucher": null,
"courier_tracking_codes": [],
"line_items": [
{
"id": "l39vKqzp2a",
"shop_uid": "405753",
"shop_variation_uid": "40575312-14",
"product_name": "adidas Perormance Badge of Sport Swimsuit PS/GS ( DQ3375 )",
"quantity": 2,
"size": {
"label": "Ηλικία",
"value": "14 χρονών",
"shop_value": "12-14",
"shop_variation_uid": "40575312-14",
"ean": "1234567890321",
"mpn": "JA-1059"
},
"unit_price": 17.99,
"total_price": 35.98,
"price_includes_vat": true,
"commission": 3.00,
"commission_rate": 8.34,
"island_vat_discount_applied": false,
"ean": "1234567890123",
"mpn": "JA-1059",
"serial_numbers": null
},
{
"id": "l39vKqzpll",
"shop_uid": "10",
"product_name": "Paul Mitchell Ultimate Color Repair 200ml",
"quantity": 1,
"unit_price": 25,
"total_price": 25,
"price_includes_vat": true,
"commission": 2.32,
"commission_rate": 9.28,
"island_vat_discount_applied": false,
"serial_numbers": null
}
],
"created_at": "2019-11-28T13:24:37+02:00",
"expires_at": "2019-12-04T10:24:00+02:00",
"dispatch_until": "2019-12-04T18:00:00+02:00",
"express": false,
"gift_wrap": false,
"fulfilled_by_skroutz": false,
"store_pickup": false,
"commission": 5.32,
"fbs_delivery_note": null,
"fbs_delivery_note_url": null,
"paid_by_user": true,
"payment_method": "card",
"accept_options": {
"number_of_parcels": [
1
],
"pickup_location": [
{
"id": "YlpD0KROym",
"label": "Πανεπιστημίου 2, Τ.Κ. 12345, Αθήνα, Αττική"
},
{
"id": "onpL6DXG4l",
"label": "Σταδίου 1, Τ.Κ. 12345, Αθήνα, Αττική"
},
{
"id": "wgO1N22OaQ",
"label": "Κρήτης 50, Τ.Κ. 73100, Χανιά, Χανιά"
}
],
"pickup_window": [
{
"id": 1,
"label": "15:00 - 18:00, Τρί 03/12/19"
},
{
"id": 2,
"label": "10:00 - 12:00, Τετ 04/12/19"
},
{
"id": 3,
"label": "12:00 - 15:00, Τετ 04/12/19"
},
{
"id": 4,
"label": "15:00 - 18:00, Τετ 04/12/19"
}
]
},
"reject_options": {
"line_item_rejection_reasons": [
{
"id": 1,
"label": "Εκτός αποθέματος στο κατάστημα ή στον προμηθευτή",
"requires_available_quantity": false
},
{
"id": 2,
"label": "Λάθος καταχωρημένη τιμή(ες)",
"requires_available_quantity": false
},
{
"id": 4,
"label": "Περιορισμένα τεμάχια",
"requires_available_quantity": true
},
{
"id": 5,
"label": "To προϊόν καταργήθηκε",
"requires_available_quantity": false
}
]
}
}
}
~~~
#### Example 3 (cancellation)
~~~ json
{
"event_type": "order_updated",
"event_time": "2019-10-29T10:39:23+02:00",
"order": {
"code": "191029-5130474",
"state": "cancelled",
"customer": {
"id": "PA4oqvpz8x",
"first_name": "John",
"last_name": "Doe",
"address":{
"street_name":"Πανεπιστημίου",
"street_number":"4",
"zip":"12345",
"city":"Αθήνα",
"region":"Αττικής",
"country_code": "GR",
"pickup_from_collection_point": false
}
},
"invoice": false,
"uploaded_invoice_file": null,
"comments": "Παράδοση στο γραφείο",
"courier": "ACS",
"courier_voucher": null,
"courier_tracking_codes": [],
"line_items": [
{
"id": "l39vKqwezt",
"shop_uid": "100",
"product_name": "L'Oreal Professionel Salon Steam Pod V2 White",
"quantity": 2,
"unit_price": 10.40,
"total_price": 20.80,
"price_includes_vat": true,
"commission": 1.73,
"commission_rate": 8.34,
"island_vat_discount_applied": false,
"ean": "1234567890123",
"mpn": "JA-1059",
"serial_numbers": null
},
{
"id": "l39vKqzpll",
"shop_uid": "10",
"product_name": "Paul Mitchell Ultimate Color Repair 200ml",
"quantity": 1,
"unit_price": 25,
"total_price": 25,
"price_includes_vat": true,
"commission": 2.32,
"commission_rate": 9.28,
"island_vat_discount_applied": false,
"serial_numbers": null
}
],
"created_at": "2019-10-29T10:39:23+02:00",
"expires_at": "2019-10-29T16:39:23+02:00",
"dispatch_until": "2019-10-30T15:00:00+02:00"
"express": false,
"gift_wrap": false,
"fulfilled_by_skroutz": false,
"store_pickup": false,
"commission": 4.05,
"fbs_delivery_note": null,
"fbs_delivery_note_url": null,
"paid_by_user": true,
"payment_method": "Card"
},
"changes": {
"state": {
"old": "open",
"new": "cancelled"
}
}
}
~~~
#### Example 4 (extension)
~~~ json
{
"event_type": "order_updated",
"event_time": "2019-10-29T10:39:23+02:00",
"order": {
"code": "191029-5130474",
"state": "open",
"customer": {
"id": "PA4oqvpz8x",
"first_name": "John",
"last_name": "Doe",
"address":{
"street_name":"Πανεπιστημίου",
"street_number":"4",
"zip":"12345",
"city":"Αθήνα",
"region":"Αττικής",
"country_code": "GR",
"pickup_from_collection_point": false
}
},
"invoice": false,
"uploaded_invoice_file": null,
"comments": "Παράδοση στο γραφείο",
"express": false,
"gift_wrap": false,
"fulfilled_by_skroutz": false,
"store_pickup": false,
"fbs_delivery_note": null,
"fbs_delivery_note_url": null,
"courier": "ACS",
"courier_voucher": null,
"courier_tracking_codes": [],
"line_items": [
{
"id": "qw3rtyab34",
"shop_uid": "100",
"product_name": "L'Oreal Professionel Salon Steam Pod V2 White",
"quantity": 2,
"unit_price": 10.40,
"total_price": 20.80,
"price_includes_vat": true,
"commission": 1.73,
"commission_rate": 8.34,
"island_vat_discount_applied": false,
"ean": "1234567890123",
"mpn": "JA-1059",
"serial_numbers": null
},
{
"id": "l39vKqzpll",
"shop_uid": "10",
"product_name": "Paul Mitchell Ultimate Color Repair 200ml",
"quantity": 1,
"unit_price": 25,
"total_price": 25,
"price_includes_vat": true,
"commission": 2.32,
"commission_rate": 9.28,
"island_vat_discount_applied": false,
"serial_numbers": null
}
],
"created_at": "2019-10-29T10:39:23+02:00",
"expires_at": "2019-10-29T16:39:23+02:00",
"dispatch_until": "2019-10-30T15:00:00+02:00",
"express": false,
"gift_wrap": false,
"fulfilled_by_skroutz": false,
"store_pickup": false,
"commission": 4.05,
"fbs_delivery_note": null,
"fbs_delivery_note_url": null,
"paid_by_user": true,
"payment_method": "card",
"accept_options": {
"number_of_parcels": [
1
],
"pickup_location": [
{
"id": "YlpD0KROym",
"label": "Πανεπιστημίου 2, Τ.Κ. 12345, Αθήνα, Αττική"
},
{
"id": "onpL6DXG4l",
"label": "Σταδίου 1, Τ.Κ. 12345, Αθήνα, Αττική"
},
{
"id": "wgO1N22OaQ",
"label": "Κρήτης 50, Τ.Κ. 73100, Χανιά, Χανιά"
}
],
"pickup_window": [
{
"id": 1,
"label": "15:00 - 18:00, Τρί 30/10/19"
},
{
"id": 2,
"label": "10:00 - 12:00, Τετ 31/10/19"
},
{
"id": 3,
"label": "12:00 - 15:00, Τετ 31/10/19"
},
{
"id": 4,
"label": "15:00 - 18:00, Τετ 31/10/19"
}
]
},
"reject_options": {
"line_item_rejection_reasons": [
{
"id": 1,
"label": "Εκτός αποθέματος στο κατάστημα ή στον προμηθευτή",
"requires_available_quantity": false
},
{
"id": 2,
"label": "Λάθος καταχωρημένη τιμή(ες)",
"requires_available_quantity": false
},
{
"id": 4,
"label": "Περιορισμένα τεμάχια",
"requires_available_quantity": true
},
{
"id": 5,
"label": "To προϊόν καταργήθηκε",
"requires_available_quantity": false
}
]
}
},
"changes": {
"expires_at": {
"old": "2019-11-02T13:15:43+02:00",
"new": "2019-11-04T13:15:00+02:00"
},
"dispatch_until": {
"old": "2019-11-03T12:00:00+02:00",
"new": "2019-11-04T18:00:00+02:00"
}
}
}
~~~
#### Example 5 (courier voucher creation)
~~~ json
{
"event_type": "order_updated",
"event_time": "2019-10-29T10:39:23+02:00",
"order": {
"code": "191029-5130474",
"state": "accepted",
"customer": {
"id": "PA4oqvpz8x",
"first_name": "John",
"last_name": "Doe",
"address":{
"street_name":"Πανεπιστημίου",
"street_number":"4",
"zip":"12345",
"city":"Αθήνα",
"region":"Αττικής",
"country_code": "GR",
"pickup_from_collection_point": false
}
},
"invoice": false,
"uploaded_invoice_file": null,
"comments": "Παράδοση στο γραφείο",
"courier": "ACS",
"courier_voucher": "https://b.scdn.gr/path-to/voucher.pdf",
"courier_tracking_codes": ["123456789"],
"line_items": [
{
"id": "l39vpqzZ1l",
"shop_uid": "100",
"product_name": "L'Oreal Professionel Salon Steam Pod V2 White",
"quantity": 2,
"unit_price": 10.40,
"total_price": 20.80,
"price_includes_vat": true,
"commission": 1.73,
"commission_rate": 8.34,
"island_vat_discount_applied": false,
"ean": "1234567890123",
"mpn": "JA-1059",
"serial_numbers": null
},
{
"id": "l39vKqzpll",
"shop_uid": "10",
"product_name": "Paul Mitchell Ultimate Color Repair 200ml",
"quantity": 1,
"unit_price": 25,
"total_price": 25,
"price_includes_vat": true,
"commission": 2.32,
"commission_rate": 9.28,
"island_vat_discount_applied": false,
"serial_numbers": null
}
],
"created_at": "2019-10-29T10:39:23+02:00",
"expires_at": "2019-10-29T16:39:23+02:00",
"dispatch_until": "2019-10-30T15:00:00+02:00",
"express": false,
"gift_wrap": false,
"fulfilled_by_skroutz": false,
"store_pickup": false,
"commission": 4.05,
"fbs_delivery_note": null,
"fbs_delivery_note_url": null,
"paid_by_user": true,
"payment_method": "card",
"pickup_window": { from: "2019-11-02T15:00:00+02:00", "to": "2019-11-02T16:00:00+02:00" },
"number_of_parcels": 1,
"pickup_address": "Πανεπιστημίου 2, Τ.Κ. 12345, Αθήνα, Αττική"
},
"changes": {
"courier_voucher": {
"old": null,
"new": "https://b.scdn.gr/path-to/voucher.pdf"
},
"courier_tracking_codes": {
"old": [],
"new": ["123456789"]
}
}
}
~~~
#### Example 6 (invoice requested, without VAT exclusion)
~~~ json
{
"event_type": "new_order",
"event_time": "2019-11-28T13:24:37+02:00",
"order": {
"code": "191029-5130474",
"state": "open",
"customer": {
"id": "PA4oqvpz8x",
"first_name": "John",
"last_name": "Doe",
"address":{
"street_name":"Πανεπιστημίου",
"street_number":"4",
"zip":"12345",
"city":"Αθήνα",
"region":"Αττικής",
"country_code": "GR",
"pickup_from_collection_point": false
}
},
"invoice": true,
"uploaded_invoice_file": null,
"invoice_details": {
"company":"ACME",
"profession":"Internet Services",
"vat_number":"111119191",
"doy":"ΙΒ Αθηνών",
"address": {
"street_name":"Πανεπιστημίου",
"street_number":"4",
"zip":"12345",
"city":"Αθήνα",
"region":"Αττικής"
},
"vat_exclusion_requested":false
},
"comments": "Παράδοση στο γραφείο",
"express": false,
"gift_wrap": false,
"fulfilled_by_skroutz": false,
"store_pickup": false,
"fbs_delivery_note": null,
"fbs_delivery_note_url": null,
"courier": "ACS",
"courier_voucher": null,
"courier_tracking_codes": [],
"line_items": [
{
"id": "l39vKqxqwe",
"shop_uid": "100",
"product_name": "L'Oreal Professionel Salon Steam Pod V2 White",
"quantity": 2,
"unit_price": 10.40,
"total_price": 20.80,
"price_includes_vat": true,
"commission": 1.73,
"commission_rate": 8.34,
"island_vat_discount_applied": false,
"ean": "1234567890123",
"mpn": "JA-1059",
"serial_numbers": null
},
{
"id": "l39vKqxqh2",
"shop_uid": "10",
"product_name": "Paul Mitchell Ultimate Color Repair 200ml",
"quantity": 1,
"unit_price": 25,
"total_price": 25,
"price_includes_vat": true,
"commission": 2.32,
"commission_rate": 9.28,
"island_vat_discount_applied": false,
"serial_numbers": null
}
],
"created_at": "2019-11-28T13:24:37+02:00",
"expires_at": "2019-12-04T10:24:00+02:00",
"dispatch_until": "2019-12-04T18:00:00+02:00",
"express": false,
"gift_wrap": false,
"fulfilled_by_skroutz": false,
"store_pickup": false,
"commission": 4.05,
"fbs_delivery_note": null,
"fbs_delivery_note_url": null,
"paid_by_user": true,
"payment_method": "card",
"accept_options": {
"number_of_parcels": [
1
],
"pickup_location": [
{
"id": "YlpD0KROym",
"label": "Πανεπιστημίου 2, Τ.Κ. 12345, Αθήνα, Αττική"
},
{
"id": "onpL6DXG4l",
"label": "Σταδίου 1, Τ.Κ. 12345, Αθήνα, Αττική"
},
{
"id": "wgO1N22OaQ",
"label": "Κρήτης 50, Τ.Κ. 73100, Χανιά, Χανιά"
}
],
"pickup_window": [
{
"id": 1,
"label": "15:00 - 18:00, Τρί 03/12/19"
},
{
"id": 2,
"label": "10:00 - 12:00, Τετ 04/12/19"
},
{
"id": 3,
"label": "12:00 - 15:00, Τετ 04/12/19"
},
{
"id": 4,
"label": "15:00 - 18:00, Τετ 04/12/19"
}
]
},
"reject_options": {
"line_item_rejection_reasons": [
{
"id": 1,
"label": "Εκτός αποθέματος στο κατάστημα ή στον προμηθευτή",
"requires_available_quantity": false
},
{
"id": 2,
"label": "Λάθος καταχωρημένη τιμή(ες)",
"requires_available_quantity": false
},
{
"id": 4,
"label": "Περιορισμένα τεμάχια",
"requires_available_quantity": true
},
{
"id": 5,
"label": "To προϊόν καταργήθηκε",
"requires_available_quantity": false
}
]
}
}
}
~~~
#### Example 7 (invoice requested, with VAT exclusion)
~~~ json
{
"event_type": "new_order",
"event_time": "2019-11-28T13:24:37+02:00",
"order": {
"code": "191029-5130474",
"state": "open",
"customer": {
"id": "PA4oqvpz8x",
"first_name": "John",
"last_name": "Doe",
"phone": "2109999999",
"mobile": "(+30) 6999999999",
"address":{
"street_name":"Πανεπιστημίου",
"street_number":"4",
"zip":"12345",
"city":"Αθήνα",
"region":"Αττικής",
"country_code": "GR",
"pickup_from_collection_point": false
}
},