Developer Guide
This section is to help Cortex client developers get coding and building their client applications as fast as possible.
Community Forums
Cortex has a passionate client developer community. Go to the Elastic Path Commerce forums to ask questions, assist your fellow client developers, share ideas, and so on.
Useful Third-Party Tools
Some tools that client developers may find helpful for creating Cortex applications include:
jQuery - Supplies a JavaScript library to simplify code development
JSONPath - Is a useful third-party tool for extracting specific information from a
JSON
objectThis can save you from having to create your own methods to loop through
JSON
objects to retrieve data.
Developing Applications
Supported Client Programming Languages
Developers can use any programming language that supports HTTP requests and JSON parsing (Java, PHP, Ruby, JavaScript, and so on) to create a Cortex client application. Cortex does not have client libraries that you need to download and install in order to build a client application. That said, Cortex works particularly well with JavaScript clients.
Start from Entry Points
Build your app to access at Cortex through its API Entry Points.
Don’t Construct URIs
You don’t need to because Cortex builds the URIs for you. That’s the benefit of a REST Level 3 API, the API returns the URI of the resource you would use for the next operation. For example, getting an item will return an item
with an addtocartform
link, which you can use to add the item to a cart. Other APIs require client developers to construct their own URIs to interact with the API, but cortex doesn’t. All you need to do is follow the API workflows to interact with the system.
Constructing your own URIs can be dangerous because if Cortex is upgraded your client app will break. Coding your client app to follow workflows decouples your code from the API, so there is less chance your client will break if the API is upgraded.
Don’t Construct Forms
Cortex constructs the form for you so there is no need to create your own.
Constructing your own forms can be dangerous because if the API is upgraded and the forms change, your constructed forms will break.
Learn Using Zoom
Learn how to Zoom
. Zoom
allows you to batch multiple GET
requests into a single HTTP request. This tool can drastically reduce the number of requests your client app needs to make.
Parsing API Responses
JSONPath is a tool that makes it easier to write code that selects and extracts data from JSON. For a complete usage guide, see JSONPath.
Minimize Requests
The less calls you make to Cortex, the faster your application will work. You can reduce the number of calls by utilizing FollowLocation
and Zoom
.