Products
Update Product
Updates fields of an existing product. Requires products.update.
PATCH
/
api
/
v1
/
products
/
{id}
Update Product
curl --request PATCH \
--url https://api.evoai.app/api/v1/products/{id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"product": {
"name": "Plano Pro",
"slug": "plano-pro",
"kind": "subscription",
"description": "<string>",
"sku": "<string>",
"default_price": 199.9,
"currency": "BRL",
"purchase_url": "<string>",
"stock_quantity": 123,
"metadata": {},
"variants_attributes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": true,
"name": "<string>",
"sku": "<string>",
"price_override": 123,
"stock_quantity": 123,
"position": 123,
"attributes_data": {}
}
]
}
}
'import requests
url = "https://api.evoai.app/api/v1/products/{id}"
payload = { "product": {
"name": "Plano Pro",
"slug": "plano-pro",
"kind": "subscription",
"description": "<string>",
"sku": "<string>",
"default_price": 199.9,
"currency": "BRL",
"purchase_url": "<string>",
"stock_quantity": 123,
"metadata": {},
"variants_attributes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": True,
"name": "<string>",
"sku": "<string>",
"price_override": 123,
"stock_quantity": 123,
"position": 123,
"attributes_data": {}
}
]
} }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product: {
name: 'Plano Pro',
slug: 'plano-pro',
kind: 'subscription',
description: '<string>',
sku: '<string>',
default_price: 199.9,
currency: 'BRL',
purchase_url: '<string>',
stock_quantity: 123,
metadata: {},
variants_attributes: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: true,
name: '<string>',
sku: '<string>',
price_override: 123,
stock_quantity: 123,
position: 123,
attributes_data: {}
}
]
}
})
};
fetch('https://api.evoai.app/api/v1/products/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.evoai.app/api/v1/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'product' => [
'name' => 'Plano Pro',
'slug' => 'plano-pro',
'kind' => 'subscription',
'description' => '<string>',
'sku' => '<string>',
'default_price' => 199.9,
'currency' => 'BRL',
'purchase_url' => '<string>',
'stock_quantity' => 123,
'metadata' => [
],
'variants_attributes' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => true,
'name' => '<string>',
'sku' => '<string>',
'price_override' => 123,
'stock_quantity' => 123,
'position' => 123,
'attributes_data' => [
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_access_token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.evoai.app/api/v1/products/{id}"
payload := strings.NewReader("{\n \"product\": {\n \"name\": \"Plano Pro\",\n \"slug\": \"plano-pro\",\n \"kind\": \"subscription\",\n \"description\": \"<string>\",\n \"sku\": \"<string>\",\n \"default_price\": 199.9,\n \"currency\": \"BRL\",\n \"purchase_url\": \"<string>\",\n \"stock_quantity\": 123,\n \"metadata\": {},\n \"variants_attributes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": true,\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"price_override\": 123,\n \"stock_quantity\": 123,\n \"position\": 123,\n \"attributes_data\": {}\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("api_access_token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.evoai.app/api/v1/products/{id}")
.header("api_access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"product\": {\n \"name\": \"Plano Pro\",\n \"slug\": \"plano-pro\",\n \"kind\": \"subscription\",\n \"description\": \"<string>\",\n \"sku\": \"<string>\",\n \"default_price\": 199.9,\n \"currency\": \"BRL\",\n \"purchase_url\": \"<string>\",\n \"stock_quantity\": 123,\n \"metadata\": {},\n \"variants_attributes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": true,\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"price_override\": 123,\n \"stock_quantity\": 123,\n \"position\": 123,\n \"attributes_data\": {}\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.evoai.app/api/v1/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["api_access_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product\": {\n \"name\": \"Plano Pro\",\n \"slug\": \"plano-pro\",\n \"kind\": \"subscription\",\n \"description\": \"<string>\",\n \"sku\": \"<string>\",\n \"default_price\": 199.9,\n \"currency\": \"BRL\",\n \"purchase_url\": \"<string>\",\n \"stock_quantity\": 123,\n \"metadata\": {},\n \"variants_attributes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": true,\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"price_override\": 123,\n \"stock_quantity\": 123,\n \"position\": 123,\n \"attributes_data\": {}\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"kind": "<string>",
"description": "<string>",
"sku": "<string>",
"default_price": 123,
"currency": "<string>",
"status": "active",
"stock_quantity": 123,
"metadata": {},
"labels": [
"<string>"
],
"variants": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"sku": "<string>",
"price_override": 123,
"stock_quantity": 123,
"position": 123,
"attributes_data": {}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z"
},
"message": "<string>"
}{
"success": false,
"message": "<string>",
"details": [
"<string>"
]
}Autorizações
Parâmetros de caminho
Corpo
application/json
Show child attributes
Show child attributes
⌘I
Update Product
curl --request PATCH \
--url https://api.evoai.app/api/v1/products/{id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"product": {
"name": "Plano Pro",
"slug": "plano-pro",
"kind": "subscription",
"description": "<string>",
"sku": "<string>",
"default_price": 199.9,
"currency": "BRL",
"purchase_url": "<string>",
"stock_quantity": 123,
"metadata": {},
"variants_attributes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": true,
"name": "<string>",
"sku": "<string>",
"price_override": 123,
"stock_quantity": 123,
"position": 123,
"attributes_data": {}
}
]
}
}
'import requests
url = "https://api.evoai.app/api/v1/products/{id}"
payload = { "product": {
"name": "Plano Pro",
"slug": "plano-pro",
"kind": "subscription",
"description": "<string>",
"sku": "<string>",
"default_price": 199.9,
"currency": "BRL",
"purchase_url": "<string>",
"stock_quantity": 123,
"metadata": {},
"variants_attributes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": True,
"name": "<string>",
"sku": "<string>",
"price_override": 123,
"stock_quantity": 123,
"position": 123,
"attributes_data": {}
}
]
} }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product: {
name: 'Plano Pro',
slug: 'plano-pro',
kind: 'subscription',
description: '<string>',
sku: '<string>',
default_price: 199.9,
currency: 'BRL',
purchase_url: '<string>',
stock_quantity: 123,
metadata: {},
variants_attributes: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: true,
name: '<string>',
sku: '<string>',
price_override: 123,
stock_quantity: 123,
position: 123,
attributes_data: {}
}
]
}
})
};
fetch('https://api.evoai.app/api/v1/products/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.evoai.app/api/v1/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'product' => [
'name' => 'Plano Pro',
'slug' => 'plano-pro',
'kind' => 'subscription',
'description' => '<string>',
'sku' => '<string>',
'default_price' => 199.9,
'currency' => 'BRL',
'purchase_url' => '<string>',
'stock_quantity' => 123,
'metadata' => [
],
'variants_attributes' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => true,
'name' => '<string>',
'sku' => '<string>',
'price_override' => 123,
'stock_quantity' => 123,
'position' => 123,
'attributes_data' => [
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_access_token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.evoai.app/api/v1/products/{id}"
payload := strings.NewReader("{\n \"product\": {\n \"name\": \"Plano Pro\",\n \"slug\": \"plano-pro\",\n \"kind\": \"subscription\",\n \"description\": \"<string>\",\n \"sku\": \"<string>\",\n \"default_price\": 199.9,\n \"currency\": \"BRL\",\n \"purchase_url\": \"<string>\",\n \"stock_quantity\": 123,\n \"metadata\": {},\n \"variants_attributes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": true,\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"price_override\": 123,\n \"stock_quantity\": 123,\n \"position\": 123,\n \"attributes_data\": {}\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("api_access_token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.evoai.app/api/v1/products/{id}")
.header("api_access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"product\": {\n \"name\": \"Plano Pro\",\n \"slug\": \"plano-pro\",\n \"kind\": \"subscription\",\n \"description\": \"<string>\",\n \"sku\": \"<string>\",\n \"default_price\": 199.9,\n \"currency\": \"BRL\",\n \"purchase_url\": \"<string>\",\n \"stock_quantity\": 123,\n \"metadata\": {},\n \"variants_attributes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": true,\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"price_override\": 123,\n \"stock_quantity\": 123,\n \"position\": 123,\n \"attributes_data\": {}\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.evoai.app/api/v1/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["api_access_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product\": {\n \"name\": \"Plano Pro\",\n \"slug\": \"plano-pro\",\n \"kind\": \"subscription\",\n \"description\": \"<string>\",\n \"sku\": \"<string>\",\n \"default_price\": 199.9,\n \"currency\": \"BRL\",\n \"purchase_url\": \"<string>\",\n \"stock_quantity\": 123,\n \"metadata\": {},\n \"variants_attributes\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": true,\n \"name\": \"<string>\",\n \"sku\": \"<string>\",\n \"price_override\": 123,\n \"stock_quantity\": 123,\n \"position\": 123,\n \"attributes_data\": {}\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"kind": "<string>",
"description": "<string>",
"sku": "<string>",
"default_price": 123,
"currency": "<string>",
"status": "active",
"stock_quantity": 123,
"metadata": {},
"labels": [
"<string>"
],
"variants": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"sku": "<string>",
"price_override": 123,
"stock_quantity": 123,
"position": 123,
"attributes_data": {}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z"
},
"message": "<string>"
}{
"success": false,
"message": "<string>",
"details": [
"<string>"
]
}