Create a catalog

put

/rest/ofscPartsCatalog/v1/catalogs/{catalog}/{language}

This operation creates a new catalog with the specified catalog label and the specified language.

Request

Path Parameters
Body ()
Root Schema : catalogSchema
Type: object
Show Source
Nested Schema : fieldSchemas
Type: array
The array of objects wherein each object describes a catalog field.
Show Source
Nested Schema : typeSchemas
Type: array
The array of objects wherein each object describes an item type.
Show Source
Nested Schema : items
Type: object
Show Source
  • Title: Field Label
    The label of the catalog field.
  • Title: Field Name
    The name of the catalog field.
  • Title: Field Preview
    Contains one of the following values: true or false. If true, then the field is cached in online mode and included in the search results. If false, then the field is cached in offline mode and the field is excluded in the search results.
  • Title: Field Property Label
    The label assigned to a custom property field.
  • Title: Field Searchable
    Contains one of the following values: true or false. If true, then the field is searchable. If false, then the field cannot be searched.
Nested Schema : items
Type: object
Show Source
Back to Top

Response

Supported Media Types

204 Response

This response code indicates that the operation completed successfully. This operation does not return elements in the response body.

Default Response

This section describes the default error response for this operation.
Body ()
Root Schema : Error
Type: object
Error response
Show Source
Back to Top

Examples

The following example shows how to create a catalog from OFSC by submitting a PUT request on the REST resource:

cURL Command Example

curl -u 'clientID@instanceName:clientSecret' \ -X PUT \ --url 'https://<instance_name>.etadirect.com/rest/ofscPartsCatalog/v1/catalogs/my_catalog/en \ -H 'Content-Type: application/json' -H 'Accept: application/json' 
-d '{
            "name": "my_catalog",
            "fieldSchemas": [
                {
                    "label": "part_id",
                    "name": "Part number",
                    "propertyLabel": "part_number",
                    "searchable": true,
                    "preview": true
                },
                {
                    "label": "vendor",
                    "name": "Vendor",
                    "searchable": true,
                    "preview": true
                },
                {
                    "label": "descr",
                    "name": "Description",
                    "searchable": true
                },
                {
                    "label": "price",
                    "name": "Cost",
                    "propertyLabel": "price",
                    "preview": true
                }
            ],
            "typeSchemas": [
                {
                    "itemType": "parts",
                    "inventoryType": "parts_general"
                },
                {
                    "itemType": "cartridge",
                    "inventoryType": "parts_cartridge"
                }
            ]
}'

Response Header Example

The following shows an example of the response header.

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 07 Feb 2019 16:28:18 GMT
Content-Type: application/json; charset=utf-8
Connection: close

Response Body Example

204 Response
Operation completed successfully
Back to Top