The image below shows a breakdown of a standard Cortex URL. The example request retrieves a list of line items in a shopper’s cart
The URI Standard is being shown as a
Reference only. You should not construct the URI when building a client application or consuming APIs. Start from Request Entry Points, then follow links in API responses returned by Cortex, Use
zoom. For more information, see the Developer guide on consuming cortex API
Cortex uses HTTP methods to perform actions and invoke changes on a resource. Cortex supports the following HTTP methods:
GET: Read a resource
PUT: Update an existing resource
POST: Create a new resource
DELETE: Delete a resource
Cortex supports JSON resource representations, so requests must set the HTTP
Content-Type header to
application/json. Requests without this header, or requests using another media type, will return the following status code:
415 Unsupported Media Type.
For example, the following request retrieves a shopper’s shopping cart:
GET http://api.elasticpath.net/cortex/carts/mobee/default Content-Type: application/json
The API’s domain address.
The family that this resource belongs to. A resource family is made up of many individual resources.
A resource is an object with data, relationships to other resources, and methods that invoke actions. Cortex represents the resource’s data using a standard JSON format. In this format, properties represent the resource’s data and the links represent the relationships the resource has with other resources. Cortex uses standard HTTP methods to perform actions on a resource.
Resources can also be linked together into lists. A list is a special type of resource that represents a collection of related resources.
The store’s identifier, which is known as the store’s scope. Stores can have different scopes for the regions they sell in.
scope is an unique identifier for a store. Companies selling goods and services through Cortex may have different scopes for the regions they sell in. For example,
mystore_UK. Scoping could also be aligned with other selling methods, such as by product line: product1_store, product2_store.
The unique identifier of the resource being retrieved, updated or deleted. This example uses
default, which is special keyword that redirects to the authenticated shopper’s default cart.
default is a keyword that is used instead of a resource identifier to discover a default resource. For example, the default keyword offers a way to find a shopper’s cart without needing to know a specific cart identifier. When the default keyword is used, Cortex returns a
307 Temporary Redirect with a location to the default resource. This capability enables resources to be API Entry Points.
A subresource is a resource that cannot exist without the existence of another resource. In this example, the line items of a shopper’s cart cannot exist with the cart itself.