### No Result Response Example Source: https://apidocs.plytix.com/ Illustrates an API response when no data is found for a query. An empty 'data' list is returned. ```json { "data": [] } ``` -------------------------------- ### Multiple Result Response Example Source: https://apidocs.plytix.com/ Demonstrates an API response containing multiple items. The 'data' field is a list with several objects. ```json { "data": [ { "filename": "blue_mug.png", "id": "5bfac7d851e7590001486761", "thumbnail": "https://files.plytix.com/api/v1.1/thumb/public_files/pim/assets/d1/6d/8e/5b/5b8e6dd17f7f46000c7e9629/images/d8/c7/fa/5b/5bfac7d851e7590001486761/blue_mug.png", "url": "https://files.plytix.com/api/v1.1/file/public_files/pim/assets/d1/6d/8e/5b/5b8e6dd17f7f46000c7e9629/images/d8/c7/fa/5b/5bfac7d851e7590001486761/blue_mug.png" }, { "filename": "blue_mug_big.jpeg", "id": "5bfaced551e7590001486763", "thumbnail": "https://files.plytix.com/api/v1.1/thumb/public_files/pim/assets/d1/6d/8e/5b/5b8e6dd17f7f46000c7e9629/images/d5/ce/fa/5b/5bfaced551e7590001486763/blue_mug_big.jpeg", "url": "https://files.plytix.com/api/v1.1/file/public_files/pim/assets/d1/6d/8e/5b/5b8e6dd17f7f46000c7e9629/images/d5/ce/fa/5b/5bfaced551e7590001486763/blue_mug_big.jpeg" } ] } ``` -------------------------------- ### Simple Error Message Example Source: https://apidocs.plytix.com/ Shows a basic error response from the API, containing a general error message. ```json { "error": { "msg": "Missing Authorization Header" } } ``` -------------------------------- ### GET /assets/{id} Source: https://apidocs.plytix.com/ Retrieve details for a specific asset by its ID. ```APIDOC ## GET /assets/{id} ### Description Retrieve information about a specific asset. ### Method GET ### Endpoint /assets/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the asset. ### Response #### Success Response (200) - **data** (array) - List of items returned from the API. #### Response Example { "data": [ { "file_size": 30358, "file_type": "TEXTS", "filename": "example.pdf", "id": "123456789012345678901234", "thumb": "https://static.plytix.com/static/pim/img/filetypes/filetype_pdf.png", "url": "https://files.plytix.com/api/v1.1/file/public_files/pim/assets/d1/6d/8e/5b/5b8e6dd17f7f46000c7e9629/texts/28/c9/fa/5b/5bfac92851e7590001486762/example.pdf" } ] } ``` -------------------------------- ### Detailed Error Message Example Source: https://apidocs.plytix.com/ Illustrates a detailed error response, including a general message and an array of specific errors with field information. ```json { "error": { "msg": "product data validation failed", "errors": [ { "field": "some_non-existing_attribute_to_patch", "msg": "label does not exist" }, { "field": "some_decimal_number_attribute_to_patch_using_wrong_number_format", "msg": "Not a valid decimal value. Format must be: ." } ] } } ``` -------------------------------- ### Single Result Response Example Source: https://apidocs.plytix.com/ Shows a typical API response when a single item is returned. The 'data' field contains a list with one object. ```json { "data": [ { "file_size": 30358, "file_type": "TEXTS", "filename": "example.pdf", "id": "123456789012345678901234", "thumb": "https://static.plytix.com/static/pim/img/filetypes/filetype_pdf.png", "url": "https://files.plytix.com/api/v1.1/file/public_files/pim/assets/d1/6d/8e/5b/5b8e6dd17f7f46000c7e9629/texts/28/c9/fa/5b/5bfac92851e7590001486762/example.pdf" } ] } ``` -------------------------------- ### Authentication - Get Token Source: https://apidocs.plytix.com/ Obtain a Bearer Token for API authentication by sending your API credentials. ```APIDOC ## POST /auth/api/get-token ### Description Obtain a valid Bearer Token for API authentication by sending your API credentials (API key and password). ### Method POST ### Endpoint https://auth.plytix.com/auth/api/get-token ### Request Body - **api_key** (string) - Required - Your Plytix API key. - **password** (string) - Required - Your Plytix API password. ### Request Example ```json { "api_key": "YOUR_API_KEY", "password": "YOUR_API_PASSWORD" } ``` ### Response #### Success Response (200) - **token** (string) - The obtained Bearer Token. - **expires_in** (integer) - The token's expiration time in seconds. #### Response Example ```json { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expires_in": 900 } ``` ``` -------------------------------- ### Product Families API Source: https://apidocs.plytix.com/ Endpoints for managing product families and their attributes. ```APIDOC ## POST /product_families ### Description Creation of new product families. ### Method POST ### Endpoint /product_families ``` ```APIDOC ## GET, PATCH, DELETE /product_families/{id} ### Description Operations on a specific product family. ### Method GET, PATCH, DELETE ### Endpoint /product_families/{id} ``` ```APIDOC ## POST /product_families/search ### Description Filter product families by multiple criteria. ### Method POST ### Endpoint /product_families/search ``` ```APIDOC ## POST /product_families/{id}/attributes/link ### Description Add new attributes to a family. ### Method POST ### Endpoint /product_families/{id}/attributes/link ``` ```APIDOC ## POST /product_families/{id}/attributes/unlink ### Description Removes attributes from a family. ### Method POST ### Endpoint /product_families/{id}/attributes/unlink ``` ```APIDOC ## GET /product_families/{id}/attributes ### Description Retrieves the product family attributes. ### Method GET ### Endpoint /product_families/{id}/attributes ``` ```APIDOC ## GET /product_families/{id}/all_attributes ### Description Retrieves the product family attributes including system attributes. ### Method GET ### Endpoint /product_families/{id}/all_attributes ``` -------------------------------- ### Products API Source: https://apidocs.plytix.com/ Endpoints for managing products, including creation, retrieval, updates, and deletion. ```APIDOC ## POST /products ### Description Creation of new products. ### Method POST ### Endpoint /products ``` ```APIDOC ## GET, PATCH, DELETE /products/{id} ### Description Operations on a specific product. ### Method GET, PATCH, DELETE ### Endpoint /products/{id} ``` ```APIDOC ## GET, POST /products/{id}/variants ### Description List and creation of variants of a product. ### Method GET, POST ### Endpoint /products/{id}/variants ``` ```APIDOC ## POST, DELETE /products/{id}/variant/{id} ### Description Operations on a specific variant. ### Method POST, DELETE ### Endpoint /products/{id}/variant/{id} ``` ```APIDOC ## POST /products/{id}/variants/resync ### Description Resync variants attribute values. ### Method POST ### Endpoint /products/{id}/variants/resync ``` ```APIDOC ## POST /products/{id}/family ### Description Assign family to a product. ### Method POST ### Endpoint /products/{id}/family ``` ```APIDOC ## GET, POST /products/{id}/assets ### Description Link of account assets to product. ### Method GET, POST ### Endpoint /products/{id}/assets ``` ```APIDOC ## GET, DELETE /products/{id}/assets/{id} ### Description Operations over linked assets. ### Method GET, DELETE ### Endpoint /products/{id}/assets/{id} ``` ```APIDOC ## GET, POST /product/{id}/categories ### Description Category assignment to product. ### Method GET, POST ### Endpoint /product/{id}/categories ``` ```APIDOC ## GET, DELETE /products/{id}/categories/{id} ### Description Operations on a specific category. ### Method GET, DELETE ### Endpoint /products/{id}/categories/{id} ``` ```APIDOC ## POST /products/{id}/relationships/{id} ### Description Add related products to current product. ### Method POST ### Endpoint /products/{id}/relationships/{id} ``` ```APIDOC ## PATCH /products/{id}/relationships/{id}/unlink ### Description Remove related products from current product. ### Method PATCH ### Endpoint /products/{id}/relationships/{id}/unlink ``` ```APIDOC ## PATCH /products/{id}/relationships/{id}/products/{id} ### Description Operations on related product. ### Method PATCH ### Endpoint /products/{id}/relationships/{id}/products/{id} ``` ```APIDOC ## POST /products/search ### Description Filter products by multiple criteria. ### Method POST ### Endpoint /products/search ``` -------------------------------- ### Specify attributes in search results Source: https://apidocs.plytix.com/ Requests specific product attributes including SKU, Label, and Stock. ```json { "attributes":["sku", "label", "stock"] } ``` -------------------------------- ### Search API Concepts Source: https://apidocs.plytix.com/ Overview of filter operators, pagination, and attribute selection for search requests. ```APIDOC ## Search API Concepts ### Description This section details how to construct search queries using filters, pagination, and attribute selection. ### Filter Operators | Operator | Arity | Type | Description | |---|---|---|---| | exists | Unary | - | Existence check | | !exists | Unary | - | Non-existence check | | eq | Binary | value | Equality check | | !eq | Binary | value | Inequality check | | like | Binary | value | Contains check | | in | Binary | list | Match check | | !in | Binary | list | Do not match check | | gt | Binary | value | Greater than | | gte | Binary | value | Greater or equal than | | lt | Binary | value | Less than | | lte | Binary | value | Less or equal than | | text_search | Binary | value | Text search | ### Pagination - **page** (Integer) - Page number to retrieve - **page_size** (Integer) - Items per page - **order** (String) - Sort order in format [+/-][ATTRIBUTE] ### Attributes - **attributes** (Array) - List of attributes to return (max 20) ### Request Example { "filters":[ [ {"field":"modified","operator":"gt","value":"2018-11-01"}, {"field":"modified","operator":"lt","value":"2018-11-30"} ], [ {"field":"short_text","operator":"like","value":"unicorn"} ] ], "pagination":{"order":"-sku","page":3,"page_size":25}, "attributes":["modified", "stock", "description", "categories"] } ``` -------------------------------- ### General API Request Headers Source: https://apidocs.plytix.com/ Standard headers required for all Plytix API V1 requests. ```APIDOC ## General API Request Headers All requests and responses in this API must use `application/json` format. Ensure you set the appropriate headers for every request. ### Headers - **Content-Type**: `application/json` - **Accept**: `application/json` - **Authorization**: `Bearer {{your_token_value}}` ``` -------------------------------- ### Set API Request Headers Source: https://apidocs.plytix.com/ Required headers for all API requests to ensure proper content negotiation and authentication. ```text Content-Type: application/json Accept: application/json Authorization: Bearer {{your_token_value}} ``` -------------------------------- ### Filter products by modification date and text content Source: https://apidocs.plytix.com/ Uses default pagination and attributes to filter products modified in November 2018 or containing 'unicorn'. ```json { "filters":[ [ {"field":"modified","operator":"gt","value":"2018-11-01"}, {"field":"modified","operator":"lt","value":"2018-11-30"} ], [ {"field":"short_text","operator":"like","value":"unicorn"} ] ] } ``` -------------------------------- ### API Error Handling Source: https://apidocs.plytix.com/ Standard structure for API error responses. ```APIDOC ## Error Handling ### Description When an operation fails, the API returns an error object containing a message and optional detailed error information. ### Response #### Error Response - **error** (object) - Contains error details. - **msg** (string) - General error message. - **errors** (array) - Optional detailed information. - **field** (string) - The offending field. - **msg** (string) - Detailed error message for the field. #### Response Example { "error": { "msg": "product data validation failed", "errors": [ { "field": "some_non-existing_attribute_to_patch", "msg": "label does not exist" } ] } } ``` -------------------------------- ### Perform complex search with pagination and custom attributes Source: https://apidocs.plytix.com/ Retrieves page 3 of filtered results, ordered by SKU descending, with a specific set of attributes. ```json { "filters":[ [ {"field":"modified","operator":"gt","value":"2018-11-01"}, {"field":"modified","operator":"lt","value":"2018-11-30"} ], [ {"field":"short_text","operator":"like","value":"unicorn"} ] ], "pagination":{"order":"-sku","page":3,"page_size":25}}, "attributes":["modified", "stock", "description", "categories"] } ``` -------------------------------- ### Relationships API Source: https://apidocs.plytix.com/ Endpoints for managing relationships between entities. ```APIDOC ## POST /relationships ### Description Creation of new relationships. ### Method POST ### Endpoint /relationships ``` ```APIDOC ## GET, PATCH, DELETE /relationships/{id} ### Description Operations on a specific relationship. ### Method GET, PATCH, DELETE ### Endpoint /relationships/{id} ``` ```APIDOC ## POST /relationships/search ### Description Filter relationships by multiple criteria. ### Method POST ### Endpoint /relationships/search ``` -------------------------------- ### Define a complex filter with OR conditions Source: https://apidocs.plytix.com/ A list of compound filters where each item acts as an OR condition. ```json [ [ {"field": "stock", "operator": "gt", "value": 10} , {"field": "vendor", "operator": "like", "value": "ACME"}], [ {"field": "customer", "operator": "eq", "value": "Wile E. Coyote"} ] ] ``` -------------------------------- ### Define a simple filter Source: https://apidocs.plytix.com/ A basic filter condition consisting of a field, operator, and value. ```json {"field": "stock", "operator": "gt", "value": 10} ``` -------------------------------- ### Define a compound filter Source: https://apidocs.plytix.com/ A list of simple filters treated as an AND condition. ```json [ {"field": "stock", "operator": "gt", "value": 10}, {"field": "vendor", "operator": "like", "value": "ACME"} ] ``` -------------------------------- ### Filtered Searches Source: https://apidocs.plytix.com/ Endpoints for performing advanced searches with custom filter conditions. ```APIDOC ### Filter Conditions #### Simple filter A _simple filter_ is defined by three fields, two of which are mandatory. Field | Description | Mandatory | Type ---|---|---|--- field | **label** of the field | YES | string operator | operation to be performed | YES | string value | value of the operation | | String/Array/Object **Example** Search for products whose stock is over 10: ```json { "field": "stock", "operator": "gt", "value": 10 } ``` #### Compound filter A _compound filter_ is a _list_ of simple filters. Every filter in the list is treated as an AND condition **Example** Search products whose stock is over 10 AND from any vendor containing text "ACME" ```json [ {"field": "stock", "operator": "gt", "value": 10}, {"field": "vendor", "operator": "like", "value": "ACME"} ] ``` #### Filter A _filter_ is a _list_ of compound filters, every item in this list acts as an OR condition **Example** Search products that: a) whose stock is over 10 AND from any vendor containing text "ACME" OR b) customer **is** "Wile E. Coyote" ```json [ [ {"field": "stock", "operator": "gt", "value": 10} , {"field": "vendor", "operator": "like", "value": "ACME"}], [ {"field": "customer", "operator": "eq", "value": "Wile E. Coyote"} ] ] ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.