Skip to content

Templates

https://{cluster-id}.api.esales.apptus.cloud/api/admin/v3/import/templates

PUT

An import of templates for response object customization, used with the query parameter 'templateId'. Importing templates with PUT will remove all existing templates not in the import!

Request

Header parameters

Name Description Example
Api-Key
Required
Api-key that was supplied during on-boarding pkA123456789AB1BE..
Content-Encoding Defines which encoding was used to compress the data. gzip
Content-Type application/json application/json

Query parameters

Name Description Example
force If false, the import will fail if an existing template was removed as a result of this import. Redo the import with this flag set to true if this is intended.
name A name to identify the import in logs

Supported Content-Type

application/json

Request body

Example
application/json
{
  "myTemplate" : {
    "products" : {
      "first" : {
        "fields" : [ "brand", "title", "link", "sellingPrice", "listPrice", "inStock", "custom.material" ],
        "variants" : {
          "all" : {
            "fields" : [ "label", "inStock", "sellingPrice", "listPrice", "custom.campaign" ]
          }
        }
      },
      "rest" : {
        "fields" : [ "link", "swatch" ],
        "maxVariants" : 0
      }
    }
  }
}
Schema

TemplateBody

Template definitions for response object customization. Template Ids must be alphanumeric and up to 25 characters.

Keys following pattern: [a-zA-Z0-9]{1,25} and with the value: TemplateSettings Max: 5 keys

curl -i \
-X PUT \
-H 'Api-Key: pkA123456789AB1BE..' \
-H 'Content-Encoding: gzip' \
-H 'Content-Type: application/json' \
"https://{cluster-id}.api.esales.apptus.cloud/api/admin/v3/import/templates?force=force&name=name" \
-T request-body.file.gz

Response

Response codes

Status Description
204 The import file was valid.
403 Incorrect cluster credentials.
404 Cluster not found.
409 An import is currently in progress.
500 Server error such as cluster unavailable or busy. If 5xx errors persist, contact support and attach any information found in the response body.

POST

An import of templates for response object customization, used with the query parameter 'templateId'. Using POST to add or remove templates will not affect templates not included in the import.

Request

Header parameters

Name Description Example
Api-Key
Required
Api-key that was supplied during on-boarding pkA123456789AB1BE..
Content-Encoding Defines which encoding was used to compress the data. gzip
Content-Type application/json application/json

Query parameters

Name Description Example
name A name to identify the import in logs

Supported Content-Type

application/json

Request body

Example
application/json
{
  "myTemplate" : {
    "products" : {
      "first" : {
        "fields" : [ "brand", "title", "link", "sellingPrice", "listPrice", "inStock", "custom.material" ],
        "variants" : {
          "all" : {
            "fields" : [ "label", "inStock", "sellingPrice", "listPrice", "custom.campaign" ]
          }
        }
      },
      "rest" : {
        "fields" : [ "link", "swatch" ],
        "maxVariants" : 0
      }
    }
  }
}
Schema

TemplateBody

Template definitions for response object customization. Template Ids must be alphanumeric and up to 25 characters.

Keys following pattern: [a-zA-Z0-9]{1,25} and with the value: TemplateSettings Max: 5 keys

curl -i \
-X POST \
-H 'Api-Key: pkA123456789AB1BE..' \
-H 'Content-Encoding: gzip' \
-H 'Content-Type: application/json' \
"https://{cluster-id}.api.esales.apptus.cloud/api/admin/v3/import/templates?name=name" \
-T request-body.file.gz

Response

Response codes

Status Description
204 The import file was valid.
403 Incorrect cluster credentials.
404 Cluster not found.
409 An import is currently in progress.
500 Server error such as cluster unavailable or busy. If 5xx errors persist, contact support and attach any information found in the response body.

Schemas

Inner schemas

ProductTemplate

Name Type Description Example
fields
Required
string[] The product level attributes to include. Custom attributes can be included by prefixing them with custom., or the special custom.* can be used to include all custom attributes.
maxVariants integer The max number of variants to include. If not specified, all variants will be included. 0
variants TemplateMappingVariantTemplateSettingsVariantTemplate The definition of the product's variants for either all or the first and rest of the variants. Required unless maxVariants is not set to 0.

TemplateMappingProductTemplateSettingsProductTemplate

Name Type Description Example
all ProductTemplate All products/variants. Only if first and rest are not used.
first ProductTemplate The first product/variant in the list.
rest ProductTemplate The remaining products/variants in the list. Required if first is used.

TemplateMappingVariantTemplateSettingsVariantTemplate

Name Type Description Example
all VariantTemplate All products/variants. Only if first and rest are not used.
first VariantTemplate The first product/variant in the list.
rest VariantTemplate The remaining products/variants in the list. Required if first is used.

TemplateSettings

Name Type Description Example
products
Required
TemplateMappingProductTemplateSettingsProductTemplate The definition of the group's products for either all or the first and rest of the products.

VariantTemplate

Name Type Description Example
fields
Required
string[] The variant level attributes to include. Custom attributes can be included by prefixing them with custom., or the special custom.* can be used to include all custom attributes.
×
Copyright

This online publication is intellectual property of Voyado Lund AB. Its contents can be duplicated in part or whole, provided that a copyright label is visibly located on each copy and the copy is used in conjunction with the product described within this document.

All information found in these documents has been compiled with utmost attention to detail. However, this does not guarantee complete accuracy. Neither Voyado Lund AB nor the authors shall be held liable for possible errors or the consequences thereof.

Software and hardware descriptions cited in these documents might be registered trademarks. All trade names are subject to copyright restrictions and may be registered trademarks. Voyado Lund AB essentially adheres to the manufacturer’s spelling. Names of products and trademarks appearing in this document, with or without specific notation, are likewise subject to trademark and trade protection laws and may thus fall under copyright restrictions.

CLOSE