Product Sets¶
https://{cluster-id}.elevate-api.cloud/api/admin/v4/import/product-sets
PUT¶
An import of product sets. Importing product sets using a PUT request will remove all existing product sets not present in the import file!
Request¶
Header parameters¶
| Name | Description | Example |
|---|---|---|
| Api-Key Required | Api-key that was supplied during on-boarding | pkA123456789AB1BE.. |
| Content-Encoding Required | Content should be gzip encoded for all production requests. For manual test purposes, uncompressed small bodies may be provided using query parameter 'bypass-compression-for-manual-test=true' and omitted Content-Encoding (or 'identity') | gzip |
| Content-Type | application/json | application/json |
Query parameters¶
| Name | Description | Example |
|---|---|---|
| force | If false, the import will fail if an existing product set was removed as a result of this import. Redo the import with this flag set to true if this was intended | |
| name | A name to identify the import in logs |
Supported Content-Type¶
application/json
Request body¶
Example
{
"WINTER" : {
"name" : "Winter sale",
"rule" : "rule incl custom.season { \"winter\" }"
},
"STRIPED" : {
"name" : "All striped items",
"rule" : "rule incl pattern { \"striped\" }"
}
}
Schema
ProductSetBody¶
Product set definitions.
Keys following pattern: [\p{L}\p{N}_\-()<>.:,&+%\[\]|?#�']{1,200} and with the value: ProductSet Max: 1000 keys
curl -i \
-X PUT \
-H 'Api-Key: pkA123456789AB1BE..' \
-H 'Content-Encoding: gzip' \
-H 'Content-Type: application/json' \
"https://{cluster-id}.elevate-api.cloud/api/admin/v4/import/product-sets?force=force&name=name" \
-T request-body.file.gz
Response¶
Response codes¶
| Status | Description |
|---|---|
| 204 | The import file was valid and imported into Elevate. |
| 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 product sets. Using POST to add or remove product sets will not affect product sets 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 Required | Content should be gzip encoded for all production requests. For manual test purposes, uncompressed small bodies may be provided using query parameter 'bypass-compression-for-manual-test=true' and omitted Content-Encoding (or 'identity') | gzip |
| Content-Type | application/json | application/json |
Query parameters¶
| Name | Description | Example |
|---|---|---|
| force | If false, the import will fail if any product set currently referenced by a page will be removed as a result of this import. Redo the import with this flag set to true if this was intended. | |
| name | A name to identify the import in logs |
Supported Content-Type¶
application/json
Request body¶
Example
{
"edit" : {
"WINTER" : {
"name" : "Winter specials",
"rule" : "rule incl custom.season { \"winter\" }"
}
},
"remove" : [ "TEST_PRODUCT_SET_1" ]
}
Schema
ProductSetImport¶
| Name | Type | Description |
|---|---|---|
| edit | <string, ProductSet> | A mapping from product set id to product set definition. Can be used to add new or edit existing product sets. Product sets not included will not be affected. Example: {"WINTER":{"name":"Winter specials","rule":"rule incl custom.season { "winter" }"}} |
| remove | string[] | The ids of product sets to be removed. Example: "TEST_PRODUCT_SET_1" |
curl -i \
-X POST \
-H 'Api-Key: pkA123456789AB1BE..' \
-H 'Content-Encoding: gzip' \
-H 'Content-Type: application/json' \
"https://{cluster-id}.elevate-api.cloud/api/admin/v4/import/product-sets?force=force&name=name" \
-T request-body.file.gz
Response¶
Response codes¶
| Status | Description |
|---|---|
| 204 | The import file was valid and imported into Elevate. |
| 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. |
Inner Schemas¶
ProductSet¶
| Name | Type | Description |
|---|---|---|
| name Required | string | The name of the product set, displayed in the Elevate application. Min length: 1. Max length: 80. |
| rules | string | A product rule expression restricting the products that the product set may contain. |