Logo
maya API Documentation

products

Number of APIs: 3


1. Get list of products

GET {{baseUrl}}/products

Service urls:
http://yourdomain.com/api/rest/products
OR
http://yourdomain.com/index.php?route=feed/rest_api/products

Search products with opencart rest api

You can combine filter parameters, you only need to use the long version of API urls.

You can combine these parameters:
  • - limit
  • - page
  • - start
  • - sort (sorty by name, model, quantity, rating, sort order, dateadded, datemodified, price)
  • - order (order by desc or asc)
  • - search (search keyword, search in product name, model, sku, upc, ean, jan, isbn, mpn)
  • - filterdescription (set this parameter 1, then the API will search in description too)
  • - filters
  • - manufacturer (manufacturer ID)
  • - category (category ID)
  • - filterdateaddedfrom, filterdateaddedto, filterdateaddedon
  • - filterdatemodifiedfrom, filterdatemodifiedto, filterdatemodifiedon
  • - subcategory (subcategory ID)
  • - tag

Example urls:
http://yourdomain.com/index.php?route=feed/rest
api/products&simple=1&customfields=id,name&search=ipod
http://yourdomain.com/index.php?route=feed/rest
api/products&sort=price&order=asc
http://yourdomain.com/index.php?route=feed/rest_api/products&sort=price&order=desc



2. Search products

POST {{baseUrl}}/products/custom_search/limit/:limit/page/:page

Search products, build your custom query.
Service urls:
http://yourdomain.com/api/rest/products/custom_search/limit/{limit}/page/{page}
OR
http://yourdomain.com/index.php?route=feed/rest_api/search&limit={limit}&page={page}

Supported fields

Field
category
quantity
stockstatus
manufacturer
model
upc
name
datestart
dateend
productid
price
filtertext

Comparison Operators

OperatorDescriptionExample
= Checks if the valuesof two operands are equal or not, if yes then condition becomes true. (a = b) is not true.
!= Checks if the values of two operands are equal ornot, if values are not equal then condition becomes true. (a != b) is true.
<>Checks if the values of two operands are equal or not, if valuesare not equal then condition becomes true. (a <> b) is true.
> Checks if the value of left operand is greater than the value of rightoperand, if yes then condition becomes true. (a > b) is not true.
< Checks if the value of left operand is less than the value of rightoperand, if yes then condition becomes true. (a < b) is true.
>= Checks if the value of left operand is greater than or equal to the valueof right operand, if yes then condition becomes true. (a >= b) is not true.
<= Checks if the value of left operand is less than or equaltothe value of right operand, if yes then condition becomes true. (a <= b) is true.
!< Checks if the value of left operand is not lessthanthe value of right operand, if yes then condition becomes true. (a !< b) is false.
!> Checks if the value of left operand is notgreaterthan the value of right operand, if yes then condition becomes true. (a !> b) is true.
INThe IN operator is used to compare a value to alist of literal values that have been specified.
LIKEThe LIKE operator is used to compare a value to similar values using wildcard operators.

Logical Operators

OperatorDescription
ANDThe AND operator allows the existence of multiple conditionsinan SQL statement's WHERE clause.
ORThe OR operator is used to combine multiple conditions in an SQL statement's WHERE clause.

Supported sort fields

Field
name
model
quantity
price
rating
sortorder
dateadded

Supported order types

Type
DESCASC

Example usage


{
sort:quantity,
order:asc,
filters:[
{
field:price,
operand:>=,
value:10
},
{
field:manufacturer,
operand:in,
"logicaloperand:and,
value:[
1,
2,
3
]
},
{
field:name,
operand:like,
value:apple"
}
]
}



3. Get list of products by page and limit

GET {{baseUrl}}/products/limit/:limit/page/:page

Service urls:
http://yourdomain.com/api/rest/products/limit/{limit}/page/{page}
OR
htt

ENDPOINTS