# Sales Layer Catalog REST API (2.0.0)

The Sales Layer Catalog REST API provides programmatic access to the catalog data managed in Sales Layer.

Use this reference to retrieve, filter, create, update, or delete products, variants, categories, attribute sets, custom entities, metadata, and changelog records. These endpoints support synchronization, enrichment, publishing, reporting, and other integration workflows across ecommerce platforms, ERPs, marketplaces, DAM systems, supplier systems, and internal tools.

Start with metadata endpoints when your integration needs to discover available fields and relationships, use pagination and filtering for large reads, and rely on changelogs for incremental synchronization whenever possible.

## Server

Sales Layer Catalog API

https://api2.saleslayer.com/catalog

## Attribute Sets

### Operations

- `get`: /AttributeSets
- `get`: /AttributeSets({attributeSetIdentifier})
- `get`: /AttributeSets({attributeSetIdentifier})/Products
- `get`: /AttributeSets/$metadata

### Request

Returns all attribute sets defined for the tenant, each including its name, identifier, and form layout configuration for Products and Variants (`ProductLayout`, `VariantLayout`).

**See also:** A legacy OData-style version of this endpoint is available at `GET /AttributeSets`.

## Authentication

Requires a valid API key in the `X-API-KEY` header.

## Response

**200 OK** — `GetAttributeSetsResponse` containing the list of attribute sets.

## Error Responses

- **401 Unauthorized** — Missing or invalid tenant identifier.
- **500 Internal Server Error** — Unexpected technical error.

## Example

**Request:**
```http
GET /v2/AttributeSets HTTP/1.1
X-API-KEY: your-api-key-here
```

### Responses

- **200 OK**: 
```json
{
  "@readLink": "string",
  "@nextLink": "string",
  "@deltaLink": "string",
  "@context": "string",
  "value": null,
  "@count": 0
}
```

### Create Attribute Set

Creates a new attribute set for the tenant from the supplied `name` and optional Product and Variant form layouts, returning the created attribute set and a `Location` header pointing to it.

## Update Attribute Set

Partially updates an existing attribute set identified by `id`. Accepted values:

- **`default`** (case-insensitive) — updates the tenant's default attribute set.
- **Positive integer** — updates the attribute set with that numeric ID.

### Example
**Request:**
```http
PATCH /v2/AttributeSets(1) HTTP/1.1
X-API-KEY: your-api-key-here
Content-Type: application/json

{ "name": "Electronics v2" }
```

## Delete Attribute Set

Deletes the attribute set identified by `id` (a positive integer). The tenant's default attribute set cannot be deleted.

### Example
**Request:**
```http
DELETE /v2/AttributeSets(7)?deleteAssociatedProductsAndVariants=false HTTP/1.1
X-API-KEY: your-api-key-here
```

## Categories
### Operations
- `get`: /Categories
- `post`: /Categories
- `get`: /Categories({categoryIdentifier})
- `patch`: /Categories({categoryId})
- `delete`: /Categories({categoryId})

## Products
### Operations
- `get`: /Products
- `post`: /Products
- `get`: /Products({productIdentifier})
- `patch`: /Products({productId})
- `delete`: /Products({productId})

## Variants
### Operations
- `get`: /Variants
- `post`: /Variants
- `get`: /Variants({variantIdentifier})
- `patch`: /Variants({variantId})
- `delete`: /Variants({variantId})

## Custom Entities
### Operations
- `get`: /CustomEntities('{customEntityDenominator}')
- `post`: /CustomEntities('{customEntityDenominator}')
- `patch`: /CustomEntities('{customEntityDenominator}')/item({itemId})
- `delete`: /CustomEntities('{customEntityDenominator}')/item({itemId})

## Metadata
### Operations
- `get`: /$metadata
