Returns the files of a product.
Admin SDKAdmin.api('commerce.product-files.find', request, function(response) { … });
HTTP POST/api/v10/commerce.product-files.find
{
"conditions" : { // returns only the files …
"product" : 281, // … of this product (id) - int(1…)
"after" : 703 // … with identifier after this value - int(0…)
},
"language" : "en", // language ( ISO code ) of the texts to return - string(2)
"fields" : [ "id", "address", … ], // fields to return - string
"order" : [ "name" ], // sort order of returned files, can contain "id", "-id", "product", "-product", "type", "-type",
// "size", "-size", "description" and "-description" - string
"limit" : 10, // maximum number of files to return - int(1…)
"first" : 0 // index of the first file to return - int(0…)
}
{
"status" : "ok",
"files" : [ {
"id" : 703, // identifier - int(1…)
"product" : 281, // product (id) - int(1…)
"address" : "https://…", // url address - string(42…255)
"type" : "pdf", // type - string(3)
"size" : 549071, // size in bytes - int(1…)
"description" : { // description - string(2) -> string(0…255)
"en" : "Manual",
"it" : "Manuale"
}
}, … ]
}
Returns a product file.
Admin SDKAdmin.api('commerce.product-files.get', request, function(response) { … });
HTTP POST/api/v10/commerce.product-files.get
{
"id" : 703, // identifier of the file - int(1…)
"language" : "en", // language ( ISO code ) of the texts to return - string(2)
"fields" : [ "id", "address", … ] // fields to return - string
}
{
"status" : "ok",
"file" : { // (can be null)
"id" : 703, // identifier - int(1…)
"product" : 281, // product (id) - int(1…)
"address" : "https://…", // url address - string(42…255)
"type" : "pdf", // type - string(3)
"size" : 549071, // size in bytes - int(1…)
"description" : { // description - string(2) -> string(0…255)
"en" : "Manual",
"it" : "Manuale"
}
}
}
Number of files tha meet the given conditions.
Admin SDKAdmin.api('commerce.product-files.count', request, function(response) { … });
HTTP POST/api/v10/commerce.product-files.count
{
"conditions" : { // counts only the files …
"product" : 281, // … of this product (id) - int(1…)
"after" : 703 // … with identifier after this value - int(0…)
}
}
{
"status" : "ok",
"count" : 7 // number of files - int(0…)
}
Creates a product file.
Admin SDKAdmin.api('commerce.product-files.create', request, function(response) { … });
HTTP POST/api/v10/commerce.product-files.create
{
"file" : { // product file to create (required)
"product" : 281, // product (id) (required) - int(1…)
"file" : { // file (required)
"name" : "manual.pdf", // name (required) - string(1…255)
"content" : "Y810D…B031M==" // content in base64 format (required) - string
},
"description" : { // description - string(2) -> string(0…255)
"en" : "Manual",
"it" : "Manuale"
}
}
}
{
"status" : "ok",
"id" : 703 // identifier of the new file - int(1…)
}
Field | Type | Description |
---|---|---|
product | NotFound | Product <product> does not exist |
Updates a product file. Any fields left out of the request will remain unchanged.
Admin SDKAdmin.api('commerce.product-files.update', request, function(response) { … });
HTTP POST/api/v10/commerce.product-files.update
{
"id" : 703, // identifier (required) - int(1…)
"file" : { // file's fields to update (required)
"file" : { // file
"name" : "manual.pdf", // name (required) - string(1…255)
"content" : "Y810D…B031M==" // content in base64 format (required) - string
},
"description" : { // description - string(2) -> string(0…255)
"en" : "Manual",
"it" : "Manuale"
}
}
}
{
"status" : "ok"
}
Field | Type | Description |
---|---|---|
id | NotFound | Product file <id> does not exist |
Deletes one or more product files.
Admin SDKAdmin.api('commerce.product-files.delete', request, function(response) { … });
HTTP POST/api/v10/commerce.product-files.delete
{
"ids" : [ 703, 1085, 280, … ] // identifiers of the files to delete (required) - int(1…)
}
{
"status" : "ok"
}