producers

producers.find

Returns all the producers.

JS
CR.api('commerce.producers.find', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.producers.find

request

{
  "language" : "en", // language ( ISO code ) of the texts to return - string(2)
  "fields" : [ "id", "code", … ], // fields to return - string
  "order" : [ "name" ], // sort order of returned producers, can contain "id", "-id", "code", "-code", "name" and "-name" - string
  "limit" : 10, // maximum number of producers to return - int(1…100)
  "first" : 30 // index of the first producer to return - int(0…)
}

response

{
  "status" : "ok",
  "producers" : [ {
    "id" : 39, // identifier - int(1…)
    "code" : "NIKE", // code - string(0…32)
    "name" : "Nike", // name - string(0…60)
    "description" : { // description - string(2) -> string(0…65535)
      "en" : "…",
      "it" : "…"
    },
    "seoTitle" : { // title for SEO - string(2) -> string(0…255)
      "en" : "…",
      "it" : "…"
    },
    "seoKeywords" : { // keywords for SEO - string(2) -> string(0…255)
      "en" : "…",
      "it" : "…"
    },
    "seoDescription" : { // description for SEO - string(2) -> string(0…255)
      "en" : "…",
      "it" : "…"
    },
    "productsLayout" : { // products layout on the producer page
      "products" : 12, // number of products per page, can be 0, 12, 24, 36, 48 or 72 - int
      "columns" : 4, // columns, can be 1, 2, 3, 4 or 6 - int
      "sortOrder" : "-Price", // sort order, can be "Position", "Name", "-Name", "Price", "-Price" - string
      "imageSize" : "Optimal", // image size, can be "Optimal", Small", "Medium" or "Large" - string
      "showDescription" : false // indicates if the description is displayed - bool
    }
  }, … ]
}

producers.get

Returns a producer given its identifier.

JS
CR.api('commerce.producers.get', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.producers.get

request

{
  "id" : 39, // identifier of the producer (required) - int(1…)
  "language" : "en", // language ( ISO code ) of the texts to return - string(2)
  "fields" : [ "id", "code", … ] // fields to return - string
}

response

{
  "status" : "ok",
  "producer" : { // (can be null)
    "id" : 39, // identifier - int(1…)
    "code" : "NIKE", // code - string(0…32)
    "name" : "Nike", // name - string(0…60)
    "description" : { // description - string(2) -> string(0…65535)
      "en" : "…",
      "it" : "…"
    },
    "seoTitle" : { // title for SEO - string(2) -> string(0…255)
      "en" : "…",
      "it" : "…"
    },
    "seoKeywords" : { // keywords for SEO - string(2) -> string(0…255)
      "en" : "…",
      "it" : "…"
    },
    "seoDescription" : { // description for SEO - string(2) -> string(0…255)
      "en" : "…",
      "it" : "…"
    },
    "productsLayout" : { // products layout on the producer page
      "products" : 12, // number of products per page, can be 0, 12, 24, 36, 48 or 72 - int
      "columns" : 4, // columns, can be 1, 2, 3, 4 or 6 - int
      "sortOrder" : "-Price", // sort order, can be "Position", "Name", "-Name", "Price", "-Price" - string
      "imageSize" : "Optimal", // image size, can be "Optimal", Small", "Medium" or "Large" - string
      "showDescription" : false // indicates if the description is displayed - bool
    }
  }
}

producers.count

Total number of producers.

JS
CR.api('commerce.producers.count', null, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.producers.count

response

{
  "status" : "ok",
  "count" : 73 // number of producers - int(0…)
}

producers.create

Creates a new producer.

JS
CR.api('commerce.producers.create', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.producers.create

request

{
  "producer" : { // producer to create (required)
    "code" : "NIKE", // code - string(1…32)
    "name" : "Nike", // name - string(0…60)
    "productsLayout" : { // products layout on the producer page
      "products" : 12, // number of products per page, can be 0, 12, 24, 36, 48 or 72 - int
      "columns" : 4, // columns, can be 1, 2, 3, 4 or 6 - int
      "sortOrder" : "-Price", // sort order, can be "Position", "Name", "-Name", "Price", "-Price" - string
      "imageSize" : "Optimal", // image size, can be "Optimal", Small", "Medium" or "Large" - string
      "showDescription" : false // indicates if the description is displayed - bool
    }
  }
}

response

{
  "status" : "ok",
  "id" : 39 // identifier of the new producer - int(1…)
}

producers.update

Updates a producer. Any fields left out of the request will remain unchanged.

JS
CR.api('commerce.producers.update', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.producers.update

request

{
  "id" : 91, // identifier of the producer to update (required)
  "producer" : { // producer's fields to update (required)
    "code" : "NIKE", // code - string(1…32)
    "name" : "Nike", // name - string(0…60)
    "productsLayout" : { // products layout on the producer page
      "products" : 12, // number of products per page, can be 0, 12, 24, 36, 48 or 72 - int
      "columns" : 4, // columns, can be 1, 2, 3, 4 or 6 - int
      "sortOrder" : "-Price", // sort order, can be "Position", "Name", "-Name", "Price", "-Price" - string
      "imageSize" : "Optimal", // image size, can be "Optimal", Small", "Medium" or "Large" - string
      "showDescription" : false // indicates if the description is displayed - bool
    }
  }
}

response

{
  "status" : "ok"
}

Errors

Field Type Description
id NotFound Producer <id> does not exist

producers.delete

Deletes one or more producers.

JS
CR.api('commerce.producers.delete', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.producers.delete

request

{
  "ids" : [ 91, 27, … ] // identifiers of the producers to delete (required) - int(1…)
}

response

{
  "status" : "ok"
}