Spree API Endpoints and Checkout Workflow

38 views
Skip to first unread message

Jerry John Jacob

unread,
Jul 3, 2014, 8:53:50 AM7/3/14
to spree...@googlegroups.com, Ernest Sankeshwar
We wanted to create a Spree app where the entire front-end is a single-page app.
What is the recommended approach for this?


As part of the same, we were exploring the Spree API endpoints required to be used from the front-end.
Are there any references or guides we can follow, particularly on the implementation of the checkout process?


We couldn't find any API documentation on creation of shipping address and billing address during the checkout process.
  • We tried sending a POST request to the addresses API controller, but there were only the show and update methods there
  • We tried a PUT request on the orders API controller by passing parameters such as orders['bill_address_attributes']['...'], orders['bill_address']['...'], but we received status 422.
  • We also tried a POST request at /checkout/update/address, but we got route not found error.
We have not been able to find a method to create shipping and billing addresses in the 'address' phase of the checkout flow.
Are there further references where we can find details on this?
Any pointers to documentation or source code regarding the above would be of great help.

Ryan Bigg

unread,
Jul 3, 2014, 11:56:08 PM7/3/14
to spree...@googlegroups.com
Hi Jerry,

I've got a Ruby script for a full walkthrough of Spree's checkout: https://github.com/radar/spree_api_examples/blob/master/examples/checkout/walkthrough.rb

I reckon that might set you on the right path. Please let us know if you need anything more detailed than that.

Thanks!
--
Ryan Bigg
Community Manager
Spree Commerce, Inc.

Jerry John Jacob

unread,
Jul 3, 2014, 11:59:37 PM7/3/14
to spree...@googlegroups.com
Hi Ryan,

Thanks a ton! This looks very useful indeed! :)

We'll try it out and let you know how it goes. :)


Thanks!

Jerry John Jacob

unread,
Jul 7, 2014, 7:02:04 AM7/7/14
to spree...@googlegroups.com
Hey Ryan,

Thanks for sharing the script!

It really helped us figure out how to find our way about the API endpoints. :)

Ryan Bigg

unread,
Jul 7, 2014, 8:58:54 PM7/7/14
to spree...@googlegroups.com
Great :) Glad you were able to understand it.
Reply all
Reply to author
Forward
0 new messages