-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi.html
More file actions
1551 lines (1413 loc) · 79.8 KB
/
api.html
File metadata and controls
1551 lines (1413 loc) · 79.8 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
<!DOCTYPE html>
<html lang="en-gb">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>REC+ API</title>
<meta name="description" content="REC+ API quick guide, taking you through set up and usage of the API.">
<link rel="dns-prefetch" href="https://cdnjs.cloudflare.com">
<link rel="preconnect" href="https://cdnjs.cloudflare.com/">
<link rel="dns-prefetch" href="https://fonts.googleapis.com">
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:400,700">
<link rel="stylesheet" href="/css/api.css?v8">
</head>
<body>
<header class="page-header">
<h1>
REC+ API
<span>
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 640 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M64 96c0-35.3 28.7-64 64-64H512c35.3 0 64 28.7 64 64V352H512V96H128V352H64V96zM0 403.2C0 392.6 8.6 384 19.2 384H620.8c10.6 0 19.2 8.6 19.2 19.2c0 42.4-34.4 76.8-76.8 76.8H76.8C34.4 480 0 445.6 0 403.2zM281 209l-31 31 31 31c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-48-48c-9.4-9.4-9.4-24.6 0-33.9l48-48c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9zM393 175l48 48c9.4 9.4 9.4 24.6 0 33.9l-48 48c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l31-31-31-31c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z"/></svg>
Quick Guide
</span>
</h1>
</header>
<div class="page-wrapper">
<nav class="page-sidebar">
<ul>
<li>
<strong>Contents</strong>
</li>
<li>
<a href="#introduction">Introduction</a>
</li>
<li>
<a href="#api-accounts">API Accounts</a>
</li>
<li>
<a href="#auth-scopes">Auth & Scopes</a>
</li>
<li>
<a class="toggle-sub-links" href="#"></a>
<a href="#request-examples">Request Examples</a>
<ul>
<li><a href="#request-examples--curl">curl</a></li>
<li><a href="#request-examples--php">PHP</a></li>
</ul>
</li>
<li>
<a class="toggle-sub-links" href="#"></a>
<a href="#responses">Response Examples</a>
<ul>
<li><a href="#responses">Products collection</a></li>
<li><a href="#responses--product">Product</a></li>
<li><a href="#responses--error">Error</a></li>
<li><a href="#responses--order">Order</a></li>
</ul>
</li>
<li>
<a class="toggle-sub-links" href="#"></a>
<a href="#resources">Resources</a>
<ul>
<li><a href="#resources--blog-posts">Blog Posts</a></li>
<li><a href="#resources--categories">Categories</a></li>
<li><a href="#resources--coupons">Coupons</a></li>
<li><a href="#resources--currency-converter">Currency Converter</a></li>
<li><a href="#resources--custom-currency-rates">Custom Currency Rates</a></li>
<li><a href="#resources--delivery-methods">Delivery Methods</a></li>
<li><a href="#resources--departments">Departments</a></li>
<li><a href="#resources--downloads">Downloads</a></li>
<li><a href="#resources--download-categories">Download categories</a></li>
<li><a href="#resources--forms">Forms</a></li>
<li><a href="#resources--gallery">Gallery</a></li>
<li><a href="#resources--google-reviews">Google Reviews</a></li>
<li><a href="#resources--linked-products">Linked Products</a></li>
<li><a href="#resources--manufacturers">Manufacturers</a></li>
<li><a href="#resources--modules">Modules</a></li>
<li><a href="#resources--newsletters">Newsletters</a></li>
<li><a href="#resources--options">Options</a></li>
<li><a href="#resources--orders">Orders</a></li>
<li><a href="#resources--pages">Pages</a></li>
<li><a href="#resources--payment-methods">Payment Methods</a></li>
<li><a href="#resources--postcode-lookup">Postcode Lookup</a></li>
<li><a href="#resources--price-list">Price List</a></li>
<li><a href="#resources--product-filter-blocks">Product Filter Blocks</a></li>
<li><a href="#resources--product-reviews">Product Reviews</a></li>
<li><a href="#resources--products">Products</a></li>
<li><a href="#resources--regions">Regions</a></li>
<li><a href="#resources--sliders">Sliders</a></li>
<li><a href="#resources--stock">Stock</a></li>
<li><a href="#resources--testimonials">Testimonials</a></li>
<li><a href="#resources--user-groups">User Groups</a></li>
<li><a href="#resources--userfiles">Userfiles</a></li>
<li><a href="#resources--users">Users</a></li>
<li><a href="#resources--vat-types">VAT Types</a></li>
</ul>
</li>
<li>
<a href="#api-webhooks">API Webhooks</a>
</li>
<li>
<a href="#api-explorer">API Explorer</a>
</li>
<li>
<a href="#further-reading">Further Reading</a>
</li>
</ul>
</nav>
<main class="page-main">
<section class="doc-section">
<header>
<h2 id="introduction">Introduction</h2>
</header>
<p>REC+ sites have a RESTful API available to lookup or modify data.
They also support webhooks which can send API objects to you on specific events such as <code>new.order</code>.</p>
</section>
<section class="doc-section">
<header>
<h2 id="api-accounts">API Accounts</h2>
</header>
<p>Set up or request API Access via admin.</p>
<p>To set up an account when logged in to the Admin area, open API Accounts on the sidebar.
<br>Set your account details and the scopes you need access to.</p>
<p>You will then be provided both a Public API key & Full API Access (limited by scopes) via <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP Basic Auth</a> over HTTPS/TLS.</p>
<p>Manage or view the logs of your API account any time via the same API Access area in Admin.</p>
<p>
<img src="/images/api/api-accounts.png" alt="API Accounts View">
</p>
</section>
<section class="doc-section">
<header>
<h2 id="auth-scopes">Auth & Scopes</h2>
</header>
<p>Public key access only gives you access to public data, such as product listings. It does not allow access to private store data such as orders, nor does it allow you to make any modifications.</p>
<p>To access (& modify) everything allowed by your scopes, you'll need to use <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP Basic Auth</a> over HTTPS with the Full API username & password. </p>
<p>Scopes limit the access your account has, such as if your app only needs access to Orders, you can limit your scope to only Orders. </p>
<p>Currently available scopes:
<br><code>store_content</code> - Manages the products, options, linked products, etc.
<br><code>content</code> - Manages the downloads, modules, userfiles, etc.
<br><code>users</code> - Manages the users, user groups, etc.
<br><code>orders</code> - Manages the orders, coupons, payment methods, delivery, etc.
<br><code>forms</code> - Access to forms and their responses.
</p>
</section>
<section class="doc-section">
<header>
<h2 id="request-examples">Request Examples</h2>
</header>
<p>
<small>Replace {DOMAIN} with the website domain name, as well as {API_USER} & {API_PASS} with your assigned API username & password.</small>
</p>
<h3 id="request-examples--curl">Curl</h3>
<pre><code class="language-bash hljs"># Lookup all products
curl "https://{DOMAIN}/api/v1/products" --user {API_USER}:{API_PASS}
# Lookup specific product by code
curl "https://{DOMAIN}/api/v1/products/test?identifier=code" --user {API_USER}:{API_PASS}
# Update specific product by code
curl -X POST -d @data.json "https://{DOMAIN}/api/v1/products/test?identifier=code" --user {API_USER}:{API_PASS}
# Batch update products
curl -X POST -d @data.json "https://{DOMAIN}/api/v1/products" --user {API_USER}:{API_PASS}
</code></pre>
<h3 id="request-examples--php">PHP</h3>
<pre><code class="language-php hljs">class REC
{
protected static string $api_user = '{API_USER}';
protected static string $api_pass = '{API_PASS}';
protected static string $base = 'https://{DOMAIN}';
public static function api(string $method, string $resource, ?array $data = null): object
{
$ch = curl_init(static::$base . '/api/v1' . $resource);
curl_setopt($ch, CURLOPT_USERPWD, static::$api_user . ':' . static::$api_pass);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$method = strtoupper($method);
if ($method === 'POST') {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data, JSON_THROW_ON_ERROR));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
} elseif ($method !== 'GET') {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
}
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return (object) [
'status' => $status,
'response' => $response ? json_decode($response, false, 512, JSON_THROW_ON_ERROR) : null,
];
}
}
</code></pre>
<pre><code class="language-php hljs">// Lookup all products
$products = REC::api('GET', '/products');
// Lookup specific product by code
$productCode = 'test';
$product = REC::api('GET', '/products/' . $productCode . '?identifier=code');
// Create new product
$product = REC::api('POST', '/products', [
'products' => [[
'code' => 'test',
'name' => 'Test Product',
]],
]);
// Update specific product by code
$product = REC::api('POST', '/products/' . $productCode . '?identifier=code', [
'name' => 'Test Product UPDATED',
]);
// Batch update products
$products = REC::api('POST', '/products?identifier=code', [
'products' => [
[
'code' => 'test',
'name' => 'Test Product',
],
[
'code' => 'test2', // or this will insert/create if code not found
'name' => 'Test Product 2',
],
],
]);
// Delete specific product by code
$product = REC::api('DELETE', '/products/' . $productCode . '?identifier=code');
// Batch delete products
$products = REC::api('DELETE', '/products?identifier=code&ids=' . implode(',', [
'test',
'test2',
]));
</code></pre>
<p>HTTP methods indicate the type of request, e.g. to lookup a collection of objects or a specific object use <code>GET</code>. Creating or updating an object uses <code>POST</code> <small>(<code>PATCH</code> also supported for updates but is treated the same as <code>POST</code>, both support partial updates)</small>. To remove/delete a resource use <code>DELETE</code>. Batch creates, updates & deletes are also supported.</p>
</section>
<section class="doc-section">
<header>
<h2 id="responses">Response Examples</h2>
</header>
<p>By default the API returns JSON responses however it can also return XML if needed.</p>
<p>Use Admin > <a href="#api-explorer">API Explorer</a> to view live example responses on the site.</p>
<p>All products example JSON:</p>
<pre><code class="language-json hljs">{
"href": "\/products.json?fields=&identifier=",
"products": [
{
"href": "\/products\/58663.json",
"id": 58663,
"name": "HOT SAUCE GIFT VOUCHER",
"code": "Sauce-gift-voucher",
"status": "live",
"link": "http:\/\/rec.localhost\/HOT_SAUCE_GIFT_VOUCHER--product--58663.html",
"image": "http:\/\/rec.localhost\/userfiles\/images\/sys\/products\/HOT_SAUCE_GIFT_VOUCHER_67999_0.jpg",
"price": {
"normal": "400.00",
"special_offer": "0.00"
}
},
{
"href": "\/products\/58662.json",
"id": 58662,
"name": "Tubby Tom's The Squealer Hot Sauce 150g",
"code": "Sauce-997706",
"status": "live",
"link": "http:\/\/rec.localhost\/Tubby_Tom039s_The_Squealer_Hot_Sauce_150g--product--58662.html",
"image": "http:\/\/rec.localhost\/userfiles\/images\/sys\/products\/Tubby_Toms_The_Squealer_Hot_Sauce_150g_12652_0.jpg",
"price": {
"normal": "8.40",
"special_offer": "0.00"
}
},
{
"href": "\/products\/58661.json",
"id": 58661,
"name": "Traeger Texas Spicy BBQ Sauce 16oz",
"code": "Sauce-1105410",
"status": "live",
"link": "http:\/\/rec.localhost\/Traeger_Texas_Spicy_BBQ_Sauce_16oz--product--58661.html",
"image": "http:\/\/rec.localhost\/userfiles\/images\/sys\/products\/Traeger_Texas_Spicy_BBQ_Sauce_16oz_70879jpeg.jpg",
"price": {
"normal": "132.00",
"special_offer": "0.00"
}
}
],
"count": 25,
"total_count": 83,
"paging": {
"offset": 0,
"limit": 25,
"first_page_href": "\/products.json?fields=&identifier=&limit=25&offset=0",
"last_page_href": "\/products.json?fields=&identifier=&limit=25&offset=75",
"next_page_href": "\/products.json?fields=&identifier=&limit=25&offset=25",
"previous_page_href": null
}
}
</code></pre>
<p id="responses--product">Specific product example JSON:</p>
<pre><code class="language-json hljs">{
"href": "\/products\/58661.json",
"id": 58661,
"name": "Traeger Texas Spicy BBQ Sauce 16oz",
"code": "Sauce-1105410",
"status": "live",
"link": "http:\/\/rec.localhost\/Traeger_Texas_Spicy_BBQ_Sauce_16oz--product--58661.html",
"image": "http:\/\/rec.localhost\/userfiles\/images\/sys\/products\/Traeger_Texas_Spicy_BBQ_Sauce_16oz_70879jpeg.jpg",
"price": {
"normal": "132.00",
"special_offer": "0.00"
},
"additional_images": [
],
"short_desc": "",
"desc": "<p> <\/p>\n\n<p><strong>Why we love it:<\/strong><\/p>\n\n<p>Features peppery heat that’s awesome with wings or pulled pork, and its thinner consistency makes it a great choice for marinating, too.<\/p>\n\n<p>Spicy, peppery sauce with that works as marinade or sauce<\/p>\n\n<p>Great on everything from chicken and pork to beef<\/p>\n\n<p><br \/>\n<strong>What you need to know:<\/strong><\/p>\n\n<p>1 x Traeger Texas Spicy BBQ Sauce 16oz<\/p>\n\n<p>Size: 16oz \/ 473ml<\/p>\n",
"tax_class": 1,
"additional_prices": [
],
"categories": {
"default": {
"href": "\/categories\/24001.json",
"id": 24001
},
"2": null,
"3": null,
"4": null,
"5": null
},
"date_added": "2023-07-25T17:31:44",
"date_modified_admin": "2023-07-25T18:07:10",
"date_modified_api": null,
"sort_order": 0,
"custom_sort_order": {
"featured": 0,
"special": 0
},
"delivery": {
"costs_to_zones": [
],
"free_delivery": 0,
"free_delivery_zone": 0
},
"manufacturer": null,
"stock": {
"qty": 1980,
"options_group_use_as_stock": "",
"pack_qty": 1,
"alert_qty": "",
"stop_qty": "",
"back_in_stock_date": ""
},
"marketing_site_link": "",
"hide_prices": false,
"is_enquiry_only": false,
"banner_text": "",
"banner_color": "#",
"model_3d_image_path": "",
"model_3d_image_path_ios": "",
"download": null,
"additional_downloads": [
],
"options": [
{
"id": 12347,
"group": "Multi Pack",
"desc": "Yes",
"code": "",
"price": "4.20",
"special_price": "",
"weight": "",
"stock_qty": 981,
"sort_order": 1,
"hidden": false,
"gtin": "",
"cost": "",
"sync_key": "RGe0x2",
"group_prices": {
},
"group_special_prices": {
}
},
{
"id": 12348,
"group": "Multi Pack",
"desc": "No",
"code": "",
"price": "0.00",
"special_price": "",
"weight": "",
"stock_qty": 999,
"sort_order": 2,
"hidden": false,
"gtin": "",
"cost": "",
"sync_key": "Rr09B2",
"group_prices": {
},
"group_special_prices": {
}
},
{
"id": 12349,
"group": "Saver Discount",
"desc": "Yes",
"code": "",
"price": "1.20",
"special_price": "",
"weight": "",
"stock_qty": 1980,
"sort_order": 3,
"hidden": false,
"gtin": "",
"cost": "",
"sync_key": "E49NjR",
"group_prices": {
},
"group_special_prices": {
}
}
],
"attributes": [
],
"weight": "",
"youtube_clip": "",
"videos": [
],
"cost_price": "",
"is_digital": false,
"is_addon_product": false,
"is_discontinued": false,
"exclude_from_api_webhook": false,
"triggers_event_system": true,
"special_offer_start_date": null,
"special_offer_end_date": null,
"meta_title": "",
"meta_keywords": "",
"meta_description": "",
"exclude_from_google_base": false,
"google_product_category": "",
"purchase_event": null,
"bundle": {
"sync_stock_with_components": false,
"sync_price_with_components": false,
"sync_cost_with_components": false,
"sync_weight_with_components": false,
"is_bundle": false,
"assembly_instructions": "",
"assembly_bin_location": ""
},
"launch_date": "0000-00-00 00:00:00",
"launch_status": "live",
"packaging_type_id": 1,
"tags": {
"Design": [
],
"Warnings": [
],
"Colours": [
],
"Season": [
],
"Product Ranges": [
],
"No products match this group": [
],
"Forge Example": [
]
},
"associations": [
],
"alternatives": [
],
"addons": [
],
"components": [
],
"variations": [
{
"code": "Sauce-1105410-yes-yes",
"prev_codes": "",
"stock": 981,
"cost": "",
"options": {
"Multi Pack": "Yes",
"Saver Discount": "Yes"
}
},
{
"code": "Sauce-1105410-no-yes",
"prev_codes": "",
"stock": 999,
"cost": "",
"options": {
"Multi Pack": "No",
"Saver Discount": "Yes"
}
}
]
}</code></pre>
<p id="responses--error">Example error response: <small>HTTP status also reflects the error status</small></p>
<pre><code class="language-json hljs">{
"errors": [
{
"status": 404,
"message": "Product not found"
}
]
}</code></pre>
<p id="responses--order">Specific order example JSON:</p>
<pre><code class="language-json hljs">{
"href": "\/orders\/112312.json",
"id": 112312,
"invoice_id": 825,
"session_id": "s.64bf9a63f18ea5.12594747",
"start_date": "2023-07-26T00:03:07",
"payment_date": "2023-07-26T00:03:59",
"payment_method": {
"href": "\/payment-methods\/58.json",
"id": 58,
"name": "PayPal Express Checkout"
},
"payment_data": {
"verify_sign": "",
"payer_id": "",
"payer_status": ""
},
"status": "Payment Received",
"user": {
"href": "\/users\/123.json",
"id": 123,
"full_name": "Bob Smith",
"membership_code": "",
"email": "bob@smithnet.co.uk",
"billing_address": {
"recipient_name": "Bob Smith",
"business_name": "",
"line_1": "12 Fake Street",
"line_2": "",
"town": "Worcester",
"region": {
"href": "\/regions\/244.json",
"country": "United States",
"county": "Alabama"
},
"post_code": "WR1 1AB",
"tel_no": "07123456789",
"mobile_tel_no": "",
"fax_no": ""
}
},
"delivery_address": {
"recipient_name": "Bob Smith",
"business_name": "",
"line_1": "12 Fake Street",
"line_2": "",
"town": "Worcester",
"region": {
"href": "\/regions\/243.json",
"country": "UK",
"county": "Worcestershire"
},
"post_code": "WR1 1AB",
"tel_no": "07123456789",
"mobile_tel_no": "",
"fax_no": ""
},
"tracking": {
"medium": "direct",
"source": "",
"term": "",
"using_stored_data": 0
},
"totals": {
"qty": 3,
"price": "0.00",
"vat": "25.70",
"weight": 0,
"delivery": "0.00"
},
"lines": [
{
"id": 19990,
"line_rel_id": 19988,
"line_type": "OPTION",
"line_desc": "Saver Discount - Yes ",
"rel_data": {
"option": {
"href": "\/options\/12349.json",
"id": 12349,
"group": "Saver Discount",
"desc": "Yes",
"code": "",
"product": {
"href": "\/products\/58661.json",
"id": 58661
}
}
},
"status": "Payment Received",
"qty": 1,
"price": "0.00",
"vat": "0.00",
"vat_percentage": 20,
"each_price_ex_vat": 0,
"each_price_vat": 0,
"each_price_discount_ex_vat": "0.00",
"each_price_discount_vat": 0,
"weight": 0
},
{
"id": 19989,
"line_rel_id": 19988,
"line_type": "OPTION",
"line_desc": "Multi Pack - Yes ",
"rel_data": {
"option": {
"href": "\/options\/12347.json",
"id": 12347,
"group": "Multi Pack",
"desc": "Yes",
"code": "",
"product": {
"href": "\/products\/58661.json",
"id": 58661
}
}
},
"status": "Payment Received",
"qty": 1,
"price": "0.00",
"vat": "0.00",
"vat_percentage": 20,
"each_price_ex_vat": 0,
"each_price_vat": 0,
"each_price_discount_ex_vat": "0.00",
"each_price_discount_vat": 0,
"weight": 0
},
{
"id": 19988,
"line_rel_id": 0,
"line_type": "PRODUCT",
"line_desc": "Traeger Texas Spicy BBQ Sauce 16oz - Sauce-1105410-yes-yes",
"rel_data": {
"product": {
"href": "\/products\/58661.json",
"id": 58661,
"name": "Traeger Texas Spicy BBQ Sauce 16oz",
"code": "Sauce-1105410-yes-yes"
}
},
"status": "Payment Received",
"qty": 1,
"price": "137.40",
"vat": "22.90",
"vat_percentage": 20,
"each_price_ex_vat": 114.5,
"each_price_vat": 22.900000000000006,
"each_price_discount_ex_vat": "0.00",
"each_price_discount_vat": 0,
"weight": 0
},
{
"id": 19991,
"line_rel_id": 0,
"line_type": "PRODUCT",
"line_desc": "Tubby Tom's The Squealer Hot Sauce 150g - Sauce-997706",
"rel_data": {
"product": {
"href": "\/products\/58662.json",
"id": 58662,
"name": "Tubby Tom's The Squealer Hot Sauce 150g",
"code": "Sauce-997706"
}
},
"status": "Payment Received",
"qty": 2,
"price": "16.80",
"vat": "2.80",
"vat_percentage": 20,
"each_price_ex_vat": 7,
"each_price_vat": 1.4000000000000004,
"each_price_discount_ex_vat": "0.00",
"each_price_discount_vat": 0,
"weight": 0
},
{
"id": 19992,
"line_rel_id": 0,
"line_type": "DELIVERY",
"line_desc": "Standard",
"rel_data": {
"delivery": {
"href": "\/delivery-methods\/1.json",
"id": 1,
"name": "Standard"
}
},
"status": "Payment Received",
"qty": 1,
"price": "0.00",
"vat": "0.00",
"vat_percentage": 20,
"each_price_ex_vat": 0,
"each_price_vat": 0,
"each_price_discount_ex_vat": 0,
"each_price_discount_vat": 0,
"weight": 0
},
{
"id": 19995,
"line_rel_id": 0,
"line_type": "COUPON",
"line_desc": "Gift Voucher for £400.00 - C46K13i8",
"rel_data": {
"coupon": {
"href": "\/coupons\/72.json",
"id": 72,
"name": "Gift Voucher for £400.00",
"code": "C46K13i8"
}
},
"status": "Payment Received",
"qty": 1,
"price": "-154.20",
"vat": "0.00",
"vat_percentage": 0,
"each_price_ex_vat": -154.2,
"each_price_vat": 0,
"each_price_discount_ex_vat": 0,
"each_price_discount_vat": 0,
"weight": 0
}
],
"is_free_delivery": false,
"customers_order_id": "",
"fob": "",
"required_by_date": "",
"purchase_order_number": "",
"delivery_note": ""
}</code></pre>
<p>We use HTTP status codes for responses (such as 200 for success, 201 for created, 204 for updated, 4XX statuses for bad requests such as 404 not found, 400 for missing requirements etc). We recommend using these in your implementation, however if your API client cannot handle these, you can surpress them to all return as 200 with <code>suppress_response_codes=true</code>.</p>
<p>Date format: ISO 8601 - Complete date plus hours, minutes and seconds YYYY-MM-DDTHH:MM:SS <small>(Timezone is the site timezone, e.g. Europe/London)</small></p>
<p>Encoding for all responses: UTF-8</p>
</section>
<section class="doc-section">
<header>
<h2 id="resources">Resources</h2>
</header>
<p>Here's a list of the API resources available under <code>/api/v1</code>:</p>
<div id="resources--blog-posts" class="endpoint">
<h3>Blog Posts</h3>
<ul>
<li class="request" data-http-method="GET" data-access="public">
<code class="request__url">/blog-posts</code>
<span class="request__info">List of blog posts</span>
<span class="request__filters">filters: <code>category</code> - category id</span>
</li>
<li class="request" data-http-method="GET" data-access="public">
<code class="request__url">/blog-posts/<strong>{id}</strong></code>
<span class="request__info">Retrieve a specific blog post</span>
</li>
</ul>
</div>
<div id="resources--categories" class="endpoint">
<h3>Categories</h3>
<ul>
<li class="request" data-http-method="GET" data-access="public">
<code class="request__url">/categories</code>
<span class="request__info">List collection of categories</span>
<span class="request__filters">filters: <code>parent</code> - filter by parent category id, <code>since_timestamp</code> (categories modified since timestamp, e.g. <code>?since_timestamp=1591970309</code> or <code>?since_timestamp=2020-06-11T07:45:02</code> - both accepted), <code>sort</code> (order to return products in - sort_order, id, live, updated, name)</span>
</li>
<li class="request" data-http-method="GET" data-access="public">
<code class="request__url">/categories/<strong>{id}</strong></code>
<span class="request__info">Retrieve data on a specific category</span>
</li>
</ul>
</div>
<div id="resources--coupons" class="endpoint">
<h3>Coupons</h3>
<ul>
<li class="request" data-http-method="GET" data-access="orders">
<code class="request__url">/coupons</code>
<span class="request__info">List collection of coupons</span>
</li>
<li class="request" data-http-method="GET" data-access="orders">
<code class="request__url">/coupons/<strong>{id}</strong></code>
<span class="request__info">Retrieve a specific coupon</span>
</li>
</ul>
</div>
<div id="resources--currency-converter" class="endpoint">
<h3>Currency Converter</h3>
<ul>
<li class="request" data-http-method="GET" data-access="public">
<code class="request__url">/currency-converter</code>
<span class="request__info">List currency exchange rates relative to the store's base currency</span>
</li>
</ul>
</div>
<div id="resources--custom-currency-rates" class="endpoint">
<h3>Custom Currency Rates</h3>
<ul>
<li class="request" data-http-method="GET" data-access="public">
<code class="request__url">/custom-currency-rates</code>
<span class="request__info">List custom currency rates configured for the store</span>
</li>
</ul>
</div>
<div id="resources--delivery-methods" class="endpoint">
<h3>Delivery Methods</h3>
<ul>
<li class="request" data-http-method="GET" data-access="orders">
<code class="request__url">/delivery-methods</code>
<span class="request__info">List collection of delivery methods</span>
</li>
<li class="request" data-http-method="GET" data-access="orders">
<code class="request__url">/delivery-methods/<strong>{id}</strong></code>
<span class="request__info">Retrieve a specific delivery method</span>
</li>
</ul>
</div>
<div id="resources--departments" class="endpoint">
<h3>Departments</h3>
<ul>
<li class="request" data-http-method="GET" data-access="public">
<code class="request__url">/departments</code>
<span class="request__info">List collection of departments</span>
</li>
<li class="request" data-http-method="GET" data-access="public">
<code class="request__url">/departments/<strong>{id}</strong></code>
<span class="request__info">Retrieve specific department</span>
</li>
</ul>
</div>
<div id="resources--downloads" class="endpoint">
<h3>Downloads</h3>
<ul>
<li class="endpoint__identifiers">identifiers: <code>id</code>, <code>srchash</code> - a sha1 of the initial location, if updated later the initial/previous srchash is maintained</li>
<li class="request" data-http-method="GET" data-access="content">
<code class="request__url">/downloads</code>
<span class="request__info">List collection of downloads</span>
<span class="request__filters">filters: <code>category</code> - filter downloads by category id, <code>ids</code> - filter downloads by a comma separated list of ids</span>
</li>
<li class="request" data-http-method="GET" data-access="content">
<code class="request__url">/downloads/<strong>{id}</strong></code>
<span class="request__info">Retrieve data on a specific download</span>
</li>
<li class="request" data-http-method="POST" data-access="content">
<code class="request__url">/downloads</code>
<span class="request__info">Batch create or update downloads</span>
<span class="request__requirements">required fields: <code>downloads</code> - array of download objects</span>
</li>
<li class="request" data-http-method="POST" data-access="content">
<code class="request__url">/downloads/<strong>{id}</strong></code>
<span class="request__info">Update a specific download</span>
<span class="request__requirements">required fields: <code>name</code>, <code>src</code></span>
</li>
<li class="request" data-http-method="DELETE" data-access="content">
<code class="request__url">/downloads</code>
<span class="request__info">Batch delete downloads</span>
<span class="request__requirements">required fields: <code>ids</code> - comma separated list of ids to delete</span>
</li>
<li class="request" data-http-method="DELETE" data-access="content">
<code class="request__url">/downloads/<strong>{id}</strong></code>
<span class="request__info">Delete a specific download</span>
</li>
</ul>
</div>
<div id="resources--download-categories" class="endpoint">
<h3>Download categories</h3>
<ul>
<li class="request" data-http-method="GET" data-access="content">
<code class="request__url">/download-categories</code>
<span class="request__info">List collection of downloads categories</span>
</li>
<li class="request" data-http-method="GET" data-access="content">
<code class="request__url">/download-categories/<strong>{id}</strong></code>
<span class="request__info">Retrieve data on a specific download category</span>
</li>
</ul>
</div>
<div id="resources--forms" class="endpoint">
<h3>Forms</h3>
<ul>
<li class="endpoint__identifiers">Only forms with API access enabled are returned.</li>
<li class="request" data-http-method="GET" data-access="forms">
<code class="request__url">/forms</code>
<span class="request__info">List of API-enabled forms</span>
</li>
<li class="request" data-http-method="GET" data-access="forms">
<code class="request__url">/forms/<strong>{id}</strong></code>
<span class="request__info">Retrieve a specific form including its sections and fields</span>
</li>
<li class="request" data-http-method="GET" data-access="forms">
<code class="request__url">/forms/<strong>{id}</strong>/responses</code>
<span class="request__info">Paginated list of responses for a form (ordered latest first)</span>
<span class="request__filters">filters: <code>limit</code>, <code>offset</code></span>
</li>
<li class="request" data-http-method="GET" data-access="forms">
<code class="request__url">/forms/<strong>{id}</strong>/responses/<strong>{responseId}</strong></code>
<span class="request__info">Retrieve a specific form response including field values</span>
</li>
</ul>
</div>
<div id="resources--gallery" class="endpoint">
<h3>Gallery</h3>
<ul>
<li class="request" data-http-method="GET" data-access="public">
<code class="request__url">/gallery</code>
<span class="request__info">List of gallery images</span>
<span class="request__filters">filters: <code>album</code> - filter gallery images by album id</span>