Logo
maya API Documentation

cart

Number of APIs: 6


1. Get cart

GET {{baseUrl}}/cart

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



2. Add item to cart

POST {{baseUrl}}/cart

Service urls:
http://yourdomain.com/api/rest/cart
OR
http://yourdomain.com/index.php?route=rest/cart/cart
Sample cart item object:
productid=34 (iPod Shuffle)
product
optionid =235 (Size)
product
optionvalueid = 30 (Large)

{
product_id: 34,
quantity: 1,
option:
{
235: 30
}

}

Add recurring item to the cart:
{
product_id: 43,
quantity: 1,
recurring_id: 2

}

Option for text field:
option: {
238:demo text
}
br>Option for date field:

option: {
238:2014-10-15
}

Option for checkbox field:
option: {
236: [33]
}

Option for checkbox field ( multiple selected ):
option: {
236: [33, 32]
}

Option for select field:
option: {
235:30
}

Option for radio field:
option: {
237:35
}

And all together:
option: {
235: 30,
237:34,
238:demo text,
239:2014-11-20,
236: [33]
}



3. Update cart item quantity

PUT {{baseUrl}}/cart

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



4. Delete cart item

DELETE {{baseUrl}}/cart

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

The product key can be found in the response of the GET /cart API call.



5. Delete cart item

DELETE {{baseUrl}}/cart/:key

Service urls:
http://yourdomain.com/api/rest/cart/{key}
OR
http://yourdomain.com/index.php?route=rest/cart/cart&key={key}

The product key can be found in the response of the GET /cart API call.



6. Empty cart

DELETE {{baseUrl}}/cart/empty

Service urls:
http://yourdomain.com/api/rest/cart/empty
OR
http://yourdomain.com/index.php?route=rest/cart/emptycart



ENDPOINTS