Blog

Devan Koshal

Introducing, Commerce.js (Beta)

Devan Koshal on

alt

What is Commerce.js?

Commerce.js is a full-stack eCommerce API & SDK for developers and designers. It means rapid eCommerce integration for any web and mobile project. We've been using Commerce.js at Chec for our own checkouts and it has handled hundreds of thousands of API request perfectly.

Unique to the API are its helper functions. When integrating, helpers do just that, they help you handle tedious tasks like checking if a requested quantity is valid, if a discount code is valid and if the pay what you want amount is valid. The helpers go as far as generating client side validation rules that can be passed straight into jQuery!

Here are just a few examples:

  • Set the tax region for a checkout session
  • Check if a variant is available and returns the updated totals
  • Check if a PayPal payment was completed
  • Get the location of a customer from the IP address
  • Check if a discount code is valid and display the new totals to reflect just that

These helper calls are also crazy fast thanks to our unique checkout token approach. We’ll go into detail about that more in the future. Basically, we don’t preform any extra database queries when you make helper calls, making the whole process instant!

Backstory

Commerce.js has been an idea in the making for quite sometime. During the Chec 2.0 rewrite, we decided we wanted to create a checkout API that handled everything from capturing an order to creating the client side validation rules we needed for jQuery. After months of development, testing and restructuring, we're incredibly proud to introduce Commerce.js to the designer and developer community.

What can you do with Commerce.js?

Create your own immersive shopping and checkout experience, create an eCommerce mobile app, or simply create your own custom self hosted checkout for your site. Commerce.js has been designed to handle all server side logic on our end which means designers can easily integrate with Chec, without ever needing to touch server side code! This makes the API that much more exciting for the design and web development community. We’re just beginning to grow the Commerce.js ecosystem and we’re really excited to see what you will make of it.

It’s live right now!

Commerce.js is live for everyone right now just visit setup > developers to get your API keys. Get in touch with us via the in app chat if you have any questions about getting started.

To get you started, we’ve built a nifty little feature right into the dashboard. If you hover over any of your products in Chec and click "generate skeleton checkout", a skeleton checkout will be automatically created for that product with Commece.js baked in. (Using your sandbox API key). It’s fully working out of the box, check the console!

Documentation can be found here - http://commercejs.com/docs . We’re actively working on creating more comprehensive documentation and guides. We hope you find them easy to make your way through. Please get in touch if you think we could make anything easier or clearer.

Join the Slack channel!

Want to help us shape Commerce.js’s future? Need help with integrating? Come join our Commerce.js Slack channel here - https://chec-commercejs-community.herokuapp.com/

Vision

First up is our Checkout API, next up is Preorders, Carts, Products, Orders, Fulfillment, Customers and so on. We're building Commerce.js & Chec to be the infrastructure to power eCommerce on the web & mobile. An eCommerce solution that fits around your code and design, not the other way round.

Ultimately we want Commerce.js to be the default for commerce on the web (and everywhere else).