The SalesLayer REST API provides a flexible and powerful way to access your catalog data.
The base URL serves as the foundation for constructing API requests. All endpoints, query parameters, and filters are appended to the base URL to retrieve specific data.
Base URL:
https://api2.saleslayer.com/rest/Catalog/
Available Endpoints
The following are some key examples of how the base URL is used to interact with the API:
Retrieve API Metadata
The $metadata endpoint provides detailed information about the structure of the API, including available entities and their attribute
https://api2.saleslayer.com/rest/Catalog/$metadata
Access Specific Data
For example, to retrieve metadata for categories:
https://api2.saleslayer.com/rest/Catalog/Categories/$metadata
Custom Queries
You can combine the base URL with query parameters to refine your searches and customize responses. Here's an example:
https://api2.saleslayer.com/rest/Catalog/Categories?$filter=startswith(cat_ref,'C')&$orderby=cat_ref asc&$skip=1&$top=3&$select=cat_id,cat_title,cat_ref,cat_description&$expand=Products
In this query:
- $select: Limits the fields returned (e.g., cat_id, cat_title, cat_description, cat_ref).
- $expand: Includes related data, like Products.
- $filter: Filters categories whose reference starts with L.
- $orderby: Sorts results by cat_ref in ascending order.
- $skip and $top: Implements pagination by skipping the first result and returning three items.
How to Use the Base URL
To get started, simply append the appropriate endpoint or query parameters to the base URL depending on the data you wish to retrieve.
Check the relevant sections in this documentation for details on endpoints like Metadata, Products, Categories, Variants and Custom Entities, or advanced options such as filtering and sorting.