# Criar produtos POST https%3A%2F%2Fwww.sitedaempresa.com.br/_functions/@fw2sites/fw2-propaganda-backend/v1/products Content-Type: application/json Cria um ou mais produtos. Aceita objeto único ou array. Reference: https://api.fw2propaganda.com.br/api-fw-2-propaganda-v-1/produtos/criar-produtos ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: collection version: 1.0.0 paths: /_functions/@fw2sites/fw2-propaganda-backend/v1/products: post: operationId: criar-produtos summary: Criar produtos description: Cria um ou mais produtos. Aceita objeto único ou array. tags: - subpackage_produtos parameters: - name: Authorization in: header required: true schema: type: string responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/Produtos_Criar produtos_Response_200' requestBody: content: application/json: schema: type: object properties: data: type: array items: $ref: >- #/components/schemas/FunctionsFw2SitesFw2PropagandaBackendV1ProductsPostRequestBodyContentApplicationJsonSchemaDataItems required: - data servers: - url: https%3A%2F%2Fwww.sitedaempresa.com.br components: schemas: FunctionsFw2SitesFw2PropagandaBackendV1ProductsPostRequestBodyContentApplicationJsonSchemaDataItemsFeaturesItems: type: object properties: title: type: string description: type: string required: - title - description title: >- FunctionsFw2SitesFw2PropagandaBackendV1ProductsPostRequestBodyContentApplicationJsonSchemaDataItemsFeaturesItems FunctionsFw2SitesFw2PropagandaBackendV1ProductsPostRequestBodyContentApplicationJsonSchemaDataItemsMetadata: type: object properties: seo_title: type: string seo_keywords: type: array items: type: string seo_description: type: string required: - seo_title - seo_keywords - seo_description title: >- FunctionsFw2SitesFw2PropagandaBackendV1ProductsPostRequestBodyContentApplicationJsonSchemaDataItemsMetadata FunctionsFw2SitesFw2PropagandaBackendV1ProductsPostRequestBodyContentApplicationJsonSchemaDataItems: type: object properties: sku: type: string slug: type: string tags: type: array items: type: string model: type: string format: uri price: type: number format: double title: type: string video: type: string format: uri views: type: integer gallery: type: array items: type: string release: type: boolean features: type: array items: $ref: >- #/components/schemas/FunctionsFw2SitesFw2PropagandaBackendV1ProductsPostRequestBodyContentApplicationJsonSchemaDataItemsFeaturesItems metadata: $ref: >- #/components/schemas/FunctionsFw2SitesFw2PropagandaBackendV1ProductsPostRequestBodyContentApplicationJsonSchemaDataItemsMetadata description: type: string price_cents: type: integer measure_depth: type: number format: double measure_width: type: integer title_preview: type: string measure_height: type: integer measure_length: type: integer measure_volume: type: number format: double measure_weight: type: number format: double measure_diameter: description: Any type short_description: type: string required: - sku - slug - tags - model - price - title - video - views - gallery - release - features - metadata - description - price_cents - measure_depth - measure_width - title_preview - measure_height - measure_length - measure_volume - measure_weight - short_description title: >- FunctionsFw2SitesFw2PropagandaBackendV1ProductsPostRequestBodyContentApplicationJsonSchemaDataItems Produtos_Criar produtos_Response_200: type: object properties: {} description: Empty response body title: Produtos_Criar produtos_Response_200 securitySchemes: apiKeyAuth: type: apiKey in: header name: Authorization ``` ## SDK Code Examples ```python import requests url = "https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/products" payload = { "data": [ { "sku": "PLZ-INT-002-PR", "slug": "interruptor-modular-2-teclas-preto", "tags": ["Lançamento", "Blackfriday"], "model": "https://meusite.com/modelo-3d.glb", "price": 19.9, "title": "Interruptor Modular 2 Teclas Preto", "video": "https://www.youtube.com/watch?v=exemplo", "views": 0, "gallery": ["URL da imagem ou Base64"], "release": True, "features": [ { "title": "Material", "description": "Plástico ABS de alta resistência" }, { "title": "Instalação", "description": "Sistema de encaixe rápido" } ], "metadata": { "seo_title": "Interruptor Modular Preto 2 Teclas", "seo_keywords": ["interruptor preto", "modular", "pluzie"], "seo_description": "Compre interruptor modular preto com design moderno e alta durabilidade." }, "description": "Interruptor modular de alta qualidade, ideal para projetos modernos. Fácil instalação e acabamento premium.", "price_cents": 1990, "measure_depth": 3.5, "measure_width": 8, "title_preview": "Interruptor Modular Preto | Pluzie", "measure_height": 12, "measure_length": 4, "measure_volume": 0.000384, "measure_weight": 0.2, "short_description": "Interruptor modular 2 teclas com acabamento premium." } ] } headers = { "Authorization": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/products'; const options = { method: 'POST', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: '{"data":[{"sku":"PLZ-INT-002-PR","slug":"interruptor-modular-2-teclas-preto","tags":["Lançamento","Blackfriday"],"model":"https://meusite.com/modelo-3d.glb","price":19.9,"title":"Interruptor Modular 2 Teclas Preto","video":"https://www.youtube.com/watch?v=exemplo","views":0,"gallery":["URL da imagem ou Base64"],"release":true,"features":[{"title":"Material","description":"Plástico ABS de alta resistência"},{"title":"Instalação","description":"Sistema de encaixe rápido"}],"metadata":{"seo_title":"Interruptor Modular Preto 2 Teclas","seo_keywords":["interruptor preto","modular","pluzie"],"seo_description":"Compre interruptor modular preto com design moderno e alta durabilidade."},"description":"Interruptor modular de alta qualidade, ideal para projetos modernos. Fácil instalação e acabamento premium.","price_cents":1990,"measure_depth":3.5,"measure_width":8,"title_preview":"Interruptor Modular Preto | Pluzie","measure_height":12,"measure_length":4,"measure_volume":0.000384,"measure_weight":0.2,"short_description":"Interruptor modular 2 teclas com acabamento premium."}]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/products" payload := strings.NewReader("{\n \"data\": [\n {\n \"sku\": \"PLZ-INT-002-PR\",\n \"slug\": \"interruptor-modular-2-teclas-preto\",\n \"tags\": [\n \"Lançamento\",\n \"Blackfriday\"\n ],\n \"model\": \"https://meusite.com/modelo-3d.glb\",\n \"price\": 19.9,\n \"title\": \"Interruptor Modular 2 Teclas Preto\",\n \"video\": \"https://www.youtube.com/watch?v=exemplo\",\n \"views\": 0,\n \"gallery\": [\n \"URL da imagem ou Base64\"\n ],\n \"release\": true,\n \"features\": [\n {\n \"title\": \"Material\",\n \"description\": \"Plástico ABS de alta resistência\"\n },\n {\n \"title\": \"Instalação\",\n \"description\": \"Sistema de encaixe rápido\"\n }\n ],\n \"metadata\": {\n \"seo_title\": \"Interruptor Modular Preto 2 Teclas\",\n \"seo_keywords\": [\n \"interruptor preto\",\n \"modular\",\n \"pluzie\"\n ],\n \"seo_description\": \"Compre interruptor modular preto com design moderno e alta durabilidade.\"\n },\n \"description\": \"Interruptor modular de alta qualidade, ideal para projetos modernos. Fácil instalação e acabamento premium.\",\n \"price_cents\": 1990,\n \"measure_depth\": 3.5,\n \"measure_width\": 8,\n \"title_preview\": \"Interruptor Modular Preto | Pluzie\",\n \"measure_height\": 12,\n \"measure_length\": 4,\n \"measure_volume\": 0.000384,\n \"measure_weight\": 0.2,\n \"short_description\": \"Interruptor modular 2 teclas com acabamento premium.\"\n }\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/products") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"data\": [\n {\n \"sku\": \"PLZ-INT-002-PR\",\n \"slug\": \"interruptor-modular-2-teclas-preto\",\n \"tags\": [\n \"Lançamento\",\n \"Blackfriday\"\n ],\n \"model\": \"https://meusite.com/modelo-3d.glb\",\n \"price\": 19.9,\n \"title\": \"Interruptor Modular 2 Teclas Preto\",\n \"video\": \"https://www.youtube.com/watch?v=exemplo\",\n \"views\": 0,\n \"gallery\": [\n \"URL da imagem ou Base64\"\n ],\n \"release\": true,\n \"features\": [\n {\n \"title\": \"Material\",\n \"description\": \"Plástico ABS de alta resistência\"\n },\n {\n \"title\": \"Instalação\",\n \"description\": \"Sistema de encaixe rápido\"\n }\n ],\n \"metadata\": {\n \"seo_title\": \"Interruptor Modular Preto 2 Teclas\",\n \"seo_keywords\": [\n \"interruptor preto\",\n \"modular\",\n \"pluzie\"\n ],\n \"seo_description\": \"Compre interruptor modular preto com design moderno e alta durabilidade.\"\n },\n \"description\": \"Interruptor modular de alta qualidade, ideal para projetos modernos. Fácil instalação e acabamento premium.\",\n \"price_cents\": 1990,\n \"measure_depth\": 3.5,\n \"measure_width\": 8,\n \"title_preview\": \"Interruptor Modular Preto | Pluzie\",\n \"measure_height\": 12,\n \"measure_length\": 4,\n \"measure_volume\": 0.000384,\n \"measure_weight\": 0.2,\n \"short_description\": \"Interruptor modular 2 teclas com acabamento premium.\"\n }\n ]\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/products") .header("Authorization", "") .header("Content-Type", "application/json") .body("{\n \"data\": [\n {\n \"sku\": \"PLZ-INT-002-PR\",\n \"slug\": \"interruptor-modular-2-teclas-preto\",\n \"tags\": [\n \"Lançamento\",\n \"Blackfriday\"\n ],\n \"model\": \"https://meusite.com/modelo-3d.glb\",\n \"price\": 19.9,\n \"title\": \"Interruptor Modular 2 Teclas Preto\",\n \"video\": \"https://www.youtube.com/watch?v=exemplo\",\n \"views\": 0,\n \"gallery\": [\n \"URL da imagem ou Base64\"\n ],\n \"release\": true,\n \"features\": [\n {\n \"title\": \"Material\",\n \"description\": \"Plástico ABS de alta resistência\"\n },\n {\n \"title\": \"Instalação\",\n \"description\": \"Sistema de encaixe rápido\"\n }\n ],\n \"metadata\": {\n \"seo_title\": \"Interruptor Modular Preto 2 Teclas\",\n \"seo_keywords\": [\n \"interruptor preto\",\n \"modular\",\n \"pluzie\"\n ],\n \"seo_description\": \"Compre interruptor modular preto com design moderno e alta durabilidade.\"\n },\n \"description\": \"Interruptor modular de alta qualidade, ideal para projetos modernos. Fácil instalação e acabamento premium.\",\n \"price_cents\": 1990,\n \"measure_depth\": 3.5,\n \"measure_width\": 8,\n \"title_preview\": \"Interruptor Modular Preto | Pluzie\",\n \"measure_height\": 12,\n \"measure_length\": 4,\n \"measure_volume\": 0.000384,\n \"measure_weight\": 0.2,\n \"short_description\": \"Interruptor modular 2 teclas com acabamento premium.\"\n }\n ]\n}") .asString(); ``` ```php request('POST', 'https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/products', [ 'body' => '{ "data": [ { "sku": "PLZ-INT-002-PR", "slug": "interruptor-modular-2-teclas-preto", "tags": [ "Lançamento", "Blackfriday" ], "model": "https://meusite.com/modelo-3d.glb", "price": 19.9, "title": "Interruptor Modular 2 Teclas Preto", "video": "https://www.youtube.com/watch?v=exemplo", "views": 0, "gallery": [ "URL da imagem ou Base64" ], "release": true, "features": [ { "title": "Material", "description": "Plástico ABS de alta resistência" }, { "title": "Instalação", "description": "Sistema de encaixe rápido" } ], "metadata": { "seo_title": "Interruptor Modular Preto 2 Teclas", "seo_keywords": [ "interruptor preto", "modular", "pluzie" ], "seo_description": "Compre interruptor modular preto com design moderno e alta durabilidade." }, "description": "Interruptor modular de alta qualidade, ideal para projetos modernos. Fácil instalação e acabamento premium.", "price_cents": 1990, "measure_depth": 3.5, "measure_width": 8, "title_preview": "Interruptor Modular Preto | Pluzie", "measure_height": 12, "measure_length": 4, "measure_volume": 0.000384, "measure_weight": 0.2, "short_description": "Interruptor modular 2 teclas com acabamento premium." } ] }', 'headers' => [ 'Authorization' => '', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/products"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"data\": [\n {\n \"sku\": \"PLZ-INT-002-PR\",\n \"slug\": \"interruptor-modular-2-teclas-preto\",\n \"tags\": [\n \"Lançamento\",\n \"Blackfriday\"\n ],\n \"model\": \"https://meusite.com/modelo-3d.glb\",\n \"price\": 19.9,\n \"title\": \"Interruptor Modular 2 Teclas Preto\",\n \"video\": \"https://www.youtube.com/watch?v=exemplo\",\n \"views\": 0,\n \"gallery\": [\n \"URL da imagem ou Base64\"\n ],\n \"release\": true,\n \"features\": [\n {\n \"title\": \"Material\",\n \"description\": \"Plástico ABS de alta resistência\"\n },\n {\n \"title\": \"Instalação\",\n \"description\": \"Sistema de encaixe rápido\"\n }\n ],\n \"metadata\": {\n \"seo_title\": \"Interruptor Modular Preto 2 Teclas\",\n \"seo_keywords\": [\n \"interruptor preto\",\n \"modular\",\n \"pluzie\"\n ],\n \"seo_description\": \"Compre interruptor modular preto com design moderno e alta durabilidade.\"\n },\n \"description\": \"Interruptor modular de alta qualidade, ideal para projetos modernos. Fácil instalação e acabamento premium.\",\n \"price_cents\": 1990,\n \"measure_depth\": 3.5,\n \"measure_width\": 8,\n \"title_preview\": \"Interruptor Modular Preto | Pluzie\",\n \"measure_height\": 12,\n \"measure_length\": 4,\n \"measure_volume\": 0.000384,\n \"measure_weight\": 0.2,\n \"short_description\": \"Interruptor modular 2 teclas com acabamento premium.\"\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "", "Content-Type": "application/json" ] let parameters = ["data": [ [ "sku": "PLZ-INT-002-PR", "slug": "interruptor-modular-2-teclas-preto", "tags": ["Lançamento", "Blackfriday"], "model": "https://meusite.com/modelo-3d.glb", "price": 19.9, "title": "Interruptor Modular 2 Teclas Preto", "video": "https://www.youtube.com/watch?v=exemplo", "views": 0, "gallery": ["URL da imagem ou Base64"], "release": true, "features": [ [ "title": "Material", "description": "Plástico ABS de alta resistência" ], [ "title": "Instalação", "description": "Sistema de encaixe rápido" ] ], "metadata": [ "seo_title": "Interruptor Modular Preto 2 Teclas", "seo_keywords": ["interruptor preto", "modular", "pluzie"], "seo_description": "Compre interruptor modular preto com design moderno e alta durabilidade." ], "description": "Interruptor modular de alta qualidade, ideal para projetos modernos. Fácil instalação e acabamento premium.", "price_cents": 1990, "measure_depth": 3.5, "measure_width": 8, "title_preview": "Interruptor Modular Preto | Pluzie", "measure_height": 12, "measure_length": 4, "measure_volume": 0.000384, "measure_weight": 0.2, "short_description": "Interruptor modular 2 teclas com acabamento premium." ] ]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/products")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```