As you probably know, eCommerce portal with OAuth2 development can be broken up into three main areas:
- Setup eCommerce portal using OpenCart
- Installing vQmod extension for OpenCart
- Add REST API with OAuth2.0 to OpenCart
Setup eCommerce portal using OpenCart
Setup eCommerce portal using OpenCart. Here is a link for reference.
Installing vQmod extension for OpenCart
“vQmod” (aka Virtual Quick Mod) is an override system designed to avoid having to change OpenCart core files.
How to install vQmod using Autoinstaller
1) Download the latest version that has “opencart” in the title from the download area.
- Using FTP, upload the “vqmod” folder from the zip to the root of your opencart store.
- Be sure the vqmod folder and the vqmod/vqcache folders are writable (either 755 or 777).
- Also be sure index.php and admin/index.php are writable.
- If you’re not sure, then try 755.
- If you get errors about permissions, then try 777.
- Also be sure index.php and admin/index.php are writable.
NOTE: 777 permissions are dangerous and should only be used as a last resort. If your hosting requires this, consult your hosting to let them know this shouldn’t be necessary
- Goto http://www.yoursite.com/vqmod/install
- You should get a success message. If not, check the above permissions, and try again
- Load your store homepage and verify that it works.
- Using FTP, verify that there are new “vq” files in the “vqmod/vqcache” folder.
- If yes, then you are ready to start downloading or creating vQmod scripts, otherwise ask for assistance.
Done!
- DO NOT DELETE THE INSTALL FOLDER!
- YOU MUST RUN THE INSTALLER EVERY TIME YOU UPGRADE OPENCART!!
- THERE IS NO DANGER OF RE-RUNNING THE INSTALLER!
How to install vQmod manually?
1) Download the latest version that has “OpenCart” in the title.
- Using FTP, upload the “vqmod” folder from the zip to the root of your OpenCart store.
- Be sure the vqmod folder and the vqmod/vqcache folders are writable (either 755 or 777).
- Also be sure index.php and admin/index.php are writable.
- If not sure which you need, first try 755.
- If you get errors about permissions, then try 777.
- Also be sure index.php and admin/index.php are writable.
- Edit your index.php file.
- FIND
123456789101112// Startuprequire_once(DIR_SYSTEM . ‘startup.php’);// Application Classesrequire_once(DIR_SYSTEM . ‘library/customer.php’);require_once(DIR_SYSTEM . ‘library/currency.php’);require_once(DIR_SYSTEM . ‘library/tax.php’);require_once(DIR_SYSTEM . ‘library/weight.php’);require_once(DIR_SYSTEM . ‘library/length.php’);require_once(DIR_SYSTEM . ‘library/cart.php’);require_once(DIR_SYSTEM . ‘library/affiliate.php’); - REPLACE WITH
12345678910111213141516// vQmodrequire_once(‘./vqmod/vqmod.php’);VQMod::bootup();// VQMODDED Startuprequire_once(VQMod::modCheck(DIR_SYSTEM . ‘startup.php’));// Application Classesrequire_once(VQMod::modCheck(DIR_SYSTEM . ‘library/customer.php’));require_once(VQMod::modCheck(DIR_SYSTEM . ‘library/currency.php’));require_once(VQMod::modCheck(DIR_SYSTEM . ‘library/tax.php’));require_once(VQMod::modCheck(DIR_SYSTEM . ‘library/weight.php’));require_once(VQMod::modCheck(DIR_SYSTEM . ‘library/length.php’));require_once(VQMod::modCheck(DIR_SYSTEM . ‘library/cart.php’));require_once(VQMod::modCheck(DIR_SYSTEM . ‘library/affiliate.php’));
Note the affiliate library file may not exist on older systems. Basically any require_once(DIR_SYSTEM . 'library/xxxxxxxx.php');
needs to be changed to use the VQMod::modCheck
above in the same format. This also applies to any additional require_once files in the next step
- Edit your admin/index.php file
- FIND
123456789// Startuprequire_once(DIR_SYSTEM . ‘startup.php’);// Application Classesrequire_once(DIR_SYSTEM . ‘library/currency.php’);require_once(DIR_SYSTEM . ‘library/user.php’));require_once(DIR_SYSTEM . ‘library/weight.php’);require_once(DIR_SYSTEM . ‘library/length.php’); - REPLACE WITH
12345678910111213// vQmodrequire_once(‘../vqmod/vqmod.php’);VQMod::bootup();// VQMODDED Startuprequire_once(VQMod::modCheck(DIR_SYSTEM . ‘startup.php’));// Application Classesrequire_once(VQMod::modCheck(DIR_SYSTEM . ‘library/currency.php’));require_once(VQMod::modCheck(DIR_SYSTEM . ‘library/user.php’));require_once(VQMod::modCheck(DIR_SYSTEM . ‘library/weight.php’));require_once(VQMod::modCheck(DIR_SYSTEM . ‘library/length.php’)); - Load your store homepage and verify if it works.
- Using FTP, verify that there are new “vq” files in the “vqmod/vqcache” folder.
- If yes, then you are ready to start downloading or creating vQmod scripts.
Done!
Add REST API with OAuth2.0 to OpenCart
OpenCart Rest API is a full featured API that allows you to set up your own rest services within minutes.
You can download it here.
The upload folder contains all files for this module.
You will notice that the folders are in the same structure as your OpenCart installation.
1. Navigate to your opencart root folder using an FTP program.
2. Upload all folders of extension to your opencart installation folder.
3. Execute these SQL statements in phpMyAdmin or whatever client you use for managing your database.
1
2
3
4
5
|
CREATE TABLE oauth_clients (client_id VARCHAR(80) NOT NULL, client_secret VARCHAR(80) NOT NULL, redirect_uri VARCHAR(2000) NOT NULL, grant_types VARCHAR(80), scope VARCHAR(100), user_id VARCHAR(80), CONSTRAINT clients_client_id_pk PRIMARY KEY (client_id));
CREATE TABLE oauth_access_tokens (access_token VARCHAR(40) NOT NULL, client_id VARCHAR(80) NOT NULL, user_id VARCHAR(255), expires TIMESTAMP NOT NULL, scope VARCHAR(2000), session_id VARCHAR(40), data TEXT, CONSTRAINT access_token_pk PRIMARY KEY (access_token));
CREATE TABLE oauth_scopes (scope TEXT, is_default BOOLEAN);
|
4. Go to your admin area in Extensions->Modules and enable your REST API extension.
You have to fill the Order id field (you can find it in the order email)
You have to fill the client id, client secret fields and TTL. This is needed for authentication with the API.
5. Paste into your opencart root folder .htaccess file after “RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]”
RewriteRule .* – [E=HTTP_Authorization:%{HTTP:Authorization}]
6. Paste into your opencart root folder .htaccess file after “RewriteBase /”
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
|
####################################### OPENCART RESTFUL API START #################################################
#REST API get token
RewriteRule ^api/rest/oauth2/token/?([a–zA–Z0–9_]+) index.php?route=feed/rest_api/gettoken&grant_type=$1 [L]
#REST API get token
RewriteRule ^api/rest/oauth2/token index.php?route=feed/rest_api/gettoken [L]
#REST API database tables checksum
RewriteRule ^api/rest/checksums index.php?route=feed/rest_api/getchecksum [L]
####################################### OPENCART UTC OFFSET #################################################
#REST API UTC and server time offset in seconds
RewriteRule ^api/rest/utc_offset index.php?route=feed/rest_api/utc_offset [L]
####################################### OPENCART ORDER STATUSES #################################################
#REST API List order statuses
RewriteRule ^api/rest/order_statuses index.php?route=feed/rest_api/order_statuses [L]
#######################################PRODUCT######################################################################
#REST API product custom search pager
RewriteRule ^api/rest/products/custom_search/limit/?([0–9]+)/page/?([0–9]+) index.php?route=feed/rest_api/search&limit=$1&page=$2 [L]
#REST API product custom search
RewriteRule ^api/rest/products/custom_search index.php?route=feed/rest_api/search[L]
RewriteRule ^api/rest/products/search/?([a–zA–Z0–9\s]+)/sort/?([a–zA–Z]+)/order/?([a–zA–Z]+) index.php?route=feed/rest_api/products&search=$1&sort=$2&order=$3 [L]
RewriteRule ^api/rest/products/search/?([a–zA–Z0–9\s]+)/sort/?([a–zA–Z]+) index.php?route=feed/rest_api/products&search=$1&sort=$2 [L]
RewriteRule ^api/rest/products/category/?([0–9]+)/sort/?([a–zA–Z]+)/order/?([a–zA–Z]+) index.php?route=feed/rest_api/products&category=$1&sort=$2&order=$3 [L]
RewriteRule ^api/rest/products/category/?([0–9]+)/sort/?([a–zA–Z]+) index.php?route=feed/rest_api/products&category=$1&sort=$2 [L]
RewriteRule ^api/rest/products/sort/?([a–zA–Z]+)/order/?([a–zA–Z]+) index.php?route=feed/rest_api/products&sort=$1&order=$2 [L]
RewriteRule ^api/rest/products/sort/?([a–zA–Z]+) index.php?route=feed/rest_api/products&sort=$1 [L]
#REST API add review
RewriteRule ^api/rest/products/?([0–9]+)/review index.php?route=feed/rest_api/reviews&id=$1 [L]
#REST API product search pager
RewriteRule ^api/rest/products/search/?([a–zA–Z0–9\s]+)/limit/?([0–9]+)/page/?([0–9]+) index.php?route=feed/rest_api/products&search=$1&limit=$2&page=$3 [L]
#REST API product search
RewriteRule ^api/rest/products/search/?([a–zA–Z0–9\s]+) index.php?route=feed/rest_api/products&search=$1 [L]
#REST API product pager
RewriteRule ^api/rest/products/limit/?([0–9]+)/page/?([0–9]+) index.php?route=feed/rest_api/products&limit=$1&page=$2 [L]
#REST API product per category pager
RewriteRule ^api/rest/products/category/?([0–9]+)/limit/?([0–9]+)/page/?([0–9]+) index.php?route=feed/rest_api/products&category=$1&limit=$2&page=$3 [L]
#REST API products per category
RewriteRule ^api/rest/products/category/?([0–9]+) index.php?route=feed/rest_api/products&category=$1 [L]
#REST API selected product
RewriteRule ^api/rest/products/?([0–9]+) index.php?route=feed/rest_api/products&id=$1 [L]
#REST API product per manufacturer pager
RewriteRule ^api/rest/products/manufacturer/?([0–9]+)/limit/?([0–9]+)/page/?([0–9]+) index.php?route=feed/rest_api/products&manufacturer=$1&limit=$2&page=$3 [L]
#REST API products per manufacturer
RewriteRule ^api/rest/products/manufacturer/?([0–9]+) index.php?route=feed/rest_api/products&manufacturer=$1 [L]
#REST API products
RewriteRule ^api/rest/products index.php?route=feed/rest_api/products [L]
#REST API simple products
RewriteRule ^api/rest/products/simple index.php?route=feed/rest_api/products&simple=1 [L]
#REST API get featured products limit
RewriteRule ^api/rest/featured/limit/?([0–9]+) index.php?route=feed/rest_api/featured&limit=$1 [L]
#REST API get featured products
RewriteRule ^api/rest/featured index.php?route=feed/rest_api/featured [L]
#REST API get product classes
RewriteRule ^api/rest/product_classes index.php?route=feed/rest_api/productclasses [L]
#REST API bestsellers
RewriteRule ^api/rest/bestsellers/limit/?([0–9]+) index.php?route=feed/rest_api/bestsellers&limit=$1 [L]
#REST API bestsellers
RewriteRule ^api/rest/bestsellers index.php?route=feed/rest_api/bestsellers [L]
#REST API filters
RewriteRule ^api/rest/filters/id/?([0–9]+) index.php?route=feed/rest_api/filters&id=$1 [L]
#REST API related
RewriteRule ^api/rest/related/?([0–9]+) index.php?route=feed/rest_api/related&id=$1 [L]
#REST API latest
RewriteRule ^api/rest/latest/limit/?([0–9]+) index.php?route=feed/rest_api/latest&limit=$1 [L]
RewriteRule ^api/rest/latest index.php?route=feed/rest_api/latest [L]
#REST API banners
RewriteRule ^api/rest/banners/?([0–9]+) index.php?route=feed/rest_api/banners&id=$1 [L]
RewriteRule ^api/rest/banners index.php?route=feed/rest_api/banners [L]
#######################################CATEGORY####################################################################
#REST API categories filter parent and level
RewriteRule ^api/rest/categories/parent/?([0–9]+)/level/?([0–9]+) index.php?route=feed/rest_api/categories&parent=$1&level=$2 [L]
#REST API categories filter level
RewriteRule ^api/rest/categories/level/?([0–9]+) index.php?route=feed/rest_api/categories&level=$1 [L]
#REST API categories filter parent
RewriteRule ^api/rest/categories/parent/?([0–9]+) index.php?route=feed/rest_api/categories&parent=$1 [L]
#REST API selected category
RewriteRule ^api/rest/categories/?([0–9]+) index.php?route=feed/rest_api/categories&id=$1 [L]
#REST API categories
RewriteRule ^api/rest/categories index.php?route=feed/rest_api/categories [L]
#######################################SLIDESHOW####################################################################
#REST API get slideshows
RewriteRule ^api/rest/slideshows index.php?route=feed/rest_api/slideshows [L]
#######################################MANUFACTURER#################################################################
#REST API selected manufacturer
RewriteRule ^api/rest/manufacturers/?([0–9]+) index.php?route=feed/rest_api/manufacturers&id=$1 [L]
#REST API manufacturers
RewriteRule ^api/rest/manufacturers index.php?route=feed/rest_api/manufacturers [L]
#######################################ORDERS######################################################################
#REST API order history
RewriteRule ^api/rest/orderhistory/?([0–9]+) index.php?route=feed/rest_api/orderhistory&id=$1 [L]
#REST API selected orders
#RewriteRule ^api/rest/orders/?([0-9]+) index.php?route=feed/rest_api/orders&id=$1 [L]
#REST API Orders with details filter by date_added range
#RewriteRule ^api/rest/orders/details/added_from/([^/]+)/added_to/([^/]+)/?$ index.php?route=feed/rest_api/listorderswithdetails&filter_date_added_from=$1&filter_date_added_to=$2 [L]
#REST API Orders with details filter by date_added from till now
#RewriteRule ^api/rest/orders/details/added_from/([^/]+)/?$ index.php?route=feed/rest_api/listorderswithdetails&filter_date_added_from=$1 [L]
#REST API Orders with details filter by date_added on
#RewriteRule ^api/rest/orders/details/added_on/([^/]+)/?$ index.php?route=feed/rest_api/listorderswithdetails&filter_date_added_on=$1 [L]
#REST API Orders with details filter by date_modified range
#RewriteRule ^api/rest/orders/details/modified_from/([^/]+)/modified_to/([^/]+)/?$ index.php?route=feed/rest_api/listorderswithdetails&filter_date_modified_from=$1&filter_date_modified_to=$2 [L]
#REST API Orders with details filter by date_modified from till now
#RewriteRule ^api/rest/orders/details/modified_from/([^/]+)/?$ index.php?route=feed/rest_api/listorderswithdetails&filter_date_modified_from=$1 [L]
#REST API Orders with details filter by date_modified on
#RewriteRule ^api/rest/orders/details/modified_on/([^/]+)/?$ index.php?route=feed/rest_api/listorderswithdetails&filter_date_modified_on=$1 [L]
#REST API Orders with details filter by status
#RewriteRule ^api/rest/orders/details/status/([0-9,?:,]+) index.php?route=feed/rest_api/listorderswithdetails&filter_order_status_id=$1 [L]
#REST API Orders with details
#RewriteRule ^api/rest/orders/details index.php?route=feed/rest_api/listorderswithdetails [L]
#REST API update order status
#RewriteRule ^api/rest/order_status/?([0-9]+) index.php?route=feed/rest_api/orderstatus&id=$1 [L]
#REST API update orders
#RewriteRule ^api/rest/orders/?([0-9]+) index.php?route=feed/rest_api/orders&id=$1 [L]
#REST API delete orders
#RewriteRule ^api/rest/orders/?([0-9]+) index.php?route=feed/rest_api/orders&id=$1 [L]
#REST API Orders filtered by user
RewriteRule ^api/rest/orders/user/?([0–9]+) index.php?route=feed/rest_api/userorders&user=$1 [L]
#REST API orders
RewriteRule ^api/rest/orders index.php?route=feed/rest_api/orders [L]
#######################################CUSTOMERS##################################################################
#REST API selected customers
RewriteRule ^api/rest/customers/?([0–9]+) index.php?route=feed/rest_api/customers&id=$1 [L]
#REST API customers
RewriteRule ^api/rest/customers index.php?route=feed/rest_api/customers [L]
#######################################LANGUAGES#################################################################
#REST API selected language
RewriteRule ^api/rest/languages/?([0–9]+) index.php?route=feed/rest_api/languages&id=$1 [L]
#REST API languages
RewriteRule ^api/rest/languages index.php?route=feed/rest_api/languages [L]
##############################################STORE###############################################################
#REST API selected store
RewriteRule ^api/rest/stores/?([0–9]+) index.php?route=feed/rest_api/stores&id=$1 [L]
#REST API stores
RewriteRule ^api/rest/stores index.php?route=feed/rest_api/stores [L]
#######################################COUNTRY###################################################################
#REST API selected country
RewriteRule ^api/rest/countries/?([0–9]+) index.php?route=feed/rest_api/countries&id=$1 [L]
#REST API countries
RewriteRule ^api/rest/countries index.php?route=feed/rest_api/countries [L]
#######################################SESSION#####################################################################
#REST API get session
RewriteRule ^api/rest/session index.php?route=feed/rest_api/session [L]
#######################################CART####################################################
#REST API cart bulk functions
RewriteRule ^api/rest/cart_bulk index.php?route=rest/cart/bulkcart [L]
#REST API empty cart
RewriteRule ^api/rest/cart/empty index.php?route=rest/cart/emptycart [L]
#REST API delete cart item by id
RewriteRule ^api/rest/cart/?([0–9]+) index.php?route=rest/cart/deletecartitembyid&id=$1 [L]
#REST API cart
RewriteRule ^api/rest/cart index.php?route=rest/cart/cart [L]
#######################################CUSTOMERS####################################################
#REST API registration
RewriteRule ^api/rest/register index.php?route=rest/register/register [L]
#REST API login
RewriteRule ^api/rest/login index.php?route=rest/login/login [L]
#REST API logout
RewriteRule ^api/rest/logout index.php?route=rest/logout/logout [L]
#REST API forgotten password
RewriteRule ^api/rest/forgotten index.php?route=rest/forgotten/forgotten [L]
#######################################VOUCHER####################################################
#REST API add voucher
RewriteRule ^api/rest/voucher index.php?route=rest/cart/voucher [L]
#######################################COUPON####################################################
#REST API add coupon
RewriteRule ^api/rest/coupon index.php?route=rest/cart/coupon [L]
#######################################REWARD#####################################################
#REST API add reward
RewriteRule ^api/rest/reward index.php?route=rest/cart/reward [L]
#######################################GUEST SHIPPING ####################################################
#REST API payment methods
RewriteRule ^api/rest/guestshipping index.php?route=rest/guest_shipping/guestshipping [L]
#######################################GUEST####################################################
#REST API guest
RewriteRule ^api/rest/guest index.php?route=rest/guest/guest [L]
#######################################PAYMENT METHOD####################################################
#REST API payment methods
RewriteRule ^api/rest/paymentmethods index.php?route=rest/payment_method/payments [L]
#######################################PAYMENT ADDRESS####################################################
#REST API payment methods
RewriteRule ^api/rest/paymentaddress index.php?route=rest/payment_address/paymentaddress [L]
#######################################SHIPPING ADDRESS####################################################
#REST API shipping methods
RewriteRule ^api/rest/shippingaddress index.php?route=rest/shipping_address/shippingaddress [L]
#######################################SHIPPING METHOD####################################################
#REST API payment methods
RewriteRule ^api/rest/shippingmethods index.php?route=rest/shipping_method/shippingmethods [L]
#######################################ZONE####################################################
#REST API get zones
RewriteRule ^api/rest/zone/?([0–9]+) index.php?route=rest/guest/zone&country_id=$1 [L]
#######################################CHECKOUT CONFIRM############################################
#REST API confirm and save order
RewriteRule ^api/rest/confirm index.php?route=rest/confirm/confirm [L]
#######################################CHECKOUT CONFIRM SIMPLE############################################
#REST API confirm and save order
RewriteRule ^api/rest/simpleconfirm index.php?route=rest/simple_confirm/confirm [L]
#######################################CHECKOUT USERDATA TEST ############################################
#REST API check user data
RewriteRule ^api/rest/checkuser index.php?route=rest/login/checkuser [L]
####################################### CUSTOMER ORDERS ####################################################
RewriteRule ^api/rest/customerorders/?([0–9]+)/product_id/?([0–9]+) index.php?route=rest/order/orders&id=$1&order_product_id=$2 [L]
#REST API customer orders details or reorder
RewriteRule ^api/rest/customerorders/?([0–9]+) index.php?route=rest/order/orders&id=$1 [L]
#REST API customer orders
RewriteRule ^api/rest/customerorders index.php?route=rest/order/orders [L]
#######################################CHANGE PASSWORD####################################################
RewriteRule ^api/rest/account/address/?([0–9]+) index.php?route=rest/account/address&id=$1 [L]
#REST API address method
RewriteRule ^api/rest/account/address index.php?route=rest/account/address [L]
#REST API change password method
RewriteRule ^api/rest/account/password index.php?route=rest/account/password [L]
#######################################GUEST ACCOUNT ####################################################
#REST API account methods
RewriteRule ^api/rest/account index.php?route=rest/account/account [L]
#REST API account custom fields
RewriteRule ^api/rest/customfield index.php?route=rest/account/customfield [L]
#######################################WISHLIST####################################################
#REST API add product to wishlist or delete from wishlist
RewriteRule ^api/rest/wishlist/?([0–9]+) index.php?route=rest/wishlist/wishlist&id=$1 [L]
#REST API wishlist
RewriteRule ^api/rest/wishlist index.php?route=rest/wishlist/wishlist [L]
#######################################START PAYMENT############################################
#REST API START PAYMENT PROCESS
RewriteRule ^api/rest/pay/access_token/?([a–zA–Z0–9]+) index.php?route=rest/confirm/confirm&page=pay&access_token=$1 [L]
RewriteRule ^api/rest/pay index.php?route=rest/confirm/confirm&page=pay [L]
#######################################Contact##############################
#REST API contact
RewriteRule ^api/rest/contact index.php?route=rest/contact/send [L]
#######################################INFORMATION#################################################################
#REST API selected information
RewriteRule ^api/rest/information/?([0–9]+) index.php?route=feed/rest_api/information&id=$1 [L]
#REST API information
RewriteRule ^api/rest/information index.php?route=feed/rest_api/information [L]
#######################################Returns##############################
#REST API selected return
RewriteRule ^api/rest/returns/?([0–9]+) index.php?route=rest/return/returns&id=$1 [L]
#REST API returns
RewriteRule ^api/rest/returns index.php?route=rest/return/returns [L]
#######################################NEWSLETTER#################################################################
#REST API newsletter
RewriteRule ^api/rest/newsletter/subscribe index.php?route=rest/account/newsletter&subscribe=1 [L]
RewriteRule ^api/rest/newsletter/unsubscribe index.php?route=rest/account/newsletter&subscribe=0 [L]
#######################################OPENCART RESTFUL API V2 END####################################
|
Now we’re able to run Mobile Apps using our own E-Commerce website REST and OAuth2.0 API.