Logo
maya API Documentation

Documentation of Opencart Shopping Cart REST API

Number of APIs: 116


For this demo, you can use the api key 123 to test the API services. Click on the Authorize button and set the secret key.

HEADER parameter nameDescription
X-Oc-Merchant-IdYou have to send an extra header parameter with the secret key
X-Oc-Merchant-LanguageChange the response language
X-Oc-CurrencyChange response currency.You can load all available currecies with this service: http://yourdomain.com/api/rest/product_classes
X-Oc-Image-DimensionChange the response image dimension. Possible values are: 1000x1000, 600x600, etc.
Change StoreIf you want to load the categories or products of selected store, you need to send 'store_id' as GET parameter(default store id = 0)


Checkout steps


Step 1GETapi/rest/sessionThe received session id needs to be added to every API call.
You have to send the received session id as an extra header parameter.
The extra header parameter name is X-Oc-Session.
Add item to cart, register / login or be a guest buyer
Create Guest user (only for guest checkout) POST api/rest/guest
Set shipping address to Guest user (only for guest checkout) POST api/rest/guestshipping
Step 2 (only for registered users)GETapi/rest/paymentaddressload the payment address of the customer
Step 3 (only for registered users)POSTapi/rest/paymentaddressset the payment address
Step 4 (only for registered users)GETapi/rest/shippingaddressload the shipping address of the customer.
Step 5 (only for registered users)POSTapi/rest/shippingaddressset the shipping address
Step 6GETapi/rest/shippingmethodsget all available shipping methods
Step 7POSTapi/rest/shippingmethodsset the shipping method
Step 8GETapi/rest/paymentmethodsget all available payment methods
Step 9POSTapi/rest/paymentmethodsset the payment method
Step 10POSTapi/rest/confirmget an overview of the order
Step 11GETapi/rest/payYou only need to call this service, if you want to start payment process in webview
Step 12PUTapi/rest/confirmUpdate order status, empty cart, and clear session data.


1. Get your session ID

GET {{baseUrl}}/session

The received session id needs to be added to every API call. You need to send as extra header parameter, the parameter's name is “X-Oc-Session“.
Service urls:
http://yourdomain.com/api/rest/session
OR
http://yourdomain.com/index.php?route=feed/rest_api/session



2. Create customer

POST {{baseUrl}}/register

Create a new customer and automatically logs in after registration is successful.
Service urls:
http://yourdomain.com/api/rest/register
OR
http://yourdomain.com/index.php?route=rest/register/register



3. Logs user into the system

POST {{baseUrl}}/login



4. Social login

POST {{baseUrl}}/sociallogin

Logs user into the system with email address. If the email address does not exist, new user will be created with the email address.
Service urls:
http://yourdomain.com/api/rest/sociallogin
OR
http://yourdomain.com/index.php?route=rest/login/socialLogin



5. Logs out current logged in user session

POST {{baseUrl}}/logout

ENDPOINTS