Update a product
curl --request PATCH \
--url https://api.vendaze.com/v1/products/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Enterprise Plan v2",
"currency": "USD",
"price_cts": 149900,
"description": "Updated plan for enterprise customers.",
"code": "PLAN-ENT-V2",
"is_active": false,
"billing_cycle": "annually",
"image": "https://example.com/new-product.png"
}
'import requests
url = "https://api.vendaze.com/v1/products/{id}"
payload = {
"name": "Enterprise Plan v2",
"currency": "USD",
"price_cts": 149900,
"description": "Updated plan for enterprise customers.",
"code": "PLAN-ENT-V2",
"is_active": False,
"billing_cycle": "annually",
"image": "https://example.com/new-product.png"
}
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({
name: 'Enterprise Plan v2',
currency: 'USD',
price_cts: 149900,
description: 'Updated plan for enterprise customers.',
code: 'PLAN-ENT-V2',
is_active: false,
billing_cycle: 'annually',
image: 'https://example.com/new-product.png'
})
};
fetch('https://api.vendaze.com/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.vendaze.com/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([
'name' => 'Enterprise Plan v2',
'currency' => 'USD',
'price_cts' => 149900,
'description' => 'Updated plan for enterprise customers.',
'code' => 'PLAN-ENT-V2',
'is_active' => false,
'billing_cycle' => 'annually',
'image' => 'https://example.com/new-product.png'
]),
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.vendaze.com/v1/products/{id}"
payload := strings.NewReader("{\n \"name\": \"Enterprise Plan v2\",\n \"currency\": \"USD\",\n \"price_cts\": 149900,\n \"description\": \"Updated plan for enterprise customers.\",\n \"code\": \"PLAN-ENT-V2\",\n \"is_active\": false,\n \"billing_cycle\": \"annually\",\n \"image\": \"https://example.com/new-product.png\"\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.vendaze.com/v1/products/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Enterprise Plan v2\",\n \"currency\": \"USD\",\n \"price_cts\": 149900,\n \"description\": \"Updated plan for enterprise customers.\",\n \"code\": \"PLAN-ENT-V2\",\n \"is_active\": false,\n \"billing_cycle\": \"annually\",\n \"image\": \"https://example.com/new-product.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vendaze.com/v1/products/{id}")
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 \"name\": \"Enterprise Plan v2\",\n \"currency\": \"USD\",\n \"price_cts\": 149900,\n \"description\": \"Updated plan for enterprise customers.\",\n \"code\": \"PLAN-ENT-V2\",\n \"is_active\": false,\n \"billing_cycle\": \"annually\",\n \"image\": \"https://example.com/new-product.png\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Enterprise Plan",
"price_cts": 99900,
"currency": "USD",
"description": "Full-featured plan for large teams.",
"image_url": "https://storage.vendaze.com/client/workspaces/abc/products/xyz/image/avatar_Ab1Cd2Ef3G.webp",
"code": "PLAN-ENT",
"is_active": true,
"billing_cycle": "monthly",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "bad_request",
"message": "Request body must be valid JSON.",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid Authorization header.",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "insufficient_scope",
"message": "This endpoint requires the 'webhooks:read' scope.",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "not_found",
"message": "Webhook not found.",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "conflict",
"message": "A record with this value already exists.",
"fields": {
"key": "Value already in use."
},
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "validation_error",
"message": "Validation failed.",
"fields": {
"url": "url must use HTTPS.",
"events": "At least one event is required."
},
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds.",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "internal_error",
"message": "An unexpected error occurred.",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Products
Update a product
Updates a product by its id (UUID). Only fields included in the body are modified.
Required scope
Required scope
products:write
PATCH
/
v1
/
products
/
{id}
Update a product
curl --request PATCH \
--url https://api.vendaze.com/v1/products/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Enterprise Plan v2",
"currency": "USD",
"price_cts": 149900,
"description": "Updated plan for enterprise customers.",
"code": "PLAN-ENT-V2",
"is_active": false,
"billing_cycle": "annually",
"image": "https://example.com/new-product.png"
}
'import requests
url = "https://api.vendaze.com/v1/products/{id}"
payload = {
"name": "Enterprise Plan v2",
"currency": "USD",
"price_cts": 149900,
"description": "Updated plan for enterprise customers.",
"code": "PLAN-ENT-V2",
"is_active": False,
"billing_cycle": "annually",
"image": "https://example.com/new-product.png"
}
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({
name: 'Enterprise Plan v2',
currency: 'USD',
price_cts: 149900,
description: 'Updated plan for enterprise customers.',
code: 'PLAN-ENT-V2',
is_active: false,
billing_cycle: 'annually',
image: 'https://example.com/new-product.png'
})
};
fetch('https://api.vendaze.com/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.vendaze.com/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([
'name' => 'Enterprise Plan v2',
'currency' => 'USD',
'price_cts' => 149900,
'description' => 'Updated plan for enterprise customers.',
'code' => 'PLAN-ENT-V2',
'is_active' => false,
'billing_cycle' => 'annually',
'image' => 'https://example.com/new-product.png'
]),
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.vendaze.com/v1/products/{id}"
payload := strings.NewReader("{\n \"name\": \"Enterprise Plan v2\",\n \"currency\": \"USD\",\n \"price_cts\": 149900,\n \"description\": \"Updated plan for enterprise customers.\",\n \"code\": \"PLAN-ENT-V2\",\n \"is_active\": false,\n \"billing_cycle\": \"annually\",\n \"image\": \"https://example.com/new-product.png\"\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.vendaze.com/v1/products/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Enterprise Plan v2\",\n \"currency\": \"USD\",\n \"price_cts\": 149900,\n \"description\": \"Updated plan for enterprise customers.\",\n \"code\": \"PLAN-ENT-V2\",\n \"is_active\": false,\n \"billing_cycle\": \"annually\",\n \"image\": \"https://example.com/new-product.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vendaze.com/v1/products/{id}")
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 \"name\": \"Enterprise Plan v2\",\n \"currency\": \"USD\",\n \"price_cts\": 149900,\n \"description\": \"Updated plan for enterprise customers.\",\n \"code\": \"PLAN-ENT-V2\",\n \"is_active\": false,\n \"billing_cycle\": \"annually\",\n \"image\": \"https://example.com/new-product.png\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Enterprise Plan",
"price_cts": 99900,
"currency": "USD",
"description": "Full-featured plan for large teams.",
"image_url": "https://storage.vendaze.com/client/workspaces/abc/products/xyz/image/avatar_Ab1Cd2Ef3G.webp",
"code": "PLAN-ENT",
"is_active": true,
"billing_cycle": "monthly",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "bad_request",
"message": "Request body must be valid JSON.",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid Authorization header.",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "insufficient_scope",
"message": "This endpoint requires the 'webhooks:read' scope.",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "not_found",
"message": "Webhook not found.",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "conflict",
"message": "A record with this value already exists.",
"fields": {
"key": "Value already in use."
},
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "validation_error",
"message": "Validation failed.",
"fields": {
"url": "url must use HTTPS.",
"events": "At least one event is required."
},
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds.",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "internal_error",
"message": "An unexpected error occurred.",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Authorizations
OAuth 2.1 access token.
Path Parameters
UUID of the resource.
Body
application/json
All fields are optional. Only fields included in the body are modified.
New product name.
Required string length:
1 - 80Example:
"Enterprise Plan v2"
ISO 4217 currency code supported by Vendaze.
Available options:
AED, ARS, AUD, BRL, CAD, CHF, CLP, CNY, COP, DKK, EGP, EUR, GBP, HKD, ILS, INR, JPY, KWD, MAD, MXN, MYR, NGN, NOK, NZD, PEN, QAR, SAR, SEK, SGD, TRY, USD, UYU, ZAR Example:
"USD"
New price in the smallest currency unit.
Required range:
0 <= x <= 1000000000000000Example:
149900
New description. Send null to clear.
Maximum string length:
1000Example:
"Updated plan for enterprise customers."
New product code. Send null to clear.
Maximum string length:
60Example:
"PLAN-ENT-V2"
Update active status.
Example:
false
New billing cycle.
Available options:
one_time, monthly, quarterly, annually Example:
"annually"
New product image. Replaces the existing one.
Example:
"https://example.com/new-product.png"
Response
Product updated successfully.
Show child attributes
Show child attributes
Was this page helpful?
⌘I