Update a Specific Product by ID
curl --request PUT \
--url https://api.trata.ai/v1/products/{product_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "pro.1731301754.OZSMSU1S",
"orgId": "org.1726902940.GZChqlpU",
"active": true,
"defaultPrice": 1299,
"currency": "USD",
"description": "Spicy Korean Chicken Wings",
"name": "Spicy Korean Chicken Wings",
"shippable": true,
"features": [],
"scheduleAppointment": false,
"props": {},
"status": "active",
"createdBy": "trata-system",
"createdAt": "2024-11-11T05:09:14.979287",
"updatedBy": "trata-system",
"updatedAt": "2024-11-11T05:09:14.979289"
}
'import requests
url = "https://api.trata.ai/v1/products/{product_id}"
payload = {
"id": "pro.1731301754.OZSMSU1S",
"orgId": "org.1726902940.GZChqlpU",
"active": True,
"defaultPrice": 1299,
"currency": "USD",
"description": "Spicy Korean Chicken Wings",
"name": "Spicy Korean Chicken Wings",
"shippable": True,
"features": [],
"scheduleAppointment": False,
"props": {},
"status": "active",
"createdBy": "trata-system",
"createdAt": "2024-11-11T05:09:14.979287",
"updatedBy": "trata-system",
"updatedAt": "2024-11-11T05:09:14.979289"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'pro.1731301754.OZSMSU1S',
orgId: 'org.1726902940.GZChqlpU',
active: true,
defaultPrice: 1299,
currency: 'USD',
description: 'Spicy Korean Chicken Wings',
name: 'Spicy Korean Chicken Wings',
shippable: true,
features: [],
scheduleAppointment: false,
props: {},
status: 'active',
createdBy: 'trata-system',
createdAt: '2024-11-11T05:09:14.979287',
updatedBy: 'trata-system',
updatedAt: '2024-11-11T05:09:14.979289'
})
};
fetch('https://api.trata.ai/v1/products/{product_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.trata.ai/v1/products/{product_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'pro.1731301754.OZSMSU1S',
'orgId' => 'org.1726902940.GZChqlpU',
'active' => true,
'defaultPrice' => 1299,
'currency' => 'USD',
'description' => 'Spicy Korean Chicken Wings',
'name' => 'Spicy Korean Chicken Wings',
'shippable' => true,
'features' => [
],
'scheduleAppointment' => false,
'props' => [
],
'status' => 'active',
'createdBy' => 'trata-system',
'createdAt' => '2024-11-11T05:09:14.979287',
'updatedBy' => 'trata-system',
'updatedAt' => '2024-11-11T05:09:14.979289'
]),
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.trata.ai/v1/products/{product_id}"
payload := strings.NewReader("{\n \"id\": \"pro.1731301754.OZSMSU1S\",\n \"orgId\": \"org.1726902940.GZChqlpU\",\n \"active\": true,\n \"defaultPrice\": 1299,\n \"currency\": \"USD\",\n \"description\": \"Spicy Korean Chicken Wings\",\n \"name\": \"Spicy Korean Chicken Wings\",\n \"shippable\": true,\n \"features\": [],\n \"scheduleAppointment\": false,\n \"props\": {},\n \"status\": \"active\",\n \"createdBy\": \"trata-system\",\n \"createdAt\": \"2024-11-11T05:09:14.979287\",\n \"updatedBy\": \"trata-system\",\n \"updatedAt\": \"2024-11-11T05:09:14.979289\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.trata.ai/v1/products/{product_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"pro.1731301754.OZSMSU1S\",\n \"orgId\": \"org.1726902940.GZChqlpU\",\n \"active\": true,\n \"defaultPrice\": 1299,\n \"currency\": \"USD\",\n \"description\": \"Spicy Korean Chicken Wings\",\n \"name\": \"Spicy Korean Chicken Wings\",\n \"shippable\": true,\n \"features\": [],\n \"scheduleAppointment\": false,\n \"props\": {},\n \"status\": \"active\",\n \"createdBy\": \"trata-system\",\n \"createdAt\": \"2024-11-11T05:09:14.979287\",\n \"updatedBy\": \"trata-system\",\n \"updatedAt\": \"2024-11-11T05:09:14.979289\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trata.ai/v1/products/{product_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"pro.1731301754.OZSMSU1S\",\n \"orgId\": \"org.1726902940.GZChqlpU\",\n \"active\": true,\n \"defaultPrice\": 1299,\n \"currency\": \"USD\",\n \"description\": \"Spicy Korean Chicken Wings\",\n \"name\": \"Spicy Korean Chicken Wings\",\n \"shippable\": true,\n \"features\": [],\n \"scheduleAppointment\": false,\n \"props\": {},\n \"status\": \"active\",\n \"createdBy\": \"trata-system\",\n \"createdAt\": \"2024-11-11T05:09:14.979287\",\n \"updatedBy\": \"trata-system\",\n \"updatedAt\": \"2024-11-11T05:09:14.979289\"\n}"
response = http.request(request)
puts response.read_body{
"id": "pro.1731301754.OZSMSU1S",
"orgId": "org.1726902940.GZChqlpU",
"active": true,
"defaultPrice": 1299,
"currency": "USD",
"description": "Spicy Korean Chicken Wings",
"name": "Spicy Korean Chicken Wings",
"shippable": true,
"features": [],
"scheduleAppointment": false,
"props": {},
"status": "active",
"createdBy": "trata-system",
"createdAt": "2024-11-11T05:09:14.979287",
"updatedBy": "trata-system",
"updatedAt": "2024-11-11T05:09:14.979289"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Products
Update a Specific Product by ID
Update a Specific Product by ID
PUT
/
v1
/
products
/
{product_id}
Update a Specific Product by ID
curl --request PUT \
--url https://api.trata.ai/v1/products/{product_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "pro.1731301754.OZSMSU1S",
"orgId": "org.1726902940.GZChqlpU",
"active": true,
"defaultPrice": 1299,
"currency": "USD",
"description": "Spicy Korean Chicken Wings",
"name": "Spicy Korean Chicken Wings",
"shippable": true,
"features": [],
"scheduleAppointment": false,
"props": {},
"status": "active",
"createdBy": "trata-system",
"createdAt": "2024-11-11T05:09:14.979287",
"updatedBy": "trata-system",
"updatedAt": "2024-11-11T05:09:14.979289"
}
'import requests
url = "https://api.trata.ai/v1/products/{product_id}"
payload = {
"id": "pro.1731301754.OZSMSU1S",
"orgId": "org.1726902940.GZChqlpU",
"active": True,
"defaultPrice": 1299,
"currency": "USD",
"description": "Spicy Korean Chicken Wings",
"name": "Spicy Korean Chicken Wings",
"shippable": True,
"features": [],
"scheduleAppointment": False,
"props": {},
"status": "active",
"createdBy": "trata-system",
"createdAt": "2024-11-11T05:09:14.979287",
"updatedBy": "trata-system",
"updatedAt": "2024-11-11T05:09:14.979289"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'pro.1731301754.OZSMSU1S',
orgId: 'org.1726902940.GZChqlpU',
active: true,
defaultPrice: 1299,
currency: 'USD',
description: 'Spicy Korean Chicken Wings',
name: 'Spicy Korean Chicken Wings',
shippable: true,
features: [],
scheduleAppointment: false,
props: {},
status: 'active',
createdBy: 'trata-system',
createdAt: '2024-11-11T05:09:14.979287',
updatedBy: 'trata-system',
updatedAt: '2024-11-11T05:09:14.979289'
})
};
fetch('https://api.trata.ai/v1/products/{product_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.trata.ai/v1/products/{product_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'pro.1731301754.OZSMSU1S',
'orgId' => 'org.1726902940.GZChqlpU',
'active' => true,
'defaultPrice' => 1299,
'currency' => 'USD',
'description' => 'Spicy Korean Chicken Wings',
'name' => 'Spicy Korean Chicken Wings',
'shippable' => true,
'features' => [
],
'scheduleAppointment' => false,
'props' => [
],
'status' => 'active',
'createdBy' => 'trata-system',
'createdAt' => '2024-11-11T05:09:14.979287',
'updatedBy' => 'trata-system',
'updatedAt' => '2024-11-11T05:09:14.979289'
]),
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.trata.ai/v1/products/{product_id}"
payload := strings.NewReader("{\n \"id\": \"pro.1731301754.OZSMSU1S\",\n \"orgId\": \"org.1726902940.GZChqlpU\",\n \"active\": true,\n \"defaultPrice\": 1299,\n \"currency\": \"USD\",\n \"description\": \"Spicy Korean Chicken Wings\",\n \"name\": \"Spicy Korean Chicken Wings\",\n \"shippable\": true,\n \"features\": [],\n \"scheduleAppointment\": false,\n \"props\": {},\n \"status\": \"active\",\n \"createdBy\": \"trata-system\",\n \"createdAt\": \"2024-11-11T05:09:14.979287\",\n \"updatedBy\": \"trata-system\",\n \"updatedAt\": \"2024-11-11T05:09:14.979289\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.trata.ai/v1/products/{product_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"pro.1731301754.OZSMSU1S\",\n \"orgId\": \"org.1726902940.GZChqlpU\",\n \"active\": true,\n \"defaultPrice\": 1299,\n \"currency\": \"USD\",\n \"description\": \"Spicy Korean Chicken Wings\",\n \"name\": \"Spicy Korean Chicken Wings\",\n \"shippable\": true,\n \"features\": [],\n \"scheduleAppointment\": false,\n \"props\": {},\n \"status\": \"active\",\n \"createdBy\": \"trata-system\",\n \"createdAt\": \"2024-11-11T05:09:14.979287\",\n \"updatedBy\": \"trata-system\",\n \"updatedAt\": \"2024-11-11T05:09:14.979289\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trata.ai/v1/products/{product_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"pro.1731301754.OZSMSU1S\",\n \"orgId\": \"org.1726902940.GZChqlpU\",\n \"active\": true,\n \"defaultPrice\": 1299,\n \"currency\": \"USD\",\n \"description\": \"Spicy Korean Chicken Wings\",\n \"name\": \"Spicy Korean Chicken Wings\",\n \"shippable\": true,\n \"features\": [],\n \"scheduleAppointment\": false,\n \"props\": {},\n \"status\": \"active\",\n \"createdBy\": \"trata-system\",\n \"createdAt\": \"2024-11-11T05:09:14.979287\",\n \"updatedBy\": \"trata-system\",\n \"updatedAt\": \"2024-11-11T05:09:14.979289\"\n}"
response = http.request(request)
puts response.read_body{
"id": "pro.1731301754.OZSMSU1S",
"orgId": "org.1726902940.GZChqlpU",
"active": true,
"defaultPrice": 1299,
"currency": "USD",
"description": "Spicy Korean Chicken Wings",
"name": "Spicy Korean Chicken Wings",
"shippable": true,
"features": [],
"scheduleAppointment": false,
"props": {},
"status": "active",
"createdBy": "trata-system",
"createdAt": "2024-11-11T05:09:14.979287",
"updatedBy": "trata-system",
"updatedAt": "2024-11-11T05:09:14.979289"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
Currency of the product
Available options:
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BOV, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHE, CHF, CHW, CLF, CLP, CNY, COP, COU, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MXV, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USN, UYI, UYU, UYW, UZS, VED, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, XSU, XUA, YER, ZAR, ZMW, ZWL Required string length:
3Response
Product updated successfully
Product and services offered by the business
