{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown","redocly_category":"Guides","api_domain":"Cross API"},"seo":{"title":"Best practices","description":"Recommended practices for building reliable Sales Layer REST API integrations.","keywords":["Sales Layer","REST API","OpenAPI","DAM API","Catalog API","product catalog API","image management API","API integration"],"lang":"en-US","meta":[{"name":"og:type","content":"website"},{"name":"og:site_name","content":"Sales Layer REST API Documentation"},{"name":"og:title","content":"Sales Layer REST API Documentation"},{"name":"og:description","content":"Complete REST API documentation for Sales Layer's DAM and Catalog APIs. Learn authentication, pagination, filtering, and integration patterns."},{"name":"twitter:card","content":"summary_large_image"},{"name":"twitter:site","content":"@saleslayer"},{"name":"twitter:title","content":"Sales Layer REST API Documentation"},{"name":"twitter:description","content":"Complete REST API documentation for Sales Layer's DAM and Catalog APIs. Learn authentication, pagination, filtering, and integration patterns."}],"llmstxt":{"hide":false,"title":"Sales Layer REST API Documentation","description":"Technical guides and OpenAPI references for Sales Layer DAM and Catalog REST APIs.","sections":[{"title":"Guides","description":"Static API guides for authentication, headers, query parameters, responses, rate limiting, and best practices.","includeFiles":["guides/**/*.md","changelog.md"],"excludeFiles":[]},{"title":"API Reference","description":"OpenAPI-based references and API overview pages for Sales Layer REST APIs.","includeFiles":["apis/**/*.md","apis/**/*.yaml"],"excludeFiles":[]},{"title":"Postman collections","description":"Importable Postman collection and environment instructions for testing Sales Layer REST APIs.","includeFiles":["postman/**/*.md"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"best-practices","__idx":0},"children":["Best practices"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use these practices to build reliable and maintainable integrations with Sales Layer REST APIs."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"use-metadata-endpoints","__idx":1},"children":["Use metadata endpoints"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Catalog metadata endpoints describe available fields, resource structures, and relationships."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use metadata before building dynamic requests, especially when working with products, variants, categories, attribute sets, or custom entities."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Recommended metadata endpoints include:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"GET https://api2.saleslayer.com/catalog/rest/Catalog/$metadata\nGET https://api2.saleslayer.com/catalog/rest/Catalog/Products/$metadata\nGET https://api2.saleslayer.com/catalog/rest/Catalog/Categories/$metadata\nGET https://api2.saleslayer.com/catalog/rest/Catalog/Variants/$metadata\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Cache metadata responses when possible, and refresh them when the account configuration changes."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"minimize-response-payloads","__idx":2},"children":["Minimize response payloads"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$select"]}," to request only the fields needed by the integration."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This reduces transfer size, speeds up processing, and makes logs easier to inspect."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"GET https://api2.saleslayer.com/catalog/rest/Catalog/Products?$select=prod_ref,prod_title\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"filter-before-processing","__idx":3},"children":["Filter before processing"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$filter"]}," to reduce the amount of data returned by the API."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Filtering at the API level is usually more efficient than retrieving a broad dataset and filtering it client-side."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"use-pagination-for-large-datasets","__idx":4},"children":["Use pagination for large datasets"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use pagination for list operations."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For large Catalog datasets, prefer token-based pagination with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$skipToken"]}," when the endpoint supports it and returns continuation links."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For DAM and endpoints that use offset-style pagination, use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$top"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$skip"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"respect-rate-limits","__idx":5},"children":["Respect rate limits"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Design clients to stay below documented rate limits and retry temporary failures with bounded backoff."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/rate-limiting"},"children":["Rate limiting"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"protect-credentials","__idx":6},"children":["Protect credentials"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["API keys must be treated as secrets."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Do not expose them in browser code, public repositories, screenshots, logs, or customer-facing error messages."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/authentication"},"children":["Authentication"]}," and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/headers"},"children":["Headers"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"handle-responses-intentionally","__idx":7},"children":["Handle responses intentionally"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use HTTP status codes to drive client behavior:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treat ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["201"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["204"]}," as successful outcomes."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treat ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["404"]}," as errors that usually require request, configuration, or permission changes."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treat ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409"]}," as a state conflict, especially for DAM resources being processed."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treat ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["500"]}," as potentially temporary, but use bounded retries."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"build-observable-integrations","__idx":8},"children":["Build observable integrations"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Log enough information to troubleshoot safely:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["API domain and endpoint."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["HTTP method and status code."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Request timing."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Retry count."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Page or continuation state."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Correlation identifiers when available."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Do not log full API keys or sensitive payload values."]}]},"headings":[{"value":"Best practices","id":"best-practices","depth":1},{"value":"Use metadata endpoints","id":"use-metadata-endpoints","depth":2},{"value":"Minimize response payloads","id":"minimize-response-payloads","depth":2},{"value":"Filter before processing","id":"filter-before-processing","depth":2},{"value":"Use pagination for large datasets","id":"use-pagination-for-large-datasets","depth":2},{"value":"Respect rate limits","id":"respect-rate-limits","depth":2},{"value":"Protect credentials","id":"protect-credentials","depth":2},{"value":"Handle responses intentionally","id":"handle-responses-intentionally","depth":2},{"value":"Build observable integrations","id":"build-observable-integrations","depth":2}],"frontmatter":{"seo":{"title":"Best practices","description":"Recommended practices for building reliable Sales Layer REST API integrations."},"keywords":{"includes":["best practices","API integration","synchronization","metadata","pagination"]},"metadata":{"redocly_category":"Guides","api_domain":"Cross API"}},"lastModified":"2026-06-03T15:57:05.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/best-practices","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}