Skip to main content
PUT
/
products
/
{id}
Update a product
curl --request PUT \
  --url https://api.contazen.ro/v1/products/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "price": 1,
  "purchase_price": 1,
  "currency": "<string>",
  "unit_of_measure": "<string>",
  "ubl_um": "<string>",
  "ubl_nc": "<string>",
  "ubl_cpv": "<string>",
  "is_service": true,
  "is_active": true,
  "stock_quantity": 123,
  "stock_min": 123,
  "stock_max": 123
}
'
import requests

url = "https://api.contazen.ro/v1/products/{id}"

payload = {
"name": "<string>",
"description": "<string>",
"price": 1,
"purchase_price": 1,
"currency": "<string>",
"unit_of_measure": "<string>",
"ubl_um": "<string>",
"ubl_nc": "<string>",
"ubl_cpv": "<string>",
"is_service": True,
"is_active": True,
"stock_quantity": 123,
"stock_min": 123,
"stock_max": 123
}
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({
name: '<string>',
description: '<string>',
price: 1,
purchase_price: 1,
currency: '<string>',
unit_of_measure: '<string>',
ubl_um: '<string>',
ubl_nc: '<string>',
ubl_cpv: '<string>',
is_service: true,
is_active: true,
stock_quantity: 123,
stock_min: 123,
stock_max: 123
})
};

fetch('https://api.contazen.ro/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.contazen.ro/v1/products/{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([
'name' => '<string>',
'description' => '<string>',
'price' => 1,
'purchase_price' => 1,
'currency' => '<string>',
'unit_of_measure' => '<string>',
'ubl_um' => '<string>',
'ubl_nc' => '<string>',
'ubl_cpv' => '<string>',
'is_service' => true,
'is_active' => true,
'stock_quantity' => 123,
'stock_min' => 123,
'stock_max' => 123
]),
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.contazen.ro/v1/products/{id}"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 1,\n \"purchase_price\": 1,\n \"currency\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"ubl_um\": \"<string>\",\n \"ubl_nc\": \"<string>\",\n \"ubl_cpv\": \"<string>\",\n \"is_service\": true,\n \"is_active\": true,\n \"stock_quantity\": 123,\n \"stock_min\": 123,\n \"stock_max\": 123\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.contazen.ro/v1/products/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 1,\n \"purchase_price\": 1,\n \"currency\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"ubl_um\": \"<string>\",\n \"ubl_nc\": \"<string>\",\n \"ubl_cpv\": \"<string>\",\n \"is_service\": true,\n \"is_active\": true,\n \"stock_quantity\": 123,\n \"stock_min\": 123,\n \"stock_max\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.contazen.ro/v1/products/{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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 1,\n \"purchase_price\": 1,\n \"currency\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"ubl_um\": \"<string>\",\n \"ubl_nc\": \"<string>\",\n \"ubl_cpv\": \"<string>\",\n \"is_service\": true,\n \"is_active\": true,\n \"stock_quantity\": 123,\n \"stock_min\": 123,\n \"stock_max\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "data": {
    "id": "prod_1a2b3c4d5e",
    "object": "product",
    "name": "<string>",
    "price": 123,
    "description": "<string>",
    "currency": "RON",
    "purchase_price": 123,
    "vat_rate": 19,
    "unit_of_measure": "buc",
    "ubl_um": "H87",
    "ubl_nc": "<string>",
    "ubl_cpv": "<string>",
    "type": "service",
    "is_service": false,
    "is_active": true,
    "stock_quantity": 123,
    "stock_min": 123,
    "stock_max": 123,
    "created_at": "2023-11-07T05:31:56Z",
    "modified_at": "2023-11-07T05:31:56Z"
  },
  "meta": {
    "version": "v1",
    "request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "response_time": "23.45ms"
  }
}
{
"success": false,
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"meta": {
"version": "v1",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"response_time": "23.45ms"
}
}
{
"success": false,
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"doc_url": "<string>"
},
"meta": {
"version": "v1",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"response_time": "23.45ms"
}
}

Authorizations

Authorization
string
header
required

Use your API key (sk_live_xxx or sk_test_xxx)

Path Parameters

id
string
required

Product CzUid

Body

application/json
name
string
description
string
price
number
Required range: x >= 0
purchase_price
number
Required range: x >= 0
currency
string
vat_rate
enum<number>
Available options:
0,
5,
9,
11,
19,
21
unit_of_measure
string
ubl_um
string
ubl_nc
string
ubl_cpv
string
type
enum<string>

See Product.type. Omit to keep the current value.

Available options:
product,
service
is_service
boolean

Legacy flag — prefer type.

is_active
boolean
stock_quantity
number
stock_min
number
stock_max
number

Response

Product updated

success
boolean
data
object
meta
object