Obtenir un produit
curl --request GET \
--url https://qwoty.app/api/products/{id} \
--header 'Authorization: <authorization>'import requests
url = "https://qwoty.app/api/products/{id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://qwoty.app/api/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://qwoty.app/api/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://qwoty.app/api/products/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://qwoty.app/api/products/{id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"product_parent_id": "660e8400-e29b-41d4-a716-446655440001",
"workspace_id": "880e8400-e29b-41d4-a716-446655440003",
"name": "Consulting Services - Senior",
"api_name": "consulting_services_senior",
"reference": "SERV-001",
"description": "Senior consultant hourly rate",
"description_inherit_from_product": true,
"primary_image_inherit_from_product": true,
"is_active": true,
"is_default": true,
"catalog_ids": ["770e8400-e29b-41d4-a716-446655440002"],
"category_ids": [],
"settings": {
"unit_per_pack": 1,
"product_type": "service",
"language_id": "990e8400-e29b-41d4-a716-446655440004",
"unit_of_measure": "hour",
"recurrence_type": "recurring"
},
"shipping": {
"weight": null,
"weight_unit": null,
"height": null,
"length": null,
"width": null,
"length_unit": null,
"country_of_origin": null,
"harmonized_system_code": null
},
"inventory": {
"sku": "CONS-SEN-001"
},
"identifiers": {
"crm": "crm_123",
"accounting": "acc_789",
"erp": "erp_456"
},
"accounting": {
"ledger_account": "4010"
},
"primary_image_id": "cc0e8400-e29b-41d4-a716-446655440020",
"parent_primary_image_id": "dd0e8400-e29b-41d4-a716-446655440021",
"options": [
{
"option_id": "aa0e8400-e29b-41d4-a716-446655440010",
"option_name": "Seniority",
"option_api_name": "seniority",
"value_id": "bb0e8400-e29b-41d4-a716-446655440011",
"value_name": "Senior",
"value_api_name": "senior"
}
],
"prices": [
{
"id": "ee0e8400-e29b-41d4-a716-446655440030",
"pricebook_id": "ff0e8400-e29b-41d4-a716-446655440031",
"pricebook_api_name": "standard"
}
],
"created_at": "2024-12-21T10:30:00Z",
"updated_at": "2024-12-21T10:30:00Z",
"created_by": "aa1e8400-e29b-41d4-a716-446655440099",
"updated_by": "aa1e8400-e29b-41d4-a716-446655440099"
}
}
Produits
Obtenir un produit
Récupérer un produit spécifique par ID
GET
/
api
/
products
/
{id}
Obtenir un produit
curl --request GET \
--url https://qwoty.app/api/products/{id} \
--header 'Authorization: <authorization>'import requests
url = "https://qwoty.app/api/products/{id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://qwoty.app/api/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://qwoty.app/api/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://qwoty.app/api/products/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://qwoty.app/api/products/{id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"product_parent_id": "660e8400-e29b-41d4-a716-446655440001",
"workspace_id": "880e8400-e29b-41d4-a716-446655440003",
"name": "Consulting Services - Senior",
"api_name": "consulting_services_senior",
"reference": "SERV-001",
"description": "Senior consultant hourly rate",
"description_inherit_from_product": true,
"primary_image_inherit_from_product": true,
"is_active": true,
"is_default": true,
"catalog_ids": ["770e8400-e29b-41d4-a716-446655440002"],
"category_ids": [],
"settings": {
"unit_per_pack": 1,
"product_type": "service",
"language_id": "990e8400-e29b-41d4-a716-446655440004",
"unit_of_measure": "hour",
"recurrence_type": "recurring"
},
"shipping": {
"weight": null,
"weight_unit": null,
"height": null,
"length": null,
"width": null,
"length_unit": null,
"country_of_origin": null,
"harmonized_system_code": null
},
"inventory": {
"sku": "CONS-SEN-001"
},
"identifiers": {
"crm": "crm_123",
"accounting": "acc_789",
"erp": "erp_456"
},
"accounting": {
"ledger_account": "4010"
},
"primary_image_id": "cc0e8400-e29b-41d4-a716-446655440020",
"parent_primary_image_id": "dd0e8400-e29b-41d4-a716-446655440021",
"options": [
{
"option_id": "aa0e8400-e29b-41d4-a716-446655440010",
"option_name": "Seniority",
"option_api_name": "seniority",
"value_id": "bb0e8400-e29b-41d4-a716-446655440011",
"value_name": "Senior",
"value_api_name": "senior"
}
],
"prices": [
{
"id": "ee0e8400-e29b-41d4-a716-446655440030",
"pricebook_id": "ff0e8400-e29b-41d4-a716-446655440031",
"pricebook_api_name": "standard"
}
],
"created_at": "2024-12-21T10:30:00Z",
"updated_at": "2024-12-21T10:30:00Z",
"created_by": "aa1e8400-e29b-41d4-a716-446655440099",
"updated_by": "aa1e8400-e29b-41d4-a716-446655440099"
}
}
Autorisation
string
requis
Jeton Bearer pour l’authentification. Format :
Bearer qwoty_your_tokenParamètres de chemin
string
requis
UUID du produit
Exemples
curl https://qwoty.app/api/products/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer qwoty_your_token"
const productId = '550e8400-e29b-41d4-a716-446655440000'
const response = await fetch(`https://qwoty.app/api/products/${productId}`, {
headers: {
Authorization: 'Bearer qwoty_your_token',
},
})
const data = await response.json()
import requests
product_id = '550e8400-e29b-41d4-a716-446655440000'
response = requests.get(
f'https://qwoty.app/api/products/{product_id}',
headers={
'Authorization': 'Bearer qwoty_your_token'
}
)
data = response.json()
Réponse
boolean
Indique si la requête a réussi
object
L’objet produit
Afficher Objet Produit
Afficher Objet Produit
string
Identifiant unique (UUID)
string
ID du produit parent (UUID)
string
ID de l’espace de travail (UUID)
string
Nom du produit (nom d’affichage combinant le parent et les options de variante)
string
Identifiant API (uniquement à la création)
string
Référence interne
string
Description du produit
boolean
Indique si la description est héritée du produit parent
boolean
Indique si l’image principale est héritée du produit parent
boolean
Statut actif
boolean
Indique s’il s’agit du produit par défaut
array
IDs de catalogue (UUIDs) liés au produit parent
array
IDs de catégorie (UUIDs) liés au produit parent
object
object
Informations d’expédition
object
string
UUID du média principal de ce produit. Null si aucun n’est défini.
Lorsque
primary_image_inherit_from_product est true et que ce champ est null,
utiliser parent_primary_image_id comme image effective.string
UUID du média principal du produit parent. Lecture seule.
Utile lorsque
primary_image_inherit_from_product est true.array
array
string
Horodatage ISO 8601
string
Horodatage ISO 8601
string
ID de l’utilisateur ayant créé le produit
string
ID de l’utilisateur ayant mis à jour le produit en dernier
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"product_parent_id": "660e8400-e29b-41d4-a716-446655440001",
"workspace_id": "880e8400-e29b-41d4-a716-446655440003",
"name": "Consulting Services - Senior",
"api_name": "consulting_services_senior",
"reference": "SERV-001",
"description": "Senior consultant hourly rate",
"description_inherit_from_product": true,
"primary_image_inherit_from_product": true,
"is_active": true,
"is_default": true,
"catalog_ids": ["770e8400-e29b-41d4-a716-446655440002"],
"category_ids": [],
"settings": {
"unit_per_pack": 1,
"product_type": "service",
"language_id": "990e8400-e29b-41d4-a716-446655440004",
"unit_of_measure": "hour",
"recurrence_type": "recurring"
},
"shipping": {
"weight": null,
"weight_unit": null,
"height": null,
"length": null,
"width": null,
"length_unit": null,
"country_of_origin": null,
"harmonized_system_code": null
},
"inventory": {
"sku": "CONS-SEN-001"
},
"identifiers": {
"crm": "crm_123",
"accounting": "acc_789",
"erp": "erp_456"
},
"accounting": {
"ledger_account": "4010"
},
"primary_image_id": "cc0e8400-e29b-41d4-a716-446655440020",
"parent_primary_image_id": "dd0e8400-e29b-41d4-a716-446655440021",
"options": [
{
"option_id": "aa0e8400-e29b-41d4-a716-446655440010",
"option_name": "Seniority",
"option_api_name": "seniority",
"value_id": "bb0e8400-e29b-41d4-a716-446655440011",
"value_name": "Senior",
"value_api_name": "senior"
}
],
"prices": [
{
"id": "ee0e8400-e29b-41d4-a716-446655440030",
"pricebook_id": "ff0e8400-e29b-41d4-a716-446655440031",
"pricebook_api_name": "standard"
}
],
"created_at": "2024-12-21T10:30:00Z",
"updated_at": "2024-12-21T10:30:00Z",
"created_by": "aa1e8400-e29b-41d4-a716-446655440099",
"updated_by": "aa1e8400-e29b-41d4-a716-446655440099"
}
}
Réponses d’erreur
{
"success": false,
"error": "Product not found"
}
{
"success": false,
"error": "Invalid API token"
}
{
"success": false,
"error": "Invalid product ID format"
}
Notes
Cet endpoint permet d’accéder directement à un produit en utilisant uniquement l’ID du produit. Pour accéder aux produits via leur produit parent, vous pouvez également utiliser :GET /api/product-parents/{id}/products/{product_id}
Cette page vous a-t-elle été utile ?
⌘I

