Mettre à jour un produit parent
curl --request PATCH \
--url https://qwoty.app/api/product-parents/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"recurrence_type": "<string>",
"name": "<string>",
"description": "<string>",
"is_active": true,
"id_crm": "<string>",
"id_erp": "<string>",
"id_accounting": "<string>"
}
'import requests
url = "https://qwoty.app/api/product-parents/{id}"
payload = {
"recurrence_type": "<string>",
"name": "<string>",
"description": "<string>",
"is_active": True,
"id_crm": "<string>",
"id_erp": "<string>",
"id_accounting": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
recurrence_type: '<string>',
name: '<string>',
description: '<string>',
is_active: true,
id_crm: '<string>',
id_erp: '<string>',
id_accounting: '<string>'
})
};
fetch('https://qwoty.app/api/product-parents/{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://qwoty.app/api/product-parents/{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([
'recurrence_type' => '<string>',
'name' => '<string>',
'description' => '<string>',
'is_active' => true,
'id_crm' => '<string>',
'id_erp' => '<string>',
'id_accounting' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://qwoty.app/api/product-parents/{id}"
payload := strings.NewReader("{\n \"recurrence_type\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"id_crm\": \"<string>\",\n \"id_erp\": \"<string>\",\n \"id_accounting\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://qwoty.app/api/product-parents/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"recurrence_type\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"id_crm\": \"<string>\",\n \"id_erp\": \"<string>\",\n \"id_accounting\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/product-parents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"recurrence_type\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"id_crm\": \"<string>\",\n \"id_erp\": \"<string>\",\n \"id_accounting\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Updated Product Parent Name",
"api_name": "updated_product_parent_name",
"description": "Updated description",
"is_active": true,
"recurrence_type": "one_off",
"id_crm": "crm_123",
"id_erp": "erp_456",
"id_accounting": "acc_789",
"created_at": "2024-12-21T10:30:00Z",
"updated_at": "2024-12-21T14:45:00Z"
}
}
Produits parents
Mettre à jour un produit parent
Mettre à jour un produit parent existant
PATCH
/
api
/
product-parents
/
{id}
Mettre à jour un produit parent
curl --request PATCH \
--url https://qwoty.app/api/product-parents/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"recurrence_type": "<string>",
"name": "<string>",
"description": "<string>",
"is_active": true,
"id_crm": "<string>",
"id_erp": "<string>",
"id_accounting": "<string>"
}
'import requests
url = "https://qwoty.app/api/product-parents/{id}"
payload = {
"recurrence_type": "<string>",
"name": "<string>",
"description": "<string>",
"is_active": True,
"id_crm": "<string>",
"id_erp": "<string>",
"id_accounting": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
recurrence_type: '<string>',
name: '<string>',
description: '<string>',
is_active: true,
id_crm: '<string>',
id_erp: '<string>',
id_accounting: '<string>'
})
};
fetch('https://qwoty.app/api/product-parents/{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://qwoty.app/api/product-parents/{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([
'recurrence_type' => '<string>',
'name' => '<string>',
'description' => '<string>',
'is_active' => true,
'id_crm' => '<string>',
'id_erp' => '<string>',
'id_accounting' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://qwoty.app/api/product-parents/{id}"
payload := strings.NewReader("{\n \"recurrence_type\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"id_crm\": \"<string>\",\n \"id_erp\": \"<string>\",\n \"id_accounting\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://qwoty.app/api/product-parents/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"recurrence_type\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"id_crm\": \"<string>\",\n \"id_erp\": \"<string>\",\n \"id_accounting\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/product-parents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"recurrence_type\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_active\": true,\n \"id_crm\": \"<string>\",\n \"id_erp\": \"<string>\",\n \"id_accounting\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Updated Product Parent Name",
"api_name": "updated_product_parent_name",
"description": "Updated description",
"is_active": true,
"recurrence_type": "one_off",
"id_crm": "crm_123",
"id_erp": "erp_456",
"id_accounting": "acc_789",
"created_at": "2024-12-21T10:30:00Z",
"updated_at": "2024-12-21T14:45:00Z"
}
}
Autorisation
string
requis
Token Bearer pour l’authentification. Format :
Bearer qwoty_your_tokenParamètres de chemin
string
requis
UUID du produit parent à mettre à jour
Corps de la requête
string
Modèle de facturation (
one_off ou recurring)string
Nom du produit parent
string
Description du produit
boolean
Statut actif
string
ID CRM externe
string
ID ERP externe
string
ID comptable externe
reference ne fait pas partie du payload du produit parent pour PATCH (il est stocké sur la variante par défaut). L’envoi de reference dans le corps entraîne une erreur de validation.
Exemples
curl -X PATCH https://qwoty.app/api/product-parents/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer qwoty_your_token" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Product Name",
"description": "Updated description",
"is_active": false
}'
const productParentId = '550e8400-e29b-41d4-a716-446655440000'
const response = await fetch(
`https://qwoty.app/api/product-parents/${productParentId}`,
{
method: 'PATCH',
headers: {
Authorization: 'Bearer qwoty_your_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Updated Product Parent Name',
description: 'Updated description',
recurrence_type: 'one_off',
}),
},
)
const data = await response.json()
import requests
product_parent_id = '550e8400-e29b-41d4-a716-446655440000'
response = requests.patch(
f'https://qwoty.app/api/product-parents/{product_parent_id}',
headers={
'Authorization': 'Bearer qwoty_your_token',
'Content-Type': 'application/json'
},
json={
'name': 'Updated Product Parent Name',
'description': 'Updated description',
'recurrence_type': 'one_off'
}
)
data = response.json()
Réponse
boolean
Indique si la requête a été effectuée avec succès
object
L’objet produit parent mis à jour avec tous les champs
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Updated Product Parent Name",
"api_name": "updated_product_parent_name",
"description": "Updated description",
"is_active": true,
"recurrence_type": "one_off",
"id_crm": "crm_123",
"id_erp": "erp_456",
"id_accounting": "acc_789",
"created_at": "2024-12-21T10:30:00Z",
"updated_at": "2024-12-21T14:45:00Z"
}
}
Réponses d’erreur
{
"success": false,
"error": "Product parent not found"
}
{
"success": false,
"error": "Validation error",
"details": ["Field 'api_name' is creation-only and cannot be updated"]
}
{
"success": false,
"error": "Invalid API token"
}
Cette page vous a-t-elle été utile ?
⌘I

