API methods list :
Notes:
Now, what you can do with API?
DESCRIPTION:change session currency
PARAMS:
api_token
DATA:
currency:code from table oc_currency
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/currency', params={'token':'768ef1810185cd6562478f61d2'}, data={'currency':'USD'} )
DESCRIPTION:adding product to cart
PARAMS:
api_token
DATA:
product_id:product_id from table oc_cart
quantity:quantity from table oc_cart
option:option array from table oc_cart
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/cart/add', params={'token':'768ef1810185cd6562478f61d2'}, data={ 'product_id':'100' 'quantuty':'1' } )
DESCRIPTION:edit product quantity in cart
PARAMS:
api_token
DATA:
key:cart_id from table oc_cart
quantity:quantity from table oc_cart
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/cart/edit', params={'token':'768ef1810185cd6562478f61d2'}, data={ 'key':'10' 'quantuty':'2' } )
DESCRIPTION:removing product from cart
PARAMS:
api_token
DATA:
key:cart_id from table oc_cart
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/cart/remove', params={'token':'768ef1810185cd6562478f61d2'}, data={ 'key':'10' } )
DESCRIPTION:cart content
PARAMS:
api_token
DATA:
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/cart/products', params={'token':'768ef1810185cd6562478f61d2'}, data={} )
DESCRIPTION:apply existing coupon
PARAMS:
api_token
DATA:
coupon:code from oc_coupon;
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/coupon', params={'token':'768ef1810185cd6562478f61d2'}, data={ 'coupon':'2222' } )
DESCRIPTION:set customer for current session
PARAMS:
api_token
DATA:
firstname:
lastname:
email:
telephone:
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/customer', params={'token':'768ef1810185cd6562478f61d2'}, data={ 'firstname':'Dear', 'lastname':'Customer', 'email':'customer@example.com', 'telephone':'+1 879 2548022'} } )
DESCRIPTION:apply existing voucher
PARAMS:
api_token
DATA:
voucher:code from oc_voucher;
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/voucher', params={'token':'768ef1810185cd6562478f61d2'}, data={ 'voucher':'VOU-7271' } )
DESCRIPTION:add new voucher for current session
PARAMS:
api_token
DATA:
from_name:from_name from oc_voucher
from_email:from_email from oc_voucher
to_name:to_name from oc_voucher
to_email:to_email from oc_voucher
amount :amount from oc_voucher in selected currency
code :code from oc_voucher
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/voucher/add', params={'token':'768ef1810185cd6562478f61d2'}, data={ 'from_name':'MyOpenCart Admin' 'from_email':'admin@example.com' 'to_name':'Dear Customer' 'to_email':'customer@example.com' 'amount':'100' 'code':'VOU-7177' } )
DESCRIPTIONIPTION:set shipping address for current session
PARAMS:
api_token
DATA:
firstname
lastname
address_1
city
country_id
zone_id
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/shipping/address', params={'token':'768ef1810185cd6562478f61d2'}, data={ 'firstname':'Customer', 'lastname':'Dear', 'address_1':'Somewhere', 'city':'KLD', 'country_id':'RUS', 'zone_id':'KGD' } )
DESCRIPTION:returning avaliable shipping methods
PARAMS:
api_token
DATA:
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/shipping/methods', params={'token':'768ef1810185cd6562478f61d2'}, )
DESCRIPTION:set shipping method for current session
PARAMS:
api_token
DATA:
shipping_method
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/shipping/method', params={'token':'768ef1810185cd6562478f61d2'}, data={ 'shipping_method':'pickup.pickup' } )
DESCRIPTION:
PARAMS:
api_token
DATA:
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/reward', params={'token':'768ef1810185cd6562478f61d2'}, data={ } )
DESCRIPTION:
PARAMS:
api_token
DATA:
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/reward/maximum', params={'token':'768ef1810185cd6562478f61d2'}, data={ } )
DESCRIPTION:
PARAMS:
api_token
DATA:
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/reward/avaliable', params={'token':'768ef1810185cd6562478f61d2'}, data={ } )
DESCRIPTION:new order by cart content and payment/delivery information has beeen set by current session
PARAMS:
api_token
DATA:
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/order/add', params={'token':'768ef1810185cd6562478f61d2'}, )
DESCRIPTION:
PARAMS:
api_token
DATA:
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/order/edit', params={'token':'768ef1810185cd6562478f61d2'}, data={ } )
DESCRIPTION:
PARAMS:
api_token
DATA:
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/order/delete', params={'token':'768ef1810185cd6562478f61d2'}, data={ } )
DESCRIPTION:
PARAMS:
api_token
DATA:
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/order/info', params={'token':'768ef1810185cd6562478f61d2'}, data={ } )
DESCRIPTION:
PARAMS:
api_token
DATA:
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/order/history', params={'token':'768ef1810185cd6562478f61d2'}, data={ } )
DESCRIPTION:set payment address for this session
PARAMS:
api_token
DATA:
firstname
lastname
address_1
city
country_id
zone_id
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/payment/address', params={'token':'768ef1810185cd6562478f61d2'}, data={ 'firstname':'Customer', 'lastname':'Dear', 'address_1':'Somewhere', 'city':'KLD', 'country_id':'RUS', 'zone_id':'KGD' } )
DESCRIPTION:returning avaliable payment methods
PARAMS:
api_token
DATA:
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/payment/methods', params={'token':'768ef1810185cd6562478f61d2'}, )
DESCRIPTION:setting payment method of avaliable in api/payment/methods
PARAMS:
api_token
DATA:
payment_method
EXAMPLE:
session.post( 'http://example.com/index.php?route=api/payment/method', params={'token':'768ef1810185cd6562478f61d2'}, data={ 'payment_method':'bank_transfer' } )