Product Drafts
Update Product Draft
Replaces the existing draft changeset for a product with new values. Updates the scheduled publication time if provided and reschedules any existing publication jobs.
PATCH
/
api
/
v1
/
{team_slug}
/
{app_slug}
/
products
/
{product_id}
/
draft
Update Product Draft
curl --request PATCH \
--url https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"changeset": {
"attributes": [
"<string>"
],
"categories": [
{
"id": "<string>",
"is_main_category": true,
"order": 123
}
],
"collections": [
"<string>"
],
"description": "<string>",
"html_description": "<string>",
"html_short_description": "<string>",
"images": [
{
"id": "<string>",
"priority": 123
}
],
"meta_description": "<string>",
"meta_title": "<string>",
"name": "<string>",
"short_description": "<string>",
"tags": [
{
"key": "<string>",
"order": 123
}
]
},
"publish_at": "<string>"
}
'import requests
url = "https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft"
payload = {
"changeset": {
"attributes": ["<string>"],
"categories": [
{
"id": "<string>",
"is_main_category": True,
"order": 123
}
],
"collections": ["<string>"],
"description": "<string>",
"html_description": "<string>",
"html_short_description": "<string>",
"images": [
{
"id": "<string>",
"priority": 123
}
],
"meta_description": "<string>",
"meta_title": "<string>",
"name": "<string>",
"short_description": "<string>",
"tags": [
{
"key": "<string>",
"order": 123
}
]
},
"publish_at": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
changeset: {
attributes: ['<string>'],
categories: [{id: '<string>', is_main_category: true, order: 123}],
collections: ['<string>'],
description: '<string>',
html_description: '<string>',
html_short_description: '<string>',
images: [{id: '<string>', priority: 123}],
meta_description: '<string>',
meta_title: '<string>',
name: '<string>',
short_description: '<string>',
tags: [{key: '<string>', order: 123}]
},
publish_at: '<string>'
})
};
fetch('https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft', 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.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft",
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([
'changeset' => [
'attributes' => [
'<string>'
],
'categories' => [
[
'id' => '<string>',
'is_main_category' => true,
'order' => 123
]
],
'collections' => [
'<string>'
],
'description' => '<string>',
'html_description' => '<string>',
'html_short_description' => '<string>',
'images' => [
[
'id' => '<string>',
'priority' => 123
]
],
'meta_description' => '<string>',
'meta_title' => '<string>',
'name' => '<string>',
'short_description' => '<string>',
'tags' => [
[
'key' => '<string>',
'order' => 123
]
]
],
'publish_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft"
payload := strings.NewReader("{\n \"changeset\": {\n \"attributes\": [\n \"<string>\"\n ],\n \"categories\": [\n {\n \"id\": \"<string>\",\n \"is_main_category\": true,\n \"order\": 123\n }\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"html_description\": \"<string>\",\n \"html_short_description\": \"<string>\",\n \"images\": [\n {\n \"id\": \"<string>\",\n \"priority\": 123\n }\n ],\n \"meta_description\": \"<string>\",\n \"meta_title\": \"<string>\",\n \"name\": \"<string>\",\n \"short_description\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"<string>\",\n \"order\": 123\n }\n ]\n },\n \"publish_at\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"changeset\": {\n \"attributes\": [\n \"<string>\"\n ],\n \"categories\": [\n {\n \"id\": \"<string>\",\n \"is_main_category\": true,\n \"order\": 123\n }\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"html_description\": \"<string>\",\n \"html_short_description\": \"<string>\",\n \"images\": [\n {\n \"id\": \"<string>\",\n \"priority\": 123\n }\n ],\n \"meta_description\": \"<string>\",\n \"meta_title\": \"<string>\",\n \"name\": \"<string>\",\n \"short_description\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"<string>\",\n \"order\": 123\n }\n ]\n },\n \"publish_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"changeset\": {\n \"attributes\": [\n \"<string>\"\n ],\n \"categories\": [\n {\n \"id\": \"<string>\",\n \"is_main_category\": true,\n \"order\": 123\n }\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"html_description\": \"<string>\",\n \"html_short_description\": \"<string>\",\n \"images\": [\n {\n \"id\": \"<string>\",\n \"priority\": 123\n }\n ],\n \"meta_description\": \"<string>\",\n \"meta_title\": \"<string>\",\n \"name\": \"<string>\",\n \"short_description\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"<string>\",\n \"order\": 123\n }\n ]\n },\n \"publish_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"app_id": "<string>",
"changeset": {
"attributes": [
"<string>"
],
"categories": [
{
"id": "<string>",
"is_main_category": true,
"order": 123
}
],
"collections": [
"<string>"
],
"description": "<string>",
"html_description": "<string>",
"html_short_description": "<string>",
"images": [
{
"id": "<string>",
"priority": 123
}
],
"meta_description": "<string>",
"meta_title": "<string>",
"name": "<string>",
"short_description": "<string>",
"tags": [
{
"key": "<string>",
"order": 123
}
]
},
"created_at": "<string>",
"id": "<string>",
"product_id": "<string>",
"publish_at": "<string>",
"updated_at": "<string>"
},
"success": true,
"details": [
"<string>"
]
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}Authorizations
Management API token, sent as Authorization: Bearer <token>.
Path Parameters
App slug
Team slug
Product ID
Body
application/json
Updated draft changeset and optional publish_at
⌘I
Update Product Draft
curl --request PATCH \
--url https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"changeset": {
"attributes": [
"<string>"
],
"categories": [
{
"id": "<string>",
"is_main_category": true,
"order": 123
}
],
"collections": [
"<string>"
],
"description": "<string>",
"html_description": "<string>",
"html_short_description": "<string>",
"images": [
{
"id": "<string>",
"priority": 123
}
],
"meta_description": "<string>",
"meta_title": "<string>",
"name": "<string>",
"short_description": "<string>",
"tags": [
{
"key": "<string>",
"order": 123
}
]
},
"publish_at": "<string>"
}
'import requests
url = "https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft"
payload = {
"changeset": {
"attributes": ["<string>"],
"categories": [
{
"id": "<string>",
"is_main_category": True,
"order": 123
}
],
"collections": ["<string>"],
"description": "<string>",
"html_description": "<string>",
"html_short_description": "<string>",
"images": [
{
"id": "<string>",
"priority": 123
}
],
"meta_description": "<string>",
"meta_title": "<string>",
"name": "<string>",
"short_description": "<string>",
"tags": [
{
"key": "<string>",
"order": 123
}
]
},
"publish_at": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
changeset: {
attributes: ['<string>'],
categories: [{id: '<string>', is_main_category: true, order: 123}],
collections: ['<string>'],
description: '<string>',
html_description: '<string>',
html_short_description: '<string>',
images: [{id: '<string>', priority: 123}],
meta_description: '<string>',
meta_title: '<string>',
name: '<string>',
short_description: '<string>',
tags: [{key: '<string>', order: 123}]
},
publish_at: '<string>'
})
};
fetch('https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft', 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.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft",
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([
'changeset' => [
'attributes' => [
'<string>'
],
'categories' => [
[
'id' => '<string>',
'is_main_category' => true,
'order' => 123
]
],
'collections' => [
'<string>'
],
'description' => '<string>',
'html_description' => '<string>',
'html_short_description' => '<string>',
'images' => [
[
'id' => '<string>',
'priority' => 123
]
],
'meta_description' => '<string>',
'meta_title' => '<string>',
'name' => '<string>',
'short_description' => '<string>',
'tags' => [
[
'key' => '<string>',
'order' => 123
]
]
],
'publish_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft"
payload := strings.NewReader("{\n \"changeset\": {\n \"attributes\": [\n \"<string>\"\n ],\n \"categories\": [\n {\n \"id\": \"<string>\",\n \"is_main_category\": true,\n \"order\": 123\n }\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"html_description\": \"<string>\",\n \"html_short_description\": \"<string>\",\n \"images\": [\n {\n \"id\": \"<string>\",\n \"priority\": 123\n }\n ],\n \"meta_description\": \"<string>\",\n \"meta_title\": \"<string>\",\n \"name\": \"<string>\",\n \"short_description\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"<string>\",\n \"order\": 123\n }\n ]\n },\n \"publish_at\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"changeset\": {\n \"attributes\": [\n \"<string>\"\n ],\n \"categories\": [\n {\n \"id\": \"<string>\",\n \"is_main_category\": true,\n \"order\": 123\n }\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"html_description\": \"<string>\",\n \"html_short_description\": \"<string>\",\n \"images\": [\n {\n \"id\": \"<string>\",\n \"priority\": 123\n }\n ],\n \"meta_description\": \"<string>\",\n \"meta_title\": \"<string>\",\n \"name\": \"<string>\",\n \"short_description\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"<string>\",\n \"order\": 123\n }\n ]\n },\n \"publish_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enad.io/api/v1/{team_slug}/{app_slug}/products/{product_id}/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"changeset\": {\n \"attributes\": [\n \"<string>\"\n ],\n \"categories\": [\n {\n \"id\": \"<string>\",\n \"is_main_category\": true,\n \"order\": 123\n }\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"html_description\": \"<string>\",\n \"html_short_description\": \"<string>\",\n \"images\": [\n {\n \"id\": \"<string>\",\n \"priority\": 123\n }\n ],\n \"meta_description\": \"<string>\",\n \"meta_title\": \"<string>\",\n \"name\": \"<string>\",\n \"short_description\": \"<string>\",\n \"tags\": [\n {\n \"key\": \"<string>\",\n \"order\": 123\n }\n ]\n },\n \"publish_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"app_id": "<string>",
"changeset": {
"attributes": [
"<string>"
],
"categories": [
{
"id": "<string>",
"is_main_category": true,
"order": 123
}
],
"collections": [
"<string>"
],
"description": "<string>",
"html_description": "<string>",
"html_short_description": "<string>",
"images": [
{
"id": "<string>",
"priority": 123
}
],
"meta_description": "<string>",
"meta_title": "<string>",
"name": "<string>",
"short_description": "<string>",
"tags": [
{
"key": "<string>",
"order": 123
}
]
},
"created_at": "<string>",
"id": "<string>",
"product_id": "<string>",
"publish_at": "<string>",
"updated_at": "<string>"
},
"success": true,
"details": [
"<string>"
]
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}