silvershop-core icon indicating copy to clipboard operation
silvershop-core copied to clipboard

Web Service API

Open jedateach opened this issue 12 years ago • 4 comments

Turning the module into a webservice could help make it more modular and customisable. It should help to abstract away the interface from the underlying system logic.

Taking this approach could also allow:

  • Full javascript front-ends using frameworks such as backbone
  • Mobile / tablet apps

Creating a web service API will not only open stores to be manipulated in a variety of ways, but also will help drive the project towards a solution that is scalable, and well modularised. This is the proposal for version 1 of the API. Related: issue #33

Sapphire provides a RestfulServer class that might help with getting set up.

Responses will be provided in json or XML format.

Customer Interactions

Get all products

Structure: GET baseurl/api/v1/products.format

Example: GET http://www.mysite.com/api/v1/products.json

Produces:

[{title:"Beach Ball",price:5.00},
{title:"Fishing Rod",price:14.00}]

Get single product

Example: GET <baseurl>/api/v1/products

Add product to cart

...

Get cart contents & subtotals

...

Get shipping estimates

...

Place an order

...

Admin Interactions

jedateach avatar Apr 24 '12 06:04 jedateach

Draw ideas from other apis http://doc.prestashop.com/display/PS14/Web-service+reference

jedateach avatar Jun 08 '12 03:06 jedateach

May also be useful: http://blog.programmableweb.com/2011/09/09/breaking-down-e-commerce-apis/

jedateach avatar Oct 17 '12 00:10 jedateach

Spree also has a great documentation site for their api: http://api.spreecommerce.com/

And note that their source is contained within a separate folder, apart from core code: https://github.com/spree/spree/tree/master/api

jedateach avatar Feb 06 '13 22:02 jedateach

some ideas here: https://gist.github.com/jedateach/5409341

jedateach avatar Apr 18 '13 01:04 jedateach